Skip to content

Quickstart

From zero to a paid invoice.

1. Get your token

Open the U Xa app, sign in, then go to Settings › Accept crypto payments. Switch on the payment methods you want and tap Create API token. Copy it and keep it on your server only.

2. Create an invoice

curl https://uxa.world/api/v1/invoices \
  -H "Authorization: Bearer uxa_live_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "25.00",
    "currency": "USD",
    "order_id": "1042",
    "description": "2 x Ethiopia Guji",
    "success_url": "https://shop.example/thanks",
    "cancel_url": "https://shop.example/cart"
  }'

The response contains the invoice id and a checkout_url:

{
  "id": "inv_7fK2mQ9xYp3RtB8wLs4N",
  "status": "pending",
  "amount": "25",
  "currency": "USD",
  "checkout_url": "https://uxa.world/pay/inv_7fK2mQ9xYp3RtB8wLs4N",
  "expires_at": "2026-10-22T15:30:00Z"
}

3. Redirect your customer

Send the customer's browser to checkout_url. The hosted checkout handles coin choice, live conversion, QR code, countdown and status updates.

4. Fulfil the order

Set a webhook URL in the app (or pass webhook_url per invoice). When you receive invoice.paid, verify the signature and ship. You can also poll:

curl https://uxa.world/api/v1/invoices/inv_7fK2mQ9xYp3RtB8wLs4N \
  -H "Authorization: Bearer uxa_live_YOUR_TOKEN"

PHP example

$ch = curl_init('https://uxa.world/api/v1/invoices');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('UXA_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'amount' => '25.00',
        'currency' => 'USD',
        'order_id' => (string) $order->id,
        'success_url' => 'https://shop.example/thanks',
    ]),
]);
$invoice = json_decode(curl_exec($ch), true);
header('Location: ' . $invoice['checkout_url']);

Node.js example

const res = await fetch('https://uxa.world/api/v1/invoices', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.UXA_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ amount: '25.00', currency: 'USD', order_id: '1042' }),
});
const invoice = await res.json();
response.redirect(invoice.checkout_url);