curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/payment-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 99.99,
"currency": "USD",
"description": "Coffee and pastry"
}
'{
"success": true,
"payment_intent": {
"id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"merchant_id": "74815c83-e47b-4dc5-aefe-abe4484dd280",
"amount": 99.99,
"currency": "USD",
"status": "pending",
"expires_at": "2026-02-24T14:30:00Z",
"merchant_name": "Whole Foods Market",
"description": "Coffee and pastry",
"qr_code_url": "data:image/png;base64,iVBORw0KGgo...",
"qr_data": "{\"payment_intent_id\":\"abc123\",\"amount\":99.99,\"currency\":\"USD\",\"merchant_id\":\"...\",\"merchant_name\":\"Whole Foods Market\"}",
"target_wallet_id": "8566959d-f366-45d9-9e6e-241ba189988f",
"completed_by": "d9f3a2b1-c4e5-6789-abcd-ef0123456789",
"refund_status": "pending",
"refund_ledger_tx_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"counter_id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"reference": "ORD-12345",
"callback_url": "https://shop.example.com/orders/ORD-12345/payment-callback",
"metadata": {
"customer_email": "alice@example.com",
"cart_id": "cart-abc123"
},
"created_at": "2026-02-24T14:00:00Z",
"updated_at": "2026-02-24T14:00:00Z"
}
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Failed to create payment intent"
}Create payment intent
Create a new payment intent with QR code for customer to scan and pay. merchant_id is taken from the JWT. POS terminals have a counter_id claim which will be associated with the intent.
curl --request POST \
--url http://api-sandbox.fexpayments.com/merchant/api/v1/payment-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 99.99,
"currency": "USD",
"description": "Coffee and pastry"
}
'{
"success": true,
"payment_intent": {
"id": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"merchant_id": "74815c83-e47b-4dc5-aefe-abe4484dd280",
"amount": 99.99,
"currency": "USD",
"status": "pending",
"expires_at": "2026-02-24T14:30:00Z",
"merchant_name": "Whole Foods Market",
"description": "Coffee and pastry",
"qr_code_url": "data:image/png;base64,iVBORw0KGgo...",
"qr_data": "{\"payment_intent_id\":\"abc123\",\"amount\":99.99,\"currency\":\"USD\",\"merchant_id\":\"...\",\"merchant_name\":\"Whole Foods Market\"}",
"target_wallet_id": "8566959d-f366-45d9-9e6e-241ba189988f",
"completed_by": "d9f3a2b1-c4e5-6789-abcd-ef0123456789",
"refund_status": "pending",
"refund_ledger_tx_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"counter_id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"reference": "ORD-12345",
"callback_url": "https://shop.example.com/orders/ORD-12345/payment-callback",
"metadata": {
"customer_email": "alice@example.com",
"cart_id": "cart-abc123"
},
"created_at": "2026-02-24T14:00:00Z",
"updated_at": "2026-02-24T14:00:00Z"
}
}{
"success": false,
"error": "Amount must be greater than 0"
}{
"success": false,
"error": "Unauthorized"
}{
"success": false,
"error": "Failed to create payment intent"
}Authorizations
Keycloak JWT. Roles: admin (platform admin — can register merchants, act on behalf of any merchant), merchant (dashboard user — scoped to their own merchant_id via user attribute mapper), POS terminals use client credentials flow with merchant_id injected via protocol mapper.
Body
x >= 0.0199.99
"USD"
"Coffee and pastry"
Seconds until expiration (default: 1800)
x >= 601800
POS terminal (counter) that created this intent. When set, the counter's webhook_url is used for delivery if no callback_url is provided.
"c1d2e3f4-a5b6-7890-abcd-ef1234567890"
Merchant's own order or invoice ID. Stored for correlation and returned in webhook payload.
"ORD-12345"
Per-intent webhook override. Takes priority over counter and merchant-level webhooks. Useful for ecommerce flows where each order has its own callback.
"https://shop.example.com/orders/ORD-12345/payment-callback"
Arbitrary JSON object stored with the intent and forwarded verbatim in the webhook payload.
{
"customer_email": "alice@example.com",
"cart_id": "cart-abc123"
}
