> For the complete documentation index, see [llms.txt](https://docs.fonbnk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fonbnk.com/server-to-server/api-endpoints/get-orders.md).

# Get orders

## <mark style="color:$success;">\[GET]</mark> /api/v2/orders

Gets a list of orders with cursor pagination and optional filters.

Request query params type:

```typescript
type QueryParams = {
    limit: number,// required
    cursor?: PaymentChannel,// optional
    userEmail?: string,// optional
    status?: OrderStatus,// optional
    fromDate?: number,// optional, unix mx
    toDate?: number,// optional, unix 
    depositCurrencyCode?: string,// optional
    depositPaymentChannel?: PaymentChannel,// optional
    depositCurrencyType?: CurrencyType,// optional
    payoutCurrencyCode?: string,// optional
    payoutPaymentChannel?: PaymentChannel,// optional
    payoutCurrencyType?: string,// optional
    depositUserWalletAddress?: string,// optional
    payoutUserWalletAddress?: string,// optional
    depositUserPhoneNumber?: string,// optional
    payoutUserPhoneNumber?: string,// optional
}
```

Response type:

{% code overflow="wrap" expandable="true" %}

```typescript
type Response = {
  nextCursor?: string;
  list: GetOrderResponse[];
}
```

{% endcode %}

Response example:

{% code overflow="wrap" expandable="true" %}

```json
{
    "nextCursor": "69283d079061f4031ad1ba03",
    "list": [
        {
            "_id": "69283e024a1db009177f2146",
            "countryIsoCode": "KE",
            "userId": "69283c0518613bc9de730cb4",
            "userEmail": "testuser+ke@fonbnk.com",
            "status": "deposit_canceled",
            "deposit": {
                "paymentChannel": "mobile_money",
                "currencyType": "fiat",
                "currencyCode": "KES",
                "currencyDetails": {
                    "countryIsoCode": "KE",
                    "carrier": {
                        "code": "ke_safaricom",
                        "name": "Safaricom Kenya",
                        "_id": "618e43914f57e07d255ff353"
                    }
                },
                "cashout": {
                    "amountBeforeFees": 135,
                    "amountAfterFees": 130,
                    "amountBeforeFeesUsd": 1.037584,
                    "amountAfterFeesUsd": 0.999155,
                    "chargedFees": [
                        {
                            "id": "service_fee",
                            "type": "percentage",
                            "recipient": "platform",
                            "amount": 3.38
                        },
                        {
                            "id": "merchant_fee",
                            "type": "percentage",
                            "recipient": "merchant",
                            "amount": 1.35
                        }
                    ],
                    "chargedFeesUsd": [
                        {
                            "id": "service_fee",
                            "type": "percentage",
                            "recipient": "platform",
                            "amount": 0.025978
                        },
                        {
                            "id": "merchant_fee",
                            "type": "percentage",
                            "recipient": "merchant",
                            "amount": 0.010376
                        }
                    ],
                    "totalChargedFees": 4.73,
                    "totalChargedFeesUsd": 0.036354,
                    "exchangeRate": 130.11,
                    "exchangeRateAfterFees": 135.1142,
                    "chargedFeesPerRecipient": {
                        "platform": 3.38,
                        "merchant": 1.35
                    },
                    "chargedFeesPerRecipientUsd": {
                        "platform": 0.025978,
                        "merchant": 0.010376
                    },
                    "feeSettings": [
                        {
                            "id": "service_fee",
                            "recipient": "platform",
                            "type": "percentage",
                            "value": 2.5,
                            "min": 0,
                            "max": "Infinity"
                        },
                        {
                            "id": "merchant_fee",
                            "recipient": "merchant",
                            "type": "percentage",
                            "value": 1,
                            "min": 0,
                            "max": "Infinity"
                        }
                    ]
                },
                "providedFieldsToCreateOrder": {
                    "phoneNumber": "2348012345678",
                    "carrierCode": "ke_safaricom"
                },
                "transferInstructions": {
                    "type": "stk_push",
                    "intermediateActionAttempts": 1,
                    "intermediateActionMaxAttempts": 3,
                    "intermediateActionButtonText": "Retry USSD prompt initialization",
                    "intermediateActionNextAttemptAvailableAt": "2025-11-27T12:04:14.750Z",
                    "intermediateActionTimeoutMs": 60000,
                    "isIntermediateActionAvailable": true,
                    "forcePhoneNumberVerification": true,
                    "fieldsForIntermediateAction": [
                        {
                            "key": "otpCode",
                            "label": "OTP code",
                            "type": "number",
                            "required": true
                        }
                    ],
                    "instructionsText": "It is a sandbox offer. Confirm the transfer from your side and system will automatically confirm the transfer within 1 minute.",
                    "warningText": "Non-confirmed orders will be automatically canceled after 5 minutes.",
                    "transferDetails": [
                        {
                            "id": "amountToSend",
                            "label": "Amount to send",
                            "value": "135"
                        }
                    ],
                    "fieldsToConfirmOrder": []
                }
            },
            "payout": {
                "paymentChannel": "crypto",
                "currencyType": "crypto",
                "currencyCode": "POLYGON_USDT",
                "currencyDetails": {
                    "network": "POLYGON",
                    "asset": "USDT",
                    "contractAddress": "0x3b3a06b48119c035a2e86afdb69d9ad930643b3d"
                },
                "cashout": {
                    "amountBeforeFees": 1.000645,
                    "amountAfterFees": 1,
                    "amountBeforeFeesUsd": 1.000645,
                    "amountAfterFeesUsd": 1,
                    "chargedFees": [
                        {
                            "id": "gas",
                            "type": "flat_amount",
                            "recipient": "blockchain",
                            "amount": 0.000645
                        }
                    ],
                    "chargedFeesUsd": [
                        {
                            "id": "gas",
                            "type": "flat_amount",
                            "recipient": "blockchain",
                            "amount": 0.000645
                        }
                    ],
                    "totalChargedFees": 0.000645,
                    "totalChargedFeesUsd": 0.000645,
                    "exchangeRate": 1,
                    "exchangeRateAfterFees": 1.0006,
                    "chargedFeesPerRecipient": {
                        "blockchain": 0.000645
                    },
                    "chargedFeesPerRecipientUsd": {
                        "blockchain": 0.000645,
                        "platform": 0.025978,
                        "merchant": 0.010376
                    },
                    "feeSettings": [
                        {
                            "id": "gas",
                            "recipient": "blockchain",
                            "type": "flat_amount",
                            "value": 0.000645,
                            "min": 0,
                            "max": "Infinity"
                        }
                    ]
                },
                "providedFieldsToCreateOrder": {
                    "blockchainWalletAddress": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20"
                }
            },
            "statusChangeLogs": [
                {
                    "newStatus": "deposit_canceled",
                    "date": "2025-11-27T12:03:20.472Z"
                }
            ],
            "createdAt": "2025-11-27T12:03:14.753Z",
            "updatedAt": "2025-11-27T12:03:20.473Z",
            "expiresAt": "2025-11-27T12:08:14.702Z"
        },
        {
            "_id": "69283d079061f4031ad1ba03",
            "countryIsoCode": "KE",
            "userId": "69283c0518613bc9de730cb4",
            "userEmail": "testuser+ke@fonbnk.com",
            "status": "payout_successful",
            "deposit": {
                "paymentChannel": "mobile_money",
                "currencyType": "fiat",
                "currencyCode": "KES",
                "currencyDetails": {
                    "countryIsoCode": "KE",
                    "carrier": {
                        "code": "ke_safaricom",
                        "name": "Safaricom Kenya",
                        "_id": "618e43914f57e07d255ff353"
                    }
                },
                "cashout": {
                    "amountBeforeFees": 135,
                    "amountAfterFees": 130,
                    "amountBeforeFeesUsd": 1.037823,
                    "amountAfterFeesUsd": 0.999385,
                    "chargedFees": [
                        {
                            "id": "service_fee",
                            "type": "percentage",
                            "recipient": "platform",
                            "amount": 3.38
                        },
                        {
                            "id": "merchant_fee",
                            "type": "percentage",
                            "recipient": "merchant",
                            "amount": 1.35
                        }
                    ],
                    "chargedFeesUsd": [
                        {
                            "id": "service_fee",
                            "type": "percentage",
                            "recipient": "platform",
                            "amount": 0.025984
                        },
                        {
                            "id": "merchant_fee",
                            "type": "percentage",
                            "recipient": "merchant",
                            "amount": 0.010378
                        }
                    ],
                    "totalChargedFees": 4.73,
                    "totalChargedFeesUsd": 0.036362,
                    "exchangeRate": 130.08,
                    "exchangeRateAfterFees": 135.0831,
                    "chargedFeesPerRecipient": {
                        "platform": 3.38,
                        "merchant": 1.35
                    },
                    "chargedFeesPerRecipientUsd": {
                        "platform": 0.025984,
                        "merchant": 0.010378
                    },
                    "feeSettings": [
                        {
                            "id": "service_fee",
                            "recipient": "platform",
                            "type": "percentage",
                            "value": 2.5,
                            "min": 0,
                            "max": "Infinity"
                        },
                        {
                            "id": "merchant_fee",
                            "recipient": "merchant",
                            "type": "percentage",
                            "value": 1,
                            "min": 0,
                            "max": "Infinity"
                        }
                    ]
                },
                "providedFieldsToCreateOrder": {
                    "phoneNumber": "2348012345678",
                    "carrierCode": "ke_safaricom"
                },
                "providedFieldsToConfirmOrder": {},
                "transferInstructions": {
                    "type": "otp_stk_push",
                    "intermediateActionAttempts": 2,
                    "intermediateActionMaxAttempts": 3,
                    "intermediateActionButtonText": "Verify OTP code",
                    "intermediateActionNextAttemptAvailableAt": "2025-11-27T12:00:14.390Z",
                    "intermediateActionTimeoutMs": 30000,
                    "isIntermediateActionAvailable": true,
                    "forcePhoneNumberVerification": true,
                    "fieldsForIntermediateAction": [
                        {
                            "key": "otpCode",
                            "label": "OTP code",
                            "type": "number",
                            "required": true
                        }
                    ],
                    "instructionsText": "It is a sandbox offer. Use 123456 as OTP code and confirm the transfer from your side and system will automatically confirm the transfer within 1 minute.",
                    "warningText": "Non-confirmed orders will be automatically canceled after 5 minutes.",
                    "transferDetails": [
                        {
                            "id": "amountToSend",
                            "label": "Amount to send",
                            "value": "135"
                        }
                    ],
                    "fieldsToConfirmOrder": [],
                    "intermediateActionRequired": true,
                    "intermediateActionExecuted": true,
                    "otpChannel": "sms"
                }
            },
            "payout": {
                "paymentChannel": "crypto",
                "currencyType": "crypto",
                "currencyCode": "POLYGON_USDT",
                "currencyDetails": {
                    "network": "POLYGON",
                    "asset": "USDT",
                    "contractAddress": "0x3b3a06b48119c035a2e86afdb69d9ad930643b3d"
                },
                "cashout": {
                    "amountBeforeFees": 1.000645,
                    "amountAfterFees": 1,
                    "amountBeforeFeesUsd": 1.000645,
                    "amountAfterFeesUsd": 1,
                    "chargedFees": [
                        {
                            "id": "gas",
                            "type": "flat_amount",
                            "recipient": "blockchain",
                            "amount": 0.000645
                        }
                    ],
                    "chargedFeesUsd": [
                        {
                            "id": "gas",
                            "type": "flat_amount",
                            "recipient": "blockchain",
                            "amount": 0.000645
                        }
                    ],
                    "totalChargedFees": 0.000645,
                    "totalChargedFeesUsd": 0.000645,
                    "exchangeRate": 1,
                    "exchangeRateAfterFees": 1.0006,
                    "chargedFeesPerRecipient": {
                        "blockchain": 0.000645
                    },
                    "chargedFeesPerRecipientUsd": {
                        "blockchain": 0.000645,
                        "platform": 0.025984,
                        "merchant": 0.010378
                    },
                    "feeSettings": [
                        {
                            "id": "gas",
                            "recipient": "blockchain",
                            "type": "flat_amount",
                            "value": 0.000645,
                            "min": 0,
                            "max": "Infinity"
                        }
                    ]
                },
                "providedFieldsToCreateOrder": {
                    "blockchainWalletAddress": "0x5b7ae3c6c87f4a3f94b35c77233b13191ebfad20"
                },
                "transaction": {
                    "meta": {
                        "transactionHash": "0xe168c39bf7165c0eaa88e4df1e21e987666e44f11f2bea6f9be1c145f382dade"
                    }
                }
            },
            "statusChangeLogs": [
                {
                    "oldStatus": "deposit_awaiting",
                    "newStatus": "deposit_validating",
                    "date": "2025-11-27T12:01:43.660Z"
                },
                {
                    "oldStatus": "deposit_validating",
                    "newStatus": "deposit_successful",
                    "date": "2025-11-27T12:02:00.770Z"
                },
                {
                    "oldStatus": "deposit_successful",
                    "newStatus": "payout_pending",
                    "date": "2025-11-27T12:02:01.306Z"
                },
                {
                    "oldStatus": "payout_pending",
                    "newStatus": "payout_successful",
                    "date": "2025-11-27T12:02:19.053Z"
                }
            ],
            "createdAt": "2025-11-27T11:59:03.754Z",
            "updatedAt": "2025-11-27T12:02:19.124Z",
            "expiresAt": "2025-11-27T12:04:03.673Z"
        }
    ]
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/api-endpoints/get-orders.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.
