跳至主要内容

Create Payment

HTTP Request

POST /v5/bybitpay/create_pay

Request Parameters

ParameterRequiredTypeComments
merchantIdtruestringOnboarding merchant UID
merchantNamefalsestringIf not filled in, we will show users the name of your company doing KYB on the Bybit platform
clientIdfalsestringMerchant client ID
paymentTypetruestringPayment type
customerfalse<CustomerType>Customer info
merchantTradeNotruestringMerchant order number
quotationIdfalsestringReturn result quotationId to create order
goodstruearray<GoodType>Product description
orderAmounttruestringOrder amount
currencytruestringOrder currency (uppercase, e.g., EUR, USD, USDT)
currencyTypetruestringCurrency type (fiat or crypto)
successUrltruestringURL to return after successful payment (max 256 characters)
failedUrltruestringURL to return after failed payment (max 256 characters)
webhookUrltruestringAPI URL to call when order is successful or failed (max 256 characters)
orderExpireTimefalseint64Order expiration time in UTC timestamp (second precision), default is 1 hour, max is 1 hour
envtrue<EnvType>Transaction source
riskInfofalse<RiskInfoType>Risk info for order pay
remarkfalsestringPayment remark, max 50 characters

Response Parameters

ParameterTypeComments
payIdstringPay-order ID created successfully
terminalTypestringTransaction source (APP, WEB, WAP, MINIAPP, OTHERS)
expireTimenumberOrder expiration time in UTC timestamp (second precision)
checkoutLinkstringUnified checkout link in Bybit, redirect for payment
qrContentstringQR code content (base64 Image, valid for 1 hour), developers generate QR image
order<PayOrderType>Bybit pay order detail
customer<CustomerType>Customer info

Request Example

POST /v5/bybitpay/create_pay HTTP/1.1
Host: api2.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1736233200000
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"merchantId": "305142568",
"merchantName": "Digital Store",
"clientId": "client_001",
"paymentType": "E_COMMERCE",
"merchantTradeNo": "af8c2d1-5b3e-4a9f-b6c7-8d2e1f3a4b5c",
"orderAmount": "100",
"currency": "USDT",
"currencyType": "crypto",
"successUrl": "https://www.merchant.com/success",
"failedUrl": "https://www.merchant.com/failed",
"webhookUrl": "https://www.merchant.com/webhook/bybitpay",
"orderExpireTime": 1736236800,
"remark": "Order for digital goods",
"customer": {
"externalUserId": "user123@merchant.com",
"userName": "John Doe",
"registerTime": 1704067200,
"kycCountry": "USA",
"remarks": "VIP customer"
},
"goods": [
{
"shoppingName": "Digital Store",
"mccCode": "5816",
"goodsName": "Premium Subscription",
"goodsDetail": "Monthly subscription for premium features"
}
],
"env": {
"terminalType": "WEB",
"device": "Mozilla/5.0 compatible browser",
"browserVersion": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
"ip": "192.168.1.100"
},
"riskInfo": {
"terminalType": "WEB"
}
}

Response Example

{
"retCode": 100000,
"retMsg": "success",
"result": {
"payId": "01JY2KM5QNPXR8S4HTJZT9BC12",
"terminalType": "WEB",
"expireTime": 1736236800,
"checkoutLink": "bybitapp://open/route?targetUrl=by-mini%3A%2F%2Fpay%2FscanResult%3ForderNo%3D01JY2KM5QNPXR8S4HTJZT9BC12",
"qrContent": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAIAAAAP3aGbAAC...",
"order": {
"merchantId": "305142568",
"clientId": "client_001",
"paymentType": "E_COMMERCE",
"merchantTradeNo": "af8c2d1-5b3e-4a9f-b6c7-8d2e1f3a4b5c",
"payId": "01JY2KM5QNPXR8S4HTJZT9BC12",
"status": "INIT",
"amount": "100",
"currency": "USDT",
"currencyType": "crypto",
"createTime": 1736233200,
"paymentTime": 0,
"finishTime": 0,
"refundOrders": [],
"remark": "Order for digital goods"
},
"customer": {
"uid": "104326789",
"externalUserId": "user123@merchant.com",
"userName": "John Doe",
"registerTime": 1704067200,
"kycCountry": "USA",
"remarks": "VIP customer"
}
}
}