Order Statuses
This section describes the various statuses an order can have, along with their meanings and whether they are final.
Statuses
ID | Status | Description | Is Final |
---|---|---|---|
0 | New | New order. | false |
1 | Filling | Order is being executed. | false |
2 | Stable | Energy delegation successful. | false |
3 | Expired | End of the delegation period. | false |
4 | Finishing | End of the delegation period. | false |
5 | Finished | Energy has been returned. | true |
6 | Failed | An error occurred. | true |
Usage
Order statuses allow you to track the lifecycle of an order. Below is a description of typical transitions:
- New → Filling → Stable: The order has been created and energy is being delegated.
- Stable → Expired → Finishing → Finished: The delegation period ends, and the energy is returned successfully.
- Failed: The order could not be completed due to an error.
Example Workflow
Transition from New to Finished
- The order is created with the
New
status. - The system processes the order, changing its status to
Filling
. - Once delegation succeeds, the status changes to
Stable
. - At the end of the delegation period, the status progresses through
Expired
andFinishing
. - Finally, the order is marked as
Finished
once the energy is returned.
Handling Failed Orders
If an error occurs during any phase, the order status will be set to Failed
. Such orders are considered final and cannot be modified.