Payment Gateway API
Accept credit/debit cards (Visa, Mastercard, Maestro), Apple Pay, Google Pay, and SEPA bank transfers on any website. No merchant onboarding required. No API keys. Instant payouts in USDC (Polygon) to your own wallet.
Integration Flow
1 server-side API call + 1 client-side redirect + callback webhook. Optionally, a currency conversion call before the redirect.
Create Wallet (server-side API call)
Generate a temporary encrypted wallet address by passing your USDC wallet + a callback URL. You receive an encrypted address_in and an ipn_token for tracking. Store the ipn_token in your database.
Redirect Customer (client-side redirect)
Redirect the customer's browser to the checkout URL with the encrypted wallet, amount, currency, and provider. The customer completes payment via the provider's hosted checkout.
Receive & Verify Callback (webhook)
After payment, a GET callback hits your URL with transaction data. Always verify via the Payment Status endpoint before marking the order as paid. USDC arrives instantly in your wallet.
Base URL
URL Encoding Rules
Incorrect URL encoding is the most common integration error. Follow these rules precisely.
| Parameter | Encoding Rule |
|---|---|
| callback | Apply encodeURIComponent() once to the full callback URL (including your query params). |
| address_in | The value returned by Create Wallet is already encoded. Apply encodeURIComponent() once more when passing it to Process Payment. |
Apply encodeURIComponent() — the @ becomes %40. |
JavaScript Example
PHP Example
Amount & Precision
To avoid floating-point rounding issues, follow these rules when handling amounts.
| Field | What it represents | When to use |
|---|---|---|
| value_coin | USDC amount received by the order's temporary wallet from the payment provider. | Use for payment verification — compare against your expected order amount. |
| value_forwarded_coin | Total USDC forwarded from the order wallet to the merchant (after network fees). | Use for accounting — this is what actually arrives in your wallet. |
When verifying payments, allow a small tolerance (e.g. ±0.02 USDC) to account for minor FX rounding by providers.
GET Create Wallet
Generate a temporary encrypted wallet address for an order. Each callback URL gets a unique wallet. All received USDC is instantly forwarded to your merchant wallet.
Request Parameters
| Parameter | Description |
|---|---|
| addressrequired | Your USDC (Polygon) wallet address to receive instant payouts. |
| callbackrequired | URL-encoded callback URL. Must be HTTPS. Include your order identifier as a query parameter (e.g. ?orderId=123) — it will be preserved in the callback. |
Example Request
Response
| Field | Description |
|---|---|
| address_in | Encrypted wallet address — pass this to the Process Payment redirect. URL-encode it once more when building the redirect URL. |
| polygon_address_in | Unencrypted Polygon wallet address assigned to this order (for reference/on-chain tracking). |
| callback_url | The decoded callback URL you provided. |
| ipn_token | Token for verifying payment status. Store this in your database alongside the order. |
GET Process Payment
Redirect the customer's browser to the payment page. This is not a server-side API call — send the customer here via HTTP redirect or window.location.
Request Parameters
| Parameter | Description |
|---|---|
| addressrequired | The URL-encoded address_in value from the Create Wallet response. |
| amountrequired | Payment amount as a string (e.g. 103.78). Do not use floating-point math. |
| providerrequired | Payment provider identifier. See providers list (e.g. moonpay, stripe, transak). |
| currencyrequired | Fiat currency code (e.g. USD, EUR). Some providers support USD only — use the Convert endpoint first. |
| emailoptional | Customer's email (URL-encoded). Pre-fills the provider's checkout form. |
Example
GET Convert to USD
Some providers (Stripe, Wert, Transfi, Ramp Network) support USD only. Use this endpoint to convert other currencies before calling Process Payment.
Request Parameters
| Parameter | Description |
|---|---|
| fromrequired | Source currency code (e.g. EUR, SEK, GBP, CHF). |
| valuerequired | Amount to convert (e.g. 1258.31). |
Example
GET Callback Event
When a customer completes payment, a GET request is sent to your callback URL with all your original query parameters plus the following transaction data.
Callback Parameters
| Parameter | Description |
|---|---|
| value_coin | USDC amount paid by the provider to the order wallet. |
| coin | Payout coin type, usually polygon_usdc or polygon_usdt. |
| txid_in | Polygon TXID — payment from provider to the order's temporary wallet. |
| txid_out | Polygon TXID — instant payout from temporary wallet to your merchant wallet. |
| address_in | Unencrypted Polygon wallet for this order. Must match polygon_address_in from Create Wallet. |
| value_forwarded_coin | Total USDC forwarded to the merchant wallet (after network fees). |
GET Check Payment Status
Verify whether a payment has been completed. Use the ipn_token stored during Create Wallet.
Request Parameters
| Parameter | Description |
|---|---|
| ipn_tokenrequired | The ipn_token from the Create Wallet response. |
Response
| Field | Description |
|---|---|
| status | paid or unpaid |
| value_coin | USDC amount sent by the provider to the order wallet. |
| txid_out | Blockchain TXID of the payout to your merchant wallet. |
| coin | Payout coin type (e.g. polygon_usdc). |
Callback Verification
Callbacks arrive as unsigned GET requests. Anyone who knows your callback URL could send a fake request. Always verify before marking an order as paid.
Required Verification Flow
Receive Callback
Extract the order ID from your callback's query parameters (e.g. orderId). Look up the stored ipn_token for that order in your database.
Verify via Payment Status
Call GET /control/payment-status.php?ipn_token={stored_token} and confirm status=paid.
Validate Amount & TXID
Compare the returned value_coin against your expected order amount (with ±0.02 tolerance). Optionally verify txid_out matches.
Idempotency Check
Before marking paid, check that this txid_out hasn't already been processed (prevents replay attacks). Only then update your order status.
Error Handling
The API may return errors in the following format.
Error Response Format
Common HTTP Status Codes
| Code | Meaning | What to do |
|---|---|---|
| 200 | Success | Parse response JSON normally. |
| 400 | Bad Request | Check your parameters — likely a missing or malformed value (bad encoding, invalid wallet address). |
| 422 | Unprocessable | Parameters are syntactically valid but semantically wrong (e.g. unsupported currency for provider). |
| 429 | Rate Limited | Too many requests. Wait 30–60 seconds before retrying. Implement exponential backoff. |
| 500 | Server Error | Transient failure. Retry with exponential backoff (max 3 retries). |
"status": "success" in the JSON response body, even on HTTP 200. Some errors may return 200 with an error message in the body.
Quickstart: Next.js (App Router)
A production-ready integration pattern using Next.js with proper callback verification, idempotency, and error handling.
1. Create Payment Session
2. Callback Handler (with Verification)
Payment Providers
Use the provider parameter in Process Payment. Each provider has different minimum order amounts, supported currencies, and fee structures. Fees are generally lower for larger transaction amounts.
| Provider ID | Currency | Notes |
|---|---|---|
| moonpay | Multi | Wide coverage, popular choice |
| stripe | USD only | Use Convert endpoint for EUR/GBP/etc. |
| transak | Multi | Good international coverage |
| wert | USD only | Fast onboarding for customers |
| rampnetwork | USD only | Use Convert endpoint for other currencies |
| guardarian | Multi | Multi-currency support |
| mercuryo | Multi | Multi-currency support |
| banxa | Multi | Multi-currency support |
| transfi | USD only | Use Convert endpoint |
| utorg | Multi | Multi-currency support |
| revolut | Multi | Recommended for UK customers (bypasses 24h FCA cooling-off period) |
Requirements
For the Merchant
A USDC wallet on the Polygon network. Use any self-custodial wallet — Trust Wallet (SWIFT option), MetaMask, Coinbase Wallet, or similar.
For the Customer
A 3D Secure enabled card (Verified by Visa / Mastercard SecureCode). First-time customers may need to complete identity verification (KYC) with the payment provider — typically under 2 minutes.
Technical Requirements
Callback endpoints must use HTTPS. The callback handler must respond within a reasonable timeout. Store ipn_token values in your database for payment verification.
Changelog
| Version | Date | Changes |
|---|---|---|
| v1.0 | 2025-02-13 | Initial release — Create Wallet, Process Payment, Convert to USD, Callback Event, Payment Status. |