Skip to main content
POST

Authorizations

Authorization
string
header
required

For partners. Send your partner key as a bearer token: Authorization: Bearer <your partner key>. It starts with wgt_prt_ and you make it in your partner's home workspace, under Settings → API keys; any other key is refused with 403. See API keys and Partners.

Headers

Idempotency-Key
string
required

A key of your own for this purchase, so that a retry cannot make a second invoice

Required string length: 8 - 50
Pattern: ^[A-Za-z0-9_-]+$

Path Parameters

partnerId
string<uuid>
required

Partner ID

Body

application/json
usd
number
required

The dollars to spend on credits, to the cent: at least 10, at most 100000 in one request. The invoice is for the most whole credits that money buys at the list price of a credit, so it is never for more than this, and can be a few cents under it.

Required range: 10 <= x <= 100000
Example:

250

Response

The invoice was issued

success
boolean
required

Always true on a success.

Example:

true

data
object
required

The invoice for extra credits that was issued, and what paying it adds.

Example:
meta
object

Extra information about the answer: where a page sits in a list, the cursor of the next page, or warnings about a call that succeeded with a caveat.