Guide
Business Scenarios
Bybit Pay provides two main payment integration methods for merchants:
| Scenario | Description | Use Case |
|---|---|---|
| QR Payment | QR code based payment where users scan to pay | E-commerce checkout, retail POS, one-time payments |
| Recurring Payments | Pre-authorized automatic deduction payment | Subscriptions, ride-hailing, recurring payments, utility bills |
QR Payment Flow
User scans merchant's QR code and completes payment through Bybit App.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Merchant │ │ Bybit │ │ Bybit App │ │ User │
│ Server │ │ Platform │ │ │ │ │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │ │
│ 1. Create Payment │ │ │
│ ─────────────────→ │ │ │
│ │ │ │
│ 2. Return QR Code │ │ │
│ ←───────────────── │ │ │
│ │ │ │
│ Display QR │ │ 3. Scan QR │
│ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─ →│← ─ ─ ─ ─ ─ ─ ─ ─ │
│ │ │ │
│ │ │ 4. Confirm Payment │
│ │ │ ←─────────────────→│
│ │ │ │
│ │ 5. Deduct │ │
│ │ ←──────────────────│ │
│ │ │ │
│ 6. Webhook Notify │ │ │
│ ←───────────────── │ │ │
│ │ │ │
▼ ▼ ▼ ▼
Key Features:
- One-time payment authorization
- Real-time payment result notification
- Support for crypto and fiat currencies
- Refund capability
Recurring Payments Flow
User pre-authorizes merchant for automatic deductions without manual confirmation each time.
Sign Flow (One-time Setup)
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Merchant │ │ Bybit │ │ Bybit App │ │ User │
│ Server │ │ Platform │ │ │ │ │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │ │
│ 1. Sign Request │ │ │
│ ─────────────────→ │ │ │
│ │ │ │
│ 2. Return Sign URL │ │ │
│ ←───────────────── │ │ │
│ │ │ │
│ Display QR │ │ 3. Scan QR │
│ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─ →│← ─ ─ ─ ─ ─ ─ ─ ─ │
│ │ │ │
│ │ │ 4. Identity Verify │
│ │ │ ←─────────────────→│
│ │ │ │
│ │ │ 5. Confirm Sign │
│ │ │ ←─────────────────→│
│ │ │ │
│ 6. Sign Webhook │ │ │
│ (agreement_no) │ │ │
│ ←───────────────── │ │ │
│ │ │ │
▼ ▼ ▼ ▼
Deduction Flow (Automatic Payment)
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Merchant │ │ Bybit │ │ User │
│ Server │ │ Platform │ │ (Passive) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
│ 1. Deduction │ │
│ (agreement_no) │ │
│ ─────────────────→ │ │
│ │ │
│ │ 2. Verify: │
│ │ - Agreement valid │
│ │ - Limit check │
│ │ - Risk check │
│ │ - Balance check │
│ │ │
│ │ 3. Auto Deduct │
│ │ ──────────────────→│
│ │ │
│ 4. Result + Webhook│ │
│ ←───────────────── │ │
│ │ │
│ │ 5. Notification │
│ │ ──────────────────→│
│ │ │
▼ ▼ ▼
Key Features:
- Pre-authorized automatic payments
- No user confirmation required per transaction
- Single and period limit controls
- Support for subscriptions, ride-hailing, utilities
- Agreement lifecycle management (sign, suspend, resume, unsign)
Base URL
| Environment | Base URL |
|---|---|
| Testnet (Sandbox) | https://api2-testnet.bybit.com |
| Mainnet (Production) | https://api2.bybit.com |
Common Response Structure
{
"retCode": 100000,
"retMsg": "success",
"result": {
// Response data
}
}
| Field | Type | Description |
|---|---|---|
| retCode | number | Return code. 100000 indicates success |
| retMsg | string | Return message |
| result | object | Business data |
Getting Started
Choose the integration method based on your business needs:
- For one-time payments: Start with QR Payment Integration
- For recurring/automatic payments: Start with Recurring Payments Integration