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 /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.
x-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.
api-key-burn
.
x-idempotency-key
header.
x-idempotency-key
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.x-idempotency-key: your_unique_generated_uuid_v4_here
Field | Type | Required | Description |
---|---|---|---|
type | string | Yes | A string identifier for the type of proof being submitted (e.g., “PRODUCT_BUY”, “TWITTER_LIKE”). |
proof | Object | Yes | A JSON object containing the actual proof data. Its structure should correspond to the type . |
burnAmount | number | Yes | The quantity of tokens to burn. Must be a positive number. |
persistOnchain | boolean | Yes | A boolean flag indicating whether the hash of the proof should be recorded on the blockchain for this operation. |
success
and errors
.
Field | Type | Description |
---|---|---|
success | Array | An array of objects, each representing a successfully processed burn operation. |
errors | Array | An array of objects, each representing a burn operation that failed. |
success
Array Object Structuresuccess
array has the following fields:
Field | Type | Description |
---|---|---|
result | string | Indicates the outcome of the operation (always “SUCCESS” for this array). |
hash | string | A SHA256 hash of the provided proof object for the successful operation. |
txHash | string | The on-chain transaction hash for the token burn. If persistOnchain was true, this hash also confirms the proof data was recorded on-chain. |
type | string | The type of proof that was processed successfully. |
dateBurned | string | An ISO 8601 timestamp indicating when the burn was processed. |
errors
Array Object Structureerrors
array has the following fields:
Field | Type | Description |
---|---|---|
message | string | A message describing the reason for the failure of this specific operation. |
type | string | The error code for this specific failure (e.g., ERR_INVALID_PROOF ). |
proof | Object | The original proof object submitted for the operation that failed. |
proofType | string | The original type of proof that was submitted for the operation that failed. |
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.A unique key generated by the client to ensure a batch request is processed at most once.
An array of token burn operations.
The body is of type object[]
.
Successful batch token burn. The response indicates success or failure for each individual operation in the batch.
The response is of type object
.