v1

latestOpenAPI 3.1.02026-07-24230114.4 KB

Charge Token

Charge a pay or kya-pay token as a seller agent or seller service.

post/api/v1/tokens/charge

Request body

tokenstring required

The complete, signed JWT string received from the buyer agent.

chargeAmountstring

The amount to charge from the token. Required unless the seller service uses the pay_per_use pricing model, in which case Skyfire automatically charges the configured service price when omitted. Tokens may be charged multiple times until their balance is exhausted. When provided, chargeAmount must:

  • Be greater than 0
  • Be less than or equal to the token's original tokenAmount
  • Be less than or equal to the token's remaining balance

A charge that exceeds the remaining balance will fail.

Response

200

amountChargedstring

The amount successfully charged from the token.

remainingBalancestring

The amount remaining on the token after the charge is processed.

Example response

{
  "amountCharged": "0.01",
  "remainingBalance": "0.01"
}