Skip to content

Create and Track Invoice

This guide walks through the full payment lifecycle: creating an invoice, sending the payment url to a customer, and confirming payment


  1. Create an invoice: your backend calls /invoice/create and receives a pay_url.
  2. Send the link: redirect the customer or embed the URL in your UI.
  3. Customer pays: they choose a cryptocurrency and network, then send the exact amount.
  4. Confirm payment: check is_paid via /invoice/info or receive a webhook notification.

See the endpoint for the full list of parameters

Terminal window
curl --request POST \
--url https://api.cru.cash/v1/invoice/create \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"amount": "100",
"currency": "USD",
"lifetime": 30,
"webhook": "https://example.com/webhook",
"payload": "{\"order_id\": \"A-1042\"}",
"ui": {
"description": "Payment for order #1042",
"redirect_url": "https://example.com/payment-success"
}
}'

Response example

{
"invoice": {
"id": "179a4662-a6e0-4129-aeba-04c4c2a8f074",
"expires_at": 1773689470
},
"pay_url": "https://pay.cru.cash/invoice/179a4662-a6e0-4129-aeba-04c4c2a8f074",
"test_mode": false
}

Send the pay_url to the customer so they can open the payment page.


Once you have an invoice id, poll /invoice/info or wait for a webhook. See the endpoint for all response fields.

Terminal window
curl --request POST \
--url https://api.cru.cash/v1/invoice/info \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"invoice_id": "YOUR_INVOICE_ID"
}'

Response example

{
"id": "179a4662-a6e0-4129-aeba-04c4c2a8f074",
"fiat_amount": "30",
"fiat_currency": "USD",
"crypto_amount": "0",
"network_fee": "0",
"crypto": "NONE",
"network": "NONE",
"pay_status": "not_paid",
"processing_status": "pending",
"is_paid": false,
"created_at": "2026-03-16T19:01:11Z",
"is_testing": false,
"payload": ""
}


A complete example. create an invoice and poll until it’s paid

Terminal window
RESPONSE=$(curl --silent --request POST \
--url https://api.cru.cash/v1/invoice/create \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"amount": "100",
"currency": "USD",
"lifetime": 30,
"webhook": "https://example.com/webhook",
"payload": "{\"order_id\": \"A-1042\"}",
"ui": {
"description": "Payment for order #1042",
"redirect_url": "https://example.com/payment-success"
}
}')
INVOICE_ID=$(echo $RESPONSE | grep -o '"id":"[^"]*"' | head -1 | cut -d'"' -f4)
PAY_URL=$(echo $RESPONSE | grep -o '"pay_url":"[^"]*"' | cut -d'"' -f4)
echo "Pay URL: $PAY_URL"
while true; do
INFO=$(curl --silent --request POST \
--url https://api.cru.cash/v1/invoice/info \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data "{\"invoice_id\": \"$INVOICE_ID\"}")
IS_PAID=$(echo $INFO | grep -o '"is_paid":[^,}]*' | cut -d':' -f2)
PAY_STATUS=$(echo $INFO | grep -o '"pay_status":"[^"]*"' | cut -d'"' -f4)
if [ "$IS_PAID" = "true" ]; then
echo "Payment confirmed"
break
fi
if [ "$PAY_STATUS" = "end" ]; then
echo "Invoice expired"
exit 1
fi
sleep 5
done
EndpointDescription
/invoice/createCreate a new invoice and get a payment URL
/invoice/infoGet invoice details and payment status