Create an invoice
GET/api/v1/invoices/new
Creates a payment request and returns the link of the hosted payment page. Price it in fiat (the customer picks the coin) or in one coin.
| Parameter | Description |
|---|---|
| api_key* | Your store's secret key (Stores & API → API). Keep it on your server. |
| order_number* | Your order id. Unique per store; repeating it is refused unless return_existing=1. |
| order_name* | What the customer pays for, shown on the payment page. |
| source_currency + source_amount | Fiat price, e.g. USD and 49.99. Converted at the current rate. |
| currency + amount | Or a crypto price in one coin, e.g. BTC and 0.001. currency alone fixes the coin of a fiat invoice. |
| allowed_psys_cids | Comma list of coins the customer may choose, e.g. BTC,USDT_TRX. Coins whose minimum the order does not reach are left out. |
| callback_url | Where status changes are POSTed (default: the store's Status URL). Add ?json=true for a JSON body. |
| success_callback_url / fail_callback_url | Extra callbacks for paid and failed invoices. |
| success_invoice_url / fail_invoice_url | Where the payment page's "Back to store" button goes. |
| Customer email: the payment link and receipt are sent there. | |
| description | Shown under the order name. |
| expire_min | Minutes before the invoice expires (default: the store's setting, else 60). |
| return_existing | 1 = an existing order_number returns that invoice instead of an error. |
curl -G "https://api.aywapay.com/api/v1/invoices/new" \
-d source_currency=USD -d source_amount=49.99 \
-d order_number=1042 --data-urlencode "order_name=Pro plan" \
--data-urlencode "callback_url=https://yourshop.com/callback?json=true" \
-d api_key=$AYWAPAY_SECRET_KEY{
"txn_id": "65f1c0ffee00000000000001",
"invoice_url": "https://pay.aywapay.com/invoice/65f1c0ffee00000000000001",
"invoice_total_sum": "0.5512"
}