Skip to content

Create Invoice Payment (Gen QRCode)

This method creates an invoice payment.

shell
POST: {{endpoint}}/v1/payment/createInvoicePayment

Headers

KeyTypeValueDescription
x-api-keystringkey_xxxxxxxxxxxxxxxxxxxxAPI Key string
x-signaturestringSHA256The HMAC SHA256 signature.
x-timestampstring1730998051892Timestamp of the request

Request Body

KeyTypeDescription
order_idstring(required) the order id
amountstring(required) the amount
from_fiat_currencystring(required) the from fiat currency
to_crypto_currencystring(required) the to crypto currency
chainstring(required) the chain-id
additional_dataobject(optional) additional data
discount_percentnumber(optional) the discount percent
url_returnstring(optional) the return url
url_successstring(optional) the success url
url_failedstring(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 transaction
  • seq_num: the sequence number of the transaction
  • order_id: the order id
  • chain: the chain-id
  • network: the network
  • from_fiat_currency: the from fiat currency
  • to_crypto_currency: the to crypto currency
  • amount: the amount
  • payment_amount: the payment amount
  • payer_paid_currency: the payer paid currency
  • payer_paid_amount: the payer paid amount
  • merchant_amount: the merchant amount
  • txid: the txid
  • address: the address
  • from_address: the from address
  • auto_convert: the auto convert
  • convert_to: the convert to
  • payment_url: the payment url
  • url_return: the return url
  • url_success: the success url
  • url_failed: the failed url
  • is_multiple_order: the is multiple order
  • lifetime: the lifetime
  • expired_at: the expired at
  • fee_subtract: the fee subtract
  • fee_percent: the fee percent
  • discount_percent: the discount percent
  • discount_amount: the discount amount
  • accuracy_percent: the accuracy percent
  • additional_data: the additional data
  • support_currencies: the support currencies
  • except_currencies: the except currencies
  • exchange_rate: the exchange rate
  • exchange_rate_source: the exchange rate source
  • payment_status: the payment status
  • payment_match_type: the payment match type
  • is_completed: the is completed
  • status: the status
  • created_at: the created at
  • owned_by_group: the owned by group
  • agent_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"
}