Request Charge for ZBD Gamertag
Learn how to generate payment requests specifically for ZBD users.
ZBD Gamertag Charge API
While you can use the Send Bitcoin to ZBD Gamertag endpoint to make a direct payment to a ZBD user, if you want to create a regular Lightning Network payment request / Charge QR code for that given user, you can do so using the Create Charge for ZBD Gamertag endpoint.
In order to request Charges from a ZBD Gamertag you just need to make a simple API call with a payload like the example below.
In order to receive updates about the status of this request, make sure to include a callbackUrl
in the data
portion of the request.
The response payload will include a invoiceRequest
which is the contents of the payment request QR code.
Once a payment is made and the Charge settles, the ZBD User will receive a Push Notification alerting them they’ve been sent some Bitcoin.
Multiplayer Commerce through ZBD Gamertag Charges
For App or Game Developers that wish to provide a more robust commerce experience for their users and gamers, requesting an invoice from ZBD Gamertags can be one of the ways.
Think of yourself, the Developer, as the Orchestrator of payments.
By leveraging Lightning Network invoices tied to specific ZBD Gamertag, you can ensure that the payment is made to the correct user, and that the payment has truly settled.
1. Two-Step Payment Orchestration
Let’s say Alice wants to buy a sword from Bob inside of the game. Well that’s easy, and there’s two ways:
2. ZBD Gamertag Charges
You can use the above endpoint to create a Charge from Bob’s ZBD Gamertag, and display it for Alice to pay. Pass a callbackUrl
on the ZBD API request and when the payment settles, you will be alerted of it and can then transfer the sword asset inside the game.
Yes, it’s really that simple!
3. Project Wallet as Escrow
Alternatively you could rely on the Project’s own Wallet as a form of escrow. You can create a Charge using the /charges
endpoint passing a callbackUrl
to receive settlement updates, and have Alice pay it.
Once payment is settled, you can use the Send Bitcoin to ZBD Gamertag endpoint and send the same amount to Bob. When this second payment settles you can then transfer the sword asset inside the game.
While this technically involves two transactions, it provides a bit more control to the Developer that wishes to manage the transfer of assets/in-game items a bit more closely and with more checks and balances in place. Both approaches are recommended.
Was this page helpful?