Skip to content
Status

Capture a payment

POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/payments/{payment_id}/capture

POST
/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.

payment_id
required
string

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.

Media typeapplication/json
object
amount
string
e.g. "50.00"

Amount to capture. If not specified, the full authorization amount will be captured.

description
string
e.g. "Partial capture for shipped items"

Optional description for the capture

Capture processed

Media typeapplication/json
object
capture
object
object
id
string
e.g. "ca_11842_10006"

Capture identifier

payment
string
e.g. "pay_11842_10005"

Payment ID this capture is associated with

amount
string
e.g. "20"

Amount that was captured

status
string · enum
e.g. "SUCCESS"

Status of the capture operation

Allowed values: SUCCESS PENDING DECLINED
reference
string
e.g. "REF-00010006"

Reference for the capture

gateway_reference
string
e.g. "ch_1GVaKJFi2CnH4uN3AmXTKHwB"

Reference from the payment gateway

gateway_status
string
e.g. "APPROVED"

Status reported by the gateway

source_transaction
string
e.g. "tr_11842_10005"

The original transaction that was captured

created
string · date-time
e.g. "2020-04-08T09:36:19.000Z"

When the capture was created

processed
string · date-time
e.g. "2020-04-08T09:36:20.000Z"

When the capture was processed

Bad request - invalid capture parameters

Media typeapplication/json

Every error has a code and a message. Some add more fields alongside them, with detail about the error.

object
code
string

The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.

message
string

What went wrong, in words, for logs and support.

Unauthorised: the API key is missing or not valid

Media typeapplication/json

Every error has a code and a message. Some add more fields alongside them, with detail about the error.

object
code
string

The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.

message
string

What went wrong, in words, for logs and support.

Example
{
"code": "UNAUTHORIZED",
"message": "Unauthorised"
}

Payment not found or not eligible for capture

Media typeapplication/json

Every error has a code and a message. Some add more fields alongside them, with detail about the error.

object
code
string

The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.

message
string

What went wrong, in words, for logs and support.

Was this page helpful?