Saltar al contenido principal

Overview

Cancel withdraws a payment intent the terminal has not charged yet. Once the card was approved, the intent is CONFIRMED and cancelling it answers 400 Payment intent already confirmed. To give the money back, refund it. The refund returns the whole charge to the same card, the same way the terminal’s and the dashboard’s Reembolsar do.

Rules

  • Same day only. Before 10:30 PM Mexico City time on the day of the sale (and never more than 24 hours after it). American Express cards charged at the terminal: before 10:00 PM. After that the refund is refused with REFUND_WINDOW_EXPIRED; a later refund, when your agreement allows one, is made from the dashboard.
  • Full only. There are no partial refunds.
  • Compago may keep its fee. The customer gets the whole charge back; depending on your agreement, Compago keeps the fee it charged on the sale and deducts it from your pending settlement. See Refunds and fees.
  • One refund per sale. A repeated request answers 409 ALREADY_REFUNDED and never reaches the bank twice.

Authentication

  • Your own API key (x-api-key) may refund any payment intent of your organization.
  • An installed app (OAuth, Authorization: Bearer) needs the payments:refund scope, and refunds only the payment intents it created. Without the scope it answers 403 insufficient_scope with "scope": "payments:refund". The merchant grants the scope when connecting the app.

Request

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.
API reference: POST /payment-intent/{id}/refund

Response

After the refund, GET /payment-intent/{id} keeps answering status: "CONFIRMED", because the intent’s status says whether the terminal charged it. To know whether the sale was given back, read refundedAt: the time of the refund, or null while the sale stands. It is filled however the sale was refunded: this endpoint, the terminal or the dashboard.

Errors