Create an invoice
How dynamic USD amounts work — one API call per checkout with that order's total.
Who calls this API?
Your server (the Ulasend merchant). Not the end buyer. The buyer never calls /api/v1/invoices — they only open the hosted checkout_url.
Dynamic amounts: create a new invoice each time
There is no shared invoice that updates when cart totals change. When Buyer A checks out for $19.99 and Buyer B for $149.00, your backend makes two create calls:
# Buyer A's order
curl -X POST https://ulasend.com/api/v1/invoices \
-H "Authorization: Bearer $ULASEND_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-A" \
-d '{"usd_amount":"19.99","external_reference":"order-A","customer_email":"a@example.com"}'
# Buyer B's order
curl -X POST https://ulasend.com/api/v1/invoices \
-H "Authorization: Bearer $ULASEND_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-B" \
-d '{"usd_amount":"149.00","external_reference":"order-B","customer_email":"b@example.com"}'Ulasend converts that USD figure to crypto at the live market price when the invoice is created (and again if the buyer switches coins).
| Field | Meaning |
|---|---|
usd_amount | Dollar total for this order (e.g. "49.99") |
amount | Fixed coin amount instead of USD — don't combine with asset selection |
asset | Starting coin — must be enabled under Settings → Accepted coins. Buyer may change it if you allow selection. |
Recommended payload
{
"usd_amount": "49.99",
"asset": "USDC_BASE",
"customer_email": "buyer@example.com",
"external_reference": "order-12345",
"allow_asset_selection": true,
"metadata": { "user_id": "usr_abc" }
}Use checkout_url from the response to send the buyer to pay. Store id against your order for reconciliation.
Card purchases on hosted checkout default to USDC unless the buyer picks another coin first — see Buy with card.