Burn Batch Tokens
Tokenomics (Deprecated)
Burn Batch Tokens (Deprecated)
This endpoint allows burning multiple tokens in a single request, each based on a provided proof, with an option to persist proof data on-chain for each.
POST
Burn Batch Tokens
Overview
ThePOST /v1/tokenomics/burn-batch endpoint facilitates the burning of specified amounts of tokens for multiple independent operations in a single API call. Each operation in the batch requires its own proof of an off-chain event or condition that justifies the burn. If persistOnchain is true for an operation, the hash of its proof will be recorded on the blockchain.
This endpoint processes each burn operation in the batch individually. The overall request will succeed, and the response will detail which operations were successful and which ones failed.
Authentication
This endpoint requires API key authentication using thex-believe-api-key request header. The API key must have the appropriate burn scope.
NOTE: This endpoint only works for /v1 tokens.
Example:
x-believe-api-key: your_actual_api_key_here
Refer to the Auth Error Codes for details on authentication-related errors.
Rate Limiting
Requests to this endpoint are rate-limited to 1 request per 10 seconds per API key. The rate limit prefix isapi-key-burn.
Idempotency
To prevent accidental duplicate operations, this endpoint supports idempotency via thex-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-keyas 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.
x-idempotency-key: your_unique_generated_uuid_v4_here
Request Body
The request body must be a JSON array, where each object in the array represents a single token burn operation with the following fields:Example Request (JSON Body)
Response Body
On success (even if some individual operations within the batch fail), the API returns a 2xx HTTP status code and a JSON object with two main arrays:success and errors.
success Array Object Structure
Each object in the success array has the following fields:
errors Array Object Structure
Each object in the errors array has the following fields:
Example Response
Functional Error Codes
Individual operations within the batch can fail with error codes similar to those in the single Burn Tokens endpoint (e.g.,ERR_TOKEN_NOT_FOUND, ERR_INVALID_PROOF, ERR_BURN_TOKENOMICS_FAILED). These will be reported in the errors array of the response, as detailed above.
If the entire batch request fails due to issues like invalid overall request structure (e.g., not an array), authentication failure, or exceeding global rate limits, the API will return a standard 4xx or 5xx error response.Authorizations
Headers
A unique key generated by the client to ensure a batch request is processed at most once.
Body
application/json
An array of token burn operations.
A string identifier for the type of proof being submitted (e.g., "PRODUCT_BUY").
A JSON object containing the actual proof data.
The quantity of tokens to burn. Must be a positive number.
A boolean flag indicating whether the hash of the proof should be recorded on the blockchain.