Token Integration & Burn API
Post-launch, Believe provides powerful API features that allow you to integrate your token directly into your product and implement token burn mechanics. This creates utility for your token and strengthens the connection with your community.
Getting Started with the API
The Believe API makes it seamless for builders to add features to their coins and integrate coins directly into their product experience.
Authentication
Generate an API key from https://believe.app/projects after creating your project. Include your API key in the x-believe-api-key
header for all requests.
x-believe-api-key: your_actual_api_key_here
Token Burn API
The Token Burn API allows you to burn tokens based on various user actions in your product. This creates scarcity and can reward active users of your project.
Key Features
- Burn tokens based on specific product actions
- Persist proof of burns on-chain
- Process multiple burns in a single batch request
- Prevent duplicate operations with idempotency keys
Burn Endpoints
Single Token Burn
POST https://public.believe.app/v1/tokenomics/burn
Burns a specified amount of tokens based on proof of an off-chain event.
Batch Token Burn
POST https://public.believe.app/v1/tokenomics/burn-batch
Burns multiple token amounts in a single request, each with its own proof.
Proof Types
When burning tokens, you must provide a proof object that justifies the burn. The structure of this proof depends on the type of action.
Example Proof Types
- PRODUCT_BUY - When a user buys a product on your platform
- PRODUCT_REFUND - When a user is refunded for a product
Example Burn Request
{ "type": "PRODUCT_BUY", "proof": { "transactionId": "237892372", "value": "100" }, "burnAmount": 10000, "persistOnchain": true }
Error Handling
The API returns specific error codes to help you identify and resolve issues:
- ERR_UNAUTHORIZED - Authentication failure
- ERR_DUPLICATE_IDEMPOTENCY_KEY - Duplicate request detected
- ERR_KEY_SCOPES_UNAUTHORIZED - API key lacks required permissions
- ERR_TOKEN_NOT_FOUND - Token not found or invalid
- ERR_INVALID_PROOF - Proof type not recognized or invalid
Integration Best Practices
When integrating the token burn functionality into your product:
- Use meaningful proof types that reflect actual user engagement
- Implement proper error handling to manage failed burn attempts
- Consider the appropriate burn amount for each action to balance tokenomics
- Use idempotency keys to prevent duplicate burns during network issues
- Record burn transaction hashes for transparency with your community