5-Minute Quickstart
Integrate Oxin Pay and create your first invoice in 5 minutes.
1. Get your API key
After signing up and verifying your email, your API key is automatically created and emailed to you. Log into your dashboard to view the key fingerprint and manage settings.
oxp_live_••••••••••••••••••••XXXX
Your key is shown only once at creation. Store it in your environment variables.
2. Create an invoice
cURL
curl -X POST https://pay.oxinchain.io/v1/invoices \
-H "Authorization: Bearer oxp_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"tokenId": 1,
"amountFiat": 50.00,
"fiatCurrency": "USD",
"description": "Order #1234",
"redirectUrl": "https://yoursite.com/success",
"cancelUrl": "https://yoursite.com/cancel"
}'3. Redirect customer to checkout
The response includes a checkoutUrl. Redirect your customer there.
{
"ok": true,
"data": {
"id": "clxyz...",
"publicId": "pub_abc123",
"checkoutUrl": "https://oxinpayments.com/checkout/pub_abc123",
"status": "pending",
"amountFiat": "50.00",
"fiatCurrency": "USD",
"expiresAt": "2026-06-21T12:00:00Z"
}
}4. Listen for webhooks
Register a webhook endpoint to receive real-time payment notifications. See the Webhooks guide for full details.
5. Handle payment confirmation
When you receive a webhook with event: "invoice.completed", the payment is confirmed. Fulfill the order and optionally redirect the customer.