跳至主要内容

Unsign API

HTTP Request

POST /v5/bybitpay/agreement/unsign

Terminate an active agreement. After unsign, no further deductions can be made. Existing successful transactions can still be refunded.


Request Parameters

ParameterTypeRequiredDescription
merchant_idstringYesMerchant ID
user_idstringYesPlatform user ID
agreement_typestringYesSign type: CYCLE / NON_CYCLE / SINGLE
agreement_nostringEitherPlatform agreement number
external_agreement_nostringEitherMerchant agreement number
unsign_typestringNoUnsign type: USER / MERCHANT / SYSTEM
unsign_reasonstringNoUnsign reason
信息

Either agreement_no or external_agreement_no must be provided.


Response Parameters

ParameterTypeDescription
retCodeintResponse code
retMsgstringResponse message
resultobjectResponse data
result.agreement_nostringPlatform agreement number
result.statusstringStatus: UNSIGNED
result.unsign_timestringUnsign time

Request Example

Unsign by Agreement Number

POST /v5/bybitpay/agreement/unsign 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",
"user_id": "U_123456789",
"agreement_type": "CYCLE",
"agreement_no": "AGR202601070001",
"unsign_type": "USER",
"unsign_reason": "User cancelled subscription"
}

Unsign by External Agreement Number

POST /v5/bybitpay/agreement/unsign 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",
"user_id": "U_123456789",
"agreement_type": "CYCLE",
"external_agreement_no": "MERCHANT_AGR_001",
"unsign_type": "MERCHANT",
"unsign_reason": "Service terminated"
}

Response Examples

Success Response

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"agreement_no": "AGR202601070001",
"status": "UNSIGNED",
"unsign_time": "2026-01-07T15:30:00Z"
}
}

Agreement Not Exist

{
"retCode": 40003,
"retMsg": "Agreement does not exist",
"result": null
}

Agreement Already Unsigned

{
"retCode": 40004,
"retMsg": "Agreement already unsigned, no need to repeat",
"result": null
}

Unsign Types

TypeDescription
USERUser initiated unsign
MERCHANTMerchant initiated unsign
SYSTEMSystem unsign (risk, account abnormal)

Notes

  1. Final State: Unsigned is a final state; agreement cannot be reactivated
  2. Refund Allowed: Existing successful transactions can still be refunded after unsign
  3. Allowed States: Only SIGNED and SUSPENDED agreements can be unsigned
  4. Webhook Notification: Platform sends unsign notification to merchant after unsign