Skip to main content

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.

Required scope: accounting:write

Grant 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 unless quote_id is sent; cannot be combined with quote_id.
  • quote_id (integer) — the quote whose deposit to collect. Required unless sales_order_id is 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 with quote_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) — card and/or us_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 setting payment_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 past expires_at reads expired) or voided.
  • amount — what the link collects, in currency_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 — card and/or us_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 is pending or processing.

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​

Created

Response Headers
    Content-Type