Create Invoice Payment (Gen QRCode)
This method creates an invoice payment.
shell
POST: {{endpoint}}/v1/payment/createInvoicePaymentHeaders
| Key | Type | Value | Description |
|---|---|---|---|
| x-api-key | string | key_xxxxxxxxxxxxxxxxxxxx | API Key string |
| x-signature | string | SHA256 | The HMAC SHA256 signature. |
| x-timestamp | string | 1730998051892 | Timestamp of the request |
Request Body
| Key | Type | Description |
|---|---|---|
| order_id | string | (required) the order id |
| amount | string | (required) the amount |
| from_fiat_currency | string | (required) the from fiat currency |
| to_crypto_currency | string | (required) the to crypto currency |
| chain | string | (required) the chain-id |
| additional_data | object | (optional) additional data |
| discount_percent | number | (optional) the discount percent |
| url_return | string | (optional) the return url |
| url_success | string | (optional) the success url |
| url_failed | string | (optional) the failed url |
Example Response
Success (HTTP 200)
JSON
// Body: raw (json)
{
"order_id": <randomInt>,
"amount": "10",
"from_fiat_currency": "USD",
"to_crypto_currency": "USDT",
"chain": "tron",
"additional_data": {},
"discount_percent": 0,
"url_return": "https://xpays.life/return",
"url_success": "https://xpays.life/success",
"url_failed": "https://xpays.life/failed"
}Response Parameters
Response status: 200 OK
id: the id of the transactionseq_num: the sequence number of the transactionorder_id: the order idchain: the chain-idnetwork: the networkfrom_fiat_currency: the from fiat currencyto_crypto_currency: the to crypto currencyamount: the amountpayment_amount: the payment amountpayer_paid_currency: the payer paid currencypayer_paid_amount: the payer paid amountmerchant_amount: the merchant amounttxid: the txidaddress: the addressfrom_address: the from addressauto_convert: the auto convertconvert_to: the convert topayment_url: the payment urlurl_return: the return urlurl_success: the success urlurl_failed: the failed urlis_multiple_order: the is multiple orderlifetime: the lifetimeexpired_at: the expired atfee_subtract: the fee subtractfee_percent: the fee percentdiscount_percent: the discount percentdiscount_amount: the discount amountaccuracy_percent: the accuracy percentadditional_data: the additional datasupport_currencies: the support currenciesexcept_currencies: the except currenciesexchange_rate: the exchange rateexchange_rate_source: the exchange rate sourcepayment_status: the payment statuspayment_match_type: the payment match typeis_completed: the is completedstatus: the statuscreated_at: the created atowned_by_group: the owned by groupagent_id: the agent id
Example Response
json
{
"data": {
"id": "74ec698a-d773-4b55-81ab-58192f6b560c",
"seq_num": 42,
"order_id": "1731785840",
"chain": "tron",
"network": "mainnet",
"from_fiat_currency": "USD",
"to_crypto_currency": "USDT",
"amount": "10",
"payment_amount": 9.99721717462727,
"payer_paid_currency": null,
"payer_paid_amount": null,
"merchant_amount": 0,
"txid": null,
"address": "TDtSWK3dsSRJyZH4qNVzsoPsdrZz6k8B3Q",
"from_address": null,
"auto_convert": false,
"convert_to": "USDT",
"payment_url": "https://xpays.life/pay/1731785840",
"url_return": "",
"url_success": "",
"url_failed": "",
"is_multiple_order": true,
"lifetime": 300,
"expired_at": "2024-11-16T20:00:04.971Z",
"fee_subtract": 0,
"fee_percent": 0.4,
"discount_percent": 0,
"discount_amount": 0,
"accuracy_percent": 0,
"additional_data": {},
"support_currencies": null,
"except_currencies": null,
"exchange_rate": null,
"exchange_rate_source": "COINGECKO",
"payment_status": "PAYMENT_CHECKING",
"payment_match_type": "EXACTLY",
"is_completed": false,
"status": "PENDING",
"created_at": "2024-11-16T19:55:04.998Z",
"owned_by_group": "8e393308-28a9-4a6e-a689-0d7760483c7e",
"agent_id": "aacc3472-f3c3-49bb-9040-d5a6aff283bf"
}
}json
{
"error": "Error message"
}json
{
"error": "Forbidden"
}