payment_url you send the buyer to.external_reference so webhooks can map back to the order.webhook_url (HTTPS in production). Without it you will not get events.success_url / cancel_url if you want the hosted page to send the buyerinvoice.id on the order before redirecting. This POST is notpayment_url and invoice.status of pending.invoice.amount is a string ("100.00"), even though you sent a number.provider or sender identity. The buyer picks the railaccount_not_ready — dashboard setup incomplete.errors.amount — below 20, above 70000, or more than 2 decimals.No active payment numbers configured — add VF/InstaPay in the dashboard.invalid_fees — customer-pays-fee flags are not viable for this merchant.status = active and at least one active payment number.curl --location '/api/v1/invoices' \
--header 'X-API-Key: <api-key>' \
--header 'X-API-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 100,
"currency": "EGP",
"customer_name": "Ahmed Ali",
"customer_email": "customer@example.com",
"customer_phone": "01012345678",
"customer_metadata": {
"order_id": "1001"
},
"external_reference": "ORD-1001",
"success_url": "https://merchant.example/orders/1001/success",
"cancel_url": "https://merchant.example/orders/1001/cancel",
"webhook_url": "https://merchant.example/webhooks/autopay",
"expires_in_hours": 48
}'{
"invoice": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"amount": "100.00",
"currency": "EGP",
"status": "pending",
"customer_email": "customer@example.com",
"customer_name": "Ahmed Ali",
"customer_phone": "01012345678",
"customer_metadata": {
"order_id": "1001"
},
"external_reference": "ORD-1001",
"success_url": "https://merchant.example/orders/1001/success",
"cancel_url": "https://merchant.example/orders/1001/cancel",
"webhook_url": "https://merchant.example/webhooks/autopay",
"expires_at": "2026-08-19T10:00:00+00:00",
"completed_at": null,
"cancelled_at": null,
"created_at": "2026-08-17T10:00:00+00:00",
"updated_at": "2026-08-17T10:00:00+00:00"
},
"payment_url": "https://autopayeg.com/payment/7c9e6679-7425-40de-944b-e07fc1f90ae7"
}