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

Retrieve a paginated list of all payment methods in your organization.

Endpoint

GET /api/payment-method
API reference: GET /payment-method

Query Parameters

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

Response

{
  "count": 25,
  "page": 1,
  "pageSize": 100,
  "items": [
    {
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "status": "ACTIVE",
      "externalId": "customer_12345",
      "card": {
        "lastFourDigits": "4242",
        "networkType": "VISA"
      },
      "createdAt": "2025-01-15T10:30:00Z"
    },
    {
      "id": "ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj",
      "status": "REVOKED",
      "externalId": "customer_67890",
      "card": {
        "lastFourDigits": "1234",
        "networkType": "MASTERCARD"
      },
      "createdAt": "2025-01-10T08:15:00Z"
    }
  ]
}

Code Examples

# List all active payment methods
curl "https://api.harmony.compago.com/api/payment-method?status=ACTIVE&page=1&pageSize=50" \
  -H "x-api-key: YOUR_API_KEY"

Get Payment Method Details

Retrieve the full details of a specific payment method.

Endpoint

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

Path Parameters

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

Response

{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "ACTIVE",
  "externalId": "customer_12345",
  "card": {
    "lastFourDigits": "4242",
    "networkType": "VISA"
  },
  "createdAt": "2025-01-15T10:30:00Z"
}

Code Examples

curl https://api.harmony.compago.com/api/payment-method/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
  -H "x-api-key: YOUR_API_KEY"

Revoke a Payment Method

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

Endpoint

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

Path Parameters

id
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

{
  "success": true
}

Code Examples

curl -X DELETE https://api.harmony.compago.com/api/payment-method/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
  -H "x-api-key: YOUR_API_KEY"

List Payments for a Payment Method

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

Endpoint

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

Path Parameters

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

Query Parameters

status
string
Filter by payment status: NOT_INITIALIZED, PENDING, CONFIRMED, CANCELLED, or REFUNDED.
page
integer
default:"1"
Page number for pagination.
pageSize
integer
default:"100"
Number of items per page (max 500).

Response

{
  "count": 10,
  "page": 1,
  "pageSize": 100,
  "items": [
    {
      "id": "11111111-2222-3333-4444-555555555555",
      "status": "CONFIRMED",
      "amount": 500,
      "currency": "MXN",
      "createdAt": "2025-02-01T12:00:00Z"
    },
    {
      "id": "66666666-7777-8888-9999-000000000000",
      "status": "REFUNDED",
      "amount": 250,
      "currency": "MXN",
      "createdAt": "2025-01-15T09:30:00Z"
    }
  ]
}

Code Examples

curl "https://api.harmony.compago.com/api/payment-method/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/payment?status=CONFIRMED&page=1" \
  -H "x-api-key: YOUR_API_KEY"

Get Payment Details

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

Endpoint

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

Path Parameters

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

Response

{
  "id": "11111111-2222-3333-4444-555555555555",
  "status": "CONFIRMED",
  "amount": 500,
  "currency": "MXN"
}

Code Examples

curl https://api.harmony.compago.com/api/payment-method/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/payment/11111111-2222-3333-4444-555555555555 \
  -H "x-api-key: YOUR_API_KEY"

Error Responses

Status CodeErrorSolution
400Cannot revoke payment method (not ACTIVE)Only ACTIVE payment methods can be revoked.
401UnauthorizedCheck your API key is valid and included in headers.
404Payment method not foundVerify the payment method ID is correct.
404Payment not foundVerify the payment ID is correct.

Next Steps

Charge a Saved Card

Charge a customer’s saved card on demand.

Process Refunds

Issue full refunds for charges.