Using Short Link
MixPay API for creating a one-time payment.
POST /one_time_payment
This payment method needs to request the API to generate a code before it can be used, and is suitable for scenarios where only one payment is allowed.
This is the recommended way to use in production. Please checkout the Security Guidelines.
Endpoint URL
https://api.mixpay.me/v1/one_time_payment
Parameters
Param | Optional | Type | Description |
---|---|---|---|
payeeId | *required | String | Account ID for receiving crypto, pls see Five types of account and How to get payeeId. |
quoteAmount | *required | Numeric | Corresponding to the amount of quoteAssetId . For example, the current commodity value is 10 USDT |
quoteAssetId | *required | String | assetId of quote cryptocurrency. You can see the supported asset id in Quote Assets. |
settlementAssetId | *required | String | assetId of settlement cryptocurrency. Settlement assets you prefer. But you need to pay attention to the strictMode field. For more options, see here. |
strictMode | optional | Boolean | Default false . true means that the payment must be settled strictly according to the currency set by settlementAssetId. See here for more details. |
paymentAssetId | optional | String | assetId of payment cryptocurrency. You can see the supported asset id in Payment Assets. |
remark | optional | String | maximum 50. Payment remark viewable by the payee. |
orderId | *required if no traceId | String | Your internal order identifier that must be unique in your system. String lengths between 6-36 characters, containing only letters, numbers, dashes and underscores (no spaces allowed). Combined with payeeId , it ensures each payment is unique and can be used to query payment status. |
traceId | *required if no orderId | String | A UUID format identifier used to track payment lifecycle. It helps prevent duplicate payments and allows you to query payment status. If provided, this becomes the primary reference for the payment. Recommended for scenarios where you do not have an orderId in your system. This traceId usually can be generated by an UUID generator like uuidjs/uuid library in JavaScript. |
settlementMemo | optional | String | maximum 200. A memo is similar to Mixin Snapshots, this parameter you can customize. |
returnTo | optional | String | After successful payment, the URL page will want to redirect to. Useful when you are in a browser JavaScript environment. |
failedReturnTo | optional | String | After payment failure, the URL page will want to redirect to. Useful when you are in a browser JavaScript environment. |
callbackUrl | optional | String | After payment successfully, MixPay will issue a POST request to this URL on our server-side. For security reasons, URLs only support HTTPS and has to be URL encoded. Please refer to Payment Callback. |
callbackEvent | optional | String | Send settle or pending to subscribe more callback event. Please refer to Payment Callback. |
expiredTimestamp | optional | int | Set a expired timestamp. This value must be greater than 10s and less than 2880min. After this period, the payment result status field will be marked as failed , and the failureReason will be Payment overtime . If you are not setting this value, the payer can have unlimited time to complete this payment. |
Example request - One-Time Payment
curl -i -X POST https://api.mixpay.me/v1/one_time_payment \
-d "payeeId"="8e69e534-d0c4-3e04-8b61-37a73cd9e7d7" \
-d "settlementAssetId"="c6d0c728-2624-429b-8e0d-d9d19b6592fa" \
-d "quoteAssetId"="usd" \
-d "quoteAmount"="10" \
-d "isTemp"="1"
// title: Response
{
"code": 0,
"success": true,
"message": "",
"data": {
"code": "525502dd-e552-4505-b114-32fe32ff23c2"
},
"timestampMs": 1645411665245
}
info
This interface response is a short code; you can access it by https://mixpay.me/code/525502dd-e552-4505-b114-32fe32ff23c2
.