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
Body Parameters
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?