Skip to main content
POST
https://api.zebedee.io
/
api
/
v1
/
rewards
/
users
/
deduct
Decrease Withdrawal Limit
curl --request POST \
  --url https://api.zebedee.io/api/v1/rewards/users/deduct \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'z-client: <z-client>' \
  --data '
{
  "rewardsUserId": "<string>",
  "amount": 123,
  "currency": "<string>",
  "type": "<string>"
}
'
{
  "success": true,
  "message": "Success."
}
Decrease the withdrawal limit for a specific user in your Rewards App. This endpoint allows you to lower the maximum amount a user can withdraw from their rewards balance.

Configuration

Header Parameters

Authorization
string
required
Bearer token for authentication. Requires either a god admin JWT token or the JWT of the game/app owner.Format: Bearer {JWT_TOKEN}
z-client
string
required
Client identifier (use “developer-dashboard”)

Body Parameters

rewardsUserId
string
required
The user’s rewards ID (UUID format)
amount
number
required
Amount to decrease the withdrawal limit by. Must be a positive number greater than 0. Cannot decrease the limit below 0.
currency
string
required
Currency type for the amountOptions: MSATS or POINT
type
string
required
Type of deduction operationValue: DEDUCT-TIME-BASED-REWARD
{
  "success": true,
  "message": "Success."
}

Response Status Codes

CodeDescription
200Deduction successful
400Bad request, invalid parameters, negative amount, or would result in negative limit
401Unauthorized, authentication required
403Forbidden, admin access required
500Internal server error
{
  "success": false,
  "message": "Invalid amount, currency, or would result in negative limit"
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
messagestringResponse message indicating the result

Code Examples

const rewardsUserId = 'USER_REWARDS_ID';
const jwtToken = 'YOUR_JWT_TOKEN';

async function decreaseWithdrawalLimit(rewardsUserId, amount, currency) {
  const response = await fetch(
    `https://api.zbdpay.com/api/v1/rewards/user/${rewardsUserId}/deduct`,
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${jwtToken}`,
        'z-client': 'developer-dashboard',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        amount: amount,
        currency: currency,
        type: 'DEDUCT-TIME-BASED-REWARD'
      })
    }
  );

  const data = await response.json();

  if (data.success) {
    console.log('Withdrawal limit decreased successfully');
    return data;
  } else {
    throw new Error(`Failed: ${data.message}`);
  }
}

// Decrease limit by 500 MSATS
await decreaseWithdrawalLimit('b28e0306-2c06-4092-8d56-a1623d6b97fb', 500, 'MSATS');
Validation Rules:
  • The amount must be a positive number greater than 0
  • The decrease cannot result in a withdrawal limit below 0
  • Negative values will result in a 400 Bad Request error

Try It Out

Ready to decrease a user’s withdrawal limit? Use our API playground on the right to test with your JWT token and user ID.