Skip to main content
POST
/
api
/
v2
/
rewards
/
limited-achievement
/
reward
Send Rewards from Server
curl --request POST \
  --url https://api.zebedee.io/api/v2/rewards/limited-achievement/reward \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --header 'z-client: <z-client>' \
  --data '{
  "rewardsUserId": "<string>",
  "amount": 123
}'
{
  "success": true,
  "message": "Success.",
  "data": [
    {
      "transactionId": "f7553b31-5ae2-43bf-a200-c0a966e94071"
    }
  ]
}
Send rewards securely from your backend using the ZBD Rewards API (v2). This method ensures all rewards are issued from a trusted environment, preventing client-side abuse and maintaining full control over reward distribution.
Reward Unit Configuration. The reward unit (e.g., 1 satoshi or $0.10) is defined for your game by your ZBD Customer Success Manager.

Configuration

Header Parameters

x-api-key
string
required
API key used for authentication. Obtain this from the Create an API Key step.
z-client
string
required
Client identifier (use “developer-dashboard” )
Content-Type
string
required
Content Type

Body Parameters

rewardsUserId
string
required
The recipient’s ZBD Rewards User ID
amount
number
required
Reward amount in configured unitsExample: 10 (units defined by your ZBD Customer Success Manager)
{
  "success": true,
  "message": "Success.",
  "data": [
    {
      "transactionId": "f7553b31-5ae2-43bf-a200-c0a966e94071"
    }
  ]
}

Response Status Codes

CodeDescription
201Reward sent successfully
400Bad request – invalid parameters
401Unauthorized – invalid or missing API key
404Rewards user not found
500Internal server error
{
  "success": false,
  "message": "Invalid parameters"
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
messagestringResponse message
dataarrayArray containing transaction details
transactionIdstringUnique transaction identifier

Security Reminder, Never expose your API key in client-side code. Always send rewards from your backend server where your API key is securely stored.

Code Examples

const apiKey = process.env.REWARDS_API_KEY;

async function sendReward(rewardsUserId, amount) {
  const response = await fetch('https://api.zebedee.io/api/v2/rewards/limited-achievement/reward', {
    method: 'POST',
    headers: {
      'x-api-key': apiKey,
      'z-client': 'developer-dashboard',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      rewardsUserId,
      amount
    })
  });

  const data = await response.json();

  if (data.success) {
    console.log(`Reward sent! Transaction ID: ${data.data[0].transactionId}`);
    return data.data[0];
  } else {
    throw new Error(`Failed to send reward: ${data.message}`);
  }
}

// Example: Send 10 reward units
await sendReward('f2154d1a-67e6-46f2-b293-b4b226948dc9', 10);

Try It Out

Ready to send your first reward from the server? Use our API playground on the right to test with your API key.

What’s Next?

You’ve now successfully sent rewards from your backend using the ZBD Rewards API (v2).
Next, continue enhancing your reward flow and security: