session/capture
session/capture
Send this request 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
Name | Mandatory | Type | Description |
---|---|---|---|
session_id | + | string | Session 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: signature' \
-d '{
"session_id":"ps_3230"
}'
Response parameters
Name | Mandatory | Type | Description |
---|---|---|---|
status | + | string | Status. Options: error , ok |
session | - | object | Payment session |
error | - | object | Error description |
Successful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"acquiring_payments": [
{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2024-05-27T02:03:00.000000Z",
"finished_at": "2024-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": "2024-05-27T02:03:00.000000Z",
"amount_details": {
"amount": 10000,
"currency": "usd"
}
}
]
}
]
}
}
Unsuccessful response example
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}