Refunds

Refunds allow you to reverse a confirmed purchase, either partially or in full, accommodating various scenarios such as customer returns, order cancellations, or billing corrections.

Refund a purchase

This endpoint allows you to process a refund for a previously completed purchase. You can refund either the full amount or a partial amount of the original transaction. The refund operation is only available for purchases with state Approved.

Request URL

You must invoke a POST request to the following URLs according to your needs.

  • Production: https://api.bamboopayment.com/v3/api/purchase/{{TransactionId}}/refund
  • Stage: https://api.stage.bamboopayment.com/v3/api/purchase/{{TransactionId}}/refund

Remember to include your merchant’s Private Key in the request headers.
For more details, check our Authentication Guide.

Request parameters

Consider the following parameters when invoking a refund request.

ParameterTypeMandatoryDescription
Amountinteger (64 bits)NoAmount to be refunded (Partial refund). If this parameter is not send, the refund will be for the amount of the purchase (Total refund).
If you require to include decimals in the amount, concatenate the decimal places without de decimal point. Example: 12,25 > 1225.
This value cannot be higher than the original amount of the purchase.
MetadataInobjectNoAdditional metadata for the refund transaction.
MetadataInDescriptionstringNoOptional description for the refund.

Request example

{
   "Amount":"2500",
   "MetadataIn": {
     "Description": "Refund description"
   }
}

Response parameters

ParameterTypeDescription
TransactionIdstringUnique identifier for the refund transaction.
ResultstringThe result of the refund operation (e.g., COMPLETED).
StatusstringThe status of the refund (e.g., APPROVED, PENDING).
ErrorCodestringError code if the refund failed (null if successful).
ErrorDescriptionstringDescription of the error if the refund failed (null if successful).
CreatedstringTimestamp of when the refund was initiated.
AuthorizationDatestringTimestamp of when the refund was authorized.
AuthorizationCodestringAuthorization code for the refund transaction.
AmountintegerThe amount that was refunded.
CurrencystringThe currency of the refund.
MetadataOutobjectAdditional metadata returned with the refund response.

Response example

Result:COMPLETED - Status: APPROVED

{
    "TransactionId": "79632697147789184",
    "Result": "COMPLETED",
    "Status": "APPROVED",
    "ErrorCode": null,
    "ErrorDescription": null,
    "Created": "2024-09-02T15:58:13.078",
    "AuthorizationDate": "2024-09-02T15:58:18.334",
    "AuthorizationCode": "673531",
    "Amount": 25000,
    "Currency": "BRL",
    "MetadataOut": null
}

  • Pending Status: A refund may remain in a pending status depending on the payment method and acquirer. This means that while the refund request has been initiated, it may not be processed immediately.

Result:COMPLETED - Status: PENDING

{
    "TransactionId": "79632697147789184",
    "Result": "COMPLETED",
    "Status": "PENDING",
    "ErrorCode": null,
    "ErrorDescription": null,
    "Created": "2024-09-02T15:58:13.078",
    "AuthorizationDate": null,
    "AuthorizationCode": null,
    "Amount": 25000,
    "Currency": "BRL",
    "MetadataOut": null
}

  • Final Result Notification: The final result of the refund will be notified through a webhook. This ensures that you receive real-time updates on the status of your refund request, even if it initially shows as pending.
footer
Last modified December 20, 2024

© Bamboo | All rights reserved 2024