Skip to main content

Charge Sales Order Card on File

POST 

/api/sales-orders/:salesOrder/charge-stored-method

Charge one of the customer's saved cards for (part of) the order's balance — or, for a card saved with Authorize.net, authorize it only (hold the amount, capture later).

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token (PAT). Requires permission: sales_orders.manage_payments

Request body fields:

  • customer_payment_method_id (integer, required) — a saved card of the order's customer (Stripe or Authorize.net).
  • amount (number, required, > 0, max 99999999) — the amount applied to the balance, in the order's currency. It can't exceed what is still chargeable: the outstanding balance less bank payments still settling and open card authorizations.
  • apply_surcharge (boolean, nullable, default true) — add the card surcharge when the surcharge policy is on (it is computed on the server; it can be waived, never added when the policy is off).
  • idempotency_key (string, nullable, max 200) — send one per attempt; a retried Stripe charge with the same key is not charged twice.
  • mode (string, nullable: capture | authorize, default capture) — authorize is only allowed for Authorize.net cards: the amount is held on the card and no payment is recorded until it is captured (see Capture Authorize.net Authorization). Authorizations expire after 30 days.

Response: payment (the recorded payment, or null for an authorization), authorization (the open Authorize.net authorization, or null), processor (stripe | authorize_net), mode, amount, surcharge_amount, charged_amount, transaction_id.

Errors (422): the card isn't the customer's, was removed or expired; the card's account is disconnected; the order is cancelled; the amount is above what is chargeable; the Authorize.net account doesn't take the order's currency; a card payment on the order is still being confirmed; the card was declined (code / decline_code); or Authorize.net is holding the payment for fraud review (code: held_for_review — nothing is recorded until it is approved in Authorize.net).

Request​

Responses​

Created

Response Headers
    Content-Type