CoinfiraEnergy API
API v1 API Reference

Order lifecycle

#Statuses

Status Terminal Meaning
pending No The order was accepted and activation or delegation is in progress.
active Yes Delegation was confirmed and billing was finalized.
failed Yes Activation or delegation failed. The merchant was not charged.
expired Yes The order can no longer be processed.
cancelled Yes The order was cancelled before completion.

New order requests normally return HTTP 202 with status: pending. A later GET /api/v1/energy/orders/{clientOrderId} still returns HTTP 200; inspect the JSON status field to determine business state.

Use webhooks as the primary completion signal and status polling as recovery:

  1. Persist the 202 response.
  2. Wait for energy.order.active or energy.order.failed.
  3. If no event arrives within the merchant's expected window, query status.
  4. Treat webhook deliveries and polling results as idempotent state updates.
  5. Do not submit another order merely because the first one is still pending.

#Billing point

The balance is charged only after delegation is confirmed and the order is finalized as active. A failed activation or delegation leaves the merchant balance unchanged, including when the activation transaction itself succeeded.