Skip to main content
POST
/
payments
/
{payment_id}
/
cancel
curl --request POST \
--url https://api.staging.bnplx.io/payments/{payment_id}/cancel \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '{
"amount_to_cancel": 5125,
"cancellation_reason": "requested_by_customer",
"order_details": [
{
"amount": 5000,
"product_id": "i124",
"product_name": "Apple airpods",
"quantity": 1,
"tax_amount": 125,
"tax_percentage": 10
}
]
}'

Authorizations

api-key
string
header
required

Use the API key created under your merchant account from the GreenBanana dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Path Parameters

payment_id
string
required

The identifier for payment

Body

application/json
amount_to_cancel
integer

This Unit struct represents MinorUnit in which core amount works

cancellation_reason
string | null

The reason for the payment cancel

merchant_connector_details
object

Merchant connector details used to make payments.

order_details
object[] | null

Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount

Example:

"[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]"

Response

Payment canceled

I