Skip to main content
POST
Burn Tokens
Deprecated: This endpoint is deprecated in favor of the new Flywheel API. The Flywheel API provides enhanced security, batch operations, multi-signature approval, and more sophisticated tokenomic strategies. Please migrate to the Flywheel API for new implementations.

Overview

The Burn Tokens endpoint facilitates the burning of a specified amount of tokens. It requires a proof of an off-chain event or condition that justifies the burn. If persistOnchain is true, the hash of the proof will be recorded on the blockchain. NOTE: This endpoint only works for /v1 tokens.

Authentication

This endpoint requires API key authentication. The API key must have the burn scope. To authenticate, provide your API key in the x-believe-api-key request header. Example: x-believe-api-key: your_actual_api_key_here

Rate Limiting

Requests to this endpoint are rate-limited to 10 requests per second per API key.

Idempotency

To prevent accidental duplicate operations, this endpoint supports idempotency via the x-idempotency-key header.
  • Header: x-idempotency-key
  • Value: A unique string (e.g., a UUID) generated by the client for each distinct operation.
  • Purpose: If a request is retried (e.g., due to a network error) with the same x-idempotency-key as a previously successful request, the server should recognize it and not perform the operation a second time, instead returning the result of the original successful operation. This ensures that operations are processed at most once.
Example: x-idempotency-key: your_unique_generated_uuid_v4_here

Request Body

Example Request

Response Body

On success, the API returns a JSON object with the following fields:

Example Response (Success)

Functional Error Codes

Beyond authentication and rate limiting, the burn endpoint can return specific error codes related to the burn operation itself. These are typically returned with a 400 Bad Request status. When these errors occur, the API response will typically include the error code and a message providing more details, similar to the authentication error format. Example (400 Bad Request):

Authorizations

x-believe-api-key
string
header
required

Headers

x-idempotency-key
string<uuid>
required

A unique key generated by the client to ensure a request is processed at most once. This is used to prevent accidental duplicate operations if a request is retried (e.g., due to a network error).

Body

application/json

Details for the token burn operation.

type
string
required

A string identifier for the type of proof being submitted (e.g., "PRODUCT_BUY").

proof
object
required

A JSON object containing the actual proof data.

burnAmount
number<double>
required

The quantity of tokens to burn. Must be a positive number.

persistOnchain
boolean
required

A boolean flag indicating whether the hash of the proof should be recorded on the blockchain.

Response

Successful token burn.

result
string
required

Indicates the outcome of the operation (e.g., "SUCCESS").

hash
string
required

A SHA256 hash of the provided proof object.

txHash
string
required

The on-chain transaction hash for the token burn, if successful.

type
string
required

The type of proof that was processed.

dateBurned
string<date-time>
required

An ISO 8601 timestamp indicating when the burn was processed.