POCKET PAY · DEVELOPER DOCS

API reference.

Every HTTP route currently registered by the Pocket Pay backend, with auth requirements and request shapes.

DEFAULT API BASE URL https://web-production-7892c.up.railway.app Use your backend host when self-hosting.
14 application routesJSON request and response bodies1874 Whitechain testnet
01

Authentication

Send the merchant API key as X-API-Key on protected routes. Keep it server-side; never expose it in browser JavaScript or a public mobile build.

Implementation status

Invoice and refund list routes are placeholders. Invoice creation, invoice detail, and refund create/status routes are not currently registered in the backend.

The current TypeScript SDK package and class are still named @paylink/sdk and PayLink in this repository; the product and site brand is Pocket Pay.

ROUTE DIRECTORY

All backend endpoints

MethodPathAuthPurpose / state
POST/api/merchants/registerPublicCreate merchant
POST/api/merchants/loginPublicLogin; returns merchant API key
GET/api/merchants/meAPI keyRead business profile
PATCH/api/merchants/meAPI keyUpdate business profile
POST/api/payments/checkout/createAPI keyCreate payment & checkout URL
GET/api/payments/API keyList merchant payments
GET/api/payments/{payment_id}PublicGet payment record
GET/api/payments/{payment_id}/statusPublicGet payment status
POST/api/payments/{payment_id}/confirmPublic*Verify submitted transaction
GET/checkout/{payment_id}PublicHosted HTML checkout
GET/api/invoices/PublicPlaceholder
GET/api/refunds/PublicPlaceholder
GET/PublicAPI name and version
GET/healthPublicBackend & chain health

* The current confirmation route does not require an API key. Framework docs are also available at /docs, /redoc, and /openapi.json. Static files are served under /static/{path}.

REQUEST DETAILS

Payloads & responses

01 / MERCHANTS

Register

POST /api/merchants/register
{
  "business_name": "Northstar Studio",
  "email": "billing@example.com",
  "wallet_address": "0x…",
  "payout_address": "0x…",
  "password": "strong-secret",
  "webhook_url": "https://example.com/hooks"
}

Returns profile fields including api_key. Errors: 400 duplicate email.

02 / MERCHANTS

Login & profile

POST /api/merchants/login
{ "email": "billing@example.com", "password": "strong-secret" }

GET /api/merchants/me returns the current profile. PATCH /api/merchants/me accepts any subset of email, business_name, wallet_address, payout_address, and webhook_url.

03 / PAYMENTS

Create checkout

POST /api/payments/checkout/create
{
  "amount": "49.00",
  "currency": "USDT",
  "order_id": "ORDER-1048",
  "description": "Studio session",
  "success_url": "https://shop.example/success",
  "cancel_url": "https://shop.example/cart",
  "metadata": "source=web"
}

Requires X-API-Key. Returns payment_id, status, checkout_url, amount, currency, merchant wallet, and creation time. Status begins as created.

04 / PAYMENTS

Read & track

GET /api/payments/…

GET /api/payments/ lists the authenticated merchant’s payments, newest first. GET /api/payments/{payment_id} returns a full payment record. GET /api/payments/{payment_id}/status returns:

{
  "payment_id": "pay_abc123",
  "status": "confirmed",
  "amount": "49.00",
  "tx_hash": "0x…",
  "confirmed_at": "2026-11-07T10:30:00Z"
}
05 / PAYMENTS

Confirm transaction

POST /api/payments/{payment_id}/confirm

Current FastAPI parameters are query parameters, not JSON:

?tx_hash=0x…&customer_wallet=0x…

On success returns {"status":"confirmed","payment":{…}}. Can return 400 for duplicate, expired, or invalid transactions and 404 if payment is missing.

06 / HOSTED CHECKOUT

Customer checkout page

GET /checkout/{payment_id}

Returns the HTML wallet checkout (or an HTML state for invalid, expired, and completed payments). The `checkout_url` from create-payment points to this flow.

HONEST STATUS

Routes still in progress

GET/api/invoices/

Returns {"message":"Invoices API - Coming soon"}. No invoice create, detail, or payment-link routes are currently registered.

GET/api/refunds/

Returns {"message":"Refunds API - Coming soon"}. No refund create or status routes are currently registered.

OUTGOING EVENT

Webhook delivery

payment.confirmed

When on-chain verification succeeds, the backend posts this event to the merchant’s configured webhook URL.

Delivery retries up to three times, with exponential backoff. An HTTP 200 response marks delivery as successful.

Headers:
X-PayLink-Event: payment.confirmed
X-PayLink-Signature: <HMAC-SHA256 hex digest>

Body:
{
  "event": "payment.confirmed",
  "data": {
    "payment_id": "pay_abc123",
    "amount": "49.00",
    "currency": "USDT",
    "tx_hash": "0x…",
    "customer_wallet": "0x…",
    "order_id": "ORDER-1048"
  },
  "timestamp": "2026-11-07T10:30:00"
}

The webhook signature header currently retains the legacy PayLink name in the backend implementation.