Capture a payment
POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/payments/{payment_id}/capture
Capture funds for a previously authorized payment. You must have created a payment with action=AUTH first.
You can capture the full authorized amount or a partial amount. Multiple partial captures are supported on some gateways, up to the total authorized amount.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The authorisation’s payment ID (pay_...) or transaction ID (tr_...), or the alt_key you gave it (case-insensitive).
The record must be an authorisation, otherwise 404 Payment not found.
An alt_key resolves to the newest authorisation with an amount still open, ignoring failed attempts.
Request Bodyrequired
Section titled “Request Bodyrequired”object
"50.00"Amount to capture. If not specified, the full authorization amount will be captured.
"Partial capture for shipped items"Optional description for the capture
Responses
Section titled “Responses”Capture processed
object
object
"ca_11842_10006"Capture identifier
"pay_11842_10005"Payment ID this capture is associated with
"20"Amount that was captured
"SUCCESS"Status of the capture operation
"REF-00010006"Reference for the capture
"ch_1GVaKJFi2CnH4uN3AmXTKHwB"Reference from the payment gateway
"APPROVED"Status reported by the gateway
"tr_11842_10005"The original transaction that was captured
"2020-04-08T09:36:19.000Z"When the capture was created
"2020-04-08T09:36:20.000Z"When the capture was processed
Bad request - invalid capture parameters
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Unauthorised: the API key is missing or not valid
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Example
{ "code": "UNAUTHORIZED", "message": "Unauthorised"}Payment not found or not eligible for capture
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Was this page helpful?
What went wrong?
Thanks for telling us.