API reference
Every operation of ShipBill's API, and every object it returns. The same description, as OpenAPI 3.1, is at api.shipbill.io/v1/openapi.json.
Basics
| Address | https://api.shipbill.io/v1 |
| Authentication | Authorization: Bearer sk_live_…. The key decides the profile and the mode; a test key sees only test data. Browser operations take the publishable key. |
| Requests | JSON bodies, snake_case fields. A field the operation doesn't know is refused. |
| Amounts | Integers in the currency's smallest unit: 4900 is $49.00. |
| Times | Unix seconds. |
| Lists | Newest first, limit (up to 100, 10 by default) per page; ask for the next page with starting_after set to the last ID. created_after catches up from a time. |
| Your IDs | Checkouts, payments, invoices, and subscriptions can be listed by your reference. |
| Retries | Idempotency-Key on any POST. See Retries and idempotency, which also gives the rate limits. |
| Errors | { error: { type, code, message, param, request_id } }. See Errors. |
Checkout sessions
Create a checkout session
POST /v1/checkout/sessions
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.
| Field | Type | Meaning |
|---|---|---|
line_items | array of object | 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. |
line_items[].productrequired | string | A product's ID (prod_…): its stored title and price are used. |
line_items[].quantity | integer | 1 to 99. A subscription renews at this quantity for its life. |
amount | integer | 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 | string | With amount: a three-letter currency code, such as USD. |
description | string | With amount: what the buyer is paying for, shown on the checkout and invoice. |
reference | string | Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event. |
metadata | map of strings | Up to 50 of your own key/value pairs, returned with the object and its events. |
attribution | object | Where the buyer came from, as your site remembers it. Shown in Analytics → Sources, before what the browser says. |
attribution.page_url | string | The page of yours the buyer was on, such as your pricing page. Its campaign tags are read when you send none. |
attribution.referrer | string | The site that first sent the buyer to you, as your site recorded it. |
attribution.utm_source | string | |
attribution.utm_medium | string | |
attribution.utm_campaign | string | |
replace_subscription | string | A plan change: this subscription (sub_…) is cancelled once the new one's first payment succeeds. |
customer | object | The buyer, when your server knows them, so they aren't asked again. |
customer.emailrequired | string | Filled in on the checkout, and fixed: the buyer can't change it. |
customer.name | string | |
customer.address | object | |
customer.address.line1required | string | |
customer.address.line2 | string | |
customer.address.cityrequired | string | |
customer.address.region | string | |
customer.address.postal_code | string | |
customer.address.countryrequired | string | |
customer.tax_number | string | |
success_url | string | Where the buyer returns after paying; ShipBill adds ?session_id=cs_…. |
cancel_url | string | Where the buyer goes if they leave without paying. |
discounts | array of object | A discount to apply, fixed: the buyer can't remove it. A code that doesn't apply fails the request with coupon_not_applicable. |
discounts[].couponrequired | string | A coupon's code, such as SAVE20, or its ID (cpn_…). |
allow_discount_codes | boolean | Whether the checkout offers a field for a discount code. By default, when you have an active coupon. |
offer_addons | boolean | 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 | integer | Seconds until the checkout expires: 1800 to 86400, 86400 by default. |
Returns CheckoutSessionCreated.
List checkout sessions
GET /v1/checkout/sessions
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
status | one of "open", "processing", "complete", "expired", "cancelled" | Only those in this status. |
reference | string | Only those with this reference of yours. |
customer_email | string | Only this customer's. |
Returns a list: { object: "list", data, has_more }, with data an array of CheckoutSession.
Retrieve a checkout session
GET /v1/checkout/sessions/{id}
Returns CheckoutSession.
Expire a checkout session
POST /v1/checkout/sessions/{id}/expire
An open session closes at once. One being paid can't be expired.
Returns CheckoutSession.
Payment intents
Create a payment intent
POST /v1/payment-intents
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.
| Field | Type | Meaning |
|---|---|---|
line_items | array of object | 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. |
line_items[].productrequired | string | A product's ID (prod_…): its stored title and price are used. |
line_items[].quantity | integer | 1 to 99. A subscription renews at this quantity for its life. |
amount | integer | 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 | string | With amount: a three-letter currency code. |
description | string | With amount: what the buyer is paying for, on the invoice. |
customerrequired | object | The buyer: their email gets the invoice and receipt. |
customer.emailrequired | string | |
customer.name | string | |
customer.address | object | |
customer.address.line1required | string | |
customer.address.line2 | string | |
customer.address.cityrequired | string | |
customer.address.region | string | |
customer.address.postal_code | string | |
customer.address.countryrequired | string | |
customer.tax_number | string | |
customer.country | string | Where the buyer is, for routing and tax, when no address is given. |
return_urlrequired | string | Where the provider sends the buyer after paying; ShipBill adds ?payment_intent=pi_…. |
discounts | array of object | A discount to apply, fixed: the buyer can't remove it. A code that doesn't apply fails the request with coupon_not_applicable. |
discounts[].couponrequired | string | A coupon's code, such as SAVE20, or its ID (cpn_…). |
reference | string | Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event. |
metadata | map of strings | Up to 50 of your own key/value pairs, returned with the object and its events. |
expires_in | integer | Seconds until it expires unpaid: 1800 to 86400, 86400 by default. |
Returns PaymentIntent.
Retrieve a payment intent
GET /v1/payment-intents/{id}
A payment still under way is checked with its provider when you read it.
Returns PaymentIntent.
Confirm a payment intent
POST /v1/payment-intents/{id}/confirm
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.
| Field | Type | Meaning |
|---|---|---|
payment_method_typerequired | one of "card", "wallet", "bank_transfer", "qris", "ewallet", "retail", "paylater", "bank", "crypto" | One of the intent's payment_methods. |
Returns PaymentIntent.
Cancel a payment intent
POST /v1/payment-intents/{id}/cancel
One nobody is paying: its order is cancelled and its invoice voided. Paid, or being paid, it can't be.
Returns PaymentIntent.
Payments
List payments
GET /v1/payments
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
status | one of "requires_payment_method", "requires_action", "processing", "authorized", "underpaid", "succeeded", "failed", "cancelled" | Only those in this status. |
reference | string | Only those with this reference of yours. |
customer_email | string | Only this customer's. |
product | string | Only payments that included this product (prod_…). |
Returns a list: { object: "list", data, has_more }, with data an array of Payment.
Retrieve a payment
GET /v1/payments/{id}
Authoritative, whatever arrived by webhook.
Returns Payment.
Record a refund
POST /v1/payments/{id}/mark-refunded
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.
| Field | Type | Meaning |
|---|---|---|
amountrequired | integer | In the payment's currency's smallest unit; at most what hasn't been refunded yet. |
noterequired | string | What was refunded and how, for your records. |
Returns Refund.
Refunds
List refunds
GET /v1/refunds
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
payment | string | Only this payment's refunds (pay_…). |
Returns a list: { object: "list", data, has_more }, with data an array of Refund.
Retrieve a refund
GET /v1/refunds/{id}
Returns Refund.
Invoices
Export invoices for your accountant
GET /v1/invoices/export
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.
| Field | Type | Meaning |
|---|---|---|
from | string | The first day, in your profile's timezone: 2026-09-01. |
to | string | The last day, included: 2026-09-30. |
format | one of "zip", "csv" | zip: every invoice's and credit note's PDF, with index.csv. csv: the index alone. |
List invoices
GET /v1/invoices
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
status | one of "open", "paid", "partially_paid", "void", "expired", "refunded" | Only those in this status. |
reference | string | Only those with this reference of yours. |
customer_email | string | Only this customer's. |
Returns a list: { object: "list", data, has_more }, with data an array of Invoice.
Retrieve an invoice
GET /v1/invoices/{id}
Returns Invoice.
Download an invoice's PDF
GET /v1/invoices/{id}/pdf
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.
Returns the PDF's bytes.
Void an open invoice
POST /v1/invoices/{id}/void
It can no longer be paid, and its checkout closes. A paid or expired invoice can't be voided.
Returns Invoice.
Credit notes
List credit notes
GET /v1/credit-notes
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.
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
invoice | string | Only this invoice's credit notes (inv_…). |
Returns a list: { object: "list", data, has_more }, with data an array of CreditNote.
Retrieve a credit note
GET /v1/credit-notes/{id}
Returns CreditNote.
Customers
List customers
GET /v1/customers
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
email | string | Only the customer with this email. |
Returns a list: { object: "list", data, has_more }, with data an array of Customer.
Retrieve a customer
GET /v1/customers/{id}
Returns Customer.
Erase a customer
DELETE /v1/customers/{id}
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.
Returns Customer.
Open the customer's billing portal
POST /v1/customers/{id}/portal-session
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.
| Field | Type | Meaning |
|---|---|---|
return_urlrequired | string | Where the customer comes back to when done. |
Returns PortalSession.
Subscriptions
List subscriptions
GET /v1/subscriptions
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
status | one of "active", "past_due", "expired", "cancelled" | Only those in this status. |
product | string | Only this product's (prod_…). |
customer_email | string | Only this customer's. |
reference | string | Only those with this reference of yours. |
Returns a list: { object: "list", data, has_more }, with data an array of Subscription.
Add an existing subscriber
POST /v1/subscriptions
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.
| Field | Type | Meaning |
|---|---|---|
customer_emailrequired | string | The subscriber's email. They're told once that it's managed here now. |
productrequired | string | An active subscription product (prod_…). |
paid_untilrequired | integer | Unix seconds: the end of the period they've already paid for, within one period from now. |
reference | string | Your own ID for the purchase or the buyer, such as an order number or user ID. Returned on every event. |
Returns Subscription.
Retrieve a subscription
GET /v1/subscriptions/{id}
Authoritative for access: refuse access after access_until even if a webhook was missed.
Returns Subscription.
Cancel a subscription
POST /v1/subscriptions/{id}/cancel
Reminders stop; access lasts until the period ends. The customer is told.
Returns Subscription.
End a subscription's discount
DELETE /v1/subscriptions/{id}/discount
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.
Returns Subscription.
Drop or add a recurring add-on
POST /v1/subscriptions/{id}/addons/{product}
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.
| Field | Type | Meaning |
|---|---|---|
renewsrequired | boolean | 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. |
Returns Subscription.
Open a checkout for the next period
POST /v1/subscriptions/{id}/renewal-session
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.
Returns RenewalSession.
Products
List products
GET /v1/products
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
status | one of "active", "archived" | Only those in this status. |
category | string |
Returns a list: { object: "list", data, has_more }, with data an array of Product.
Create a product
POST /v1/products
Products are shared by test and live mode.
| Field | Type | Meaning |
|---|---|---|
titlerequired | string | |
description | string or null | |
price_amountrequired | integer | The price in the currency's smallest unit: 4900 is $49.00. |
currency | string | A three-letter code; the profile's currency by default. |
prices | array of object | 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. |
prices[].currencyrequired | string | |
prices[].amountrequired | integer | |
category | string or null | A category's ID (cat_…), or null. |
providers | "all" or array of string | "all" connected providers (the default), or only these, such as ["oxapay"]. |
after_payment_message | string or null | Shown to the buyer after paying, and in their receipt. |
after_payment_url | string or null | A link offered to the buyer after paying, such as a download. A convenience, not access control. |
metadata | map of strings | Up to 50 of your own key/value pairs, returned with the object and its events. |
addons | array of object | 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. |
addons[].productrequired | string | 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). |
addons[].quantity | integer | Its quantity by default: 1 to 99. |
addons[].offered | boolean | 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. |
buyer_quantity | object or null | 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 | one of "one_time", "subscription" | one_time (the default), or subscription: paid again every interval_count intervals. Fixed once created. |
interval | one of "day", "week", "month", "year" | A subscription's period. |
interval_count | integer | How many intervals each period lasts; 1 by default. |
renewal_reminders | boolean | False for a fixed term: no reminders while it runs, and one notice when it ends. |
renewal_mode | one of "reminder", "automatic", "automatic_or_reminder" | A subscription's renewal: reminder (the default), automatic (sold only by providers with their own subscription engine), or automatic_or_reminder. |
Returns Product.
Retrieve a product
GET /v1/products/{id}
Returns Product.
Update a product
PATCH /v1/products/{id}
Changes apply to new checkouts; open ones keep their price. status archives or restores it.
| Field | Type | Meaning |
|---|---|---|
title | string | |
description | string or null | |
price_amount | integer | The price in the currency's smallest unit: 4900 is $49.00. |
currency | string | A three-letter code; the profile's currency by default. |
prices | array of object | 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. |
prices[].currencyrequired | string | |
prices[].amountrequired | integer | |
category | string or null | A category's ID (cat_…), or null. |
providers | "all" or array of string | "all" connected providers (the default), or only these, such as ["oxapay"]. |
after_payment_message | string or null | Shown to the buyer after paying, and in their receipt. |
after_payment_url | string or null | A link offered to the buyer after paying, such as a download. A convenience, not access control. |
metadata | map of strings | Up to 50 of your own key/value pairs, returned with the object and its events. |
addons | array of object | 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. |
addons[].productrequired | string | 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). |
addons[].quantity | integer | Its quantity by default: 1 to 99. |
addons[].offered | boolean | 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. |
buyer_quantity | object or null | 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 | one of "day", "week", "month", "year" | A subscription's period. |
interval_count | integer | How many intervals each period lasts; 1 by default. |
renewal_reminders | boolean | False for a fixed term: no reminders while it runs, and one notice when it ends. |
renewal_mode | one of "reminder", "automatic", "automatic_or_reminder" | A subscription's renewal: reminder (the default), automatic (sold only by providers with their own subscription engine), or automatic_or_reminder. |
status | one of "active", "archived" | archived stops it selling; active restores it. |
Returns Product.
Delete a product
DELETE /v1/products/{id}
It stops selling and leaves your lists; past payments and invoices keep what was sold.
Returns { id, object, deleted: true }.
Product categories
List product categories
GET /v1/product-categories
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
Returns a list: { object: "list", data, has_more }, with data an array of ProductCategory.
Create a product category
POST /v1/product-categories
| Field | Type | Meaning |
|---|---|---|
namerequired | string | |
description | string or null |
Returns ProductCategory.
Update a product category
PATCH /v1/product-categories/{id}
| Field | Type | Meaning |
|---|---|---|
name | string | |
description | string or null |
Returns ProductCategory.
Delete a product category
DELETE /v1/product-categories/{id}
Its products stay, without a category.
Returns { id, object, deleted: true }.
Coupons
List coupons
GET /v1/coupons
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
archived | one of "true", "false" | Archived coupons instead of the live ones. |
Returns a list: { object: "list", data, has_more }, with data an array of Coupon.
Create a coupon
POST /v1/coupons
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.
| Field | Type | Meaning |
|---|---|---|
coderequired | string | What buyers type, 3 to 32 letters, digits, or hyphens; matched without case. It can't change. |
namerequired | string | Your name for it, shown on invoices; buyers type the code. |
kindrequired | one of "percent", "fixed" | |
percent_bp | integer or null | Percent off in basis points: 1550 is 15.5%. |
amounts | array of object | A fixed coupon's amount off in each currency it applies to; never converted. |
amounts[].currencyrequired | string | |
amounts[].amountrequired | integer | |
minimum_subtotals | array of object | The smallest order, before the discount, per currency. |
minimum_subtotals[].currencyrequired | string | |
minimum_subtotals[].amountrequired | integer | |
duration | one of "once", "repeating", "forever" | For subscriptions: the first payment, duration_periods payments, or every payment. |
duration_periods | integer or null | |
applies_to | one of "all", "products" | |
products | array of string | With applies_to products: the products (prod_…). |
max_redemptions | integer or null | |
max_per_customer | integer or null | |
first_purchase_only | boolean | |
starts_at | integer or null | Unix seconds: it can't be used before. |
ends_at | integer or null | Unix seconds: it can't be used after. |
Returns Coupon.
Retrieve a coupon
GET /v1/coupons/{id}
Returns Coupon.
Update a coupon
PATCH /v1/coupons/{id}
Everything but the code may change. Subscriptions already using it keep their current discount.
| Field | Type | Meaning |
|---|---|---|
name | string | Your name for it, shown on invoices; buyers type the code. |
kind | one of "percent", "fixed" | |
percent_bp | integer or null | Percent off in basis points: 1550 is 15.5%. |
amounts | array of object | A fixed coupon's amount off in each currency it applies to; never converted. |
amounts[].currencyrequired | string | |
amounts[].amountrequired | integer | |
minimum_subtotals | array of object | The smallest order, before the discount, per currency. |
minimum_subtotals[].currencyrequired | string | |
minimum_subtotals[].amountrequired | integer | |
duration | one of "once", "repeating", "forever" | For subscriptions: the first payment, duration_periods payments, or every payment. |
duration_periods | integer or null | |
applies_to | one of "all", "products" | |
products | array of string | With applies_to products: the products (prod_…). |
max_redemptions | integer or null | |
max_per_customer | integer or null | |
first_purchase_only | boolean | |
starts_at | integer or null | Unix seconds: it can't be used before. |
ends_at | integer or null | Unix seconds: it can't be used after. |
Returns Coupon.
Archive a coupon
POST /v1/coupons/{id}/archive
Nothing new may use it; subscriptions already carrying it keep it.
Returns Coupon.
List a coupon's uses
GET /v1/coupons/{id}/redemptions
Who used it, on which order: reserved while a checkout is open, redeemed once paid. Newest first.
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
Returns a list: { object: "list", data, has_more }, with data an array of CouponRedemption.
Payment links
List payment links
GET /v1/payment-links
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
product | string |
Returns a list: { object: "list", data, has_more }, with data an array of PaymentLink.
Create a payment link
POST /v1/payment-links
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.
| Field | Type | Meaning |
|---|---|---|
productrequired | string | The product's ID (prod_…). |
items | array of object | 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. |
items[].productrequired | string | One of the product's add-ons (prod_…). |
items[].quantity | integer | 1 to 99. |
items[].offered | boolean | true: Offered, a box the buyer may tick. false: Included, in every sale. |
quantity | integer or null | 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 | string or null | Your own name for the link, such as a campaign. |
expires_at | integer or null | Unix seconds: the link stops working then. |
max_payments | integer or null | The link stops after this many payments. |
coupon | string or null | A coupon (cpn_…) or its code, applied when the link opens; the buyer can remove it. |
metadata | map of strings | Up to 50 of your own key/value pairs, returned with the object and its events. |
Returns PaymentLinkCreated.
Update a payment link
PATCH /v1/payment-links/{id}
status: "active" also resumes a link paused after a spike of declined cards.
| Field | Type | Meaning |
|---|---|---|
label | string or null | |
status | one of "active", "disabled" | Only those in this status. |
expires_at | integer or null | |
max_payments | integer or null | |
coupon | string or null |
Returns PaymentLink.
Delete a payment link
DELETE /v1/payment-links/{id}
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.
Returns { id, object, deleted: true }.
Webhook endpoints
List webhook endpoints
GET /v1/webhook-endpoints
Returns a list: { object: "list", data, has_more }, with data an array of WebhookEndpoint.
Create a webhook endpoint
POST /v1/webhook-endpoints
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.
| Field | Type | Meaning |
|---|---|---|
urlrequired | string | A public https address on port 443. |
description | string or null | Your own name for it. |
enabled_events | array of "*" or one of "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" | The event types to send, or ["*"] for all (the default). |
Returns WebhookEndpoint.
Update a webhook endpoint
PATCH /v1/webhook-endpoints/{id}
status: "enabled" also restarts an endpoint disabled after three days of failures.
| Field | Type | Meaning |
|---|---|---|
url | string | A public https address on port 443. |
description | string or null | Your own name for it. |
enabled_events | array of "*" or one of "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" | The event types to send, or ["*"] for all (the default). |
status | one of "enabled", "disabled" | enabled also restarts an endpoint disabled after three days of failures. |
Returns WebhookEndpoint.
Delete a webhook endpoint
DELETE /v1/webhook-endpoints/{id}
Nothing more is sent to it. Its past deliveries stay in the dashboard's log.
Returns { id, object, deleted: true }.
Events
List events
GET /v1/events
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.
| Field | Type | Meaning |
|---|---|---|
limit | integer | How many per page: 1 to 100, 10 by default. |
starting_after | string | The last ID of the previous page, for the next one. |
created_after | integer | Unix seconds: only what was created after this, for catching up. |
type | string |
Returns a list: { object: "list", data, has_more }, with data an array of Event.
Retrieve an event
GET /v1/events/{id}
Returns Event.
Test helpers
Move a test subscription through time
POST /v1/test/subscriptions/{id}/advance
Test-mode keys only: the next reminder now, the due date now, or past the grace period.
| Field | Type | Meaning |
|---|---|---|
torequired | one of "next_reminder", "due_date", "past_grace" | next_reminder sends it now; due_date makes it past due; past_grace expires it. |
Returns Subscription.
In the browser
What shipbill.js calls from your pages, with the publishable key. Only from your allowed websites; a secret key is refused here.
Open a buy button's checkout
POST /v1/embed/checkout/sessions · publishable key, from an allowed website
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.
| Field | Type | Meaning |
|---|---|---|
productrequired | string | An active product's ID (prod_…), at its stored price. |
quantity | integer | 1 by default. A subscription renews at this quantity. |
addons | array of object | 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. |
addons[].productrequired | string | One of the product's add-ons (prod_…). |
addons[].quantity | integer | 1 to 99. |
customer_email | string | Fills in the buyer's email; they can still change it. |
reference | string | Your ID for the buyer, from the page. A buyer can edit it; set it from your server when it must be certain. |
coupon | string | A discount code to apply when it opens; the buyer can remove it. |
page | string | The page the button is on, to come back to. |
referrer | string | The site that sent the buyer to this page, its origin and path; empty when there was none. |
Returns EmbedSession.
Preview prices for a pricing page
GET /v1/embed/prices · publishable key, from an allowed website
What the checkout would show this visitor, as display strings. A preview: the amount charged is fixed when the checkout opens.
| Field | Type | Meaning |
|---|---|---|
products | string | Up to 20 product IDs (prod_…), separated by commas. |
Returns a list: { object: "list", data, has_more }, with data an array of PricePreview.
Before framing a checkout
What shipbill.js asks before it shows a checkout opened by its client_token over your page, so a website that isn't allowed is told at once. No key: the client_token names the checkout.
Check a page may open a checkout
GET /v1/embed-frames/{token} · no key: the checkout's client_token
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.
Returns nothing, with status 204.
Objects
CheckoutSession
| Field | Type | Meaning |
|---|---|---|
id | ID (cs_…) | |
object | "checkout.session" | |
livemode | boolean | |
status | one of "open", "processing", "complete", "expired", "cancelled" | |
payment_status | one of "paid", "underpaid", "unpaid" | |
amount | integer | In the currency's smallest unit, such as cents. |
amount_tax | integer | 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 | string | |
line_items | array of LineItem | |
discount | object or null | |
reference | string or null | |
metadata | map of strings | |
customer | ID (cus_…) or null | |
customer_email | string or null | |
payment | ID (pay_…) or null | |
payment_link | ID (plink_…) or null | |
success_url | string or null | |
cancel_url | string or null | |
expires_at | integer | |
completed_at | integer or null | |
created | integer |
CheckoutSessionCreated
| Field | Type | Meaning |
|---|---|---|
id | ID (cs_…) | |
object | "checkout.session" | |
livemode | boolean | |
status | one of "open", "processing", "complete", "expired", "cancelled" | |
payment_status | one of "paid", "underpaid", "unpaid" | |
amount | integer | In the currency's smallest unit, such as cents. |
amount_tax | integer | 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 | string | |
line_items | array of LineItem | |
discount | object or null | |
reference | string or null | |
metadata | map of strings | |
customer | ID (cus_…) or null | |
customer_email | string or null | |
payment | ID (pay_…) or null | |
payment_link | ID (plink_…) or null | |
success_url | string or null | |
cancel_url | string or null | |
expires_at | integer | |
completed_at | integer or null | |
created | integer | |
client_token | string | Opens this checkout in the embedded modal (shipbill.js). |
url | string | The hosted checkout page to send the buyer to. |
LineItem
| Field | Type | Meaning |
|---|---|---|
product | ID (prod_…) or null | Null for a custom amount. |
type | one of "one_time", "subscription" | |
title | string | |
quantity | integer | |
unit_amount | integer | In the currency's smallest unit, such as cents. |
amount | integer | The line's price, before any discount. |
discount_amount | integer | A coupon's share of the line; 0 without one. |
PaymentIntent
| Field | Type | Meaning |
|---|---|---|
id | ID (pi_…) | |
object | "payment_intent" | |
livemode | boolean | |
status | one of "requires_payment_method", "requires_action", "processing", "succeeded", "expired", "cancelled" | 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 | integer | The price after any discount, before tax added at checkout. |
amount_tax | integer | The merchant's own tax for the buyer: added to amount, or inside it. |
currency | string | |
line_items | array of LineItem | |
discount | object or null | |
payment_methods | array of object | The methods it can be confirmed with, while it needs one. |
payment_methods[].type | string | |
payment_methods[].label | string | The method's name for the buyer, as the dashboard shows it: "Card", "Bank transfer", "QRIS". |
payment_methods[].amount | integer | What this method charges, the tax included where it's added. |
payment_methods[].currency | string | |
payment_methods[].merchant_of_record | string or null | A merchant of record sells it: it adds its own tax on its page. |
next_action | object or object or null | 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 | object or null | Why the last attempt failed, in words for the buyer. |
customer | ID (cus_…) | |
customer_email | string | |
payment | ID (pay_…) or null | |
invoice | ID (inv_…) or null | |
return_url | string | |
reference | string or null | |
metadata | map of strings | |
expires_at | integer | |
created | integer |
Payment
| Field | Type | Meaning |
|---|---|---|
id | ID (pay_…) | |
object | "payment" | |
livemode | boolean | |
status | one of "requires_payment_method", "requires_action", "processing", "authorized", "underpaid", "succeeded", "failed", "cancelled" | |
amount | integer | In the currency's smallest unit, such as cents. |
currency | string | |
base_amount | integer | The amount in the profile's base currency. |
base_currency | string | |
price_source | one of "fixed", "converted" | 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 | integer | In the currency's smallest unit, such as cents. |
manual | boolean | Recorded by the merchant (Mark as paid), not taken through a provider. |
origin | one of "checkout", "external" | 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 | string or null | |
provider | string or null | |
failure_code | string or null | |
order | ID (ord_…) | |
reference | string or null | The merchant's own ID, given when the checkout was created. |
metadata | map of strings | |
line_items | array of LineItem | |
discount | object or null | |
checkout_session | ID (cs_…) or null | |
payment_intent | ID (pi_…) or null | The payment intent it was made through, for a custom checkout. |
customer | ID (cus_…) or null | |
invoice | ID (inv_…) or null | |
created | integer | |
succeeded_at | integer or null | |
access | one of "lifetime", "period" | |
access_until | integer or null | |
subscription | ID (sub_…) or null | |
risk_status | one of "clear", "flagged", "cleared_by_merchant", "refunded_for_risk" | flagged: your fraud rules hold delivery until you clear it (then payment.risk_cleared). refunded_for_risk: refunded after being flagged. |
risk_notes | array of object | Fraud signals on the payment or its checkout. A signal is not proof: ShipBill never refuses a buyer or refunds because of one. |
risk_notes[].signal | one of "disposable_email", "elevated_risk", "early_fraud_warning", "card_country_mismatch", "velocity", "duplicate_payment", "repeat_offender", "subscription_domino" | |
risk_notes[].evidence | map of strings | What was seen: a domain, a country, a count. Never a card number or an email address. |
risk_notes[].created | integer | |
refund | object | payment.refunded: the refund this event records. |
refund.id | ID (re_…) | |
refund.amount | integer | In the currency's smallest unit, such as cents. |
refund.currency | string | |
refund.source | one of "provider", "manual" | |
dispute | object | payment.disputed: the dispute this event records. |
dispute.amount | integer | In the currency's smallest unit, such as cents. |
dispute.currency | string | |
dispute.reason | string or null | |
declined | true | payment.failed: the merchant declined an underpayment. |
reversed | true | payment.cancelled: the merchant reversed a manual payment. |
Refund
| Field | Type | Meaning |
|---|---|---|
id | ID (re_…) | |
object | "refund" | |
livemode | boolean | |
payment | ID (pay_…) | |
amount | integer | In the currency's smallest unit, such as cents. |
currency | string | |
status | one of "pending", "succeeded", "failed" | A refund counts once it has succeeded; one recorded by hand has. |
source | one of "provider", "manual" | Reported by the provider, or recorded by you. |
note | string or null | What you wrote when recording it by hand. |
created | integer | |
completed_at | integer or null |
Invoice
| Field | Type | Meaning |
|---|---|---|
id | ID (inv_…) | |
object | "invoice" | |
livemode | boolean | |
number | string | |
status | one of "open", "paid", "partially_paid", "void", "expired", "refunded" | |
currency | string | |
amount_due | integer | In the currency's smallest unit, such as cents. |
amount_tax | integer | The merchant's own tax in amount_due: added to the lines, or inside them where prices include it; 0 without tax. |
amount_paid | integer | In the currency's smallest unit, such as cents. |
amount_refunded | integer | Returned to the buyer since; refunded once it is all of it. |
customer | ID (cus_…) or null | |
customer_email | string | |
customer_name | string or null | |
lines | array of object | |
lines[].product | ID (prod_…) or null | |
lines[].title | string | |
lines[].quantity | integer | |
lines[].unit_amount | integer | In the currency's smallest unit, such as cents. |
lines[].amount | integer | In the currency's smallest unit, such as cents. |
lines[].discount_amount | integer | A coupon's share of the line; 0 without one. |
discount | object or null | |
order | ID (ord_…) | |
reference | string or null | |
payment | ID (pay_…) or null | |
hosted_url | string | The buyer's page for this invoice, with its PDF. |
revision | integer | 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 | integer | |
paid_at | integer or null | |
created | integer |
CreditNote
| Field | Type | Meaning |
|---|---|---|
id | ID (cn_…) | |
object | "credit_note" | |
livemode | boolean | |
number | string | Its own sequence: CN-2026-00012. |
invoice | ID (inv_…) | |
invoice_number | string | |
refund | ID (re_…) | The refund it records; one credit note per refund. |
payment | ID (pay_…) | |
customer | ID (cus_…) or null | |
customer_email | string | |
currency | string | The invoice's currency. |
amount | integer | What is credited, as a positive amount in the invoice's currency. |
lines | array of object | |
lines[].title | string | |
lines[].quantity | integer | |
lines[].unit_amount | integer | In the currency's smallest unit, such as cents. |
lines[].amount | integer | In the currency's smallest unit, such as cents. |
refund_amount | integer | What went back to the buyer, in the currency they paid in. |
refund_currency | string | |
note | string or null | Your note on the refund. Never shown to the buyer or printed. |
hosted_url | string | The invoice's page, which lists its credit notes with their PDFs. |
issued_at | integer | |
created | integer |
Customer
| Field | Type | Meaning |
|---|---|---|
id | ID (cus_…) | |
object | "customer" | |
livemode | boolean | |
erased | boolean | 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 | string | |
name | string or null | |
country | string or null | |
address | object or null | |
tax_number | string or null | |
tax_number_country | string or null | |
tax_number_status | one of "verified", "unverified", "pending", "invalid" or null | 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 | string or null | Your own ID for this customer: the reference of the first checkout your server created for them. Unique in a mode. |
created | integer |
PortalSession
| Field | Type | Meaning |
|---|---|---|
object | "portal_session" | |
url | string | |
provider | string | The provider whose portal it is (polar), or "shipbill" for ShipBill's own subscription page. |
subscription | ID (sub_…) | |
expires_at | integer or null | When the address stops working; null for ShipBill's own page. |
Subscription
| Field | Type | Meaning |
|---|---|---|
id | ID (sub_…) | |
object | "subscription" | |
livemode | boolean | |
status | one of "active", "past_due", "expired", "cancelled" | |
product | ID (prod_…) | |
reference | string or null | |
metadata | map of strings | |
customer | ID (cus_…) | |
customer_email | string | |
amount | integer | The price locked when it started, before any discount: its items' total each period. Released if it lapses. |
currency | string | |
items | array of object | 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. |
items[].product | ID (prod_…) | |
items[].quantity | integer | |
items[].unit_amount | integer | Locked when it started. |
items[].amount | integer | unit_amount × quantity, each period, before any discount. |
items[].starts_at | integer or null | A recurring add-on added to it: the start of the first period it renews in. Null: from the start. |
items[].ends_at | integer or null | A recurring add-on dropped from it: the end of the last period it renews in. Null: it goes on renewing. |
discount | object or null | 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 | one of "day", "week", "month", "year" | |
interval_count | integer | |
renewal_reminders | boolean | |
current_period_start | integer | |
current_period_end | integer | |
access | "period" | |
access_until | integer | The end of the paid period: refuse access after it, even if a webhook is missed. |
grace_until | integer or null | Past due: when it expires if still unpaid. |
cancel_at_period_end | boolean | |
cancelled_at | integer or null | |
cancelled_by | one of "customer", "merchant", "replaced", "product_deleted" or null | |
replaced_by | ID (sub_…) or null | |
imported | boolean | Added by the merchant, not bought through ShipBill. |
renewal_mode | one of "reminder", "automatic" | 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 | string or null | Automatic renewal: the provider whose subscription charges it (polar). |
paused | boolean | The merchant's account is locked: nothing is sent and nothing expires. |
manage_url | string | The customer's own page: renew, see receipts, cancel, or Manage billing at the provider. |
payment | ID (pay_…) or null | The latest payment for it. |
invoice | object or null | The latest invoice paid for it. |
created | integer |
RenewalSession
| Field | Type | Meaning |
|---|---|---|
object | "checkout.renewal_session" | |
subscription | ID (sub_…) | |
client_token | string | |
url | string | |
expires_at | integer |
Product
| Field | Type | Meaning |
|---|---|---|
id | ID (prod_…) | |
object | "product" | |
title | string | |
description | string or null | |
price_amount | integer | In the currency's smallest unit, such as cents. |
currency | string | |
prices | array of object | Fixed prices in other currencies: charged exactly, in place of a converted price. |
prices[].currency | string | |
prices[].amount | integer | In the currency's smallest unit, such as cents. |
type | one of "one_time", "subscription" | |
interval | one of "day", "week", "month", "year" or null | Subscriptions only. |
interval_count | integer or null | |
renewal_reminders | boolean or null | Subscriptions only: off for a fixed term. |
renewal_mode | one of "reminder", "automatic", "automatic_or_reminder" or null | 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 | string or null | |
category | ID (cat_…) or null | |
providers | "all" or array of string | "all" connected providers, or only these, by provider ("oxapay"). |
after_payment_message | string or null | |
after_payment_url | string or null | |
status | one of "active", "archived" | |
metadata | map of strings | |
addons | array of object | Other products sold with it, each with its quantity by default: one-time, or on a subscription, recurring. |
addons[].product | ID (prod_…) | |
addons[].quantity | integer | |
addons[].offered | boolean | Offered at the checkout: a box the buyer may tick, on a buy button and with offer_addons. |
buyer_quantity | object or null | The range a buyer may choose from on a link's or buy button's checkout; null: off. |
created | integer | |
updated | integer |
ProductCategory
| Field | Type | Meaning |
|---|---|---|
id | ID (cat_…) | |
object | "product_category" | |
name | string | |
description | string or null | |
created | integer |
Coupon
| Field | Type | Meaning |
|---|---|---|
id | ID (cpn_…) | |
object | "coupon" | |
livemode | boolean | |
code | string | |
name | string | |
kind | one of "percent", "fixed" | |
percent_bp | integer or null | |
amounts | array of object | |
amounts[].currency | string | |
amounts[].amount | integer | In the currency's smallest unit, such as cents. |
minimum_subtotals | array of object | |
minimum_subtotals[].currency | string | |
minimum_subtotals[].amount | integer | In the currency's smallest unit, such as cents. |
duration | one of "once", "repeating", "forever" | |
duration_periods | integer or null | |
applies_to | one of "all", "products" | |
products | array of ID (prod_…) | |
max_redemptions | integer or null | |
max_per_customer | integer or null | |
first_purchase_only | boolean | |
starts_at | integer or null | |
ends_at | integer or null | |
redemptions_count | integer | Kept uses: a full refund gives one back. |
archived_at | integer or null | |
created | integer |
CouponRedemption
| Field | Type | Meaning |
|---|---|---|
id | ID (cpnr_…) | |
object | "coupon_redemption" | |
coupon | ID (cpn_…) | |
status | one of "reserved", "redeemed", "released" | |
order | ID (ord_…) | |
customer | ID (cus_…) or null | |
customer_email | string or null | |
amount | integer | In the currency's smallest unit, such as cents. |
currency | string | |
redeemed_at | integer or null | |
created | integer |
PaymentLink
| Field | Type | Meaning |
|---|---|---|
id | ID (plink_…) | |
object | "payment_link" | |
livemode | boolean | |
url | string | |
label | string or null | |
status | one of "active", "disabled", "paused" | "paused": stopped after a spike of declined cards. |
product | ID (prod_…) | |
quantity | integer or null | The product's quantity, fixed; null: 1, or the buyer's choice where the product allows it. |
items | array of object | The product's add-ons it sells, at their quantities, set when it was made. |
items[].product | ID (prod_…) | |
items[].quantity | integer | |
items[].offered | boolean | Offered, a box the buyer may tick; otherwise Included, in every sale. |
amount | integer or null | What it sells, at current prices: the product at its quantity, and the add-ons it includes. |
currency | string or null | |
expires_at | integer or null | |
max_payments | integer or null | |
payments_count | integer | |
available | boolean | Whether a buyer opening it now could pay. |
coupon | ID (cpn_…) or null | A coupon applied when the link opens; the buyer can remove it. |
metadata | map of strings | |
created | integer |
PaymentLinkCreated
| Field | Type | Meaning |
|---|---|---|
id | ID (plink_…) | |
object | "payment_link" | |
livemode | boolean | |
url | string | |
label | string or null | |
status | one of "active", "disabled", "paused" | "paused": stopped after a spike of declined cards. |
product | ID (prod_…) | |
quantity | integer or null | The product's quantity, fixed; null: 1, or the buyer's choice where the product allows it. |
items | array of object | The product's add-ons it sells, at their quantities, set when it was made. |
items[].product | ID (prod_…) | |
items[].quantity | integer | |
items[].offered | boolean | Offered, a box the buyer may tick; otherwise Included, in every sale. |
amount | integer or null | What it sells, at current prices: the product at its quantity, and the add-ons it includes. |
currency | string or null | |
expires_at | integer or null | |
max_payments | integer or null | |
payments_count | integer | |
available | boolean | Whether a buyer opening it now could pay. |
coupon | ID (cpn_…) or null | A coupon applied when the link opens; the buyer can remove it. |
metadata | map of strings | |
created | integer | |
warnings | array of object | Empty when buyers can pay. Otherwise why they can't yet, and how to fix it. |
warnings[].code | one of "checkout_unavailable", "items_unavailable" | "checkout_unavailable": no enabled payment provider can take its payments yet. "items_unavailable": its products share no provider that can take them together. |
warnings[].message | string |
Payout
| Field | Type | Meaning |
|---|---|---|
id | ID (po_…) | |
object | "payout" | |
livemode | boolean | |
status | one of "pending", "in_transit", "paid", "failed", "cancelled" | pending: not sent yet; in_transit: on its way; paid: arrived; failed: refused by your bank; cancelled: one you recorded, undone. |
provider | string | |
provider_reference | string or null | The provider's ID for it; null for one you recorded. |
manual | boolean | Recorded by you, for a provider ShipBill can't read payouts from. |
amount | integer | The whole payout, your sales outside ShipBill included; negative when it took money from your bank. |
currency | string | |
shipbill_amount | integer or null | The part from sales through ShipBill, in the payout's currency; null until its lines are read. |
fee | integer | What the provider charged for sending it. |
arrival_date | string or null | When it's expected at your bank, where the provider says. |
paid_at | integer or null | |
created | integer |
WebhookEndpoint
| Field | Type | Meaning |
|---|---|---|
id | ID (whep_…) | |
object | "webhook_endpoint" | |
livemode | boolean | |
url | string | |
description | string or null | |
enabled_events | array of string | "*" for every event, or the types chosen. |
status | one of "enabled", "disabled", "auto_disabled" | |
created | integer | |
secret | string |
Event
| Field | Type | Meaning |
|---|---|---|
id | ID (evt_…) | |
object | "event" | |
type | string | payment.succeeded, invoice.paid, checkout.expired, … |
created | integer | |
livemode | boolean | |
api_version | string | |
data | object | |
data.object | Payment or CheckoutSession or Invoice or Subscription or WebhookTestObject | The object as it was when the event happened, complete enough to act on alone. |
WebhookPayload
| Field | Type | Meaning |
|---|---|---|
id | ID (evt_…) | |
type | string | payment.succeeded, invoice.paid, checkout.expired, … |
created | integer | |
livemode | boolean | |
api_version | string | |
data | object | |
data.object | Payment or CheckoutSession or Invoice or Subscription or WebhookTestObject | The object as it was when the event happened, complete enough to act on alone. |
WebhookTestObject
| Field | Type | Meaning |
|---|---|---|
object | "webhook_test" | |
endpoint | ID (whep_…) | |
message | string |
EmbedSession
| Field | Type | Meaning |
|---|---|---|
object | "checkout.embed_session" | |
client_token | string | |
url | string | The hosted page, for when a modal can't be opened. |
expires_at | integer |
PricePreview
| Field | Type | Meaning |
|---|---|---|
product | string | |
available | boolean | False for a product that isn't active, or isn't this profile's. |
display | string or null | The localised price, such as "€45.12". |
currency | string or null | |
base | string or null | The merchant's own price, such as "$49.00". |
source | one of "fixed", "converted" or null | 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 | one of "day", "week", "month", "year" or null | For a subscription, the unit of its period; null for a one-time price. |
interval_count | integer or null | For a subscription, how many intervals each period lasts; null for a one-time price. |
Error
| Field | Type | Meaning |
|---|---|---|
error | object | |
error.type | one of "invalid_request_error", "authentication_error", "permission_error", "rate_limit_error", "idempotency_error", "api_error" | |
error.code | string | |
error.message | string | |
error.param | string or null | The field at fault, such as "line_items.0.product". |
error.request_id | string |