Skip to main content
You can refund charges made against saved payment methods. Refunds are always for the full charge amount and are processed through Compago’s infrastructure. The funds are returned to the customer’s original payment method.

Endpoint

API reference: POST /payment-method/{id}/payment/{paymentId}/refund

Authentication

Include your API key in the request headers:

Path Parameters

string
required
The unique identifier of the payment method (UUID).
string
required
The unique identifier of the payment to refund (UUID).

Request Body

Response

Code Examples

These examples call the production host. While you build, replace https://api-harmony.compago.com with https://demo-api-harmony.compago.com and use a key from the Demo dashboard. See Environments.
The entire original charge amount will be refunded.

Refund Rules

Only CONFIRMED payments can be refunded. Attempting to refund a payment with any other status (NOT_INITIALIZED, PENDING, CANCELLED, REFUNDED) will result in a 400 error.
Refunds are permanent. Once a refund is processed, it cannot be reversed. The payment status changes to REFUNDED.

Holds Cannot Be Refunded

A hold is not a charge: the money was reserved on the card, never taken, so there is nothing to give back. Calling refund on a payment whose status is HELD, HOLD_RELEASED, or HOLD_EXPIRED returns 409 with the error code PAYMENT_IS_HOLD. Once a hold has been captured, it stops being a hold: the payment is CONFIRMED and refunds work exactly as they do for any other charge. If the capture was partial, the refund returns the captured amount (amount), not the amount that was held (heldAmount).

Refund Window

Refunds are only possible within 24 hours of the payment, and only before 10:30 PM (Mexico City time) on that same day. After the daily settlement runs, the processor can no longer reverse the charge.
For a captured hold, the window runs from the capture date, not from the hold date. A hold placed on Monday and captured on Thursday reaches the bank on Thursday, so Thursday is when its refund window opens and closes. The capturedAt field on the payment tells you the exact starting point.

Error Handling

Best Practices

Always check that the payment status is CONFIRMED before attempting a refund to avoid unnecessary API errors.
Always include a reason field when processing refunds. This helps with accounting, auditing, and customer service.
Protect against duplicate refund requests by checking if the payment has already been refunded before making the API call.
Refund processing times depend on the customer’s bank. Let customers know that while the refund is processed immediately on Compago’s side, it may take a few business days to appear on their statement.

Next Steps

Manage Payment Methods

List, retrieve, and revoke saved payment methods.

Hold Funds

Hold funds on a saved card, then capture them (in full or in part) or release them within 7 natural days.

Payment Methods Overview

Review payment method statuses, use cases, and how the feature works.