Skip to main content
POST
/
payment-method
/
{id}
/
payment
Charge a saved payment method
curl --request POST \
  --url https://demo.api.harmony.compago.com/api/payment-method/{id}/payment \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "amount": 500,
  "currency": "MXN",
  "description": "Monthly subscription - January 2025"
}
'
{
  "id": "11111111-2222-3333-4444-555555555555",
  "status": "CONFIRMED",
  "amount": 123,
  "currency": "MXN"
}

Authorizations

x-api-key
string
header
required

Path Parameters

id
string<uuid>
required

The unique identifier of the payment method to charge

Body

application/json

Request body for charging a saved payment method

amount
number<decimal>
required

The amount to charge in MXN. Must be a positive number.

Required range: x >= 0.01
Example:

500

currency
enum<string>
default:MXN

Currency code. Defaults to MXN.

Available options:
MXN
Example:

"MXN"

description
string

A description of the charge.

Example:

"Monthly subscription - January 2025"

Response

Payment created successfully

Response after charging a payment method

id
string<uuid>
required

Unique identifier of the payment

Example:

"11111111-2222-3333-4444-555555555555"

status
enum<string>
required

Current status of the payment

Available options:
NOT_INITIALIZED,
PENDING,
CONFIRMED,
CANCELLED,
REFUNDED
Example:

"CONFIRMED"

amount
number<decimal>
required
currency
string
required
Example:

"MXN"