PayLex API Reference
Simple, powerful payment integration in minutes. Accept crypto payments with instant USDC payouts.
Instant Payouts
Receive USDC directly to your wallet within seconds
Secure & Reliable
Enterprise-grade security with callback verification
Easy Integration
RESTful API with simple GET requests
Integration Flow
Create Wallet
Generate temporary wallet address
Redirect Customer
Send to payment page
Receive Callback
Get payment confirmation
Complete Order
Process customer order
Step 1: Create Wallet
GEThttps://api.paylex.org/control/wallet.phpWhat this does
Generates a temporary encrypted wallet address for receiving customer payments. This is the first step in every payment flow.
Request Parameters
addressRequiredYour Polygon wallet address for receiving instant USDC payouts. Must be a valid Polygon USDC address.
0xF977814e90dA44bFA03b6295A0616a897441aceCcallbackRequiredURL-encoded callback endpoint where payment confirmations will be sent via GET request.
Response Fields
address_inEncrypted wallet address. Use this in Step 2 for payment link generation.
polygon_address_inDecrypted address for tracking. Do not use in payment links.
callback_urlConfirmation of your callback URL with all parameters.
ipn_tokenTracking token for support and debugging purposes.
Example Request
https://api.paylex.org/control/wallet.php?address=0xF977814e90dA44bFA03b6295A0616a897441aceC&callback=https%3A%2F%2Fwww.example.com%2Forders.php%3Fnumber%3D827746841326Step 2: Generate Payment Link
GEThttps://checkout.paylex.org/pay.phpWhat this does
Creates a payment link with the encrypted wallet address from Step 1. Redirects customers to a hosted checkout page with multiple payment provider options.
Request Parameters
addressRequiredThe encrypted address_in from Step 1. Do not use your wallet address directly.
amountRequiredPayment amount (e.g., 105.78). This should be your order total. You can add fees to cover processing costs.
emailRequiredURL-encoded customer email address.
currencyRequiredCurrency code (USD, EUR, CAD, etc.).
Example Request
https://checkout.paylex.org/pay.php?address=k1PrTuxSNpkdPZwdmCm4K3nMjAYo1sx17ea6uG0LunhFbr7SHBGQ8NBs3b5jkQw9RVoyWIbOyqzh7wtEipPbGg%3D%3D&amount=103.78&email=john%40example.com¤cy=USDStep 3: Handle Callback
GETYour callback URL from Step 1What this does
After payment completion, PayLex sends a GET request to your callback URL with payment details. Use this to update your order status and fulfill the purchase.
Callback Parameters
Your original parameters plus the following payment data:
value_coinAmount of USDC paid by the customer.
coinCryptocurrency type (usually polygon_usdc or polygon_usdt).
txid_inTransaction hash from payment provider to temporary wallet.
txid_outInstant payout transaction hash to your merchant wallet.
address_inMatches polygon_address_in from Step 1 for verification.
Example Callback
https://www.example.com/orders.php?number=827746841326&value_coin=105.6&coin=polygon_usdc&txid_in=0xa22a82b4aefbc55f6382e1b5c0b4f0e3c034a654df3bcac431f7fed1942e22bc&txid_out=0x94c2c3e84c2021e6bf377aebf8abf03b49570611bb0c336e357d7f4516f56244&address_in=0x32e854bD1270670C832634CA87858fFd9F3e2c78Check Payment Status
GEThttps://api.paylex.org/control/payment-status.phpWhat this does
Query payment status using the IPN token from Step 1. Useful for polling or verifying payment completion.
Request Parameters
ipn_tokenRequiredThe IPN token received from Step 1 (wallet creation response).
Response Fields
statusPayment status: paid or unpaid.
value_coinAmount of cryptocurrency sent (usually USDC).
txid_outPayout transaction hash to your merchant wallet.
coinCryptocurrency type (usually polygon_usdc).
Example Request
https://api.paylex.org/control/payment-status.php?ipn_token=aHR0cHM6Ly9wYW5lbC5ubHhzdHJlYW1lci5pbmZvL21vZHVsZXMvZ2F0ZXdheXMvY2FsbGJhY2svaGlnaHJpc2tzaG9wLnBocD9pbnZvaWNlX2lkPTEzNzI0Njk%3D