QR Payment Introduction
Version History
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2025-02-10 | Initial release |
| 5.0 | 2025-02-17 | |
| 5.0 | 2025-03-03 | clientId to optional when initiating refund or querying order statusgoods into PayOrder structurecustomer from PayOrder structureorderAmount to amount for all PayOrder typesmerchantRefundNo when creating a refund order50000 (Bybit internal error), 400004 (Order not found), 500105 (Order not paid)regionTime to registerTime in Customer type |
| 5.0 | 2025-03-31 | |
| 5.0 | 2025-04-16 | |
| 5.0 | 2025-05-09 | |
| 5.0 | 2025-05-13 | /v5/bybitpay/pay-status/mock to /v5/bybitpay/paystatus/mock |
| 5.0 | 2025-05-21 | |
| 5.0 | 2025-05-27 | BYBIT_PAY_MERCHANT_PAYOUT to MERCHANT_PAYOUT |
| 5.0 | 2025-05-28 | /v5/bybitpay/pay_result API and Payment Notify |
| 5.0 | 2025-06-01 | |
| 5.0 | 2025-06-30 | |
| 5.01 | 2025-07-04 | |
| 5.01 | 2025-07-04 | |
| 5.01 | 2025-09-03 | |
| 5.01 | 2025-09-09 | remarks field in /v5/bybitpay/create_pay and /v5/bybitpay/pay_result APIs |
Overview
QR Payment is a one-time payment method where users scan a merchant-generated QR code to complete payment through the Bybit App.
Applicable Scenarios:
- E-commerce checkout
- Retail POS systems
- One-time service payments
- Event ticket purchases
Payment Flow
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Merchant │ │ Bybit │ │ Bybit App │ │ User │
│ Server │ │ Platform │ │ │ │ │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │ │
│ 1. Create Payment │ │ │
│ ─────────────────→ │ │ │
│ │ │ │
│ 2. Return QR Code │ │ │
│ & Pay URL │ │ │
│ ←───────────────── │ │ │
│ │ │ │
│ Display QR Code │ │ │
│ to User │ │ 3. Scan QR │
│ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─ →│← ─ ─ ─ ─ ─ ─ ─ ─ │
│ │ │ │
│ │ │ 4. Confirm Payment │
│ │ │ & Enter PIN │
│ │ │ ←─────────────────→│
│ │ │ │
│ │ 5. Process │ │
│ │ Payment │ │
│ │ ←──────────────────│ │
│ │ │ │
│ 6. Webhook Notify │ │ 7. Show Result │
│ Payment Result │ │ ──────────────────→│
│ ←───────────────── │ │ │
│ │ │ │
▼ ▼ ▼ ▼
API List
| API Name | Method | Endpoint | Description |
|---|---|---|---|
| Create Payment | POST | /v5/bybitpay/create_pay | Create payment order, get QR code |
| Get Payment Result | GET | /v5/bybitpay/pay_result | Query payment status |
| Payment Notify | POST | Webhook URL | Receive payment result callback |
| Payment FxConvert | POST | /v5/bybitpay/fx/convert | Get exchange rate quotation |
| Payment Status Mock | POST | /v5/bybitpay/paystatus/mock | Mock payment status (sandbox only) |
Order Status Flow
┌──────────┐ ┌───────────────┐ ┌───────────────┐
│ INIT │────→│ PAY_SUCCESS │────→│ REFUND_SUCCESS│
│ (Created)│ │ (Paid) │ │ (Refunded) │
└────┬─────┘ └───────────────┘ └───────────────┘
│
│ Timeout/Failed
▼
┌───────────────┐
│ TIMEOUT/FAILED│
│ │
└───────────────┘
| Status | Description |
|---|---|
INIT | Order created, waiting for payment |
PAY_SUCCESS | Payment completed successfully |
PAY_FAILED | Payment failed |
TIMEOUT | Order expired (not paid in time) |
REFUND_SUCCESS | Refund completed |
REFUND_FAILED | Refund failed |
Quick Start
Step 1: Create Payment
POST /v5/bybitpay/create_pay
{
"merchantId": "305142568",
"clientId": "client_001",
"paymentType": "E_COMMERCE",
"merchantTradeNo": "ORDER-2026-0001",
"orderAmount": "100",
"currency": "USDT",
"webhookUrl": "https://merchant.com/webhook",
"expireTime": 1800
}
Step 2: Display QR Code
Display the returned qrCodeUrl or payUrl to the user.
Step 3: Handle Webhook
Receive payment result notification at your webhook URL:
{
"paymentType": "E_COMMERCE",
"merchantId": "305142568",
"merchantTradeNo": "ORDER-2026-0001",
"payId": "01JY2KM5QNPXR8S4HTJZT9BC12",
"status": "PAY_SUCCESS",
"amount": "100",
"currency": "USDT"
}
Related APIs
- Refund - Process refunds for completed payments
- Payout - Send payouts to Bybit users
- Settlement - Query settlement records