Buy credits as an agent (machine payment)

Answers with a payment challenge in the WWW-Authenticate header. Pay it and retry the same request. With an API key, the credits go to that key's account. Without one, a new account is created when the payment settles and its API key is returned in the response. An empty body asks for the $1 minimum.

post/v1/billing/machine-topup

Request

  • Base URL: https://api.toolrouter.com
  • URL: https://api.toolrouter.com/v1/billing/machine-topup
  • Auth: one of:
    • HTTP bearer
    • none

Request body

amount_usdnumber

Credit value to buy, in US dollars, no finer than whole cents. Defaults to the $1 minimum.

Response

Payment accepted and credits added

credited_usdnumber required

Credit value added to the account.

charged_usdnumber required

Amount actually paid, including the purchase fee.

balance_usdnumber required

Credit balance after the top-up.

payment_refstring required

Settled payment reference the grant is keyed on.

api_keystring

Only when paid without an API key: the new account's API key. Shown once.

account_idstring

Only when paid without an API key: the new account id.

claim_urlstring

Only when paid without an API key: link for the user to claim and manage the account.

messagestring

Only when paid without an API key: how to use the new key.

Changes

No recorded changes to this operation across all 1 revision of this API.