Authorize and capture a payment
Hold a customer's funds with an auth, then collect all or part of them later with a capture.
An auth confirms that the customer has funds available and places a temporary hold on them. It doesn't transfer funds to the merchant. A capture settles the auth for funding later. Use them when time passes between the customer agreeing to pay and the merchant being able to fulfill the order, such as delayed shipping. To charge in one step, see Charge a payment.
You send captures through the API. Cards take auth and capture. Bank accounts don't. See ACH payments.
Before you start, make sure you have the following:
- The merchant's ID, for a merchant with a connection that accepts the card. See Supported connections.
- The card, as a Preczn token or as card data. See the Tokenization Overview.
- A way to route the transaction: the connection's name in
processor, or a routing plan assigned to the merchant. See Choose a routing method.
Auth
An auth places a hold on the customer's funds. Nothing reaches the merchant until you capture it.
To authorize a payment, complete the following steps:
-
Send
POST /v1/transactionswithtypeset toauth, themerchantId, thepayment, and theamount.{ "merchantId": "{merchantId}", "type": "auth", "payment": { "token": "{tokenId}" }, "amount": 125 } -
Check
authorization.statusin the response, and save the transactionidfor the capture. An auth response describes a hold rather than a completed payment, soauthorization.processorCodeandauthorization.processorMessagecarry the connection's own hold wording. For Stripe, that'spayment_intentandrequires_capture.
Capture
A capture settles a previously approved auth for funding. Merchant, payment method, and currency come from the auth.
- A capture must run against a previously approved auth.
- A capture can be for a different amount than the auth authorized, and it can carry more transaction details that override the original authorization.
- Capturing more than the authorized amount is allowed only where tipping is enabled, such as at restaurants, and is still processed as a partial capture.
To capture the payment, send POST /v1/transactions with type set to capture and transactionId set to the auth's id. To capture only part of the auth, add an amount. See the Partial capture section.
{
"type": "capture",
"transactionId": "{authTransactionId}"
}{
"type": "capture",
"amount": 50,
"transactionId": "{authTransactionId}"
}The response is a transaction object with these differences:
originalTransactionIdholds the ID of the auth that was captured.authorization.processorMessageholds the connection's outcome text.metadatais present only when the capture request sendsmetadata. The response doesn't carry the auth'smetadata.
Partial capture
To capture only part of an authorization, send an amount lower than the original. Only that amount is captured, and authorization.partial is true in the response.
Follow-on captures
Some connections allow more than one partial capture, up to the remaining authorization balance. Others don't allow a second capture on one authorization. On those, each additional capture needs a new authorization.
To cancel the auth or return captured funds, see Void or refund a transaction.
Updated 21 minutes ago
