API Reference
Everything you need to integrate crypto payments into your platform. REST API, webhooks, SDKs.
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.
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"}'Payment API
/api/payments/createCreate PaymentCreates a new payment session and returns a wallet address for the customer to pay.
amountnumberrequiredPayment amount in USDcoinstringrequiredCoin to accept — see supported coins tableorderIdstringoptionalYour internal order reference (stored, returned in webhook)webhookUrlstringoptionalURL we POST payment events toredirectUrlstringoptionalWhere to redirect after successful payment{
"amount": 100,
"coin": "USDT_TRC20",
"orderId": "ORD-001",
"webhookUrl": "https://yoursite.com/webhook",
"redirectUrl": "https://yoursite.com/success"
}{
"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"
}/api/payments/[id]Get PaymentFetch the current status and details of a payment by its ID.
{
"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"
}/api/payments/listList PaymentsReturns a paginated list of all payments for your merchant account.
pagequeryoptionalPage number (default 1)limitqueryoptionalResults per page (default 20, max 100)statusqueryoptionalFilter by status: pending, confirming, confirmed, expired, partial{
"payments": [ { ... }, { ... } ],
"total": 142,
"page": 1,
"limit": 20
}Payment Statuses
pendingCreated, waiting for customer to send funds
detectingTransaction seen in mempool, not yet confirmed
confirmingSeen on-chain, waiting for required confirmations
confirmedPayment complete — webhook fired
partialCustomer sent less than required amount
expiredSession timed out with no payment
Supported Coins
BTCBitcoin mainnet8ETHEthereum mainnet6USDT_ERC20Ethereum (ERC-20)6USDT_TRC20TRON (TRC-20)6USDT_BEP20BNB Smart Chain6USDT_POLYGONPolygon6BNBBNB Smart Chain6SOLSolana mainnet6TRXTRON mainnet6MATICPolygon mainnet6Receiving 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.
{
"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"
}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.
Error Codes
400Bad RequestMissing or invalid request parameters401UnauthorizedMissing or invalid API key403ForbiddenAPI key does not have permission for this resource404Not FoundPayment or resource does not exist429Rate LimitedToo many requests — slow down and retry with backoff500Internal ErrorServer error — retry after a short delayReady to integrate?
Get your API key from the dashboard and start in minutes.