{"openapi":"3.1.0","info":{"title":"ShipBill API","version":"2026-10-01","description":"Authenticate with a secret key (`sk_live_…` or `sk_test_…`); the key decides the profile and mode. Amounts are integers in the currency's smallest unit; times are unix seconds. Lists are newest first: page with `starting_after` and `limit`. Up to 50 requests a second and 250 every 10 seconds per key."},"servers":[{"url":"https://api.shipbill.io/v1"}],"security":[{"secretKey":[]}],"x-shipbill-embed":{"description":"shipbill.js frames the checkout at `frame` and accepts messages only from `checkout_origin` whose `source` and `version` match. Within a version, messages and fields may be added but never removed or renamed: ignore what you don't recognise. The frame's `theme` is optional: `light`, `dark`, or `system` (the buyer's device) for this modal. It replaces the profile's checkout theme only when the profile lets the site choose (Settings → Checkout); otherwise the profile's applies. The frame's `referrer` is the site before the page (its `document.referrer`, origin and path), empty when there was none; Analytics names it as where the buyer came from. In `frame`, `embed=2` means an iframe whose `color-scheme` is `light dark`, which lets the checkout follow the buyer's device in every browser; `embed=1`, an iframe at `light` from earlier versions of shipbill.js, is still accepted.","version":1,"source":"shipbill-checkout","checkout_origin":"https://pay.shipbill.io","frame":"https://pay.shipbill.io/c/{client_token}?embed=2&origin={page origin}&page={page URL}&referrer={referrer}&theme={theme}","messages":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"shipbill-checkout"},"version":{"type":"number","const":1},"type":{"type":"string","const":"ready"}},"required":["source","version","type"],"additionalProperties":{},"description":"The checkout has loaded."},{"type":"object","properties":{"source":{"type":"string","const":"shipbill-checkout"},"version":{"type":"number","const":1},"type":{"type":"string","const":"resize"},"height":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["source","version","type","height"],"additionalProperties":{},"description":"The checkout card's height in CSS pixels, whenever it changes."},{"type":"object","properties":{"source":{"type":"string","const":"shipbill-checkout"},"version":{"type":"number","const":1},"type":{"type":"string","const":"complete"},"status":{"type":"string","const":"paid"}},"required":["source","version","type","status"],"additionalProperties":{},"description":"Paid. A signal for the page (show thanks), not proof of payment: the webhook is."},{"type":"object","properties":{"source":{"type":"string","const":"shipbill-checkout"},"version":{"type":"number","const":1},"type":{"type":"string","const":"close"}},"required":["source","version","type"],"additionalProperties":false,"description":"The buyer closed the checkout: remove the frame."},{"type":"object","properties":{"source":{"type":"string","const":"shipbill-checkout"},"version":{"type":"number","const":1},"type":{"type":"string","const":"redirect_required"},"url":{"type":"string"}},"required":["source","version","type","url"],"additionalProperties":{},"description":"The method continues on the provider's own page, which can't be framed: open `url` in the top window."}]}},"paths":{"/checkout/sessions":{"post":{"operationId":"createCheckoutSession","x-shipbill-sdk":{"resource":"checkout.sessions","method":"create"},"summary":"Create a checkout session","description":"From your products (`line_items`) or a custom `amount` and `currency`. Send the buyer to `url`, or open the embedded checkout with `client_token`; both are returned only here.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"listCheckoutSessions","x-shipbill-sdk":{"resource":"checkout.sessions","method":"list"},"summary":"List checkout sessions","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"status","in":"query","required":false,"description":"Only those in this status.","schema":{"type":"string","enum":["open","processing","complete","expired","cancelled"],"description":"Only those in this status."}},{"name":"reference","in":"query","required":false,"description":"Only those with this reference of yours.","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only those with this reference of yours."}},{"name":"customer_email","in":"query","required":false,"description":"Only this customer's.","schema":{"description":"Only this customer's.","type":"string","maxLength":254}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSession"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/checkout/sessions/{id}":{"get":{"operationId":"getCheckoutSession","x-shipbill-sdk":{"resource":"checkout.sessions","method":"retrieve"},"summary":"Retrieve a checkout session","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/checkout/sessions/{id}/expire":{"post":{"operationId":"expireCheckoutSession","x-shipbill-sdk":{"resource":"checkout.sessions","method":"expire"},"summary":"Expire a checkout session","description":"An open session closes at once. One being paid can't be expired.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-intents":{"post":{"operationId":"createPaymentIntent","x-shipbill-sdk":{"resource":"payment_intents","method":"create"},"summary":"Create a payment intent","description":"For your own payment page: what is bought (`line_items`, or `amount` and `currency`) and the buyer. The invoice is issued now. Confirm it with the method the buyer chooses. An intent is never updated: when the cart, the email, or the country changes, cancel it and create another.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-intents/{id}":{"get":{"operationId":"getPaymentIntent","x-shipbill-sdk":{"resource":"payment_intents","method":"retrieve"},"summary":"Retrieve a payment intent","description":"A payment still under way is checked with its provider when you read it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-intents/{id}/confirm":{"post":{"operationId":"confirmPaymentIntent","x-shipbill-sdk":{"resource":"payment_intents","method":"confirm"},"summary":"Confirm a payment intent","description":"Starts the payment with the provider ShipBill routes the method to, and answers with `next_action`: send the buyer to its `url`, or mount the provider's secure fields; `ShipBill.mount(next_action, element)` in shipbill.js does either. After a failure, confirm it again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentConfirmParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-intents/{id}/cancel":{"post":{"operationId":"cancelPaymentIntent","x-shipbill-sdk":{"resource":"payment_intents","method":"cancel"},"summary":"Cancel a payment intent","description":"One nobody is paying: its order is cancelled and its invoice voided. Paid, or being paid, it can't be.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payments":{"get":{"operationId":"listPayments","x-shipbill-sdk":{"resource":"payments","method":"list"},"summary":"List payments","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"status","in":"query","required":false,"description":"Only those in this status.","schema":{"type":"string","enum":["requires_payment_method","requires_action","processing","authorized","underpaid","succeeded","failed","cancelled"],"description":"Only those in this status."}},{"name":"reference","in":"query","required":false,"description":"Only those with this reference of yours.","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only those with this reference of yours."}},{"name":"customer_email","in":"query","required":false,"description":"Only this customer's.","schema":{"description":"Only this customer's.","type":"string","maxLength":254}},{"name":"product","in":"query","required":false,"description":"Only payments that included this product (prod_…).","schema":{"type":"string","maxLength":64,"description":"Only payments that included this product (prod_…)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payments/{id}":{"get":{"operationId":"getPayment","x-shipbill-sdk":{"resource":"payments","method":"retrieve"},"summary":"Retrieve a payment","description":"Authoritative, whatever arrived by webhook.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payments/{id}/mark-refunded":{"post":{"operationId":"markPaymentRefunded","x-shipbill-sdk":{"resource":"payments","method":"mark_refunded"},"summary":"Record a refund","description":"Records a refund you made at your provider, in full or in part. ShipBill never sends money. Refunds the provider reports are recorded on their own; check a payment's refunds first so one isn't recorded twice.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkRefundedParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/refunds":{"get":{"operationId":"listRefunds","x-shipbill-sdk":{"resource":"refunds","method":"list"},"summary":"List refunds","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"payment","in":"query","required":false,"description":"Only this payment's refunds (pay_…).","schema":{"type":"string","maxLength":64,"description":"Only this payment's refunds (pay_…)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/refunds/{id}":{"get":{"operationId":"getRefund","x-shipbill-sdk":{"resource":"refunds","method":"retrieve"},"summary":"Retrieve a refund","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Refund"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invoices/export":{"get":{"operationId":"exportInvoices","x-shipbill-sdk":{"resource":"invoices","method":"export"},"summary":"Export invoices for your accountant","description":"Every invoice and credit note issued from `from` to `to` (in your profile's timezone), as a ZIP of their PDFs with an index.csv, or the CSV alone. Made in the background: until the file is ready the answer is 409 `invoice_export_pending` with Retry-After, so call again. The same request within an hour gets the same file. A closed month's ZIP is the one kept when it was closed. A range with nothing issued in it answers 409 `nothing_to_export`.","parameters":[{"name":"from","in":"query","required":true,"description":"The first day, in your profile's timezone: 2026-09-01.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The first day, in your profile's timezone: 2026-09-01."}},{"name":"to","in":"query","required":true,"description":"The last day, included: 2026-09-30.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The last day, included: 2026-09-30."}},{"name":"format","in":"query","required":false,"description":"zip: every invoice's and credit note's PDF, with index.csv. csv: the index alone.","schema":{"default":"zip","description":"zip: every invoice's and credit note's PDF, with index.csv. csv: the index alone.","type":"string","enum":["zip","csv"]}}],"responses":{"200":{"description":"The file: a ZIP for `format=zip`, CSV for `format=csv`.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}},"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/credit-notes":{"get":{"operationId":"listCreditNotes","x-shipbill-sdk":{"resource":"credit_notes","method":"list"},"summary":"List credit notes","description":"Credit notes for refunds, newest first: one for each refund of an invoiced payment, with its own number and PDF, against the invoice it credits.","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"invoice","in":"query","required":false,"description":"Only this invoice's credit notes (inv_…).","schema":{"type":"string","maxLength":64,"description":"Only this invoice's credit notes (inv_…)."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CreditNote"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/credit-notes/{id}":{"get":{"operationId":"getCreditNote","x-shipbill-sdk":{"resource":"credit_notes","method":"retrieve"},"summary":"Retrieve a credit note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditNote"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invoices":{"get":{"operationId":"listInvoices","x-shipbill-sdk":{"resource":"invoices","method":"list"},"summary":"List invoices","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"status","in":"query","required":false,"description":"Only those in this status.","schema":{"type":"string","enum":["open","paid","partially_paid","void","expired","refunded"],"description":"Only those in this status."}},{"name":"reference","in":"query","required":false,"description":"Only those with this reference of yours.","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only those with this reference of yours."}},{"name":"customer_email","in":"query","required":false,"description":"Only this customer's.","schema":{"description":"Only this customer's.","type":"string","maxLength":254}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invoices/{id}":{"get":{"operationId":"getInvoice","x-shipbill-sdk":{"resource":"invoices","method":"retrieve"},"summary":"Retrieve an invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invoices/{id}/pdf":{"get":{"operationId":"getInvoicePdf","x-shipbill-sdk":{"resource":"invoices","method":"pdf"},"summary":"Download an invoice's PDF","description":"Drawn when the invoice is paid or changes, and otherwise on the first request; the answer is 409 `invoice_pdf_pending` only while a paid or refunded invoice's draw is still running.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/invoices/{id}/void":{"post":{"operationId":"voidInvoice","x-shipbill-sdk":{"resource":"invoices","method":"void"},"summary":"Void an open invoice","description":"It can no longer be paid, and its checkout closes. A paid or expired invoice can't be voided.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/customers":{"get":{"operationId":"listCustomers","x-shipbill-sdk":{"resource":"customers","method":"list"},"summary":"List customers","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"email","in":"query","required":false,"description":"Only the customer with this email.","schema":{"description":"Only the customer with this email.","type":"string","maxLength":254}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/customers/{id}":{"get":{"operationId":"getCustomer","x-shipbill-sdk":{"resource":"customers","method":"retrieve"},"summary":"Retrieve a customer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"eraseCustomer","x-shipbill-sdk":{"resource":"customers","method":"erase"},"summary":"Erase a customer","description":"At the buyer's request: their email, name, address, and tax number become placeholders on the customer and on every copy ShipBill keeps (checkouts, sent mail, visits, risk notes, and your events), mail still waiting to them is dropped, and subscriptions ShipBill runs for them end without an email. Their payments, refunds, invoices, and credit notes stay as issued, as tax law requires you to keep them. Refused with `customer_has_provider_subscriptions` while a provider still charges them on its own: cancel it there first. Erasing again changes nothing; nobody can undo it. A provider that kept its own record of the buyer is erased there.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/customers/{id}/portal-session":{"post":{"operationId":"createPortalSession","x-shipbill-sdk":{"resource":"customers","method":"create_portal_session"},"summary":"Open the customer's billing portal","description":"For a Manage billing button on your site, from your server: the provider's portal for a subscription it renews automatically (change the card, cancel at the period end, its invoices), or ShipBill's own subscription page for one renewed by reminder. The provider's address is short-lived: redirect the customer to it at once.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSession"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/events":{"get":{"operationId":"listEvents","x-shipbill-sdk":{"resource":"events","method":"list"},"summary":"List events","description":"Every event exactly as webhooks deliver it, for the last 30 days: older ones are deleted. Read from `created_after` to catch up after downtime; skip the IDs you have already handled.","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"type","in":"query","required":false,"schema":{"type":"string","maxLength":64,"pattern":"^[a-z_]+\\.[a-z_]+$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/events/{id}":{"get":{"operationId":"getEvent","x-shipbill-sdk":{"resource":"events","method":"retrieve"},"summary":"Retrieve an event","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/products":{"get":{"operationId":"listProducts","x-shipbill-sdk":{"resource":"products","method":"list"},"summary":"List products","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"status","in":"query","required":false,"description":"Only those in this status.","schema":{"type":"string","enum":["active","archived"],"description":"Only those in this status."}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createProduct","x-shipbill-sdk":{"resource":"products","method":"create"},"summary":"Create a product","description":"Products are shared by test and live mode.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/products/{id}":{"get":{"operationId":"getProduct","x-shipbill-sdk":{"resource":"products","method":"retrieve"},"summary":"Retrieve a product","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"updateProduct","x-shipbill-sdk":{"resource":"products","method":"update"},"summary":"Update a product","description":"Changes apply to new checkouts; open ones keep their price. `status` archives or restores it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteProduct","x-shipbill-sdk":{"resource":"products","method":"delete"},"summary":"Delete a product","description":"It stops selling and leaves your lists; past payments and invoices keep what was sold.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"product"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/product-categories":{"get":{"operationId":"listProductCategories","x-shipbill-sdk":{"resource":"product_categories","method":"list"},"summary":"List product categories","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductCategory"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createProductCategory","x-shipbill-sdk":{"resource":"product_categories","method":"create"},"summary":"Create a product category","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCategoryCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCategory"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/product-categories/{id}":{"patch":{"operationId":"updateProductCategory","x-shipbill-sdk":{"resource":"product_categories","method":"update"},"summary":"Update a product category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCategoryUpdateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCategory"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteProductCategory","x-shipbill-sdk":{"resource":"product_categories","method":"delete"},"summary":"Delete a product category","description":"Its products stay, without a category.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"product_category"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-links":{"get":{"operationId":"listPaymentLinks","x-shipbill-sdk":{"resource":"payment_links","method":"list"},"summary":"List payment links","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"product","in":"query","required":false,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentLink"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createPaymentLink","x-shipbill-sdk":{"resource":"payment_links","method":"create"},"summary":"Create a payment link","description":"A link sells one product at its current price, in the key's mode. `warnings` says what it can't do yet, such as take payments while no provider is enabled.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/payment-links/{id}":{"patch":{"operationId":"updatePaymentLink","x-shipbill-sdk":{"resource":"payment_links","method":"update"},"summary":"Update a payment link","description":"`status: \"active\"` also resumes a link paused after a spike of declined cards.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLinkUpdateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deletePaymentLink","x-shipbill-sdk":{"resource":"payment_links","method":"delete"},"summary":"Delete a payment link","description":"It leaves your lists for good, and its address stops working as a disabled link's does, never reused. A checkout already open from it can finish; payments, invoices, and analytics made through it keep it. To pause a link instead, update its `status` to `disabled`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"payment_link"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/coupons":{"get":{"operationId":"listCoupons","x-shipbill-sdk":{"resource":"coupons","method":"list"},"summary":"List coupons","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"archived","in":"query","required":false,"description":"Archived coupons instead of the live ones.","schema":{"type":"string","enum":["true","false"],"description":"Archived coupons instead of the live ones."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Coupon"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createCoupon","x-shipbill-sdk":{"resource":"coupons","method":"create"},"summary":"Create a coupon","description":"A discount code for the key's mode. Buyers type it on the checkout; a payment link, a buy button, or a checkout session can preset it. ShipBill prices and counts it the same on every provider.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/coupons/{id}":{"get":{"operationId":"getCoupon","x-shipbill-sdk":{"resource":"coupons","method":"retrieve"},"summary":"Retrieve a coupon","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"updateCoupon","x-shipbill-sdk":{"resource":"coupons","method":"update"},"summary":"Update a coupon","description":"Everything but the code may change. Subscriptions already using it keep their current discount.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponUpdateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/coupons/{id}/archive":{"post":{"operationId":"archiveCoupon","x-shipbill-sdk":{"resource":"coupons","method":"archive"},"summary":"Archive a coupon","description":"Nothing new may use it; subscriptions already carrying it keep it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Coupon"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/coupons/{id}/redemptions":{"get":{"operationId":"listCouponRedemptions","x-shipbill-sdk":{"resource":"coupons","method":"list_redemptions"},"summary":"List a coupon's uses","description":"Who used it, on which order: reserved while a checkout is open, redeemed once paid. Newest first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/CouponRedemption"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","x-shipbill-sdk":{"resource":"webhook_endpoints","method":"list"},"summary":"List webhook endpoints","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createWebhookEndpoint","x-shipbill-sdk":{"resource":"webhook_endpoints","method":"create"},"summary":"Create a webhook endpoint","description":"Up to ten per mode, each with its own events and signing secret. The secret is in this answer only. The owner is emailed when an address is set.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/webhook-endpoints/{id}":{"patch":{"operationId":"updateWebhookEndpoint","x-shipbill-sdk":{"resource":"webhook_endpoints","method":"update"},"summary":"Update a webhook endpoint","description":"`status: \"enabled\"` also restarts an endpoint disabled after three days of failures.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteWebhookEndpoint","x-shipbill-sdk":{"resource":"webhook_endpoints","method":"delete"},"summary":"Delete a webhook endpoint","description":"Nothing more is sent to it. Its past deliveries stay in the dashboard's log.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"webhook_endpoint"},"deleted":{"type":"boolean","const":true}},"required":["id","object","deleted"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions":{"get":{"operationId":"listSubscriptions","x-shipbill-sdk":{"resource":"subscriptions","method":"list"},"summary":"List subscriptions","parameters":[{"name":"limit","in":"query","required":false,"description":"How many per page: 1 to 100, 10 by default.","schema":{"default":10,"description":"How many per page: 1 to 100, 10 by default.","type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","required":false,"description":"The last ID of the previous page, for the next one.","schema":{"type":"string","maxLength":64,"description":"The last ID of the previous page, for the next one."}},{"name":"created_after","in":"query","required":false,"description":"Unix seconds: only what was created after this, for catching up.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Unix seconds: only what was created after this, for catching up."}},{"name":"status","in":"query","required":false,"description":"Only those in this status.","schema":{"type":"string","enum":["active","past_due","expired","cancelled"],"description":"Only those in this status."}},{"name":"product","in":"query","required":false,"description":"Only this product's (prod_…).","schema":{"type":"string","maxLength":64,"description":"Only this product's (prod_…)."}},{"name":"customer_email","in":"query","required":false,"description":"Only this customer's.","schema":{"description":"Only this customer's.","type":"string","maxLength":254}},{"name":"reference","in":"query","required":false,"description":"Only those with this reference of yours.","schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only those with this reference of yours."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createSubscription","x-shipbill-sdk":{"resource":"subscriptions","method":"create"},"summary":"Add an existing subscriber","description":"No payment is taken: active until `paid_until`, then reminded and renewed like any other. The customer is emailed that it is managed here now. `subscription.created` carries `imported: true`.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions/{id}":{"get":{"operationId":"getSubscription","x-shipbill-sdk":{"resource":"subscriptions","method":"retrieve"},"summary":"Retrieve a subscription","description":"Authoritative for access: refuse access after `access_until` even if a webhook was missed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions/{id}/cancel":{"post":{"operationId":"cancelSubscription","x-shipbill-sdk":{"resource":"subscriptions","method":"cancel"},"summary":"Cancel a subscription","description":"Reminders stop; access lasts until the period ends. The customer is told.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions/{id}/discount":{"delete":{"operationId":"endSubscriptionDiscount","x-shipbill-sdk":{"resource":"subscriptions","method":"end_discount"},"summary":"End a subscription's discount","description":"From its next renewal it's at the full price; payments already made keep their discount, and the coupon stays available to everyone else. The subscriber is told, and `subscription.updated` carries `discount.ended_at` with `ended_reason: \"ended_by_merchant\"`. Refused with `no_discount` when it has none to end, and with `discount_not_endable` at Creem or Whop, which can't end one.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions/{id}/addons/{product}":{"post":{"operationId":"setSubscriptionAddon","x-shipbill-sdk":{"resource":"subscriptions","method":"set_addon"},"summary":"Drop or add a recurring add-on","description":"`product` is one of the subscription's product's recurring add-ons (prod_…). `renews: false` stops it at the end of this period, `renews: true` adds it from the next renewal at its price now; either undoes the other while it's still ahead. Nothing is charged or refunded at the change, and the subscriber is told. `items[].ends_at` and `starts_at` show it, and `subscription.updated` is sent. Refused with `addon_not_changeable` when the subscription isn't running, is set to end, or the product isn't one of its recurring add-ons.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"product","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionAddonParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/subscriptions/{id}/renewal-session":{"post":{"operationId":"createRenewalSession","x-shipbill-sdk":{"resource":"subscriptions","method":"create_renewal_session"},"summary":"Open a checkout for the next period","description":"For a Renew button on your site: renews an active or past-due subscription from its period end, or restarts an ended one from the payment date at the current price.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewalSession"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/test/subscriptions/{id}/advance":{"post":{"operationId":"advanceTestSubscription","x-shipbill-sdk":{"resource":"test.subscriptions","method":"advance"},"summary":"Move a test subscription through time","description":"Test-mode keys only: the next reminder now, the due date now, or past the grace period.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionAdvanceParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/embed/checkout/sessions":{"post":{"operationId":"createEmbedSession","x-shipbill-sdk":"browser","summary":"Open a buy button's checkout","security":[{"publishableKey":[]}],"description":"From the browser, with the publishable key, on one of the profile's allowed websites (the request's Origin). An active product at its stored price; never an amount. Open the result with shipbill.js.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedSessionCreateParams"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedSession"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/embed-frames/{token}":{"get":{"operationId":"checkEmbedFrame","x-shipbill-sdk":"browser","summary":"Check a page may open a checkout","security":[],"description":"Asked by shipbill.js before it opens a checkout with its `client_token`, from the page that will show it (the request's Origin). No key: the token names the checkout. 204 when the page is one of the profile's allowed websites for the checkout's mode; otherwise `origin_not_allowed`, and the message says why. You don't call this yourself.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Nothing: the answer is the status."},"default":{"$ref":"#/components/responses/Error"}}}},"/embed/prices":{"get":{"operationId":"previewPrices","x-shipbill-sdk":"browser","summary":"Preview prices for a pricing page","security":[{"publishableKey":[]}],"description":"What the checkout would show this visitor, as display strings. A preview: the amount charged is fixed when the checkout opens.","parameters":[{"name":"products","in":"query","required":true,"description":"Up to 20 product IDs (prod_…), separated by commas.","schema":{"type":"string","maxLength":800,"description":"Up to 20 product IDs (prod_…), separated by commas."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PricePreview"}},"has_more":{"type":"boolean"}},"required":["object","data","has_more"],"additionalProperties":false}}}},"default":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"event":{"post":{"summary":"An event, delivered to your endpoint","description":"Check the ShipBill-Signature header before trusting the body. Answer with any 2xx status; anything else is retried for about three days. Order isn't guaranteed and an event may arrive twice: skip IDs you have handled.","parameters":[{"name":"ShipBill-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of `<t>.<raw body>`>; two v1 values during a secret rotation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Received."}},"x-event-types":{"checkout.created":"CheckoutSession","checkout.expired":"CheckoutSession","payment.created":"Payment","payment.processing":"Payment","payment.requires_action":"Payment","payment.authorized":"Payment","payment.succeeded":"Payment","payment.failed":"Payment","payment.cancelled":"Payment","payment.refunded":"Payment","payment.disputed":"Payment","payment.risk_cleared":"Payment","invoice.created":"Invoice","invoice.paid":"Invoice","invoice.expired":"Invoice","subscription.created":"Subscription","subscription.renewal_upcoming":"Subscription","subscription.renewed":"Subscription","subscription.reactivated":"Subscription","subscription.past_due":"Subscription","subscription.expired":"Subscription","subscription.cancelled":"Subscription","subscription.updated":"Subscription","payout.created":"Payout","payout.completed":"Payout","payout.failed":"Payout","webhook.test":"WebhookTestObject"}}}},"components":{"securitySchemes":{"secretKey":{"type":"http","scheme":"bearer","description":"A secret API key, on your server only."},"publishableKey":{"type":"http","scheme":"bearer","description":"The publishable key (pk_…): safe in a web page, and only accepted from your allowed websites."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Retrying with the same key within 24 hours returns the first answer (with `Idempotent-Replayed: true`) instead of acting twice. A different body with the same key is refused.","schema":{"type":"string","minLength":1,"maxLength":255}}},"responses":{"Error":{"description":"An error, with the field at fault in `param` when there is one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"LineItem":{"type":"object","properties":{"product":{"anyOf":[{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null for a custom amount."},"type":{"type":"string","enum":["one_time","subscription"]},"title":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The line's price, before any discount."},"discount_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A coupon's share of the line; 0 without one."}},"required":["product","type","title","quantity","unit_amount","amount","discount_amount"],"additionalProperties":false},"CheckoutSession":{"type":"object","properties":{"id":{"type":"string","pattern":"^cs_[0-9a-f]{32}$"},"object":{"type":"string","const":"checkout.session"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["open","processing","complete","expired","cancelled"]},"payment_status":{"type":"string","enum":["paid","underpaid","unpaid"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount_tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The merchant's own tax for the buyer's country: added to `amount` where prices don't include it, inside it where they do; 0 without tax. A merchant of record's method adds its own instead."},"currency":{"type":"string","minLength":3,"maxLength":3},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null once the coupon is gone; the code stays as it was used."},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["coupon","code","amount","currency"],"additionalProperties":false},{"type":"null"}]},"reference":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"customer_email":{"type":["string","null"]},"payment":{"anyOf":[{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},{"type":"null"}]},"payment_link":{"anyOf":[{"type":"string","pattern":"^plink_[0-9a-f]{32}$"},{"type":"null"}]},"success_url":{"type":["string","null"]},"cancel_url":{"type":["string","null"]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","status","payment_status","amount","amount_tax","currency","line_items","discount","reference","metadata","customer","customer_email","payment","payment_link","success_url","cancel_url","expires_at","completed_at","created"],"additionalProperties":false},"CheckoutSessionCreated":{"type":"object","properties":{"id":{"type":"string","pattern":"^cs_[0-9a-f]{32}$"},"object":{"type":"string","const":"checkout.session"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["open","processing","complete","expired","cancelled"]},"payment_status":{"type":"string","enum":["paid","underpaid","unpaid"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount_tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The merchant's own tax for the buyer's country: added to `amount` where prices don't include it, inside it where they do; 0 without tax. A merchant of record's method adds its own instead."},"currency":{"type":"string","minLength":3,"maxLength":3},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null once the coupon is gone; the code stays as it was used."},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["coupon","code","amount","currency"],"additionalProperties":false},{"type":"null"}]},"reference":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"customer_email":{"type":["string","null"]},"payment":{"anyOf":[{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},{"type":"null"}]},"payment_link":{"anyOf":[{"type":"string","pattern":"^plink_[0-9a-f]{32}$"},{"type":"null"}]},"success_url":{"type":["string","null"]},"cancel_url":{"type":["string","null"]},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"client_token":{"type":"string","description":"Opens this checkout in the embedded modal (shipbill.js)."},"url":{"type":"string","description":"The hosted checkout page to send the buyer to."}},"required":["id","object","livemode","status","payment_status","amount","amount_tax","currency","line_items","discount","reference","metadata","customer","customer_email","payment","payment_link","success_url","cancel_url","expires_at","completed_at","created","client_token","url"],"additionalProperties":false},"Payment":{"type":"object","properties":{"id":{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},"object":{"type":"string","const":"payment"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["requires_payment_method","requires_action","processing","authorized","underpaid","succeeded","failed","cancelled"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"base_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The amount in the profile's base currency."},"base_currency":{"type":"string","minLength":3,"maxLength":3},"price_source":{"type":"string","enum":["fixed","converted"],"description":"fixed: the product's fixed price in the charged currency, charged exactly, with base_amount converted at that day's rate for reports; converted: the merchant's price, converted or not."},"amount_refunded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"manual":{"type":"boolean","description":"Recorded by the merchant (Mark as paid), not taken through a provider."},"origin":{"type":"string","enum":["checkout","external"],"description":"external: a payment taken at the provider without ShipBill, such as on the merchant's own site, recorded only to give it an invoice. No webhook event is sent for it, and it has no product, so never grant access on it."},"method_type":{"type":["string","null"]},"provider":{"type":["string","null"]},"failure_code":{"type":["string","null"]},"order":{"type":"string","pattern":"^ord_[0-9a-f]{32}$"},"reference":{"description":"The merchant's own ID, given when the checkout was created.","type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null once the coupon is gone; the code stays as it was used."},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["coupon","code","amount","currency"],"additionalProperties":false},{"type":"null"}]},"checkout_session":{"anyOf":[{"type":"string","pattern":"^cs_[0-9a-f]{32}$"},{"type":"null"}]},"payment_intent":{"anyOf":[{"type":"string","pattern":"^pi_[0-9a-f]{32}$"},{"type":"null"}],"description":"The payment intent it was made through, for a custom checkout."},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"string","pattern":"^inv_[0-9a-f]{32}$"},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"succeeded_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"access":{"type":"string","enum":["lifetime","period"]},"access_until":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"subscription":{"anyOf":[{"type":"string","pattern":"^sub_[0-9a-f]{32}$"},{"type":"null"}]},"risk_status":{"type":"string","enum":["clear","flagged","cleared_by_merchant","refunded_for_risk"],"description":"`flagged`: your fraud rules hold delivery until you clear it (then `payment.risk_cleared`). `refunded_for_risk`: refunded after being flagged."},"risk_notes":{"type":"array","items":{"type":"object","properties":{"signal":{"type":"string","enum":["disposable_email","elevated_risk","early_fraud_warning","card_country_mismatch","velocity","duplicate_payment","repeat_offender","subscription_domino"]},"evidence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]},"description":"What was seen: a domain, a country, a count. Never a card number or an email address."},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["signal","evidence","created"],"additionalProperties":false},"description":"Fraud signals on the payment or its checkout. A signal is not proof: ShipBill never refuses a buyer or refunds because of one."},"refund":{"description":"payment.refunded: the refund this event records.","type":"object","properties":{"id":{"type":"string","pattern":"^re_[0-9a-f]{32}$"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"source":{"type":"string","enum":["provider","manual"]}},"required":["amount","currency"],"additionalProperties":false},"dispute":{"description":"payment.disputed: the dispute this event records.","type":"object","properties":{"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"reason":{"type":["string","null"]}},"required":["amount","currency","reason"],"additionalProperties":false},"declined":{"description":"payment.failed: the merchant declined an underpayment.","type":"boolean","const":true},"reversed":{"description":"payment.cancelled: the merchant reversed a manual payment.","type":"boolean","const":true}},"required":["id","object","livemode","status","amount","currency","base_amount","base_currency","price_source","amount_refunded","manual","origin","method_type","provider","failure_code","order","reference","metadata","line_items","discount","checkout_session","payment_intent","customer","invoice","created","succeeded_at","access","access_until","subscription","risk_status","risk_notes"],"additionalProperties":false},"PaymentIntent":{"type":"object","properties":{"id":{"type":"string","pattern":"^pi_[0-9a-f]{32}$"},"object":{"type":"string","const":"payment_intent"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["requires_payment_method","requires_action","processing","succeeded","expired","cancelled"],"description":"requires_payment_method: confirm it with a method (again, after a failure); requires_action: send the buyer to next_action; processing: the provider is confirming it; succeeded: paid."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The price after any discount, before tax added at checkout."},"amount_tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The merchant's own tax for the buyer: added to amount, or inside it."},"currency":{"type":"string","minLength":3,"maxLength":3},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null once the coupon is gone; the code stays as it was used."},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["coupon","code","amount","currency"],"additionalProperties":false},{"type":"null"}]},"payment_methods":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string","description":"The method's name for the buyer, as the dashboard shows it: \"Card\", \"Bank transfer\", \"QRIS\"."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What this method charges, the tax included where it's added."},"currency":{"type":"string","minLength":3,"maxLength":3},"merchant_of_record":{"description":"A merchant of record sells it: it adds its own tax on its page.","type":["string","null"]}},"required":["type","label","amount","currency","merchant_of_record"],"additionalProperties":false},"description":"The methods it can be confirmed with, while it needs one."},"next_action":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"redirect"},"url":{"type":"string"}},"required":["type","url"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"client_component"},"provider":{"type":"string"},"client_secret":{"type":"string"},"publishable_key":{"type":"string"},"return_url":{"type":"string","description":"The intent's return_url: where the provider sends the buyer after its fields, so mounting them needs nothing else."}},"required":["type","provider","client_secret","publishable_key","return_url"],"additionalProperties":false}]},{"type":"null"}],"description":"Where the buyer pays: the provider's page, or its secure fields to mount (shipbill.js: ShipBill.mount(next_action, element)). A client_component comes only in the confirm response."},"last_payment_error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Why the last attempt failed, in words for the buyer."},"customer":{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},"customer_email":{"type":"string"},"payment":{"anyOf":[{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"string","pattern":"^inv_[0-9a-f]{32}$"},{"type":"null"}]},"return_url":{"type":"string"},"reference":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","status","amount","amount_tax","currency","line_items","discount","payment_methods","next_action","last_payment_error","customer","customer_email","payment","invoice","return_url","reference","metadata","expires_at","created"],"additionalProperties":false},"Payout":{"type":"object","properties":{"id":{"type":"string","pattern":"^po_[0-9a-f]{32}$"},"object":{"type":"string","const":"payout"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["pending","in_transit","paid","failed","cancelled"],"description":"pending: not sent yet; in_transit: on its way; paid: arrived; failed: refused by your bank; cancelled: one you recorded, undone."},"provider":{"type":"string"},"provider_reference":{"description":"The provider's ID for it; null for one you recorded.","type":["string","null"]},"manual":{"type":"boolean","description":"Recorded by you, for a provider ShipBill can't read payouts from."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The whole payout, your sales outside ShipBill included; negative when it took money from your bank."},"currency":{"type":"string","minLength":3,"maxLength":3},"shipbill_amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The part from sales through ShipBill, in the payout's currency; null until its lines are read."},"fee":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What the provider charged for sending it."},"arrival_date":{"description":"When it's expected at your bank, where the provider says.","type":["string","null"]},"paid_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","status","provider","provider_reference","manual","amount","currency","shipbill_amount","fee","arrival_date","paid_at","created"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"id":{"type":"string","pattern":"^inv_[0-9a-f]{32}$"},"object":{"type":"string","const":"invoice"},"livemode":{"type":"boolean"},"number":{"type":"string"},"status":{"type":"string","enum":["open","paid","partially_paid","void","expired","refunded"]},"currency":{"type":"string","minLength":3,"maxLength":3},"amount_due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount_tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The merchant's own tax in `amount_due`: added to the lines, or inside them where prices include it; 0 without tax."},"amount_paid":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount_refunded":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Returned to the buyer since; `refunded` once it is all of it."},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"customer_email":{"type":"string"},"customer_name":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"product":{"anyOf":[{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},{"type":"null"}]},"title":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"discount_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A coupon's share of the line; 0 without one."}},"required":["product","title","quantity","unit_amount","amount","discount_amount"],"additionalProperties":false}},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"Null once the coupon is gone; the code stays as it was used."},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["coupon","code","amount","currency"],"additionalProperties":false},{"type":"null"}]},"order":{"type":"string","pattern":"^ord_[0-9a-f]{32}$"},"reference":{"type":["string","null"]},"payment":{"anyOf":[{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},{"type":"null"}]},"hosted_url":{"type":"string","description":"The buyer's page for this invoice, with its PDF."},"revision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1 as issued. Each correction the buyer makes to their own details (name, company, address, tax number, reference) adds one; the number and amounts never change."},"issued_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paid_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","number","status","currency","amount_due","amount_tax","amount_paid","amount_refunded","customer","customer_email","customer_name","lines","discount","order","reference","payment","hosted_url","revision","issued_at","paid_at","created"],"additionalProperties":false},"Customer":{"type":"object","properties":{"id":{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},"object":{"type":"string","const":"customer"},"livemode":{"type":"boolean"},"erased":{"type":"boolean","description":"Erased at the buyer's request (`DELETE /v1/customers/{id}`): their email, name, address, and tax number are placeholders here and on every copy ShipBill keeps. Their payments and invoices stay as issued."},"email":{"type":"string"},"name":{"type":["string","null"]},"country":{"type":["string","null"]},"address":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":["string","null"]},"city":{"type":"string"},"region":{"type":["string","null"]},"postal_code":{"type":["string","null"]},"country":{"type":"string"}},"required":["line1","line2","city","region","postal_code","country"],"additionalProperties":false},{"type":"null"}]},"tax_number":{"type":["string","null"]},"tax_number_country":{"type":["string","null"]},"tax_number_status":{"anyOf":[{"type":"string","enum":["verified","unverified","pending","invalid"]},{"type":"null"}],"description":"verified: confirmed by the country's register (VIES, HMRC, the ABR); unverified: right format, no register to ask; pending: the register was down, asked again shortly; invalid: the register has no record of it."},"external_ref":{"description":"Your own ID for this customer: the `reference` of the first checkout your server created for them. Unique in a mode.","type":["string","null"]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","erased","email","name","country","address","tax_number","tax_number_country","tax_number_status","external_ref","created"],"additionalProperties":false},"Product":{"type":"object","properties":{"id":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"object":{"type":"string","const":"product"},"title":{"type":"string"},"description":{"type":["string","null"]},"price_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"prices":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."}},"required":["currency","amount"],"additionalProperties":false},"description":"Fixed prices in other currencies: charged exactly, in place of a converted price."},"type":{"type":"string","enum":["one_time","subscription"]},"interval":{"anyOf":[{"type":"string","enum":["day","week","month","year"]},{"type":"null"}],"description":"Subscriptions only."},"interval_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"renewal_reminders":{"description":"Subscriptions only: off for a fixed term.","type":["boolean","null"]},"renewal_mode":{"anyOf":[{"type":"string","enum":["reminder","automatic","automatic_or_reminder"]},{"type":"null"}],"description":"Subscriptions only: reminder (the customer pays each period through a link), automatic (a provider with its own subscription engine charges each period; only such providers sell it), or automatic_or_reminder (automatic where the chosen provider supports it)."},"image":{"type":["string","null"]},"category":{"anyOf":[{"type":"string","pattern":"^cat_[0-9a-f]{32}$"},{"type":"null"}]},"providers":{"anyOf":[{"type":"string","const":"all"},{"type":"array","items":{"type":"string"}}],"description":"\"all\" connected providers, or only these, by provider (\"oxapay\")."},"after_payment_message":{"type":["string","null"]},"after_payment_url":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"addons":{"type":"array","items":{"type":"object","properties":{"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offered":{"type":"boolean","description":"Offered at the checkout: a box the buyer may tick, on a buy button and with `offer_addons`."}},"required":["product","quantity","offered"],"additionalProperties":false},"description":"Other products sold with it, each with its quantity by default: one-time, or on a subscription, recurring."},"buyer_quantity":{"anyOf":[{"type":"object","properties":{"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["min","max"],"additionalProperties":false},{"type":"null"}],"description":"The range a buyer may choose from on a link's or buy button's checkout; null: off."},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","title","description","price_amount","currency","prices","type","interval","interval_count","renewal_reminders","renewal_mode","image","category","providers","after_payment_message","after_payment_url","status","metadata","addons","buyer_quantity","created","updated"],"additionalProperties":false},"ProductCategory":{"type":"object","properties":{"id":{"type":"string","pattern":"^cat_[0-9a-f]{32}$"},"object":{"type":"string","const":"product_category"},"name":{"type":"string"},"description":{"type":["string","null"]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","name","description","created"],"additionalProperties":false},"PaymentLink":{"type":"object","properties":{"id":{"type":"string","pattern":"^plink_[0-9a-f]{32}$"},"object":{"type":"string","const":"payment_link"},"livemode":{"type":"boolean"},"url":{"type":"string"},"label":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","paused"],"description":"\"paused\": stopped after a spike of declined cards."},"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The product's quantity, fixed; null: 1, or the buyer's choice where the product allows it."},"items":{"type":"array","items":{"type":"object","properties":{"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offered":{"type":"boolean","description":"Offered, a box the buyer may tick; otherwise Included, in every sale."}},"required":["product","quantity","offered"],"additionalProperties":false},"description":"The product's add-ons it sells, at their quantities, set when it was made."},"amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},{"type":"null"}],"description":"What it sells, at current prices: the product at its quantity, and the add-ons it includes."},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_payments":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"payments_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"boolean","description":"Whether a buyer opening it now could pay."},"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"A coupon applied when the link opens; the buyer can remove it."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","url","label","status","product","quantity","items","amount","currency","expires_at","max_payments","payments_count","available","coupon","metadata","created"],"additionalProperties":false},"PaymentLinkCreated":{"type":"object","properties":{"id":{"type":"string","pattern":"^plink_[0-9a-f]{32}$"},"object":{"type":"string","const":"payment_link"},"livemode":{"type":"boolean"},"url":{"type":"string"},"label":{"type":["string","null"]},"status":{"type":"string","enum":["active","disabled","paused"],"description":"\"paused\": stopped after a spike of declined cards."},"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The product's quantity, fixed; null: 1, or the buyer's choice where the product allows it."},"items":{"type":"array","items":{"type":"object","properties":{"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offered":{"type":"boolean","description":"Offered, a box the buyer may tick; otherwise Included, in every sale."}},"required":["product","quantity","offered"],"additionalProperties":false},"description":"The product's add-ons it sells, at their quantities, set when it was made."},"amount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},{"type":"null"}],"description":"What it sells, at current prices: the product at its quantity, and the add-ons it includes."},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_payments":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"payments_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"boolean","description":"Whether a buyer opening it now could pay."},"coupon":{"anyOf":[{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},{"type":"null"}],"description":"A coupon applied when the link opens; the buyer can remove it."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["checkout_unavailable","items_unavailable"],"description":"\"checkout_unavailable\": no enabled payment provider can take its payments yet. \"items_unavailable\": its products share no provider that can take them together."},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Empty when buyers can pay. Otherwise why they can't yet, and how to fix it."}},"required":["id","object","livemode","url","label","status","product","quantity","items","amount","currency","expires_at","max_payments","payments_count","available","coupon","metadata","created","warnings"],"additionalProperties":false},"Coupon":{"type":"object","properties":{"id":{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},"object":{"type":"string","const":"coupon"},"livemode":{"type":"boolean"},"code":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["percent","fixed"]},"percent_bp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amounts":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."}},"required":["currency","amount"],"additionalProperties":false}},"minimum_subtotals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."}},"required":["currency","amount"],"additionalProperties":false}},"duration":{"type":"string","enum":["once","repeating","forever"]},"duration_periods":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"applies_to":{"type":"string","enum":["all","products"]},"products":{"type":"array","items":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"}},"max_redemptions":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"max_per_customer":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"first_purchase_only":{"type":"boolean"},"starts_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"redemptions_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Kept uses: a full refund gives one back."},"archived_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","code","name","kind","percent_bp","amounts","minimum_subtotals","duration","duration_periods","applies_to","products","max_redemptions","max_per_customer","first_purchase_only","starts_at","ends_at","redemptions_count","archived_at","created"],"additionalProperties":false},"CouponRedemption":{"type":"object","properties":{"id":{"type":"string","pattern":"^cpnr_[0-9a-f]{32}$"},"object":{"type":"string","const":"coupon_redemption"},"coupon":{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},"status":{"type":"string","enum":["reserved","redeemed","released"]},"order":{"type":"string","pattern":"^ord_[0-9a-f]{32}$"},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"customer_email":{"type":["string","null"]},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"redeemed_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","coupon","status","order","customer","customer_email","amount","currency","redeemed_at","created"],"additionalProperties":false},"Event":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{32}$"},"object":{"type":"string","const":"event"},"type":{"type":"string","description":"payment.succeeded, invoice.paid, checkout.expired, …"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"livemode":{"type":"boolean"},"api_version":{"type":"string"},"data":{"type":"object","properties":{"object":{"anyOf":[{"$ref":"#/components/schemas/Payment"},{"$ref":"#/components/schemas/CheckoutSession"},{"$ref":"#/components/schemas/Invoice"},{"$ref":"#/components/schemas/Subscription"},{"$ref":"#/components/schemas/WebhookTestObject"}],"description":"The object as it was when the event happened, complete enough to act on alone."}},"required":["object"],"additionalProperties":false}},"required":["id","object","type","created","livemode","api_version","data"],"additionalProperties":false},"WebhookPayload":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{32}$"},"type":{"type":"string","description":"payment.succeeded, invoice.paid, checkout.expired, …"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"livemode":{"type":"boolean"},"api_version":{"type":"string"},"data":{"type":"object","properties":{"object":{"anyOf":[{"$ref":"#/components/schemas/Payment"},{"$ref":"#/components/schemas/CheckoutSession"},{"$ref":"#/components/schemas/Invoice"},{"$ref":"#/components/schemas/Subscription"},{"$ref":"#/components/schemas/WebhookTestObject"}],"description":"The object as it was when the event happened, complete enough to act on alone."}},"required":["object"],"additionalProperties":false}},"required":["id","type","created","livemode","api_version","data"],"additionalProperties":false},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","pattern":"^whep_[0-9a-f]{32}$"},"object":{"type":"string","const":"webhook_endpoint"},"livemode":{"type":"boolean"},"url":{"type":"string"},"description":{"type":["string","null"]},"enabled_events":{"type":"array","items":{"type":"string"},"description":"\"*\" for every event, or the types chosen."},"status":{"type":"string","enum":["enabled","disabled","auto_disabled"]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"secret":{"type":"string"}},"required":["id","object","livemode","url","description","enabled_events","status","created"],"additionalProperties":false},"Subscription":{"type":"object","properties":{"id":{"type":"string","pattern":"^sub_[0-9a-f]{32}$"},"object":{"type":"string","const":"subscription"},"livemode":{"type":"boolean"},"status":{"type":"string","enum":["active","past_due","expired","cancelled"]},"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"reference":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"customer":{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},"customer_email":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The price locked when it started, before any discount: its items' total each period. Released if it lapses."},"currency":{"type":"string","minLength":3,"maxLength":3},"items":{"type":"array","items":{"type":"object","properties":{"product":{"type":"string","pattern":"^prod_[0-9a-f]{32}$"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Locked when it started."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"`unit_amount` × `quantity`, each period, before any discount."},"starts_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"A recurring add-on added to it: the start of the first period it renews in. Null: from the start."},"ends_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"A recurring add-on dropped from it: the end of the last period it renews in. Null: it goes on renewing."}},"required":["product","quantity","unit_amount","amount","starts_at","ends_at"],"additionalProperties":false},"description":"What renews each period: the product first, then any recurring add-ons. One-time add-ons were charged with the first payment only, so they aren't here."},"discount":{"anyOf":[{"type":"object","properties":{"coupon":{"type":"string","pattern":"^cpn_[0-9a-f]{32}$"},"code":{"type":"string"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Taken off each discounted period."},"currency":{"type":"string","minLength":3,"maxLength":3},"periods_remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Renewals still discounted after the current period: null forever, 0 done."},"ended_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"When the discount ended before its periods ran out: its coupon archived, used up, or past its end date, or ended by you. `periods_remaining` is 0 from then on."},"ended_reason":{"anyOf":[{"type":"string","enum":["coupon_archived","coupon_used_up","coupon_ended","ended_by_merchant"]},{"type":"null"}],"description":"Why it ended early; null unless `ended_at` is set."}},"required":["coupon","code","amount","currency","periods_remaining","ended_at","ended_reason"],"additionalProperties":false},{"type":"null"}],"description":"The coupon it was bought with, which discounts its renewals for its periods while the coupon is available: archived, used up, or past its end date, it stops from the next renewal, and never comes back."},"interval":{"type":"string","enum":["day","week","month","year"]},"interval_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"renewal_reminders":{"type":"boolean"},"current_period_start":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"current_period_end":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"access":{"type":"string","const":"period"},"access_until":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The end of the paid period: refuse access after it, even if a webhook is missed."},"grace_until":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Past due: when it expires if still unpaid."},"cancel_at_period_end":{"type":"boolean"},"cancelled_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"cancelled_by":{"anyOf":[{"type":"string","enum":["customer","merchant","replaced","product_deleted"]},{"type":"null"}]},"replaced_by":{"anyOf":[{"type":"string","pattern":"^sub_[0-9a-f]{32}$"},{"type":"null"}]},"imported":{"type":"boolean","description":"Added by the merchant, not bought through ShipBill."},"renewal_mode":{"type":"string","enum":["reminder","automatic"],"description":"reminder: the customer pays each period through a link. automatic: `provider` charges each period itself; the customer manages it in the provider's portal."},"provider":{"description":"Automatic renewal: the provider whose subscription charges it (polar).","type":["string","null"]},"paused":{"type":"boolean","description":"The merchant's account is locked: nothing is sent and nothing expires."},"manage_url":{"type":"string","description":"The customer's own page: renew, see receipts, cancel, or Manage billing at the provider."},"payment":{"anyOf":[{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},{"type":"null"}],"description":"The latest payment for it."},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^inv_[0-9a-f]{32}$"},"number":{"type":"string"},"url":{"type":"string"}},"required":["id","number","url"],"additionalProperties":false},{"type":"null"}],"description":"The latest invoice paid for it."},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","status","product","reference","metadata","customer","customer_email","amount","currency","items","discount","interval","interval_count","renewal_reminders","current_period_start","current_period_end","access","access_until","grace_until","cancel_at_period_end","cancelled_at","cancelled_by","replaced_by","imported","renewal_mode","provider","paused","manage_url","payment","invoice","created"],"additionalProperties":false},"Refund":{"type":"object","properties":{"id":{"type":"string","pattern":"^re_[0-9a-f]{32}$"},"object":{"type":"string","const":"refund"},"livemode":{"type":"boolean"},"payment":{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string","minLength":3,"maxLength":3},"status":{"type":"string","enum":["pending","succeeded","failed"],"description":"A refund counts once it has succeeded; one recorded by hand has."},"source":{"type":"string","enum":["provider","manual"],"description":"Reported by the provider, or recorded by you."},"note":{"description":"What you wrote when recording it by hand.","type":["string","null"]},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","object","livemode","payment","amount","currency","status","source","note","created","completed_at"],"additionalProperties":false},"CreditNote":{"type":"object","properties":{"id":{"type":"string","pattern":"^cn_[0-9a-f]{32}$"},"object":{"type":"string","const":"credit_note"},"livemode":{"type":"boolean"},"number":{"type":"string","description":"Its own sequence: CN-2026-00012."},"invoice":{"type":"string","pattern":"^inv_[0-9a-f]{32}$"},"invoice_number":{"type":"string"},"refund":{"type":"string","pattern":"^re_[0-9a-f]{32}$","description":"The refund it records; one credit note per refund."},"payment":{"type":"string","pattern":"^pay_[0-9a-f]{32}$"},"customer":{"anyOf":[{"type":"string","pattern":"^cus_[0-9a-f]{32}$"},{"type":"null"}]},"customer_email":{"type":"string"},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"The invoice's currency."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What is credited, as a positive amount in the invoice's currency."},"lines":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unit_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In the currency's smallest unit, such as cents."}},"required":["title","quantity","unit_amount","amount"],"additionalProperties":false}},"refund_amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What went back to the buyer, in the currency they paid in."},"refund_currency":{"type":"string","minLength":3,"maxLength":3},"note":{"description":"Your note on the refund. Never shown to the buyer or printed.","type":["string","null"]},"hosted_url":{"type":"string","description":"The invoice's page, which lists its credit notes with their PDFs."},"issued_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","object","livemode","number","invoice","invoice_number","refund","payment","customer","customer_email","currency","amount","lines","refund_amount","refund_currency","note","hosted_url","issued_at","created"],"additionalProperties":false},"RenewalSession":{"type":"object","properties":{"object":{"type":"string","const":"checkout.renewal_session"},"subscription":{"type":"string","pattern":"^sub_[0-9a-f]{32}$"},"client_token":{"type":"string"},"url":{"type":"string"},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["object","subscription","client_token","url","expires_at"],"additionalProperties":false},"PortalSession":{"type":"object","properties":{"object":{"type":"string","const":"portal_session"},"url":{"type":"string"},"provider":{"type":"string","description":"The provider whose portal it is (polar), or \"shipbill\" for ShipBill's own subscription page."},"subscription":{"type":"string","pattern":"^sub_[0-9a-f]{32}$"},"expires_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"When the address stops working; null for ShipBill's own page."}},"required":["object","url","provider","subscription","expires_at"],"additionalProperties":false},"WebhookTestObject":{"type":"object","properties":{"object":{"type":"string","const":"webhook_test"},"endpoint":{"type":"string","pattern":"^whep_[0-9a-f]{32}$"},"message":{"type":"string"}},"required":["object","endpoint","message"],"additionalProperties":false},"EmbedSession":{"type":"object","properties":{"object":{"type":"string","const":"checkout.embed_session"},"client_token":{"type":"string"},"url":{"type":"string","description":"The hosted page, for when a modal can't be opened."},"expires_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["object","client_token","url","expires_at"],"additionalProperties":false},"PricePreview":{"type":"object","properties":{"product":{"type":"string"},"available":{"type":"boolean","description":"False for a product that isn't active, or isn't this profile's."},"display":{"description":"The localised price, such as \"€45.12\".","type":["string","null"]},"currency":{"anyOf":[{"type":"string","minLength":3,"maxLength":3},{"type":"null"}]},"base":{"description":"The merchant's own price, such as \"$49.00\".","type":["string","null"]},"source":{"anyOf":[{"type":"string","enum":["fixed","converted"]},{"type":"null"}],"description":"fixed: the merchant's fixed price in this currency, shown and charged exactly (no \"about\"); converted: worked out from their price, or their price itself."},"interval":{"anyOf":[{"type":"string","enum":["day","week","month","year"]},{"type":"null"}],"description":"For a subscription, the unit of its period; null for a one-time price."},"interval_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a subscription, how many `interval`s each period lasts; null for a one-time price."}},"required":["product","available","display","currency","base","source","interval","interval_count"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","idempotency_error","api_error"]},"code":{"type":"string"},"message":{"type":"string"},"param":{"description":"The field at fault, such as \"line_items.0.product\".","type":["string","null"]},"request_id":{"type":"string"}},"required":["type","code","message","param","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"CheckoutSessionCreateParams":{"type":"object","properties":{"line_items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"A product's ID (prod_…): its stored title and price are used."},"quantity":{"default":1,"description":"1 to 99. A subscription renews at this quantity for its life.","type":"integer","minimum":1,"maximum":99}},"required":["product"],"additionalProperties":false},"description":"What is bought: up to 20 of your products. One subscription at most, the first line, with only its own add-ons after it; its one-time add-ons are charged with the first payment only. Or send amount and currency instead."},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"A custom amount in the currency's smallest unit, instead of line_items. Secret key only. A one-time payment, never offered to a merchant of record, which sells only products: use line_items for those."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"With amount: a three-letter currency code, such as USD."},"description":{"type":"string","minLength":1,"maxLength":200,"description":"With amount: what the buyer is paying for, shown on the checkout and invoice."},"reference":{"type":"string","minLength":1,"maxLength":200,"description":"Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event."},"metadata":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 of your own key/value pairs, returned with the object and its events."},"attribution":{"type":"object","properties":{"page_url":{"type":"string","maxLength":2000,"format":"uri","description":"The page of yours the buyer was on, such as your pricing page. Its campaign tags are read when you send none."},"referrer":{"type":"string","maxLength":2000,"format":"uri","description":"The site that first sent the buyer to you, as your site recorded it."},"utm_source":{"type":"string","minLength":1,"maxLength":100},"utm_medium":{"type":"string","minLength":1,"maxLength":100},"utm_campaign":{"type":"string","minLength":1,"maxLength":100}},"additionalProperties":false,"description":"Where the buyer came from, as your site remembers it. Shown in Analytics → Sources, before what the browser says."},"replace_subscription":{"type":"string","maxLength":64,"description":"A plan change: this subscription (sub_…) is cancelled once the new one's first payment succeeds."},"customer":{"type":"object","properties":{"email":{"description":"Filled in on the checkout, and fixed: the buyer can't change it.","type":"string","maxLength":254},"name":{"type":"string","minLength":1,"maxLength":120},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":120},"line2":{"type":"string","maxLength":120},"city":{"type":"string","minLength":1,"maxLength":80},"region":{"type":"string","maxLength":80},"postal_code":{"type":"string","maxLength":20},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"tax_number":{"type":"string","minLength":1,"maxLength":40}},"required":["email"],"additionalProperties":false,"description":"The buyer, when your server knows them, so they aren't asked again."},"success_url":{"type":"string","maxLength":500,"format":"uri","description":"Where the buyer returns after paying; ShipBill adds ?session_id=cs_…."},"cancel_url":{"type":"string","maxLength":500,"format":"uri","description":"Where the buyer goes if they leave without paying."},"discounts":{"maxItems":1,"type":"array","items":{"type":"object","properties":{"coupon":{"type":"string","minLength":1,"maxLength":64,"description":"A coupon's code, such as SAVE20, or its ID (cpn_…)."}},"required":["coupon"],"additionalProperties":false},"description":"A discount to apply, fixed: the buyer can't remove it. A code that doesn't apply fails the request with coupon_not_applicable."},"allow_discount_codes":{"type":"boolean","description":"Whether the checkout offers a field for a discount code. By default, when you have an active coupon."},"offer_addons":{"type":"boolean","description":"true: the checkout offers the first line's product's add-ons marked Offer at the checkout, as boxes the buyer may tick, beside line_items. Those already in line_items aren't offered again. Off by default."},"expires_in":{"type":"integer","minimum":1800,"maximum":86400,"description":"Seconds until the checkout expires: 1800 to 86400, 86400 by default."}},"additionalProperties":false},"PaymentIntentCreateParams":{"type":"object","properties":{"line_items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"A product's ID (prod_…): its stored title and price are used."},"quantity":{"default":1,"description":"1 to 99. A subscription renews at this quantity for its life.","type":"integer","minimum":1,"maximum":99}},"required":["product"],"additionalProperties":false},"description":"What is bought: up to 20 of your products. One subscription at most, the first line, with only its own add-ons after it; its one-time add-ons are charged with the first payment only. Or send amount and currency instead."},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"A custom amount in the currency's smallest unit, instead of line_items. Secret key only. A one-time payment, never offered to a merchant of record, which sells only products: use line_items for those."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"With amount: a three-letter currency code."},"description":{"type":"string","minLength":1,"maxLength":200,"description":"With amount: what the buyer is paying for, on the invoice."},"customer":{"type":"object","properties":{"email":{"type":"string","maxLength":254},"name":{"type":"string","minLength":1,"maxLength":120},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":120},"line2":{"type":"string","maxLength":120},"city":{"type":"string","minLength":1,"maxLength":80},"region":{"type":"string","maxLength":80},"postal_code":{"type":"string","maxLength":20},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["line1","city","country"],"additionalProperties":false},"tax_number":{"type":"string","minLength":1,"maxLength":40},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"Where the buyer is, for routing and tax, when no address is given."}},"required":["email"],"additionalProperties":false,"description":"The buyer: their email gets the invoice and receipt."},"return_url":{"type":"string","maxLength":500,"format":"uri","description":"Where the provider sends the buyer after paying; ShipBill adds ?payment_intent=pi_…."},"discounts":{"maxItems":1,"type":"array","items":{"type":"object","properties":{"coupon":{"type":"string","minLength":1,"maxLength":64,"description":"A coupon's code, such as SAVE20, or its ID (cpn_…)."}},"required":["coupon"],"additionalProperties":false},"description":"A discount to apply, fixed: the buyer can't remove it. A code that doesn't apply fails the request with coupon_not_applicable."},"reference":{"type":"string","minLength":1,"maxLength":200,"description":"Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event."},"metadata":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 of your own key/value pairs, returned with the object and its events."},"expires_in":{"type":"integer","minimum":1800,"maximum":86400,"description":"Seconds until it expires unpaid: 1800 to 86400, 86400 by default."}},"required":["customer","return_url"],"additionalProperties":false},"PaymentIntentConfirmParams":{"type":"object","properties":{"payment_method_type":{"type":"string","enum":["card","wallet","bank_transfer","qris","ewallet","retail","paylater","bank","crypto"],"description":"One of the intent's payment_methods."}},"required":["payment_method_type"],"additionalProperties":false},"ProductCreateParams":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"price_amount":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999,"description":"The price in the currency's smallest unit: 4900 is $49.00."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"A three-letter code; the profile's currency by default."},"prices":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999}},"required":["currency","amount"],"additionalProperties":false},"description":"Fixed prices in other currencies, such as `[{ currency: \"EUR\", amount: 4500 }]`: a buyer in that currency pays exactly that. One per currency, never the product's own. On an update, the whole list; omit it to leave them as they are."},"category":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"A category's ID (cat_…), or null."},"providers":{"anyOf":[{"type":"string","const":"all"},{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,32}$"}}],"description":"\"all\" connected providers (the default), or only these, such as [\"oxapay\"]."},"after_payment_message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Shown to the buyer after paying, and in their receipt."},"after_payment_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}],"description":"A link offered to the buyer after paying, such as a download. A convenience, not access control."},"metadata":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 of your own key/value pairs, returned with the object and its events."},"addons":{"maxItems":19,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"A product's ID (prod_…), in this product's currency: a one-time product, or, on a subscription, a subscription renewing as it does (a recurring add-on)."},"quantity":{"default":1,"description":"Its quantity by default: 1 to 99.","type":"integer","minimum":1,"maximum":99},"offered":{"default":false,"description":"Offer at the checkout: a box the buyer may tick, on a buy button that sends no selection of its own and on a session made with `offer_addons`.","type":"boolean"}},"required":["product"],"additionalProperties":false},"description":"Up to 19 add-ons, other products in this product's currency, none with add-ons of its own. A payment link picks which it includes. A subscription's one-time add-ons are charged with its first payment only; its recurring add-ons, subscription products with its interval, renew with it. On an update, the whole list; omit it to leave them as they are."},"buyer_quantity":{"anyOf":[{"type":"object","properties":{"min":{"type":"integer","minimum":1,"maximum":99},"max":{"type":"integer","minimum":1,"maximum":99}},"required":["min","max"],"additionalProperties":false},{"type":"null"}],"description":"Lets the buyer choose how many, between min and max, on a payment link's or buy button's checkout. A subscription renews at the quantity chosen. null turns it off."},"type":{"type":"string","enum":["one_time","subscription"],"description":"one_time (the default), or subscription: paid again every interval_count intervals. Fixed once created."},"interval":{"type":"string","enum":["day","week","month","year"],"description":"A subscription's period."},"interval_count":{"type":"integer","minimum":1,"maximum":365,"description":"How many intervals each period lasts; 1 by default."},"renewal_reminders":{"type":"boolean","description":"False for a fixed term: no reminders while it runs, and one notice when it ends."},"renewal_mode":{"type":"string","enum":["reminder","automatic","automatic_or_reminder"],"description":"A subscription's renewal: reminder (the default), automatic (sold only by providers with their own subscription engine), or automatic_or_reminder."}},"required":["title","price_amount"],"additionalProperties":false},"ProductUpdateParams":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"price_amount":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999,"description":"The price in the currency's smallest unit: 4900 is $49.00."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"A three-letter code; the profile's currency by default."},"prices":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9999999999}},"required":["currency","amount"],"additionalProperties":false},"description":"Fixed prices in other currencies, such as `[{ currency: \"EUR\", amount: 4500 }]`: a buyer in that currency pays exactly that. One per currency, never the product's own. On an update, the whole list; omit it to leave them as they are."},"category":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"A category's ID (cat_…), or null."},"providers":{"anyOf":[{"type":"string","const":"all"},{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{1,32}$"}}],"description":"\"all\" connected providers (the default), or only these, such as [\"oxapay\"]."},"after_payment_message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Shown to the buyer after paying, and in their receipt."},"after_payment_url":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}],"description":"A link offered to the buyer after paying, such as a download. A convenience, not access control."},"metadata":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 of your own key/value pairs, returned with the object and its events."},"addons":{"maxItems":19,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"A product's ID (prod_…), in this product's currency: a one-time product, or, on a subscription, a subscription renewing as it does (a recurring add-on)."},"quantity":{"default":1,"description":"Its quantity by default: 1 to 99.","type":"integer","minimum":1,"maximum":99},"offered":{"default":false,"description":"Offer at the checkout: a box the buyer may tick, on a buy button that sends no selection of its own and on a session made with `offer_addons`.","type":"boolean"}},"required":["product"],"additionalProperties":false},"description":"Up to 19 add-ons, other products in this product's currency, none with add-ons of its own. A payment link picks which it includes. A subscription's one-time add-ons are charged with its first payment only; its recurring add-ons, subscription products with its interval, renew with it. On an update, the whole list; omit it to leave them as they are."},"buyer_quantity":{"anyOf":[{"type":"object","properties":{"min":{"type":"integer","minimum":1,"maximum":99},"max":{"type":"integer","minimum":1,"maximum":99}},"required":["min","max"],"additionalProperties":false},{"type":"null"}],"description":"Lets the buyer choose how many, between min and max, on a payment link's or buy button's checkout. A subscription renews at the quantity chosen. null turns it off."},"interval":{"type":"string","enum":["day","week","month","year"],"description":"A subscription's period."},"interval_count":{"type":"integer","minimum":1,"maximum":365,"description":"How many intervals each period lasts; 1 by default."},"renewal_reminders":{"type":"boolean","description":"False for a fixed term: no reminders while it runs, and one notice when it ends."},"renewal_mode":{"type":"string","enum":["reminder","automatic","automatic_or_reminder"],"description":"A subscription's renewal: reminder (the default), automatic (sold only by providers with their own subscription engine), or automatic_or_reminder."},"status":{"type":"string","enum":["active","archived"],"description":"archived stops it selling; active restores it."}},"additionalProperties":false},"ProductCategoryCreateParams":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false},"ProductCategoryUpdateParams":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"additionalProperties":false},"PaymentLinkCreateParams":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"The product's ID (prod_…)."},"items":{"maxItems":19,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"One of the product's add-ons (prod_…)."},"quantity":{"default":1,"description":"1 to 99.","type":"integer","minimum":1,"maximum":99},"offered":{"default":false,"description":"true: Offered, a box the buyer may tick. false: Included, in every sale.","type":"boolean"}},"required":["product"],"additionalProperties":false},"description":"Which of the product's add-ons it sells, at what quantities: Included in every sale, or Offered as a box the buyer may tick. Set when it's made and never changed: to sell something else, make another link."},"quantity":{"anyOf":[{"type":"integer","minimum":1,"maximum":99},{"type":"null"}],"description":"The product's quantity, fixed. Omitted: 1, or the buyer's choice where the product's buyer_quantity allows it. A subscription renews at it for its life."},"label":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"description":"Your own name for the link, such as a campaign."},"expires_at":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Unix seconds: the link stops working then."},"max_payments":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}],"description":"The link stops after this many payments."},"coupon":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"description":"A coupon (cpn_…) or its code, applied when the link opens; the buyer can remove it."},"metadata":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,40}$"},"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 of your own key/value pairs, returned with the object and its events."}},"required":["product"],"additionalProperties":false},"PaymentLinkUpdateParams":{"type":"object","properties":{"label":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"status":{"type":"string","enum":["active","disabled"],"description":"Only those in this status."},"expires_at":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"max_payments":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]},"coupon":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}},"additionalProperties":false},"CouponCreateParams":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9-]{3,32}$","description":"What buyers type, 3 to 32 letters, digits, or hyphens; matched without case. It can't change."},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Your name for it, shown on invoices; buyers type the code."},"kind":{"type":"string","enum":["percent","fixed"]},"percent_bp":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}],"description":"Percent off in basis points: 1550 is 15.5%."},"amounts":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["currency","amount"],"additionalProperties":false},"description":"A fixed coupon's amount off in each currency it applies to; never converted."},"minimum_subtotals":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["currency","amount"],"additionalProperties":false},"description":"The smallest order, before the discount, per currency."},"duration":{"default":"once","type":"string","enum":["once","repeating","forever"],"description":"For subscriptions: the first payment, `duration_periods` payments, or every payment."},"duration_periods":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"applies_to":{"default":"all","type":"string","enum":["all","products"]},"products":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","maxLength":64},"description":"With applies_to products: the products (prod_…)."},"max_redemptions":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":10000000},{"type":"null"}]},"max_per_customer":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"first_purchase_only":{"default":false,"type":"boolean"},"starts_at":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Unix seconds: it can't be used before."},"ends_at":{"default":null,"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Unix seconds: it can't be used after."}},"required":["code","name","kind"],"additionalProperties":false},"CouponUpdateParams":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Your name for it, shown on invoices; buyers type the code."},"kind":{"type":"string","enum":["percent","fixed"]},"percent_bp":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}],"description":"Percent off in basis points: 1550 is 15.5%."},"amounts":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["currency","amount"],"additionalProperties":false},"description":"A fixed coupon's amount off in each currency it applies to; never converted."},"minimum_subtotals":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["currency","amount"],"additionalProperties":false},"description":"The smallest order, before the discount, per currency."},"duration":{"type":"string","enum":["once","repeating","forever"],"description":"For subscriptions: the first payment, `duration_periods` payments, or every payment."},"duration_periods":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"applies_to":{"type":"string","enum":["all","products"]},"products":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":64},"description":"With applies_to products: the products (prod_…)."},"max_redemptions":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000000},{"type":"null"}]},"max_per_customer":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"first_purchase_only":{"type":"boolean"},"starts_at":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Unix seconds: it can't be used before."},"ends_at":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Unix seconds: it can't be used after."}},"additionalProperties":false},"EmbedSessionCreateParams":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"An active product's ID (prod_…), at its stored price."},"quantity":{"type":"integer","minimum":1,"maximum":99,"description":"1 by default. A subscription renews at this quantity."},"addons":{"maxItems":19,"type":"array","items":{"type":"object","properties":{"product":{"type":"string","maxLength":64,"description":"One of the product's add-ons (prod_…)."},"quantity":{"default":1,"description":"1 to 99.","type":"integer","minimum":1,"maximum":99}},"required":["product"],"additionalProperties":false},"description":"Your page's own choice of the product's add-ons, each at its quantity; the checkout then offers none. Omitted: it offers the add-ons the product offers at the checkout."},"customer_email":{"description":"Fills in the buyer's email; they can still change it.","type":"string","maxLength":254},"reference":{"type":"string","minLength":1,"maxLength":200,"description":"Your ID for the buyer, from the page. A buyer can edit it; set it from your server when it must be certain."},"coupon":{"type":"string","minLength":1,"maxLength":64,"description":"A discount code to apply when it opens; the buyer can remove it."},"page":{"type":"string","maxLength":2000,"format":"uri","description":"The page the button is on, to come back to."},"referrer":{"type":"string","maxLength":2000,"description":"The site that sent the buyer to this page, its origin and path; empty when there was none."}},"required":["product"],"additionalProperties":false},"WebhookEndpointCreateParams":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"format":"uri","description":"A public https address on port 443."},"description":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Your own name for it."},"enabled_events":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"*"},{"type":"string","enum":["checkout.created","checkout.expired","payment.created","payment.processing","payment.requires_action","payment.authorized","payment.succeeded","payment.failed","payment.cancelled","payment.refunded","payment.disputed","payment.risk_cleared","invoice.created","invoice.paid","invoice.expired","subscription.created","subscription.renewal_upcoming","subscription.renewed","subscription.reactivated","subscription.past_due","subscription.expired","subscription.cancelled","subscription.updated","payout.created","payout.completed","payout.failed"]}]},"description":"The event types to send, or [\"*\"] for all (the default)."}},"required":["url"],"additionalProperties":false},"WebhookEndpointUpdateParams":{"type":"object","properties":{"url":{"type":"string","maxLength":500,"format":"uri","description":"A public https address on port 443."},"description":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"description":"Your own name for it."},"enabled_events":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","const":"*"},{"type":"string","enum":["checkout.created","checkout.expired","payment.created","payment.processing","payment.requires_action","payment.authorized","payment.succeeded","payment.failed","payment.cancelled","payment.refunded","payment.disputed","payment.risk_cleared","invoice.created","invoice.paid","invoice.expired","subscription.created","subscription.renewal_upcoming","subscription.renewed","subscription.reactivated","subscription.past_due","subscription.expired","subscription.cancelled","subscription.updated","payout.created","payout.completed","payout.failed"]}]},"description":"The event types to send, or [\"*\"] for all (the default)."},"status":{"type":"string","enum":["enabled","disabled"],"description":"enabled also restarts an endpoint disabled after three days of failures."}},"additionalProperties":false},"SubscriptionCreateParams":{"type":"object","properties":{"customer_email":{"description":"The subscriber's email. They're told once that it's managed here now.","type":"string","maxLength":254},"product":{"type":"string","maxLength":64,"description":"An active subscription product (prod_…)."},"paid_until":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Unix seconds: the end of the period they've already paid for, within one period from now."},"reference":{"type":"string","minLength":1,"maxLength":200,"description":"Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event."}},"required":["customer_email","product","paid_until"],"additionalProperties":false},"PortalSessionCreateParams":{"type":"object","properties":{"return_url":{"type":"string","maxLength":500,"format":"uri","description":"Where the customer comes back to when done."}},"required":["return_url"],"additionalProperties":false},"MarkRefundedParams":{"type":"object","properties":{"amount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"In the payment's currency's smallest unit; at most what hasn't been refunded yet."},"note":{"type":"string","minLength":3,"maxLength":500,"description":"What was refunded and how, for your records."}},"required":["amount","note"],"additionalProperties":false},"SubscriptionAdvanceParams":{"type":"object","properties":{"to":{"type":"string","enum":["next_reminder","due_date","past_grace"],"description":"next_reminder sends it now; due_date makes it past due; past_grace expires it."}},"required":["to"],"additionalProperties":false},"SubscriptionAddonParams":{"type":"object","properties":{"renews":{"type":"boolean","description":"true: it renews from the next renewal, added at its price now (or a drop undone). false: it stops at the end of this period (or an addition undone). Nothing is charged or refunded at the change."}},"required":["renews"],"additionalProperties":false}}}}