This endpoint allows burning tokens based on a provided proof, with an option to persist proof data on-chain.
persistOnchain is true, the hash of the proof will be recorded on the blockchain.
NOTE: This endpoint only works for /v1 tokens.
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
x-idempotency-key header.
x-idempotency-keyx-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”, “PRODUCT_SELL”). |
proof | Object | Yes | A JSON object containing the actual proof data. Its structure will depend on 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. |
| Field | Type | Description |
|---|---|---|
result | string | Indicates the outcome of the operation (e.g., “SUCCESS”). |
hash | string | A SHA256 hash of the provided proof object. |
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. |
dateBurned | string | An ISO 8601 timestamp indicating when the burn was processed. |
| Error Code | Description |
|---|---|
ERR_TOKEN_NOT_FOUND | The token associated with the API key (or specified, if applicable) could not be found or is invalid. Ensure the token ID is correct. |
ERR_CREATE_API_EVENT_FAILED | The system encountered an issue while trying to record the API event for this burn attempt. This might indicate a temporary internal problem. |
ERR_INVALID_PROOF | The type of proof provided is not recognized, not permitted for the API key, or the proof object itself is considered invalid. |
ERR_BURN_TOKENOMICS_FAILED | The core token burn operation failed. This could be due to issues with the on-chain transaction, insufficient funds, or other internal errors during the burn process. |
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).
Details for the token burn operation.
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.
Successful token burn.
Indicates the outcome of the operation (e.g., "SUCCESS").
A SHA256 hash of the provided proof object.
The on-chain transaction hash for the token burn, if successful.
The type of proof that was processed.
An ISO 8601 timestamp indicating when the burn was processed.