Refunds

Refunds reverse approved purchases, supporting full, partial, or multiple refund operations. Includes request rules, response fields, and final status handling.

Refunds revert all or part of an approved purchase, generating a new transaction logically linked to the original one. Refunds are used for returns, cancellations, or billing adjustments once the purchase has been successfully completed.

This page describes the functional behavior, constraints, and typical flows for refunds in the Purchase API. For the full endpoint definition, request/response schema, and testable examples, refer to the Refunds section in the API Reference.


Refund Availability

Refunds are only permitted for purchases with final status Approved.
The following refund types may be available, depending on the payment method and acquirer:

Full Refund

Reverts the entire amount of the original purchase in a single operation.

Partial Refund

Reverts only part of the original amount.
The refunded amount cannot exceed the remaining refundable balance.

Multiple Refunds

Allows several partial refunds, provided that the cumulative amount does not exceed the original purchase value.


📘

Additional limitations or processing times may apply depending on the country and payment method. Refer to the specific payment method documentation for detailed rules.


Endpoint

Send a POST request to the refund endpoint associated with the purchase being reverted:

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

Staging
https://api.stage.bamboopayment.com/v3/api/purchase/{{TransactionId}}/refund

For full endpoint details, refer to the **Refunds** section in the API Reference.


Request Parameters

The refund request accepts the following fields:

ParameterTypeRequiredDescription
Amountinteger (64 bits)NoAmount to be refunded. If omitted, the API processes a full refund. When decimals are required, concatenate them without a separator (e.g., 12,251225). The value cannot exceed the remaining refundable balance.
MetadataInobjectNoContainer for optional metadata associated with the refund.
MetadataIn.DescriptionstringNoOptional description or internal reference for the refund operation.

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 status of a refund is delivered through the webhook notification mechanism.
This ensures that the definitive result is communicated even when the initial response returns a PENDING status.

Refer to the Webhook Notifications section for the full structure and event definitions.




Discover the API