{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/checkout-sessions":{"get":{"operationId":"checkoutSessions_list","summary":"List Checkout Sessions","description":"Lists your Checkout Sessions in the key's mode, newest first, so you can reconcile payments without having kept every id. Narrow it with `status` and a `from`/`to` created range. To page, pass the `nextCursor` you got as `cursor` until it is null.","tags":["checkoutSessions"],"parameters":[{"name":"limit","in":"query","description":"1 to 100; defaults to 10.","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","description":"The `nextCursor` from the previous page; returns the sessions older than it. Opaque: don't build or change one.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Only sessions with this status: one of `pending`, `succeeded`, `failed` or `cancelled`.","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","description":"Only sessions created at or after this Unix ms timestamp.","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","description":"Only sessions created at or before this Unix ms timestamp.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A page of Checkout Sessions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionList"}}}},"400":{"description":"Invalid `cursor`, `status`, `from` or `to` (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]},"post":{"operationId":"checkoutSessions_create","summary":"Create a Checkout Session","description":"Starts a payment: call this from your server, then redirect the Customer to the returned `hostedUrl`, which takes the payment with any Provider. Don't fulfil on the redirect; wait for the `checkout_session.succeeded` webhook or retrieve the session. The `Idempotency-Key` header is required: a retry with the same key replays the original session instead of creating a second one, so derive it from your order. An `sk_test_` key creates a Test mode session that simulates payment; an `sk_live_` key creates a Live mode session that moves real money.","tags":["checkoutSessions"],"parameters":[{"name":"idempotency-key","in":"header","description":"Client-generated key; a repeated key returns the original session.","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Checkout Session created (or replayed from the Idempotency-Key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Invalid request (`invalid_request`), including an amount (or a quote converting to an amount) of FJD 5,000.00 or more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different amount/currency/quote (`idempotency_key_reused`), a Live mode key while no Provider takes Live mode payments yet (`live_mode_unavailable`), or a `quote` with a Live mode key (`quote_unavailable_in_live_mode`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionRequest"}}}},"security":[{"bearerAuth":[]}]}},"/v1/checkout-sessions/{id}":{"get":{"operationId":"checkoutSessions_retrieve","summary":"Retrieve a Checkout Session","description":"Returns a Checkout Session's current state. Use it to confirm the outcome when the Customer lands on your `successUrl` with `session_id`, or to check a webhook you missed. Only sessions created with a key of the same Merchant and mode are visible; anything else is 404.","tags":["checkoutSessions"],"parameters":[{"name":"id","in":"path","description":"Checkout Session identifier.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The Checkout Session's current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Checkout Session for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/checkout-sessions/{id}/cancel":{"post":{"operationId":"checkoutSessions_cancel","summary":"Cancel a Checkout Session","description":"Withdraws a `pending` Checkout Session so it can't be paid, e.g. when the order is abandoned or changed. Fails with `payment_in_progress` once the Customer has started paying; wait for the outcome webhook instead. Unpaid sessions also cancel on their own after `expiresAt`, unless the Customer has started paying.","tags":["checkoutSessions"],"parameters":[{"name":"id","in":"path","description":"Checkout Session identifier.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled; a `checkout_session.cancelled` webhook is sent. Safe to retry: a repeat returns 409 `invalid_state`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Checkout Session for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`invalid_state` if the session isn't pending; `payment_in_progress` if the Customer has already started paying.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/invoices":{"get":{"operationId":"invoices_list","summary":"List Invoices","description":"Lists your Invoices in the key's mode, newest first. To page, pass the last `id` you got as `starting_after` while `hasMore` is true.","tags":["invoices"],"parameters":[{"name":"limit","in":"query","description":"1 to 100; defaults to 10.","required":false,"schema":{"type":"integer"}},{"name":"starting_after","in":"query","description":"An Invoice `id`; returns the Invoices older than it.","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A page of Invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceList"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]},"post":{"operationId":"invoices_create","summary":"Create an Invoice","description":"Creates a draft Invoice in the key's mode. It has no number and no working `url` until you send it. The total, with tax, must be under FJD 5,000.00 (at most 499999 cents), in Test mode and Live mode alike. The `Idempotency-Key` header is required: a retry with the same key returns the original draft instead of making a second.","tags":["invoices"],"parameters":[{"name":"idempotency-key","in":"header","description":"Client-generated key; a repeated key returns the original result instead of repeating the change.","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"201":{"description":"Draft created, or replayed from the Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid request (`invalid_request`), including a total of FJD 5,000.00 or more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"}}}},"security":[{"bearerAuth":[]}]}},"/v1/invoices/{id}":{"get":{"operationId":"invoices_retrieve","summary":"Retrieve an Invoice","description":"Returns one Invoice and its current state. Invoices from the other mode or another Merchant are 404.","tags":["invoices"],"parameters":[{"name":"id","in":"path","description":"Invoice identifier.","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The Invoice.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Invoice for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/invoices/{id}/send":{"post":{"operationId":"invoices_send","summary":"Send an Invoice","description":"Releases a draft: assigns its Invoice number (from your prefix and counter in Settings) and makes its `url` work for the Customer. Transxact does not email it for you here; share the `url`, or email it from the dashboard. A sent Invoice can't be edited; void it and make another. The `Idempotency-Key` header is required: a retry returns the sent Invoice and uses no second number.","tags":["invoices"],"parameters":[{"name":"id","in":"path","description":"Invoice identifier.","required":false,"schema":{"type":"integer"}},{"name":"idempotency-key","in":"header","description":"Client-generated key; a repeated key returns the original result instead of repeating the change.","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The sent Invoice, or the original result of a retried key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Refused (`invalid_request`), such as a total over the cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Invoice for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Invoice was not a draft (`invalid_state`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/invoices/{id}/void":{"post":{"operationId":"invoices_void","summary":"Void an Invoice","description":"Cancels a sent, unpaid Invoice so it can no longer be paid. Its number is kept and never reused. Refused for a draft, a paid Invoice, or while a Customer is paying it right now. The `Idempotency-Key` header is required.","tags":["invoices"],"parameters":[{"name":"id","in":"path","description":"Invoice identifier.","required":false,"schema":{"type":"integer"}},{"name":"idempotency-key","in":"header","description":"Client-generated key; a repeated key returns the original result instead of repeating the change.","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The voided Invoice, or the original result of a retried key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Refused (`invalid_request`), such as a total over the cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Invoice for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Only a sent Invoice can be voided (`invalid_state`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/invoices/{id}/pdf":{"get":{"operationId":"invoices_retrievePdf","summary":"Download an Invoice's PDF","description":"The Invoice as a PDF, the same file the Customer's page and emails carry. This is the `pdfUrl` on the Invoice. Available once the Invoice is sent.","tags":["invoices"],"parameters":[{"name":"id","in":"path","description":"Invoice identifier.","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The PDF.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The account is not a Business account (`business_only`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Invoice for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Invoice is still a draft (`invalid_state`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/merchants/me":{"get":{"operationId":"merchants_me","summary":"Retrieve your Merchant account","description":"Returns the Merchant that owns the API key: its tier, the key's mode, the balance not yet paid out in that mode, and the Payout schedule. A cheap way to check a key works and which mode it's in.","tags":["merchants"],"responses":{"200":{"description":"The calling Merchant's own account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/payouts":{"get":{"operationId":"payouts_list","summary":"List Payouts","description":"Lists the Merchant's Payouts in the key's mode, oldest id first. Payouts are made on the Merchant's Payout schedule, or when the Merchant asks from the dashboard on the manual schedule; they can't be created through the API. To page, pass the last id you got as `starting_after` while `hasMore` is true.","tags":["payouts"],"parameters":[{"name":"starting_after","in":"query","description":"Cursor: return Payouts after this id.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max rows to return (default 10, max 100).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"The calling Merchant's Payouts, oldest-id first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payouts_list_Response_200"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}},"/v1/payouts/{id}":{"get":{"operationId":"payouts_retrieve","summary":"Retrieve a Payout","description":"Returns one Payout by id: its amount, rail and status, and why it failed if it did. Payouts from the other mode or another Merchant are 404.","tags":["payouts"],"parameters":[{"name":"id","in":"path","description":"Payout identifier.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The requested Payout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payout"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such Payout for this Merchant and mode.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"bearerAuth":[]}]}}},"tags":[{"name":"checkoutSessions"},{"name":"invoices"},{"name":"merchants"},{"name":"payouts"}],"servers":[{"url":"https://api.transxact.io","description":"Production"}],"components":{"schemas":{"CheckoutSessionStatus":{"type":"string","enum":["pending","succeeded","failed","cancelled"],"description":"`pending` until the Customer pays or the session ends. `succeeded`: paid, safe to fulfil. `failed`: the payment was declined or didn't go through. `cancelled`: you cancelled it or it expired unpaid. Only `pending` ever changes, and each change sends the matching `checkout_session.*` webhook.","title":"CheckoutSessionStatus"},"CheckoutSessionMode":{"type":"string","enum":["test","live"],"description":"`test` for a session made with an `sk_test_` key, `live` for an `sk_live_` key. Webhook endpoints each hear one mode, and the payload says which it came from.","title":"CheckoutSessionMode"},"CheckoutSessionCurrency":{"type":"string","enum":["FJD"],"description":"Always FJD in v1.","title":"CheckoutSessionCurrency"},"CheckoutSessionQuoteCurrency":{"type":"string","enum":["USD","AUD"],"description":"USD or AUD.","title":"CheckoutSessionQuoteCurrency"},"CheckoutSessionQuote":{"type":"object","properties":{"amount":{"type":"integer","description":"The price you sent, in cents of `currency`."},"currency":{"$ref":"#/components/schemas/CheckoutSessionQuoteCurrency","description":"USD or AUD."},"rate":{"type":"string","description":"FJD per 1 unit of `currency`, a decimal string."},"asOf":{"type":"integer","description":"Unix ms time the rate was taken."}},"required":["amount","currency","rate","asOf"],"description":"Present when you created the session with a `quote`: the USD or AUD price you sent, the FJD rate it was converted at (a decimal string), and the Unix ms time the rate was taken. `amount` is the FJD that is charged. Never shown to the Customer.","title":"CheckoutSessionQuote"},"CheckoutSession":{"type":"object","properties":{"id":{"type":"string","description":"Checkout Session identifier."},"status":{"$ref":"#/components/schemas/CheckoutSessionStatus","description":"`pending` until the Customer pays or the session ends. `succeeded`: paid, safe to fulfil. `failed`: the payment was declined or didn't go through. `cancelled`: you cancelled it or it expired unpaid. Only `pending` ever changes, and each change sends the matching `checkout_session.*` webhook."},"mode":{"$ref":"#/components/schemas/CheckoutSessionMode","description":"`test` for a session made with an `sk_test_` key, `live` for an `sk_live_` key. Webhook endpoints each hear one mode, and the payload says which it came from."},"amount":{"type":"integer","description":"Amount to charge, in FJD cents (minor units)."},"currency":{"$ref":"#/components/schemas/CheckoutSessionCurrency","description":"Always FJD in v1."},"hostedUrl":{"type":"string","description":"Transxact-hosted URL to redirect the Customer to."},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Your own key/value data from creation; empty object if none was set."},"expiresAt":{"type":"integer","description":"Unix ms timestamp after which no payment can start; a still-pending session is then cancelled."},"invoiceNumber":{"type":"string","description":"The Invoice number, such as `INV-0007`, when the session pays one of your Invoices; absent otherwise. Also in the webhook payload."},"quote":{"$ref":"#/components/schemas/CheckoutSessionQuote","description":"Present when you created the session with a `quote`: the USD or AUD price you sent, the FJD rate it was converted at (a decimal string), and the Unix ms time the rate was taken. `amount` is the FJD that is charged. Never shown to the Customer."}},"required":["id","status","mode","amount","currency","hostedUrl","metadata","expiresAt"],"title":"CheckoutSession"},"CheckoutSessionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSession"},"description":"This page of Checkout Sessions, newest first."},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to get the next page; null on the last page."}},"required":["data","nextCursor"],"title":"CheckoutSessionList"},"ErrorError":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable error code."},"message":{"type":"string","description":"Human-readable detail, not contractual."}},"required":["code","message"],"description":"Branch on `code`; `message` is for logs.","title":"ErrorError"},"Error":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorError","description":"Branch on `code`; `message` is for logs."}},"required":["error"],"title":"Error"},"CreateCheckoutSessionRequestCurrency":{"type":"string","enum":["FJD"],"description":"Always FJD in v1. Required with `amount`.","title":"CreateCheckoutSessionRequestCurrency"},"CreateCheckoutSessionRequestQuoteCurrency":{"type":"string","enum":["USD","AUD"],"description":"USD or AUD.","title":"CreateCheckoutSessionRequestQuoteCurrency"},"CreateCheckoutSessionRequestQuote":{"type":"object","properties":{"amount":{"type":"integer","exclusiveMinimum":0,"description":"Price in cents of `currency`."},"currency":{"$ref":"#/components/schemas/CreateCheckoutSessionRequestQuoteCurrency","description":"USD or AUD."}},"required":["amount","currency"],"description":"Price the session in USD or AUD instead of sending `amount`. `amount` is in cents of that currency. We convert it to FJD once, now, and lock the rate; the Customer sees and pays FJD only. The converted FJD amount must still be under FJD 5,000.00. Test mode only for now: a Live mode key gets `quote_unavailable_in_live_mode`. Only on Business accounts.","title":"CreateCheckoutSessionRequestQuote"},"CreateCheckoutSessionRequest":{"type":"object","properties":{"amount":{"type":"integer","maximum":499999,"exclusiveMinimum":0,"description":"Amount to charge, in FJD cents (minor units). Must be under FJD 5,000.00 (at most 499999), in Test mode and Live mode alike. Send this with `currency`, or send `quote` instead, never both."},"currency":{"$ref":"#/components/schemas/CreateCheckoutSessionRequestCurrency","description":"Always FJD in v1. Required with `amount`."},"quote":{"$ref":"#/components/schemas/CreateCheckoutSessionRequestQuote","description":"Price the session in USD or AUD instead of sending `amount`. `amount` is in cents of that currency. We convert it to FJD once, now, and lock the rate; the Customer sees and pays FJD only. The converted FJD amount must still be under FJD 5,000.00. Test mode only for now: a Live mode key gets `quote_unavailable_in_live_mode`. Only on Business accounts."},"successUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Where the hosted checkout sends the Customer after the payment succeeds. HTTPS only. Transxact appends `session_id=<Checkout Session id>`; confirm the outcome with GET /v1/checkout-sessions/{id} rather than trusting the redirect."},"cancelUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Where the hosted checkout sends the Customer if they cancel or the payment doesn't go through. HTTPS only. Transxact appends `session_id=<Checkout Session id>`; confirm the outcome with GET /v1/checkout-sessions/{id} rather than trusting the redirect."},"metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 20 string key/value pairs (keys ≤40 chars, values ≤500) for matching the session to your own records. Returned on retrieve and in webhooks; never shown to the Customer. Don't put secrets or personal data here."},"customerEmail":{"type":"string","format":"email","maxLength":254,"description":"The Customer's email. In Live mode, once the payment succeeds, Transxact emails them a receipt from you (branded with your Display name) unless you've turned receipts off in Settings. We keep the address 30 days after the session ends and never return it. In Test mode it is checked and dropped; nothing is sent."},"expiresAt":{"type":"integer","description":"Unix ms timestamp, 30 minutes to 24 hours from now, after which the session can't be paid and is cancelled. Defaults to 24 hours."}},"title":"CreateCheckoutSessionRequest"},"InvoiceStatus":{"type":"string","enum":["draft","sent","paid","void"],"description":"`draft` until sent and editable only from the dashboard. `sent`: the Customer can pay it. `paid`: paid in full. `void`: you voided it; it can no longer be paid.","title":"InvoiceStatus"},"InvoiceMode":{"type":"string","enum":["test","live"],"description":"`test` for an Invoice made with an `sk_test_` key, `live` for an `sk_live_` key.","title":"InvoiceMode"},"InvoiceItem":{"type":"object","properties":{"description":{"type":"string","description":"What it is, up to 200 characters."},"quantity":{"type":"integer","description":"Whole units, 1 to 9999."},"unitPrice":{"type":"integer","description":"Price of one unit, excluding tax, in FJD cents (minor units)."}},"required":["description","quantity","unitPrice"],"title":"InvoiceItem"},"Invoice":{"type":"object","properties":{"id":{"type":"integer","description":"Invoice identifier."},"number":{"type":["string","null"],"description":"The Invoice number, such as `INV-0007`. Assigned when the Invoice is sent, so a draft has none; numbers are never reused."},"status":{"$ref":"#/components/schemas/InvoiceStatus","description":"`draft` until sent and editable only from the dashboard. `sent`: the Customer can pay it. `paid`: paid in full. `void`: you voided it; it can no longer be paid."},"overdue":{"type":"boolean","description":"A sent, unpaid Invoice past its due date (Pacific/Fiji). Derived, not a status; the Customer can still pay."},"mode":{"$ref":"#/components/schemas/InvoiceMode","description":"`test` for an Invoice made with an `sk_test_` key, `live` for an `sk_live_` key."},"customerName":{"type":"string","description":"Who you billed."},"customerEmail":{"type":["string","null"],"description":"The Customer's email, if you gave one."},"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"},"description":"The line items, excluding tax."},"taxLabel":{"type":["string","null"],"description":"Label of the tax line; null if none."},"taxPercent":{"type":"number","format":"double","description":"0 when there is no tax line."},"vatNumber":{"type":["string","null"],"description":"Your VAT number, if you gave one."},"dueDate":{"type":"string","description":"`YYYY-MM-DD`, Pacific/Fiji."},"subtotal":{"type":"integer","description":"Sum of the line items, in FJD cents (minor units)."},"tax":{"type":"integer","description":"The tax line, in FJD cents (minor units)."},"total":{"type":"integer","description":"Amount due; under FJD 5,000.00, in FJD cents (minor units)."},"url":{"type":"string","description":"The hosted page the Customer opens and pays on. Works once the Invoice is sent."},"pdfUrl":{"type":["string","null"],"description":"Where to `GET` the PDF, with your secret key. Null on a draft."},"createdAt":{"type":"integer","description":"Unix ms timestamp the draft was created."},"sentAt":{"type":["integer","null"],"description":"Unix ms timestamp it was sent; null on a draft."},"paidAt":{"type":["integer","null"],"description":"Unix ms timestamp it was paid; null until then."}},"required":["id","number","status","overdue","mode","customerName","customerEmail","items","taxLabel","taxPercent","vatNumber","dueDate","subtotal","tax","total","url","pdfUrl","createdAt","sentAt","paidAt"],"title":"Invoice"},"InvoiceList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"},"description":"This page of Invoices."},"hasMore":{"type":"boolean","description":"True if older Invoices follow."}},"required":["data","hasMore"],"title":"InvoiceList"},"CreateInvoiceRequest":{"type":"object","properties":{"customerName":{"type":"string","description":"Who you are billing, up to 100 characters."},"customerEmail":{"type":"string","description":"Optional until you email the Invoice from the dashboard."},"dueDate":{"type":"string","description":"`YYYY-MM-DD`, Pacific/Fiji."},"items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"},"description":"1 to 50 line items, entered excluding tax."},"taxLabel":{"type":"string","description":"Label for the one optional tax line, such as `VAT`. Needs `taxPercent`."},"taxPercent":{"type":"number","format":"double","description":"Tax as a percentage of the subtotal, up to 100 with 2 decimal places."},"vatNumber":{"type":"string","description":"Your VAT number, if you are registered."}},"required":["customerName","dueDate","items"],"title":"CreateInvoiceRequest"},"MerchantTier":{"type":"string","enum":["business","individual"],"description":"Merchant's account tier.","title":"MerchantTier"},"MerchantMode":{"type":"string","enum":["test","live"],"description":"Mode of the API key used for this request.","title":"MerchantMode"},"MerchantPayoutSchedule":{"type":"string","enum":["daily","weekly","fortnightly","monthly","manual"],"description":"When Payouts are made, in UTC: `daily`; `weekly` on Mondays (the default); `fortnightly` on every other Monday; `monthly` on the 1st; or `manual`, where a Payout is made only when the Merchant asks for one from the dashboard. Set on the dashboard.","title":"MerchantPayoutSchedule"},"Merchant":{"type":"object","properties":{"tier":{"$ref":"#/components/schemas/MerchantTier","description":"Merchant's account tier."},"mode":{"$ref":"#/components/schemas/MerchantMode","description":"Mode of the API key used for this request."},"balance":{"type":"integer","description":"Earned balance not yet swept into a Payout, in FJD cents (minor units)."},"payoutSchedule":{"$ref":"#/components/schemas/MerchantPayoutSchedule","description":"When Payouts are made, in UTC: `daily`; `weekly` on Mondays (the default); `fortnightly` on every other Monday; `monthly` on the 1st; or `manual`, where a Payout is made only when the Merchant asks for one from the dashboard. Set on the dashboard."}},"required":["tier","mode","balance","payoutSchedule"],"title":"Merchant"},"PayoutRail":{"type":"string","enum":["bank_transfer","wallet"],"description":"Business -> bank_transfer, Individual -> wallet.","title":"PayoutRail"},"PayoutStatus":{"type":"string","enum":["pending","paid","failed"],"description":"pending until the money reaches your payout destination, then paid. failed means the transfer didn't go through; the amount returns to your balance and goes out in the next Payout. Test mode Payouts are always paid.","title":"PayoutStatus"},"Payout":{"type":"object","properties":{"id":{"type":"string","description":"Payout identifier."},"amount":{"type":"integer","description":"Amount paid out, in FJD cents (minor units)."},"rail":{"$ref":"#/components/schemas/PayoutRail","description":"Business -> bank_transfer, Individual -> wallet."},"status":{"$ref":"#/components/schemas/PayoutStatus","description":"pending until the money reaches your payout destination, then paid. failed means the transfer didn't go through; the amount returns to your balance and goes out in the next Payout. Test mode Payouts are always paid."},"paidAt":{"type":["integer","null"],"description":"Unix ms timestamp the Payout was paid, or null."},"failureReason":{"type":["string","null"],"description":"Why the transfer failed, when status is failed."},"createdAt":{"type":"integer","description":"Unix ms timestamp of the settlement run that created this Payout."}},"required":["id","amount","rail","status","paidAt","failureReason","createdAt"],"title":"Payout"},"payouts_list_Response_200":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Payout"},"description":"This page of Payouts."},"hasMore":{"type":"boolean","description":"True if more Payouts follow; pass the last id as `starting_after` to get them."}},"required":["data","hasMore"],"title":"payouts_list_Response_200"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your secret key: sk_test_... in Test mode, sk_live_... in Live mode."}}}}