Skip to main content

Sending Transactions through ZBD Shield

Now that ZBD Shield is protecting your Project Wallet, you need to route transactions from your project through ZBD Shield.

If you’ve previously used the ZEBEDEE API, you’ll be familiar with the typical ZEBEDEE domain and endpoints (e.g. https://api.zebedee.io/v0/..., described in our API Reference), however, transactions for ZBD Shield will be routed through different endpoints. Any transactions processed through the standard endpoints will not be routed through ZBD Shield, and will thus not be protected by ZBD Shield.

Prepare Transaction Payload

To process a transaction through ZBD Shield, you need the following JSON transaction payload:

{
// Required - gamertag for the user withdrawing from the game
"gamerTag": "freeberty098",
// Required - amount of funds, in milisats
"amount": "1000",
// Optional - transaction description shown to the user; default is "Thank you"
"description": "From Sarutobi's game to freeberty098",
// Required - platform the user is on; possible values: PC | Android | iOS | Mac | Web
"platform": "PC",
// Required - Your game's version the user is on
"appVersion": "1.0.0",
// Optional - if Shield is configured to block non-google play installs then it's required
"isGooglePlay": true,
// Required - tells that app is running on a real device, must be true
"isDevice": true,
// Required - the user's unique device id
"deviceId": "a3k034a0c403af2c3e36119c2c62f3ff477029e3786f1db41ba363119f5e8077",
// Required - name of your game
"appId": "App identification",
// Optional - required if device versions was set on Shield config; possible values: an object string containing all user's device info including "operatingSystem"
"deviceInfo": "{\"operatingSystem\": \"iOS\"}",
// Optional - but required if device versions was set on Shield config
"deviceVersionNumber": "2.3.1"
}

Authenticate

To authenticate the request, you will need your ZBD Shield Access Token.

You can get this by going to Settings -> Access Token

info

Generate your key for the first time by pressing the Regenerate button.

ZBD Shield | Access Token

ZBD Shield | Access Token

danger

Regenerating your Access Token will disable all previous Access Tokens.

Send Transaction

To send a transaction, use the https://{your.Shield.domain}/api/v1/zbd/create-transaction endpoint with the applicable payload and valid API key.

curl --location '{ShieldURL}/api/v1/zbd/create-transaction' \
--header 'Access-Token: {YourShieldAccessToken}' \
--header 'Content-Type: application/json' \
--data '{
"gamerTag": "",
"amount": "",
"description": "",
"platform": "",
"appVersion": "",
"isGooglePlay": bool,
"isDevice": bool,
"deviceId": "",
"appId": "",
"deviceInfo": "",
"deviceVersionNumber": ""
}'

Congrats! These transactions will route through your ZBD Shield instance.

Cooldown

To prevent the same user from requesting multiple times in rapid succession, there is a cooldown wherein ZBD Shield will block additional requests until the cooldown period has elapsed.

This can be changed via API on the https://{your.Shield.domain}/api/v1/zbd/config/set endpoint.

{
"coolDownPeriod": 10 // in seconds
}

That's it! You're now able to process transactions through ZBD Shield!