Skip to main content

Deduction Refund API

HTTP Request​

POST /v5/pay/agreement/refund

Initiate refund for a successful deduction transaction. Supports full and partial refunds.


Request Parameters​

ParameterTypeRequiredDescription
merchantIdstringYesMerchant ID
userIdstringYesPlatform user ID
agreementTypestringYesSign type: CYCLE / NON_CYCLE / SINGLE
tradeNostringEitherPlatform trade number
outTradeNostringEitherMerchant order number
outRefundNostringYesMerchant refund number (unique)
refundAmountobjectYesRefund amount
refundAmount.totalstringYesRefund amount (minimum unit)
refundAmount.currencystringYesCurrency code
refundAmount.currencyTypestringYesFIAT or CRYPTO
refundReasonstringNoRefund reason
notifyUrlstringYesRefund result webhook URL
info

Either tradeNo or outTradeNo must be provided.


Response Parameters​

ParameterTypeDescription
retCodeintResponse code
retMsgstringResponse message
resultobjectResponse data
result.refundNostringPlatform refund number
result.outRefundNostringMerchant refund number
result.tradeNostringOriginal trade number
result.statusstringRefund status: PROCESSING / SUCCESS / FAILED
result.refundAmountobjectRefund amount
result.refundTimestringRefund success time (on success)
result.failureReasonstringFailure reason (on failure)

Request Example​

Full Refund​

POST /v5/pay/agreement/refund HTTP/1.1
Host: api.bybit.com
Content-Type: application/json
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
X-Timestamp: 1736233200000
X-Signature: {signature}
Authorization: Bearer {access_token}

{
"merchantId": "M123456789",
"userId": "U_123456789",
"agreementType": "CYCLE",
"tradeNo": "PAY202601070001",
"outRefundNo": "REFUND20260107001",
"refundAmount": {
"total": "2350",
"currency": "USDT",
"currencyType": "CRYPTO"
},
"refundReason": "User requested cancellation",
"notifyUrl": "https://merchant.com/notify/refund"
}

Partial Refund​

POST /v5/pay/agreement/refund HTTP/1.1
Host: api.bybit.com
Content-Type: application/json
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
X-Timestamp: 1736233200000
X-Signature: {signature}
Authorization: Bearer {access_token}

{
"merchantId": "M123456789",
"userId": "U_123456789",
"agreementType": "CYCLE",
"outTradeNo": "ORDER20260107001",
"outRefundNo": "REFUND20260107002",
"refundAmount": {
"total": "1000",
"currency": "USDT",
"currencyType": "CRYPTO"
},
"refundReason": "Partial service not provided",
"notifyUrl": "https://merchant.com/notify/refund"
}

Response Examples​

Refund Success​

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"refundNo": "RF202601070001",
"outRefundNo": "REFUND20260107001",
"tradeNo": "PAY202601070001",
"status": "SUCCESS",
"refundAmount": {
"total": "2350",
"currency": "USDT",
"currencyType": "CRYPTO"
},
"refundTime": "2026-01-07T11:30:00Z"
}
}

Refund Processing​

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"refundNo": "RF202601070002",
"outRefundNo": "REFUND20260107002",
"tradeNo": "PAY202601070001",
"status": "PROCESSING",
"refundAmount": {
"total": "1000",
"currency": "USDT",
"currencyType": "CRYPTO"
}
}
}

Refund Failed​

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"refundNo": "RF202601070003",
"outRefundNo": "REFUND20260107003",
"tradeNo": "PAY202601070001",
"status": "FAILED",
"refundAmount": {
"total": "5000",
"currency": "USDT",
"currencyType": "CRYPTO"
},
"failureReason": "REFUND_AMOUNT_EXCEED"
}
}

Refund Rules​

  1. Refundable Amount: Cannot exceed original transaction amount minus already refunded amount
  2. Multiple Refunds: Same transaction supports multiple partial refunds
  3. Quota Restoration: Used agreement quota is restored after successful refund
  4. Agreement State: Refund is allowed even after agreement is unsigned/expired

Error Scenarios​

Error CodeDescriptionHandling
REFUND_AMOUNT_EXCEEDRefund amount exceeds refundable amountCheck refunded amount
REFUND_NOT_ALLOWTransaction status does not support refundTransaction must be successful
REFUND_PROCESSINGAnother refund is in progressWait for completion
TRADE_NOT_EXISTOriginal transaction not foundCheck trade number

Notes​

  1. Idempotency: Same outRefundNo returns result of first request
  2. Currency Matching: Refund currency must match original transaction currency
  3. Async Processing: PROCESSING status requires waiting for webhook or query
  4. Timeout Handling: Set 30-second timeout, query if timeout occurs