Skip to main content

session/refund

session/refund

This request is used to return money to the user after a successful payment.

After completing the refund, Smart Glocal will send you a payment_refunded webhook.

Endpoint

api/v1/session/refund

Request parameters

NameMandatoryTypeDescription
session_id+stringIdentifier of the session with the successful payment that needs to be refunded
amount_details-AmountDetailsAmount of the refund. If not specified, the refund will be made for the full amount of the payment
metadata-*Additional information

Request example

curl -X POST \
https://demo.smart-glocal.com/api/v1/session/refund \
-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"
}