# Order statuses

{% @mermaid/diagram content="flowchart TD
%% Pastel Styles
classDef expectedFlow fill:#B5E3FF,stroke:#4A90E2,stroke-width:2px,color:#000,rx:8px,ry:8px
classDef payout fill:#C5F7C1,stroke:#4CAF50,stroke-width:2px,color:#000,rx:8px,ry:8px
classDef refund fill:#FFE5B4,stroke:#FF9800,stroke-width:2px,color:#000,rx:8px,ry:8px
classDef fail fill:#F8C8DC,stroke:#E57373,stroke-width:2px,color:#000,rx:8px,ry:8px
classDef terminal fill:#E0E0E0,stroke:#9E9E9E,stroke-width:2px,color:#000,rx:8px,ry:8px

```
%% Deposit states
A[deposit_awaiting]:::expectedFlow --> B[deposit_validating]:::expectedFlow
A --> E2[deposit_canceled]:::terminal
A --> D2[deposit_invalid]:::terminal
A --> F2[deposit_expired]:::terminal
B --> C[deposit_successful]:::expectedFlow
B --> D[deposit_invalid]:::terminal
B --> E[deposit_canceled]:::terminal
B --> F[deposit_expired]:::terminal

%% Payout states
C --> G[payout_pending]:::expectedFlow
G --> H[payout_successful]:::payout
G --> J[payout_failed]:::fail
J --> H


%% Refund states
J --> K[refund_pending]:::refund
K --> L[refund_successful]:::refund
K --> M[refund_failed]:::fail
M --> |Retry until refund_successful| L" %}
```

Statuses explanation:

* deposit\_awaiting – waiting for a user to make the deposit
* deposit\_validating – user confirmed deposit, validating
* deposit\_invalid – deposit was invalid (e.g., wrong amount, wrong reference)
* deposit\_successful – deposit validated successfully, initiating payout
* deposit\_canceled – order was canceled by a user before deposit was made
* deposit\_expired – deposit was not made in time
* payout\_pending – payout is being processed
* payout\_successful – payout completed successfully
* payout\_failed – payout failed (e.g., invalid wallet address, blockchain failure)
* refund\_pending – refund is being processed
* refund\_successful – refund completed successfully
* refund\_failed – refund failed (e.g., bank rejection, blockchain failure)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fonbnk.com/server-to-server/order-statuses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
