API Supports Idempotency
π CatFee Energy Purchase API Now Supports Idempotency!By adding an optional parameter client_order_id
, users can now ensure that the same request will not be executed multiple times, effectively preventing duplicate charges, inconsistent order statuses, and making transactions more secure and reliable.
π What is Idempotency and Why is it Important?
Idempotency means that no matter how many times the same request is submitted, the final result is identical, and the request won't be re-executed. This is especially important for payment and purchase APIs, as it helps prevent:
Duplicate charges due to network timeouts
Inconsistent states caused by system failures
User errors such as repeated submissions
Now, the CatFee Energy Purchase API uses client_order_id
to achieve idempotency, ensuring the same request wonβt be processed more than once. Your transactions are now safer and more reliable!
π How to Use CatFee Energy Purchase API for Idempotent Requests?
π Request Example
According to CatFee.IO Rest API rules, all parameters are passed via query parameters, and the signature calculation does NOT include query parameters.
Example POST Request
If a user wants to purchase 65000 ENERGY with a client_order_id=abc123
for idempotency, the complete request would be:
π Request Headers
π Parameter Description
client_order_id
Optional unique client-side ID used to enforce idempotency
πΉ Idempotency Logic
If
client_order_id
is submitted for the first time, the system creates a new energy purchase order and returns its details.If the same
client_order_id
is submitted again, the system returns the previous order response without charging or creating a new order.
π Response Example
π― First Request - Success
π Duplicate Submission with Same client_order_id
client_order_id
If the user resubmits the same request (due to timeout or retry), the API returns the original order result, avoiding any duplicate charge:
β This effectively prevents issues such as double charges due to user mistakes or network glitches!
π― When to Use Idempotent API Calls?
π 1. Preventing Duplicate Submissions from Network Timeouts
If the user sends a purchase request but doesnβt receive a timely response, they may mistakenly assume it failed and retry.
Using client_order_id
ensures no duplicate purchase is made, even if retried.
π 2. Avoiding Repeated Charges During Batch Operations
Automated scripts may crash mid-batch and leave some requests in an uncertain state.
With client_order_id
, each request is uniquely tracked and wonβt be executed twice.
π 3. Enhancing Reliability of API Calls
Many payment systems and exchanges require API requests to be idempotent. Now CatFee supports this too, increasing reliability across business scenarios.
π CatFee Makes Energy Trading More Efficient and Secure!
CatFee is always focused on improving user experience. With idempotency now supported in the energy purchase API, you can use client_order_id
to make transactions safer, avoid duplicate charges, and enjoy more stable API calls.
π Try the CatFee Energy Purchase API today and make your TRON-based transactions smoother and worry-free! π
Last updated
Was this helpful?