Skip to main content

session/capture

session/capture

This request is used to debit amounts put on hold.

Payments with later capture are performed in two stages:

  1. The money is put on hold (for example, on the user's bank card).
  2. The money is debited (fully or partially) in response to your request.

The request is sent after you received a ready_to_capture webhook when you are ready to debit the amount put on hold.

To cancel the debit, send a session/cancel request.

Endpoint

api/v1/session/capture

Request parameters

NameMandatoryTypeDescription
session_id+stringSession identifier

Request example

curl -X POST \
https://demo.smart-glocal.com/api/v1/session/capture \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: 721af394d5a7aefd0e91f5390abc4d7e20fb2b5784b091fef621f3c61b7abb4b' \
-d '{
"session_id":"ps_3230"
}'

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session-PaymentSessionPayment session
error-ErrorError

Successful response example

{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"acquiring_payments": [
{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2018-05-27T02:03:00.000000Z",
"finished_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "visa",
"last4": "4242"
}
},
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"refunds": [
{
"id": "rf_23",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"amount_details": {
"amount": 10000,
"currency": "usd"
}
}
]
}
]
}
}

Unsuccessful response example

    {
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}