Skip to main content
POST
/
api
/
v1
/
widget
/
users
/
deplete
curl -X POST https://api.zbdpay.com/api/v1/widget/users/deplete \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
    "amount": 500,
    "currency": "USDZ",
    "idempotency_key": "551d1b1b-c387-4e16-9a7a-c15be30d0d62"
  }'
{
  "success": true,
  "message": "Point transfer completed successfully.",
  "data": {
    "transfer_id": "f4ba94c1-1234-5678-abcd-ef0123456789",
    "status": "COMPLETED"
  },
  "error": null
}

Description

Debit publisher points from a widget user’s point balance and return them to the project’s configured sink/source account. Amount is in currency minor units. For USDZ, 100 equals $1.00 worth of points. This endpoint is idempotent on idempotency_key. The user must already have enough point balance for the debit.

Configuration

Header Parameters

apikey
string
required
Your ZBD project API key (production scope).
Content-Type
string
Content Type

Body Parameters

user_id
string
required
The ZBD user ID returned by Create User.
amount
integer
required
Amount in currency minor units. For USDZ: 100 = 1.00,1000=1.00, `1000` = 10.00.
currency
string
required
Point currency code. Use USDZ unless your project has a different configured point currency.
idempotency_key
string
required
Unique key to prevent duplicate transfers. Use a UUID.
curl -X POST https://api.zbdpay.com/api/v1/widget/users/deplete \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
    "amount": 500,
    "currency": "USDZ",
    "idempotency_key": "551d1b1b-c387-4e16-9a7a-c15be30d0d62"
  }'
{
  "success": true,
  "message": "Point transfer completed successfully.",
  "data": {
    "transfer_id": "f4ba94c1-1234-5678-abcd-ef0123456789",
    "status": "COMPLETED"
  },
  "error": null
}
{
  "success": false,
  "message": "Insufficient point balance.",
  "data": null,
  "error": {
    "code": "TX3017",
    "message": "Insufficient point balance."
  }
}