Production API
Quickstart
Create an API credential, sign a request, and submit your first production Energy order.
On this page
This is the shortest path from an empty integration to a created order.
1. Create a credential
Open Dashboard → API, select Create API key, and save both values:
api_key— the public credential identifier;api_secret— the secret shown once.
Keep the secret on your server, for example in RENTRON_API_SECRET. Never expose it to a browser, mobile app, URL, or log.
2. Check server time
curl https://api.rentron.xyz/v1/time
{"unix_time":1784376000}
A signed request timestamp must be within five minutes of server time.
3. Read order options
Sign GET /v1/energy/options. It returns the portion size, allowed durations, and whether order intake is enabled.
{"energy_per_portion":65000,"max_energy":1300000,"duration_hours":[1],"intake_enabled":true}
4. Create an order
Serialize JSON once and sign the exact bytes you send.
{"client_request_id":"order-1042","address":"TXYZ","energy":65000,"duration_hours":1,"expected_total_trx":"3.200000"}
POST /v1/energy/orders HTTP/1.1
Host: api.rentron.xyz
Content-Type: application/json
Authorization: HMAC-SHA256 {api_key}:{base64_signature}
X-Request-Timestamp: 1784376000
A new order returns 201 Created, the order JSON, and Location: /v1/energy/orders/{id}. An identical replay returns the existing order with 200 OK.
Use the exact total_trx from the latest quote. If energy_price_changed is returned, fetch a new quote and submit once more; no order or hold was created.
5. Wait for completion
Poll Location after 1, 2, 5, then 10 seconds. Stop only when both values are true:
{"lifecycle_final":true,"delivery_final":true}
Next: get an order, polling and retries, and API errors.
Rentron