1. Dispute Management
TrustPay
en
  • en
  • zh
  • Integration Guide
  • Signature Calculation
  • Payment Gateway
    • Risk Control – Merchant Integration
    • Enums
    • Payment Callback Specification
    • C21 Suport Regions
      • TrustPay Supported Billing Countries and US/Canada Regions
    • Whitelist Management
      • Add Card Whitelists
      • Query Card Whitelists
      • Query Card Whitelists Task
    • Card Direct Payin
      POST
    • Cashier Payin
      POST
    • Order Refund
      POST
    • Payment Callback
      POST
    • Balance
      POST
    • Order Query
      POST
    • Fee Query
      POST
    • Refund Query
      POST
  • Dispute Management
    • Dispute Enums
    • Dispute Alert
    • Dispute Alert Callback
    • Dispute Prevention (RDR)
    • Dispute Management(Chargeback)
    • Chargeback Callback
  • Credit Card Issuer
    • Available Card
      POST
    • Open Card
      POST
    • Open/Recharge Card Callback
      POST
    • Get Card Detail
      POST
    • Card Recharge
      POST
    • Order List
      POST
    • Card List
      POST
    • Transaction List
      POST
    • Fee Query
      POST
  • Physical Card Issuer
    • Create Cardholder
    • List Cardholders
    • Assign Physical Cards
    • List Assigned Physical Cards
    • Query Card Balance
    • Query Card Transactions
    • Query Account
    • Card Charge
  • Schemas
    • VCardDetail
    • VOrderDetail
  1. Dispute Management

Chargeback Callback

Purpose#

TrustPay sends a signed JSON callback to the original payment order notify_url when a formal dispute enters a merchant-relevant funds state:
opened and funds held;
lost;
won.
Formal dispute callbacks are independent from type = 7 Dispute Alert callbacks.

Request#

Method: POST
Content-Type: application/json
URL: the notify_url submitted with the original order
Notification type: type = 4

Delivery and Idempotency#

TrustPay treats only HTTP 200 as successful delivery.
Network errors, timeouts, and non-200 responses may be retried.
Verify the signature before applying business changes.
Durably accept the event before returning HTTP 200.
Process repeated events idempotently using dispute_id together with dispute_status.

Fields#

FieldTypeRequiredDescription
typeintegerYesAlways 4
merchant_idintegerYesTrustPay merchant ID
order_nostringYesOriginal merchant order number
order_amountnumberYesFormal dispute principal
balance_amountnumberYesMerchant balance movement for this lifecycle event
reasonstringYesTrustPay lifecycle description
dispute_statusstringYeschargeback_pending, chargeback_lost, or chargeback_won
dispute_idstringNoTrustPay formal dispute ID when available
response_statusstringNoCurrent merchant response state
dispute_feenumberYesProcessing fee charged in this event; zero for lost/won finalization
expiration_datestringNoResponse deadline in YYYY-MM-DD format
signstringYesLowercase hexadecimal MD5 signature
Payment-only fields such as status, paid_amount, refund_amount, merchant_refund_no, fee, and pay_time are omitted from a formal dispute callback.

Funds Semantics#

dispute_statusbalance_amountdispute_feeMeaning
chargeback_pendingNegativeConfigured feePrincipal and fee held when the case is created
chargeback_lost00Funds were already held; final loss does not create another debit
chargeback_wonPositive principal0Previously held principal returned; the processing fee is not returned

Pending Example#

{
  "type": 4,
  "merchant_id": 1001,
  "order_no": "ORDER_123456",
  "order_amount": 100,
  "balance_amount": -115,
  "reason": "Chargeback opened: funds held pending dispute decision",
  "dispute_status": "chargeback_pending",
  "dispute_id": "dsp_example_001",
  "response_status": "needs_response",
  "dispute_fee": 15,
  "expiration_date": "2026-08-15",
  "sign": "SIGNATURE_VALUE"
}

Lost Example#

{
  "type": 4,
  "merchant_id": 1001,
  "order_no": "ORDER_123456",
  "order_amount": 100,
  "balance_amount": 0,
  "reason": "Chargeback lost: dispute refund confirmed",
  "dispute_status": "chargeback_lost",
  "dispute_id": "dsp_example_001",
  "response_status": "no_response_allowed",
  "dispute_fee": 0,
  "sign": "SIGNATURE_VALUE"
}

Won Example#

{
  "type": 4,
  "merchant_id": 1001,
  "order_no": "ORDER_123456",
  "order_amount": 100,
  "balance_amount": 100,
  "reason": "Chargeback won: held funds released",
  "dispute_status": "chargeback_won",
  "dispute_id": "dsp_example_001",
  "response_status": "responded",
  "dispute_fee": 0,
  "sign": "SIGNATURE_VALUE"
}
The chargeback_* values and current English reason messages are machine-contract values. Customer-facing documentation refers to the lifecycle as a formal dispute.

Signature Verification#

All non-empty fields in the callback participate in the signature, excluding sign.
1.
Remove sign.
2.
Remove empty values.
3.
Sort field names lexicographically.
4.
Join as key1=value1&key2=value2.
5.
Append &secret=YOUR_SECRET.
6.
Calculate lowercase hexadecimal MD5.
Do not round or reformat numeric values before verification.

Recommended Processing#

1.
Parse the JSON body.
2.
Verify sign.
3.
Validate type = 4, merchant_id, dispute_id, and dispute_status.
4.
Store the event idempotently by dispute_id and dispute_status.
5.
Apply the funds movement represented by balance_amount only once.
6.
Return HTTP 200.

Related Documents#

Dispute Management
Dispute Enums
Signature Calculation
Modified at 2026-07-30 13:34:24
Previous
Dispute Management(Chargeback)
Next
Available Card
Built with