Skip to main content
POST
/
payment-intent
Create a payment intent
curl --request POST \
  --url https://demo.api.harmony.compago.com/api/payment-intent \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "amount": 350.5,
  "currency": "MXN",
  "externalId": "order_12345_pos",
  "terminalCode": "TERMINAL-001"
}
'
{
  "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "status": "PENDING",
  "amount": 123,
  "currency": "MXN",
  "externalId": "<string>",
  "organizationId": "11111111-2222-3333-4444-555555555555",
  "terminalId": "66666666-7777-8888-9999-000000000000",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Request body for creating a payment intent. Payment intents represent card-present payment requests that are processed by POS terminals.

amount
number<decimal>
required

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

Example:

350.5

currency
enum<string>
required

Currency code. Must be MXN.

Available options:
MXN
Example:

"MXN"

externalId
string
required

Your unique identifier for this payment intent. Must be unique per organization.

Example:

"order_12345_pos"

terminalCode
string

Serial number of the target POS terminal. If provided, the payment intent is routed to that specific terminal and any other pending intents for that terminal are automatically cancelled. If omitted, the payment intent is available to any terminal in your organization.

Example:

"TERMINAL-001"

Response

Payment intent created successfully

The created payment intent object

id
string<uuid>
required

Unique identifier of the payment intent

Example:

"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"

status
enum<string>
required

Initial status is always PENDING

Available options:
PENDING
amount
number<decimal>
required

The payment amount

currency
string
required
Example:

"MXN"

externalId
string
required

Your external identifier

organizationId
string<uuid>

The organization that owns this payment intent

Example:

"11111111-2222-3333-4444-555555555555"

terminalId
string<uuid>

The terminal associated with this payment intent, if any

Example:

"66666666-7777-8888-9999-000000000000"

createdAt
string<date-time>
updatedAt
string<date-time>