Skip to main content

session/cancel

session/cancel

Send this request in response to a ready_to_confirm or ready_to_capture webhook when you want to cancel the operation.

Endpoint

api/v1/session/cancel

Request parameters

NameMandatoryTypeDescription
session_id+stringSession identifier
Request example
curl -X POST \
https://demo.smart-glocal.com/api/v1/session/cancel \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'

Response parameters

NameMandatoryTypeDescription
status+stringStatus. Options: error, ok
session-objectPayment session
error-objectError description
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",
"payments": [
{
"id": "po_1313",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [
{
"email": "user@gmail.com"
}
]
},
"payment_method": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa"
}
},
"amount_details": {
"amount": 10000,
"currency": "usd"
},
"metadata": "good"
}
]
}
}
Unsuccessful response example
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}