curl -X POST https://api.zbdpay.com/api/v1/transactions/debits \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: 551d1b1b-c387-4e16-9a7a-c15be30d0d62" \
-H "Content-Type: application/json" \
-d '{
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD",
"reference_id": "season_3_win_reversal"
}'
{
"success": true,
"message": "Debit completed.",
"data": {
"transaction_id": "txn_4c22",
"type": "debit",
"status": "completed",
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD"
},
"error": null
}
Earnings
Debit a User
Reverse a credit you made to a user.
POST
/
api
/
v1
/
transactions
/
debits
curl -X POST https://api.zbdpay.com/api/v1/transactions/debits \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: 551d1b1b-c387-4e16-9a7a-c15be30d0d62" \
-H "Content-Type: application/json" \
-d '{
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD",
"reference_id": "season_3_win_reversal"
}'
{
"success": true,
"message": "Debit completed.",
"data": {
"transaction_id": "txn_4c22",
"type": "debit",
"status": "completed",
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD"
},
"error": null
}
Only for programs where ZBD tracks earnings. If you track earnings yourself, this returns
403 feature_not_enabled.Configuration
Header Parameters
string
required
Your ZBD API key.
string
required
A UUID you generate for this debit.
string
Content Type
Body Parameters
string
required
The ZBD user ID returned by Create a User.
string
required
The
transaction_id of the credit you’re reversing.integer
required
Amount in the currency’s smallest unit. Up to the amount of the original credit.
string
required
The currency of the original credit.
string
Your own ID for this debit.
curl -X POST https://api.zbdpay.com/api/v1/transactions/debits \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: 551d1b1b-c387-4e16-9a7a-c15be30d0d62" \
-H "Content-Type: application/json" \
-d '{
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD",
"reference_id": "season_3_win_reversal"
}'
{
"success": true,
"message": "Debit completed.",
"data": {
"transaction_id": "txn_4c22",
"type": "debit",
"status": "completed",
"user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
"credit_transaction_id": "txn_3b10",
"amount": 1000,
"currency": "USD"
},
"error": null
}
Errors
| HTTP | code | When |
|---|---|---|
400 | idempotency_key_required · validation_failed | No idempotency key, a malformed body, or more than the original credit |
403 | feature_not_enabled | You track earnings yourself |
404 | user_not_found | The user or the credit doesn’t exist under your key |
422 | insufficient_funds | The user no longer has that value, for example because they spent it or cashed it out |
Was this page helpful?