Developer documentation

API workspace
https://api.rentron.xyz/v1
OpenAPI schema

Quickstart

// DOC

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_minutes":[15,60,240,1440],"intake_enabled":true}

4. Create an order

Serialize JSON once and sign the exact bytes you send.

{"client_request_id":"order-1042","address":"TJRabPrwbZy45sbavfcjinPJC18kjpRTv8","energy":65000,"duration_minutes":60,"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. Send when the Energy is usable

Poll Location after 1, 2, 5, then every 10 seconds. Send your own transaction as soon as energy_usable turns true:

{"status":"available","delivery_final":false,"energy_usable":true,"rental_expires_at":1784379612}

available means the Energy is already delegated to the address and spendable, and the window you paid for runs until rental_expires_at. delivered replaces it about a minute later, once our independent verification proves the delivery. Branch on energy_usable, not on delivered — waiting for the proof spends rental time you have already paid for.

6. Wait for the final state

Keep polling if you record the whole lifecycle. Stop only when both values are true:

{"lifecycle_final":true,"delivery_final":true}

Next: get an order, polling and retries, and API errors.