Payment API

Endpoints for payment gateways, balance top-ups, webhook handling, and receipt downloads on FonProxy.

Updated 2026-04-09 16:13:00
Payment API

For authentication, error format, and common headers, see General API Info.

See payments.md for full architecture, flow diagrams, and gateway integration guide.

Gateways

List Payment Gateways Auth required

GET /payment/gateways

List available payment gateways.

Response

{
  "gateways": [
    {
      "key": "monobank",
      "name": "Monobank",
      "description": "Ukrainian neobank. Pay with Visa/Mastercard, Apple Pay, Google Pay.",
      "logo": "/assets/gateways/monobank.png",
      "website": "https://monobank.ua",
      "supportedCurrencies": ["USD", "EUR", "UAH"],
      "allCurrencies": true,
      "allRegions": true,
      "estimatedFee": {
        "percent": 2.0,
        "fixed": 0,
        "currency": "USD",
        "description": "2% per transaction"
      },
      "minAmount": 0.50,
      "maxAmount": 29999,
      "requiresMeta": false
    },
    ...
  ]
}

Get Gateway Meta Schema Auth required

GET /payment/gateways/:key/meta

Get the meta field schema for a gateway (when requiresMeta: true).

Parameters

NameTypeDescriptionRequired
:keystringGateway keyYes

Response

{
  "meta": {
    "fields": [
      {
        "key": "coin",
        "type": "select",
        "label": "payment.meta.coin",
        "required": true,
        "options": [
          { "value": "USDT", "label": "Tether" }
        ]
      }
    ]
  }
}

Resolve Meta Field Options Auth required

POST /payment/gateways/:key/meta/options

Resolve dependent field options based on current selections.

Parameters

NameTypeDescriptionRequired
:keystringGateway keyYes

Request Body

{
  "selections": { "coin": "USDT" }
}

Response

Full meta fields with resolved options (same shape as GET /payment/gateways/:key/meta).


Top-ups

Preview Payment Auth required

POST /payment/preview

Preview a payment before confirming.

Request Body

{
  "amount": 100,
  "gateway": "monobank"
}

Response

{
  "preview": {
    "amount": 100,
    "currency": "UAH",
    "amountUsd": 2.42,
    "exchangeRate": 41.37,
    "fee": {
      "percent": 2.0,
      "fixed": 0,
      "estimatedFee": 0.05,
      "estimatedFeeDisplay": 2.07,
      "description": "2% per transaction"
    },
    "totalUsd": 2.47,
    "totalDisplay": 102.07,
    "lines": []
  }
}

Create Top-up Auth required

POST /payment/topup

Create a top-up. Returns a redirect URL to the payment page.

Request Body

NameTypeDescriptionRequired
amountnumberAmount in user's display currencyYes
gatewaystringGateway keyYes
redirectUrlstringWhere user returns after paymentYes
orderIdstringOptional order ID to linkNo
reasonstringOptional reasonNo
gatewayMetaobjectRequired when requiresMeta: trueNo*
{
  "amount": 100,
  "gateway": "monobank",
  "redirectUrl": "https://dashboard.fonproxy.io/topup/callback",
  "reason": "Balance top-up"
}

Response

{
  "topupId": "k5Xz9qR2Wp",
  "pageUrl": "https://pay.mbnk.biz/abc123..."
}

Poll Top-up Status Auth required

GET /payment/topup/:id/status

Parameters

NameTypeDescriptionRequired
:idstringTop-up IDYes

Response

{
  "topupId": "k5Xz9qR2Wp",
  "status": "pending",
  "amount": 100,
  "currency": "UAH",
  "amountUsd": 2.42,
  "gateway": "monobank",
  "pageUrl": "https://pay.mbnk.biz/abc123...",
  "createdAt": "2026-03-15T12:00:00.000Z"
}
StatusMeaning
pendingWaiting for payment
processingWaiting for confirmation
successBalance credited
failedPayment failed
expiredPayment page expired

Receipts

View Receipt (Public)

GET /receipts/:id

View a transaction receipt as an inline PDF. Public โ€” ID acts as access token.

Parameters

NameTypeDescriptionRequired
:idstringReceipt IDYes

Response

Content-Type: application/pdf (inline)


Download Receipt (Public)

GET /receipts/:id/download

Download the receipt PDF as a file attachment.

Parameters

NameTypeDescriptionRequired
:idstringReceipt IDYes

Response

Content-Type: application/pdf (attachment)

FonProxy Payment API โ€” Gateways, Top-ups & Receipts