Skip to main content

Sign Request API

HTTP Request

POST /v5/bybitpay/agreement/sign

Create a sign request to initiate the agreement signing process. Returns a QR code and URL for the user to scan and complete authorization.


Request Parameters

ParameterTypeRequiredDescription
merchant_idstringYesMerchant ID
agreement_typestringYesSign type: CYCLE (periodic deduction) / NON_CYCLE (non-periodic deduction) / SINGLE (single authorization)
scene_codestringYesScene code - Supports 17 scenarios including TAXI, PARKING, SUBSCRIPTION, FOOD, ENTERTAINMENT, EDUCATION, etc.
product_codestringYesProduct code (assigned by platform)
external_agreement_nostringYesMerchant agreement number (unique)
notify_urlstringYesSign result webhook URL
merchant_user_idstringNoMerchant-side user ID (optional, used for merchant internal user association. If not provided, agreement will only be bound to platform userId)
sign_valid_timestringNoSign validity period (ISO8601 format, must be at least 24 hours after current time)
single_limitobjectNoSingle transaction limit
single_limit.amountstringConditionalLimit amount (required if single_limit provided)
single_limit.currencystringConditionalCurrency code
single_limit.currency_typestringConditionalFIAT or CRYPTO
single_limit.chainstringNoChain network (for crypto, e.g., ERC20, TRC20)
single_limit.chain_addressstringNoChain address (required for dynamic on-chain settlement)
period_limitsarrayNoPeriod limit configuration list
period_limits[].period_typestringConditionalDAY / WEEK / MONTH / YEAR
period_limits[].amountstringConditionalPeriod limit amount
period_limits[].currencystringConditionalCurrency code
period_limits[].currency_typestringConditionalFIAT or CRYPTO
period_limits[].chainstringNoChain network
period_limits[].chain_addressstringNoChain address (required for dynamic on-chain settlement)
return_urlstringNoRedirect URL after sign completion
sign_expire_minutesintNoSign link validity (minutes), default 30, max 1440
extra_paramsstringNoExtension parameters (JSON string, passed through)

Response Parameters

ParameterTypeDescription
retCodeintResponse code
retMsgstringResponse message
resultobjectResponse data
result.sign_order_idstringPlatform sign order number
result.sign_urlstringSign page URL (for H5 redirect)
result.qr_codestringSign QR code content (for App scan)
result.qr_code_urlstringSign QR code image URL
result.expire_timestringSign link expiration time

Request Example

Basic Sign Request

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

{
"merchant_id": "M123456789",
"agreement_type": "CYCLE",
"merchant_user_id": "merchant_user_123",
"scene_code": "SUBSCRIPTION",
"external_agreement_no": "MERCHANT_AGR_001",
"notify_url": "https://merchant.com/notify/sign"
}

Sign Request with Limits

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

{
"merchant_id": "M123456789",
"agreement_type": "CYCLE",
"merchant_user_id": "merchant_user_123",
"scene_code": "SUBSCRIPTION",
"product_code": "PROD_001",
"external_agreement_no": "MERCHANT_AGR_002",
"sign_valid_time": "2027-12-31T23:59:59Z",
"single_limit": {
"amount": "100000",
"currency": "USDT",
"currency_type": "CRYPTO",
"chain": "TRC20"
},
"period_limits": [
{
"period_type": "DAY",
"amount": "500000",
"currency": "USDT",
"currency_type": "CRYPTO",
"chain": "TRC20"
},
{
"period_type": "MONTH",
"amount": "5000000",
"currency": "USDT",
"currency_type": "CRYPTO",
"chain": "TRC20"
}
],
"notify_url": "https://merchant.com/notify/sign",
"return_url": "https://merchant.com/return",
"sign_expire_minutes": 60
}

Response Example

Success Response

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"sign_order_id": "AGR202601070001",
"sign_url": "https://pay.bybit.com/sign?token=xxx",
"qr_code": "https://pay.bybit.com/sign?token=xxx",
"qr_code_url": "https://pay.bybit.com/qr/AGR202601070001.png",
"expire_time": "2026-01-07T11:30:00Z"
}
}

Failure Response

{
"retCode": 40001,
"retMsg": "Parameter error: external_agreement_no already exists",
"result": null
}

Sign Types

TypeDescriptionUse Case
CYCLEPeriodic deductionSubscriptions, recurring payments
NON_CYCLENon-periodic deductionOn-demand payments (e.g., ride-hailing, parking)
SINGLESingle authorizationOne-time pre-authorization

Notes

  1. User Identity Mapping: merchant_user_id is optional and can be used to establish mapping between merchant's user system and Bybit platform. If not provided, agreement will only be bound to platform userId
  2. Limit Configuration: If not provided, platform default limits apply
  3. Sign Expiration: Default 30 minutes, can be extended up to 24 hours
  4. Idempotency: Same external_agreement_no returns existing sign request result