Send transaction
How to Send a Transaction
To send a transaction, you need to send a POST request to the following API endpoint:
[POST] api.blls.me/billing/transactionsRequest Body
The body of the request should contain the following fields:
{
"from": "string", // Address from where the transaction is sent
"to": "string", // Address to where the transaction is sent
"value": 1, // Quantity of tokens to send
"signature": "string",// Signature to verify the transaction
"message": "string", // Optional message with the transaction
"symbol": "str", // Token symbol
"idempotencyKey": "string" // Optional: unique key to prevent duplicates (1-64 chars)
}Idempotency Protection
Automatic: If you don't provide an idempotencyKey, the system will automatically generate one based on your transaction signature. This ensures duplicate protection even for existing clients.
Manual (Recommended): For better control, provide your own idempotencyKey:
{
"from": "0x742d35Cc6634C0532925a3b8D5C",
"to": "0x8ba1f109551bD432803012645Hac",
"value": 100,
"symbol": "MTK",
"signature": "0x...",
"message": "Payment for invoice #12345",
"idempotencyKey": "payment-invoice-12345"
}Learn more about Idempotency Keys for safe API operations.
Signing the Transaction
To send a valid transaction, you need to sign it using your private key. You can read about how to sign a transaction here. The signature ensures the transaction is authorized by the wallet owner.
You can read how to sign the transaction here
API Responses
Success Response (200):
If the transaction is successful, you will receive a 200 status code with the transaction details:
{
"_id": "string", // Unique transaction ID
"from": "string", // Sender address
"to": "string", // Recipient address
"symbol": "string", // Token symbol
"timestamp": "2024-10-16T16:38:58.973Z", // Time of transaction
"message": "string", // Optional message
"value": 0 // Value of the transaction
}Validation Error (400):
If there’s a problem with the request data, you will receive a 400 status code indicating a validation error:
{
"url": "/transactions",
"statusCode": 409,
"statusMessage": "Validation Error",
"message": "Validation Error"
}Summary
To send a transaction:
- Send a POST request to api.blls.me/billing/transactions.
- Include the from and to addresses, value, signature, message, and symbol in the request body.
- Make sure your transaction is signed using your private key.
By following these steps, you can transfer tokens securely.