Skip to main content

Payments Results

MixPay API for getting a payment results.

GET /payments_result

Get payment results.


For security best practice, you should not trust the client side application for getting the payment result. Always make sure to call this API in your server side, to make sure the payment result is 100% correct.

Endpoint URL


traceId*required if no orderIdStringTrace Id of payments.
orderId*required if no traceIdStringUnique in your system. String lengths between 6-36 must be letters, numbers, dashes and underscores and NOT space.
payeeId*required if has orderIdStringAccount ID for receiving crypto, pls see Five types of account and How to get payeeId.
with=paymentoptionalStringReturn with the relative payment object.
with=transactionsoptionalStringReturn with the relative transaction objects.

If you just want to check if the payment is paid or not, Normally, you don't need the with parameter, checking the data.status is success is enough. The with parameter only if you need extra info about the payment.

If you want transactions and payment, you can pass it like with=payment,transactions in the URI.

Example request - GET payment results.

curl -i -X GET -G \
-d "traceId"="a0d7791408776b47eb1dd3f94ed15d6a"
// title: Response
"code": 0,
"success": true,
"message": "",
"data": {
// `unpaid`, `pending`(processing), `failed`, `auditing` and `success`
"status": "success",
"quoteAmount": "0.01",
"quoteSymbol": "USD",
// If is USDT, then should be:
// "quoteAssetId": "a1283b13-d483-4262-90dd-3b1b324a81fb",
"quoteAssetId": "usd",
"quoteAssetVersion": "",

"paymentAmount": "0.010013",
"paymentSymbol": "USDT",
"paymentAssetId": "4d8c508b-91c5-375b-92b0-ee702ed2dac5",
"paymentAssetVersion": "ERC20",

"payee": "payee_username",
"payeeId": "xxxxx-xxx-xxx-xxx-xxxxxxx",
"payeeMixinNumber": "38xxxxx08",
"payeeAvatarUrl": "",
// On-chain transaction ID, only when on-chain payment
"txid": "",
"blockExplorerUrl": "",
"date": 1656513302,
// when the payer pays more than he/her should
// pay, here is the surplus amount
"surplusAmount": "0",
// surplus refund status.
// `no` - no refund needed;
// `pending` - not refund yet;
// `sending` - refund is processing;
// `success` - done refund.
"surplusStatus": "no",
// On-chain transfer confirmations count.
// Only when `status` is `pending`, `confirmations` will be greater than -1.
"confirmations": -1,
// amount should pay
"payableAmount": "0.010013",
"payableSymbol": "USDT",
"payableAssetId": "4d8c508b-91c5-375b-92b0-ee702ed2dac5",
"payableAssetVersion": "ERC20",
// see the "Checking for failure" section
"failureCode": "0",
"failureReason": "",
// If status is `success`, will return `returnTo` when
// you create a payment, failed will return `failedReturnTo`'s value.
"returnTo": "",
"traceId": "a0d7791408776b47eb1dd3f94ed15d6a",

// settle status
// pending - to be settled
// success - settlement completed
"settleStatus": "success",
// when settleStatus is pending, the following fields are empty characters.
"settleAmount": "0.00003",
"settleSymbol": "BTC",
"settleAsset": "c6d0c728-2624-429b-8e0d-d9d19b6592fa",
"settleAssetVersion": "",

// if `with=transactions` presented

// if `with=payment` presented

"timestampMs": 1656561881048

This response status returns unpaid, pending(processing), failed, auditing and success.

Checking for success payment

Besides checking the response data.status is equal to success, you MUST check the following fileds matching your order:

payeeId —— Does this payment result belong to you?
quoteAmount —— The amount you want user to pay;
quoteAssetId —— Currency of your choice.

Here is the example code in PHP:

// Get the order from database
$order = Order::find($order_id);

// Get the payment result from MixPay `payments_result` API
$payment_result = getMixPayResult($order->id)

if ($payment_result["success"]) {

// Handle `status` equal to `success`
if ($payment_result["data"]["status"] == "success") {

// 1. checking the payeeId is correct
if ($payment_result["data"]["payeeId"] != $__my_payeeId__) {
throw new Exception('Wrong payeeId!');

// 2. checking the payment amount is correct
if ($payment_result["data"]["quoteAmount"] != $order->amountShouldPay) {
throw new Exception('Wrong amount!');

// 3. checking the currency
if ($payment_result["data"]["quoteAssetId"] != $order->paymentAssetId) {
throw new Exception('Wrong currency!');

// ... now is safe to mark your order as paid, an do other logic ...

// handle other `status` - `unpaid`, `pending`(processing), `failed`

Security note: You have to check payeeId, quoteAssetId and quoteAmount to make sure a payment is paid successfully.

Please checkout the Security Guidelines.

Checking for failure

You can use the failureCode and failureReason to check the result, their possible values are:

'40000' => 'Payment overtime',
'40020' => 'Wrong asset paid',
'40021' => 'Double payment',
'40024' => 'Wrong Amount paid',
'40025' => 'Too much market volatility.',