IPN - Invoice

IPNs (Instant Payment Notifications) are sent to the notify_url provided by merchants when creating the invoice, when invoice status is changed to paid, confirmed and complete.

🚧

1.Notification sent by gateway is in POST Method.
2.Body is a JSON-formatted string (content-Type: application/json)

Invoice Status Change Process

Invoice is paid in full

IndexEventStatuserror_statusDescription
1invoice_createdNewNoneInvoice is created
2invoice_paidInFullPaidNoneBuyer make the payment
3invoice_confirmedConfirmedNonePayment is confirmed by some blocks
4invoice_completedCompleteNonePayment is completed

Invoice is expired without payment

IndexEventStatuserror_statusDescription
1invoice_createdNewNoneInvoice is created
2invoice_expiredExpiredNoneInvoice is expired

Invoice is over paid

IndexEventStatuserror_statusDescription
1invoice_createdNewNoneInvoice is created
2invoice_paidInFullPaidPaidOverBuyer make the payment(OverPay)
3invoice_confirmedConfirmedPaidOverPayment is confirmed by some blocks
4invoice_completedCompletePaidOverPayment is completed

Invoice is partial paid

IndexEventStatuserror_statusDescription
1invoice_createdNewNoneInvoice is created
2invoice_expiredExpiredPaidPartialPayment expired with PaidPartial

Example

{
  "ipn_type": "invoice",
  "event": "invoice_created",
  "app_id": "de5076a5-71aa-4a4a-a35f-bdb424af5658",
  "invoice_id": "XjwyQQanwVVUtJXVMGXtCe",
  "order_id": "#0001",
  "price_amount": 10,
  "price_currency": "USD",
  "network": null,
  "address": null,
  "pay_currency": "USDT",
  "pay_amount": 0,
  "exchange_rate": 0,
  "paid_amount": 0,
  "confirmed_amount": 0,
  "refunded_price_amount": 0,
  "create_time": "2023-05-05T03:54:29.5708901Z",
  "expiration_time": "2023-05-05T15:54:29.5708934Z",
  "status": "New",
  "error_status": "None",
  "ext_args": null,
  "transactions": null,
  "notify_id": "714c8f9e-b06d-49b9-9ebc-203f7cadcaa0",
  "notify_time": "2023-05-05T03:55:49.1566646Z"
}

Description

Field NameTypeDescription
ipn_typestringThe type of IPN; 'invoice' specifies it is for invoice notifications.
eventstringThe specific event type associated with the invoice.
app_idstringThe unique identifier for the Merchant's Payment Application.
invoice_idstringThe unique identifier for the UniPayment Invoice.
price_amountfloatThe original amount requested in the transaction, matching the request.
price_currencystringThe currency of the price_amount, identical to that specified in the request.
pay_amountfloatThe actual amount in cryptocurrency that the buyer is expected to pay.
pay_currencystringThe type of cryptocurrency the buyer will use for the payment.
networkstringThe blockchain network from which the payment will be sent by the buyer.
addressaddressThe cryptocurrency address to which the payment should be sent.
exchange_ratefloatThe rate at which the pay_currency is converted to the price_currency.
paid_amountfloatThe amount of cryptocurrency, as defined by pay_currency, that the buyer has paid.
confirmed_amountfloatThe amount of cryptocurrency, as defined by pay_currency, confirmed by the blockchain network.
refunded_price_amountfloatThe amount refunded to the customer by the merchant, if applicable.
create_timedatetimeThe timestamp marking the creation of the invoice.
expiration_timedatetimeThe timestamp after which the invoice will no longer be valid.
statusstringThe current status of the invoice. See InvoiceStatus
error_statusstringDescribes any errors related to the invoice. See InvoiceErrorStatus
notify_idstringA unique identifier for the notification related to this invoice.
notify_timedatetimeThe timestamp when the notification was sent.