API Documentation

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

1

Create Wallet

Generate temporary wallet address

2

Redirect Customer

Send to payment page

3

Receive Callback

Get payment confirmation

4

Complete Order

Process customer order

Step 1: Create Wallet

GET
https://api.paylex.org/control/wallet.php

What this does

Generates a temporary encrypted wallet address for receiving customer payments. This is the first step in every payment flow.

Request Parameters

addressRequired

Your Polygon wallet address for receiving instant USDC payouts. Must be a valid Polygon USDC address.

Example: 0xF977814e90dA44bFA03b6295A0616a897441aceC
callbackRequired

URL-encoded callback endpoint where payment confirmations will be sent via GET request.

Important: Must include at least one unique GET parameter per request (e.g., order ID, timestamp) to ensure unique wallet generation.

Response Fields

address_in

Encrypted wallet address. Use this in Step 2 for payment link generation.

polygon_address_in

Decrypted address for tracking. Do not use in payment links.

callback_url

Confirmation of your callback URL with all parameters.

ipn_token

Tracking token for support and debugging purposes.

Example Request

GET Request
https://api.paylex.org/control/wallet.php?address=0xF977814e90dA44bFA03b6295A0616a897441aceC&callback=https%3A%2F%2Fwww.example.com%2Forders.php%3Fnumber%3D827746841326

Step 2: Generate Payment Link

GET
https://checkout.paylex.org/pay.php

What 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

addressRequired

The encrypted address_in from Step 1. Do not use your wallet address directly.

Warning: Using your wallet address directly will result in a 400 error.
amountRequired

Payment amount (e.g., 105.78). This should be your order total. You can add fees to cover processing costs.

emailRequired

URL-encoded customer email address.

currencyRequired

Currency code (USD, EUR, CAD, etc.).

Example Request

GET Request
https://checkout.paylex.org/pay.php?address=k1PrTuxSNpkdPZwdmCm4K3nMjAYo1sx17ea6uG0LunhFbr7SHBGQ8NBs3b5jkQw9RVoyWIbOyqzh7wtEipPbGg%3D%3D&amount=103.78&email=john%40example.com&currency=USD

Step 3: Handle Callback

GET
Your callback URL from Step 1

What 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_coin

Amount of USDC paid by the customer.

coin

Cryptocurrency type (usually polygon_usdc or polygon_usdt).

txid_in

Transaction hash from payment provider to temporary wallet.

txid_out

Instant payout transaction hash to your merchant wallet.

address_in

Matches polygon_address_in from Step 1 for verification.

Example Callback

GET Request to Your Server
https://www.example.com/orders.php?number=827746841326&value_coin=105.6&coin=polygon_usdc&txid_in=0xa22a82b4aefbc55f6382e1b5c0b4f0e3c034a654df3bcac431f7fed1942e22bc&txid_out=0x94c2c3e84c2021e6bf377aebf8abf03b49570611bb0c336e357d7f4516f56244&address_in=0x32e854bD1270670C832634CA87858fFd9F3e2c78

Check Payment Status

GET
https://api.paylex.org/control/payment-status.php

What this does

Query payment status using the IPN token from Step 1. Useful for polling or verifying payment completion.

Request Parameters

ipn_tokenRequired

The IPN token received from Step 1 (wallet creation response).

Response Fields

status

Payment status: paid or unpaid.

value_coin

Amount of cryptocurrency sent (usually USDC).

txid_out

Payout transaction hash to your merchant wallet.

coin

Cryptocurrency type (usually polygon_usdc).

Example Request

GET Request
https://api.paylex.org/control/payment-status.php?ipn_token=aHR0cHM6Ly9wYW5lbC5ubHhzdHJlYW1lci5pbmZvL21vZHVsZXMvZ2F0ZXdheXMvY2FsbGJhY2svaGlnaHJpc2tzaG9wLnBocD9pbnZvaWNlX2lkPTEzNzI0Njk%3D