Skip to main content
POST
https://api.zbdpay.com
/
v0
/
gamertag
/
charges
Create Charge
curl --request POST \
  --url https://api.zbdpay.com/v0/gamertag/charges \
  --header 'Content-Type: application/json' \
  --header 'apikey: <apikey>' \
  --data '
{
  "amount": "<string>",
  "gamertag": "<string>",
  "description": "<string>",
  "expiresIn": 123,
  "internalId": "<string>",
  "callbackUrl": "<string>"
}
'
{
  "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
  }
}

Description

While you can use the Pay to ZBD Gamertag 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.
The response payload will include a 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.
Important: ZBD Gamertags are mutable and can be changed by users at any time. If you’re implementing user-specific limits (e.g., 1 withdrawal per day) or tracking balances, do not use Gamertags as identifiers. Instead, use the Get ID by ZBD Gamertag endpoint to retrieve the immutable User ID for each Gamertag, then track limits and balances using that User ID. Otherwise, users can bypass your limits simply by changing their Gamertag.

Configuration

Header Parameters

apikey
string
required
ZBD Project API Key
Content-Type
string
Content Type

Body

amount
string
required
The amount for the Payment -> in millisatoshis
gamertag
string
required
Destination ZBD Gamertag
description
string
Note or comment for this Payment (visible to recipient)
expiresIn
number
Time until Charge expiration -> in seconds
internalId
string
Open metadata string property
callbackUrl
string
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
  }
}