Documentation

API Reference

Everything you need to integrate crypto payments into your platform. REST API, webhooks, SDKs.

Base URL: https://pg.srglobalmarkets.com
Authentication

API Keys

All API requests require authentication via an API key. Include your key in the x-api-key request header. You can generate and manage API keys from your merchant dashboard → Settings → API Keys.

Example Request
curl -X POST https://pg.srglobalmarkets.com/api/payments/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"coin":"USDT_TRC20","orderId":"ORD-001"}'
Endpoints

Payment API

POST/api/payments/createCreate Payment

Creates a new payment session and returns a wallet address for the customer to pay.

Auth: API Key (x-api-key header)
Parameters
amountnumberrequiredPayment amount in USD
coinstringrequiredCoin to accept — see supported coins table
orderIdstringoptionalYour internal order reference (stored, returned in webhook)
webhookUrlstringoptionalURL we POST payment events to
redirectUrlstringoptionalWhere to redirect after successful payment
Request Body
{
  "amount": 100,
  "coin": "USDT_TRC20",
  "orderId": "ORD-001",
  "webhookUrl": "https://yoursite.com/webhook",
  "redirectUrl": "https://yoursite.com/success"
}
Response
{
  "paymentId": "pay_abc123xyz",
  "address": "TJmK...9xQZ",
  "cryptoAmount": "100.000000",
  "coin": "USDT_TRC20",
  "expiresAt": "2025-06-01T14:30:00.000Z",
  "payUrl": "https://pg.srglobalmarkets.com/pay/pay_abc123xyz"
}
GET/api/payments/[id]Get Payment

Fetch the current status and details of a payment by its ID.

Auth: API Key (x-api-key header)
Response
{
  "paymentId": "pay_abc123xyz",
  "status": "confirmed",
  "coin": "USDT_TRC20",
  "amount": 100,
  "cryptoAmount": "100.000000",
  "receivedCryptoAmount": "100.000000",
  "receivedUsdAmount": 100,
  "txHash": "a1b2c3...",
  "orderId": "ORD-001",
  "confirmedAt": "2025-06-01T14:25:00.000Z"
}
GET/api/payments/listList Payments

Returns a paginated list of all payments for your merchant account.

Auth: API Key (x-api-key header)
Parameters
pagequeryoptionalPage number (default 1)
limitqueryoptionalResults per page (default 20, max 100)
statusqueryoptionalFilter by status: pending, confirming, confirmed, expired, partial
Response
{
  "payments": [ { ... }, { ... } ],
  "total": 142,
  "page": 1,
  "limit": 20
}
Reference

Payment Statuses

pending

Created, waiting for customer to send funds

detecting

Transaction seen in mempool, not yet confirmed

confirming

Seen on-chain, waiting for required confirmations

confirmed

Payment complete — webhook fired

partial

Customer sent less than required amount

expired

Session timed out with no payment

Reference

Supported Coins

coin valuenetworkdecimals
BTCBitcoin mainnet8
ETHEthereum mainnet6
USDT_ERC20Ethereum (ERC-20)6
USDT_TRC20TRON (TRC-20)6
USDT_BEP20BNB Smart Chain6
USDT_POLYGONPolygon6
BNBBNB Smart Chain6
SOLSolana mainnet6
TRXTRON mainnet6
MATICPolygon mainnet6
Webhooks

Receiving Payment Events

When a payment status changes, we POST a JSON body to your webhookUrl. Your endpoint must respond with HTTP 200 to confirm receipt. Failed deliveries are retried up to 5 times.

Webhook Payload — payment.confirmed
{
  "event": "payment.confirmed",
  "paymentId": "pay_abc123xyz",
  "orderId": "ORD-001",
  "status": "confirmed",
  "coin": "USDT_TRC20",
  "amount": 100,
  "receivedCryptoAmount": "100.000000",
  "receivedUsdAmount": 100,
  "txHash": "a1b2c3d4e5f6...",
  "confirmedAt": "2025-06-01T14:25:00.000Z"
}
Signature Verification

Every webhook POST includes an X-Webhook-Signature header — HMAC-SHA256 of the raw body, signed with your webhook secret. Always verify this before marking an order as paid. Your webhook secret is shown in Dashboard → Settings → Webhook.

Reference

Error Codes

400Bad RequestMissing or invalid request parameters
401UnauthorizedMissing or invalid API key
403ForbiddenAPI key does not have permission for this resource
404Not FoundPayment or resource does not exist
429Rate LimitedToo many requests — slow down and retry with backoff
500Internal ErrorServer error — retry after a short delay

Ready to integrate?

Get your API key from the dashboard and start in minutes.