Create Stripe Payment Link
POST/api/stripe/payment-links
Creates a Stripe payment link that collects money for a sales order or a quote deposit, and returns the link with its customer-facing url. SKU.io hosts the pay page; when the customer pays, the payment is recorded on the order (or as a quote deposit) automatically.
accounting:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Permission: sales_orders.manage_payments. Limited to 30 requests per minute.
Request body:
sales_order_id(integer) — the sales order to collect for. Required unlessquote_idis sent; cannot be combined withquote_id.quote_id(integer) — the quote whose deposit to collect. Required unlesssales_order_idis sent.sales_payment_request_id(integer, nullable) — an open payment request on the order to collect for. When omitted on a sales order, a new payment request is raised for the link. Not allowed withquote_id. A request can carry only one open link.amount(number, required, > 0, max 99,999,999) — the amount to collect, in the document currency. Cannot exceed what is still due (the order balance, the payment request's collectible balance, or the unpaid deposit).payment_methods(array, required, 1–2 distinct items) —cardand/orus_bank_account. Bank (ACH) debit requires ACH to be enabled in the payment collection settings and a USD document.expires_in_days(integer, nullable, 1–30) — days the link stays payable. Defaults to the payment collection settingpayment_link_default_expiry_days.note(string, nullable, max 500) — a message shown to the customer on the pay page.integration_instance_id(integer, nullable) — which connected Stripe account collects the money. Defaults to the first connected account that can take payments. The account must settle in the document currency.
The order must be approved and not cancelled. Any card surcharge is calculated when the customer pays, never sent by the client.
Payment link fields
url— the customer-facing pay page on your own SKU.io domain (https://{your-domain}/pay/stripe/{token}). Send this to the customer; it stays valid until the link expires, is paid or is voided.status—pending(payable),processing(a bank debit was started and has not settled),paid,expired(a pending link pastexpires_atreadsexpired) orvoided.amount— what the link collects, incurrency_code.surcharge_preview— the card surcharge a card payment would add today (0 when card is not offered or surcharging is off).surcharge_amount— the surcharge actually charged once paid.payment_methods—cardand/orus_bank_account(US bank debit / ACH).checkout_method— the method the customer last chose.payment_id/payment_reference— the recorded payment and its Stripe PaymentIntent id once paid.last_failure_message/last_failed_at— the last failed attempt (e.g. a bank debit that bounced), if any.sales_payment_request— the payment request ({id, number}) a sales-order link collects for; null on a quote link.can_void— true while the link ispendingorprocessing.
Returns 201 with {data, message}. Returns 422 for validation errors, when no Stripe account can take payments, or when the amount is more than is due.
Request
Responses
- 201
- 401
- 403
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.