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.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.
Charges / Payment Requests have defined expiration times. After a Charge expires it cannot be paid, but you can simply create another one.
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 acallbackUrl
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.
Alice will effectively be paying the Project Wallet in this scenario.