Skip to content

Cancel Payment

This method cancels a payment.

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

Headers

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

Request Body

KeyTypeDescription
idstring(required) the id of the payment

Example Response

Success (HTTP 200)

JSON
// Body: raw (json)
{
  "id": "115bd219-28a1-4c26-87e8-41d1e611a262"
}

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": "25e2c615-c90c-4868-b24d-0c1e3b81f92e",
    "seq_num": 43,
    "order_id": "391",
    "chain": "tron",
    "network": "testnet",
    "from_fiat_currency": "USD",
    "to_crypto_currency": "USDT",
    "amount": "2",
    "payment_amount": 2.006488233020612,
    "payer_paid_currency": null,
    "payer_paid_amount": null,
    "merchant_amount": 0,
    "txid": null,
    "address": "TZAiamSzmrrTz5RnP8D8B96XAR2GsUvtw1",
    "from_address": null,
    "auto_convert": false,
    "convert_to": "USDT",
    "payment_url": "https://xpays.life/pay/25e2c615-c90c-4868-b24d-0c1e3b81f92e",
    "url_return": "https://xpays.life/return",
    "url_success": "https://xpays.life/success",
    "url_failed": "https://xpays.life/failed",
    "is_multiple_order": true,
    "lifetime": 900,
    "expired_at": "2024-11-25T06:53:21.256Z",
    "fee_subtract": 0,
    "fee_percent": 0.4,
    "discount_percent": 0,
    "discount_amount": 0,
    "accuracy_percent": 0.5,
    "additional_data": {},
    "support_currencies": null,
    "except_currencies": null,
    "exchange_rate": 0.9967663737499999,
    "exchange_rate_source": "COINGECKO",
    "payment_status": "PAYMENT_CANCELED",
    "payment_match_type": "EXACTLY",
    "is_completed": true,
    "status": "CANCELED",
    "created_at": "2024-11-25T06:38:21.260Z",
    "owned_by_group": "8e393308-28a9-4a6e-a689-0d7760483c7e",
    "agent_id": "aacc3472-f3c3-49bb-9040-d5a6aff283bf"
  }
}
json
{
  "error": "Error message"
}
json
{
  "error": "Forbidden"
}