Skip to content

Hosted HTTP API

HTTP service for platforms that prefer API + API key over embedding the Node SDK. Same verification rules as @autlantic/payments.

You can self-host the reference server from the DrProfit monorepo (apps/payments-api) or run it on Railway.

Authentication

Every request except GET /health needs:

X-Autlantic-Api-Key: your_key

or Authorization: Bearer your_key

Production: set AUTLANTIC_API_KEYS=key1,key2 (comma-separated).

Dev fallback (non-production): apk_test_local if no keys are configured.

Endpoints

MethodPathDescription
GET/healthLiveness (no auth)
GET/v1/scenariosList sandbox test scenarios
POST/v1/intentsCreate payment intent
POST/v1/payments/verifyVerify tx hash
POST/v1/payments/confirmVerify + payment.confirmed event
POST/v1/payments/pollPoll incoming USDT
POST/v1/test-events/triggerSandbox: emit test event

Example (sandbox)

bash
curl -s http://localhost:8787/health

curl -s -X POST http://localhost:8787/v1/intents \
  -H "Content-Type: application/json" \
  -H "X-Autlantic-Api-Key: apk_test_local" \
  -d '{
    "merchantRef": "order_99",
    "amountUsdt": 20,
    "payToAddress": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
    "matchStrategy": "minimum_amount"
  }'

curl -s -X POST http://localhost:8787/v1/payments/verify \
  -H "Content-Type: application/json" \
  -H "X-Autlantic-Api-Key: apk_test_local" \
  -d '{
    "merchantRef": "order_99",
    "amountUsdt": 20,
    "payToAddress": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH",
    "txHash": "sandbox_payment_confirmed"
  }'

Environment

VariablePurpose
PORTHTTP port (default 8787)
AUTLANTIC_API_KEYSComma-separated API keys
AUTLANTIC_PAYMENTS_SANDBOXTest mode (no TronGrid)
TRONGRID_API_KEYLive chain access
AUTLANTIC_PAYMENTS_WEBHOOK_SECRETSign confirm webhooks

WARNING

Do not set AUTLANTIC_PAYMENTS_SANDBOX in production.

npm SDK alternative

bash
npm install @autlantic/payments

See Getting started.