Charge Processing

The Charge Token API allows sellers to charge a previously issued pay or kya-pay token after delivering a service, tool, or resource.


Token Requirements

Only tokens with the following typ values can be charged:

  • pay
  • kya-pay

Tokens of type kya cannot be charged.


Token Expiration Handling

Sellers are expected to enforce the token's exp claim and reject tokens that have expired.

However, Skyfire allows a token to be charged up to 24 hours after its expiration time.

This allows sellers to complete payment processing for services that may take time to deliver.


Expired Token Charging Window

If a token is charged after its expiration but within the 24-hour grace period, Skyfire assumes that:

  • The seller validated the token before it expired, and
  • The charge corresponds to a service that was accepted while the token was still valid.

That is, sellers should not accept already-expired tokens from buyers, but they may complete a charge shortly after expiration if the service execution began while the token was valid.


Best Practices

Sellers should:

  • Validate the token when the request is first received
  • Reject tokens that are already expired
  • Only charge tokens associated with a valid service request

This ensures proper accounting ant prevents misuse of expired tokens.