Skip to main content
Compago provides a full set of endpoints for managing your saved payment methods and their associated payments. You can list all payment methods, retrieve details for a specific one, revoke cards you no longer need, and view the payment history for any saved card.

List Payment Methods

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.
Retrieve a paginated list of all payment methods in your organization.

Endpoint

API reference: GET /payment-method

Query Parameters

string
Filter by payment method status: PENDING, ACTIVE, EXPIRED, or REVOKED.
integer
default:"1"
Page number for pagination.
integer
default:"100"
Number of items per page (max 500).

Response

This is not the payment externalId. They are two different fields, one screen apart in these docs:
  • The payment method externalId, sent to POST /api/payment-method and documented here, is your reference for the saved card or customer.
  • The payment externalId, sent to POST /api/payment-method/{id}/payment and documented in Charge a Saved Card and Hold Funds, is your idempotency key for one charge or hold.
They live in separate namespaces, so the same string may safely be used for both. They are never compared with each other.

Code Examples

Get Payment Method Details

Retrieve the full details of a specific payment method.

Endpoint

API reference: GET /payment-method/{id}

Path Parameters

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

Response

Code Examples

Revoke a Payment Method

Permanently revoke a saved payment method. Once revoked, the card can no longer be charged.

Endpoint

API reference: DELETE /payment-method/{id}

Path Parameters

string
required
The unique identifier of the payment method to revoke (UUID).
This action is permanent. Once a payment method is revoked, it cannot be reactivated. You will need to create a new payment method and have the customer save their card again.

Response

Code Examples

List Payments for a Payment Method

Retrieve a paginated list of all payments (charges) made against a specific payment method.

Endpoint

API reference: GET /payment-method/{id}/payment

Path Parameters

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

Query Parameters

string
Filter by payment status: NOT_INITIALIZED, PENDING, CONFIRMED, CANCELLED, REFUNDED, HELD, HOLD_RELEASED, or HOLD_EXPIRED. Filtering by HELD is the quickest way to list the holds that are still live on a card.
integer
default:"1"
Page number for pagination.
integer
default:"100"
Number of items per page (max 500).

Response

Every payment in the list carries the idempotency key you sent as externalId (null when you sent none), and the hold fields: heldAmount, heldAt, capturedAt, holdReleasedAt, holdExpiresAt, holdExpired, and holdDaysRemaining. They are null on regular charges (holdExpired is false) and populated on holds:
On a hold that was captured for only part of its amount, amount is the amount that was captured and heldAmount stays at the amount that was originally held, so a payment showing "amount": 200 with "heldAmount": 1200 was a 1,200MXNholdcapturedfor1,200 MXN hold captured for 200 MXN. See Capturing a Hold. The heldAt above is 2025-03-04 10:20 in Mexico City, so the placement day is Tuesday 4 March. Six calendar days later is Monday 10 March, and the window closes at 23:00 that day, which is 2025-03-11T05:00:00.000Z in UTC. holdExpiresAt is always 23:00 America/Mexico_City, never the clock time at which you placed the hold. holdDaysRemaining is 7 here because the hold was placed before 23:00 on its own placement day, so that day still counts. See Hold Funds for what each field means and how to tell whether a hold is still capturable.

Code Examples

Get Payment Details

Retrieve the details of a specific payment made against a payment method.

Endpoint

API reference: GET /payment-method/{id}/payment/{paymentId}

Path Parameters

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

Response

This response carries the same externalId and hold fields as the list endpoint (heldAmount, heldAt, capturedAt, holdReleasedAt, holdExpiresAt, holdExpired, holdDaysRemaining), so it is the endpoint to poll when you need to know whether a hold is still live, and the one to read to see how much of a hold was actually captured.

Code Examples

Error Responses

Next Steps

Charge a Saved Card

Charge a customer’s saved card on demand.

Process Refunds

Issue full refunds for charges.