Create Charge
/v0/gamertag/charges
curl --request POST \
--url https://api.zebedee.io/v0/gamertag/charges \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '{
"amount": "<amount>",
"gamertag": "<gamertag>",
"description": "",
"internalId": "",
"callbackUrl": ""
}'
ZBD API is migrating the terminology from ZBD Gamertags to ZBD Usernames. There are no breaking changes to you as a developer.
In general, if you used to search for ‘Gamertag’ inside zbd.dev documentation, now search for ‘Username’. Please do also note some ZBD API endpoints are still using gamertag
in the URL.
Description
While you can use the Pay to ZBD Username endpoint to make a direct Bitcoin payment to a given ZBD user, if for whatever reason you’d want to create a general Lightning Network Charge / Payment Request QR code, you can use this endpoint.
invoiceRequest
which is the contents of the Charge / Payment Request QR code. Do note that Charges have defined expiration times. After a Charge expires it cannot be paid, simply create another Charge.Configuration
Header Parameters
ZBD Project API Key
Content Type
Body
The amount for the Payment -> in millisatoshis
Destination ZBD Username
Note or comment for this Payment (visible to recipient)
Open metadata string property
The endpoint ZBD will POST Charge updates to
{
"success": true,
"data": {
"unit": "msats",
"status": "CHARGE_PENDING",
"amount": "15000",
"createdAt": "2023-03-14T19:40:13.880Z",
"internalId": "test",
"callbackUrl": "https://my-website.ngrok.io/callback",
"description": "Requesting Charge for Gamertag",
"invoiceRequest": "lnbc10n1pjppnvapp5camc852ky0et9g46gyey9mnv5xgux6tnkkq5qc6cexrr65xw2j9sdps2fjhzat9wd6xjmn8yppksctjvajjqen0wgsywctdv4e8gct8cqzpgxqzjcsp5jgs84mxjwk8n9r7xmp7ulzycy7882f5m8zagk45s2qp23p7rprqq9qyyssq3ysvdsgg5qvx0nwtlz46hcrucs7m6nkvsffcze5nhes40hqrnnes3xjcq0a4wtpqvvrdqlyqy3sz5yhqh6944unan4d32py2azq38zgq4c5ysu",
"invoiceExpiresAt": "2023-03-14T19:50:13.859Z",
"invoiceDescriptionHash": null
}
}
Was this page helpful?
curl --request POST \
--url https://api.zebedee.io/v0/gamertag/charges \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '{
"amount": "<amount>",
"gamertag": "<gamertag>",
"description": "",
"internalId": "",
"callbackUrl": ""
}'
{
"success": true,
"data": {
"unit": "msats",
"status": "CHARGE_PENDING",
"amount": "15000",
"createdAt": "2023-03-14T19:40:13.880Z",
"internalId": "test",
"callbackUrl": "https://my-website.ngrok.io/callback",
"description": "Requesting Charge for Gamertag",
"invoiceRequest": "lnbc10n1pjppnvapp5camc852ky0et9g46gyey9mnv5xgux6tnkkq5qc6cexrr65xw2j9sdps2fjhzat9wd6xjmn8yppksctjvajjqen0wgsywctdv4e8gct8cqzpgxqzjcsp5jgs84mxjwk8n9r7xmp7ulzycy7882f5m8zagk45s2qp23p7rprqq9qyyssq3ysvdsgg5qvx0nwtlz46hcrucs7m6nkvsffcze5nhes40hqrnnes3xjcq0a4wtpqvvrdqlyqy3sz5yhqh6944unan4d32py2azq38zgq4c5ysu",
"invoiceExpiresAt": "2023-03-14T19:50:13.859Z",
"invoiceDescriptionHash": null
}
}