Hermeseus Docs
Legacy docs

A merchant-friendly payment flow modelled on the Noghte gateway: create a transaction, redirect your payer, then confirm the result server-to-server. Collect from your own site or app and have the net (amount minus the gateway fee) credited to your office wallet in USD.

Server-to-server. Your api_key (starts with gw_) goes in the request body, never in browser code. Create one in the console under Wallet → Merchant gateway API (shown once). A test key collects in sandbox; a live key collects for real.

The flow

  1. Your server calls POST /api/gateway/token and gets a trans_id and payment_url.
  2. Redirect the payer's browser (a normal GET) to payment_url.
  3. The payer pays by card (Flitt, with 3-D Secure) or crypto/USDT (KemApp).
  4. The payer's browser is sent back to your callback_uri with the result in the query string.
  5. Your server calls POST /api/gateway/verify with the same trans_id and the amount you stored. Treat the order as paid only when the response is code: 0.
⚠️ The query parameters on callback_uri come from the payer's browser and can be forged. Always confirm with /api/gateway/verify on your server.

Create a transaction

POST/api/gateway/token
curl https://api.hermeseus.com/api/gateway/token \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "gw_xxxxxxxx...",
    "order_id": "ORDER-1001",
    "amount": 1000,
    "currency": "USD",
    "callback_uri": "https://yourshop.example/payment/callback",
    "forced_gateway": null,
    "customer_email": "buyer@example.com",
    "customer_phone": "+15551234567",
    "payer_name": "Jane Doe",
    "payer_desc": "Invoice #2043",
    "custom_json_fields": "{\"cart_id\":77}",
    "auto_verify": "no"
  }'
FieldReqDescription
api_keyyesYour gateway key (gw_…). In the body, server-side only.
order_idyesYour order id. 1–100 chars, A–Z a–z 0–9 _ - . : /. Not checked for uniqueness — send a unique value per attempt. Echoed back on return and in verify.
amountyesAmount to collect, in currency (> 0).
callback_uriyeshttp/https return URL. May already have a query string; our params are appended with &.
currencyno3–4 letter code (default USD). Converted to the gateway's charge currency; credited to your wallet in USD.
forced_gatewaynoflitt or kemapp to skip the picker.
customer_email, customer_phone, payer_name, payer_descnoStored; shown to the payer / in the console where relevant.
custom_json_fieldsnoA JSON string (max 5000 chars). Returned in verify as custom (an object). Sending an object instead of a string is rejected with -38.
auto_verifynoyes/no. We always finalize automatically from the gateway's signed callback, so verify just reports the stored result either way.

Response 201

{
  "code": -1,
  "trans_id": "9f1c0b64-5b2e-4a1e-9b1a-2c3d4e5f6a7b",
  "amount": 1000,
  "currency": "USD",
  "payment_url": "https://payment.skygate.travel/gateway/payment/9f1c0b64-5b2e-4a1e-9b1a-2c3d4e5f6a7b"
}

code: -1 here means “created” (success) — this value is used only in token. Store trans_id and the amount next to your order, then redirect the payer to payment_url.

Payer return to callback_uri

After the payer returns from the gateway, we send their browser (GET) back to your callback_uri:

https://yourshop.example/payment/callback?np_status=OK&status=credited&code=0&trans_id=9f1c0b64-…&order_id=ORDER-1001&amount=1000¤cy=USD&ref_number=flt_abc123
ParamValue
np_statusOK paid · Failed declined/expired · Pending (you returned before the server callback settled — just verify)
code0 paid · -2 failed · -4 expired/canceled · -3 still pending
status, trans_id, order_idThe transaction status, our id, and your order id
amount, currency, ref_numberSent only on success (ref_number = the gateway's payment id)

Verify (confirm the payment)

POST/api/gateway/verify
curl https://api.hermeseus.com/api/gateway/verify \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "gw_xxxxxxxx...",
    "trans_id": "9f1c0b64-5b2e-4a1e-9b1a-2c3d4e5f6a7b",
    "amount": 1000
  }'
FieldReqDescription
api_keyyesThe same key the transaction was created with.
trans_idyesThe transaction id from token.
amountyesMust equal the transaction amount (use the value you stored, not the one from the browser). Mismatch → -34.
currencynoUnit of amount and the reply (default: the transaction's currency).

Response 200 (paid)

{
  "code": 0,
  "amount": 1000,
  "currency": "USD",
  "order_id": "ORDER-1001",
  "gateway": "flitt",
  "credited_usd": 960.00,
  "fee_percent": 4,
  "ref_id": "flt_abc123",
  "customer_phone": "+15551234567",
  "custom": { "cart_id": 77 },
  "three_ds_verified": true,
  "created_at": "2026-01-01T12:00:00+00:00"
}

Only code: 0 means paid. credited_usd is the net added to your wallet (amount × (1 − fee%)). It is idempotent: calling verify again returns the same result.

Response codes

codeMeaningHTTP
0Paid (verify)200
-1Created (token only)201
-2Failed / declined400
-3Awaiting the gateway result400
-4Expired / canceled400
-5Payer hasn't started the gateway yet400
-34Amount doesn't match the transaction400
-37Transaction not found (for this key)404
-38Validation error422
-39Invalid / revoked API key401
-43Rate limited (120/min)429
-45No gateway available in this mode503
-46Invalid transaction state400

Fees

The platform fee is set per gateway and applied when the payment is credited: credited = amount × (1 − fee%). Current live fees:

GatewayFeeStatus
flitt — Flitt (card · 3-D Secure)0%Not configured
kemapp — KemApp (crypto · USDT)0%Not configured
3-D Secure (card / Flitt). Card payments are credited only when fully 3-D Secure authenticated; a non-3DS attempt ends failed. Crypto (KemApp) has no 3DS step. Crediting is driven only by the gateway's signed server callback plus a server-to-server re-check — never by the payer's browser.