Terminal payments quickstart

API request

POST /developers/v1/terminal-payments

Push amount + currency to a signed-in terminal for CRM/POS checkout.

curl -X POST "https://api.mainmoney.net/api/v2/developers/v1/terminal-payments" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{"terminalId":"POS-ABC123-001","businessId":"biz_...","amount":1.03,"currencyCode":"USD","merchantReference":"crm-order-1001","metadata":{"table":"12"},"expiresInSeconds":300}'

Terminal payments quickstart

Happy path only. Base URL: https://api.mainmoney.net/api/v2.

The cashier always chooses palm / phone / QR / cash on the terminal. Your API only pushes amount and currency.

Prerequisites

  • Sandbox developer app with client_id, client_secret, and webhook signing secret
  • At least one signed-in MainMoney terminal for the target business
  • Optional: terminal-payments-demo + ngrok for local webhooks

1. Credentials → token

curl -X POST https://api.mainmoney.net/api/v2/developers/oauth/token \
  -H 'Content-Type: application/json' \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "mm_test_...",
    "client_secret": "YOUR_SECRET"
  }'

Export TOKEN from data.access_token. Use Authorization: Bearer $TOKEN below.

2. Merchants

curl https://api.mainmoney.net/api/v2/developers/v1/merchants \
  -H "Authorization: Bearer $TOKEN"
  • OPERATING — single business (optional businessId later)
  • GROUP — pick a child businessId for the next steps

3. Terminals

curl "https://api.mainmoney.net/api/v2/developers/v1/terminals?businessId=BUSINESS_ID" \
  -H "Authorization: Bearer $TOKEN"

Note a terminalId (e.g. POS-ABC123-001) that is online / recently used.

4. Create payment

curl -X POST https://api.mainmoney.net/api/v2/developers/v1/terminal-payments \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "terminalId": "POS-ABC123-001",
    "businessId": "BUSINESS_ID",
    "amount": 1.03,
    "currencyCode": "USD",
    "merchantReference": "crm-order-1001",
    "metadata": { "table": "12", "waiter": "alice" }
  }'

The signed-in terminal prefills 1.03 USD. Default TTL is 5 minutes.

5. Webhook

Configure your app webhookUrl. On completion you receive terminal_payment.completed (also failed / cancelled / expired).

Verify X-Mainmoney-Signature as HMAC-SHA256 of the raw body with your whsec_… secret. Details: Terminal payment webhooks.

6. Sandbox simulate (optional)

curl -X POST https://api.mainmoney.net/api/v2/developers/v1/terminal-payments/{id}/simulate-complete \
  -H "Authorization: Bearer $TOKEN"

Sandbox only — fires the completed webhook without a real device charge.