Skip to main content
In the Bango Platform, transactions are two-step: in the first step your store authorizes payment, and in the second step your store captures payment. Between authorization and capture you can cancel authorization to release all reserved funds. After capture, you may be able to refund the user: returning the full amount the user paid, or less than the full amount (a partial refund). Partial cancellation is not possible. To cancel or refund payment, you make a DELETE request to the Bango Payment API, specifying the transaction ID. Some payment providers may not support full or partial refunds. As part of the API request, you supply:
  • The transaction ID
  • Optionally, a structure representing the item the user is purchasing (required for partial refunds only)
  • Optionally, custom transaction data
The API response is a structure that describes the result of the cancel/refund request.

Sequence diagrams

The Bango Platform successfully cancels authorization for a payment that is not yet captured:
The Bango Platform successfully refunds a captured payment:
The Bango Platform fails to cancel authorization or refund payment:

Skeleton code

FAQ

In the skeleton code above, the transaction ID is specified as a path parameter but no body parameters are included in the request. For refunds, this means the user is refunded the full amount for the purchase (the price specified when the payment was captured). To support partial refund, you would pass a body parameter that specifies a replacement paymentItems structure where the grossAmount and/or taxAmount is less than the original. For authorized but not captured payments, only full cancellation is possible.You could also pass a body parameter that defines an externalTransactionId for the transaction.See Bango Payment / Merchant API reference / API reference overview for detailed information on all request parameters.
All responses contain a responseCode string that indicates the result of the request. Use this code to determine how to react.See Bango Payment / Merchant API reference / API reference overview for detailed information on all responses.