List Orders
Retrieve a paginated list of orders for a specific store.
HTTP Method & Endpoint
GET | /order
Request
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | Number | No | Page number to fetch (default: 1) |
limit | Number | No | Number of items per page (default: 10) |
Response Format
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
message | String | Status message indicating the result of the operation |
data | Data | Contains the list of orders and pagination details |
source | String | Source of the order data (e.g., "db") |
Data Object Properties
| Field | Type | Description |
|---|---|---|
orders | Array(Order) | List of order objects |
pagination | Pagination | Pagination metadata |
Examples
Javascript (React)
import axios from "axios";
import { api } from "../constant";
const getOrderList = async () => {
try {
const response = await api.get("/order?page=1&limit=10");
console.log("Orders fetched:", response.data);
} catch (error) {
console.error("Error fetching orders:", error.response?.data || error.message);
}
};
Sample Response
{
"message": "Orders fetched successfully",
"data": {
"orders": [
{
"id": "123",
"storeId": "124",
"customerId": "124",
"status": "PENDING",
"fulfillmentStatus": "PENDING",
"purchaseDate": "2025-03-25T11:50:23.890Z",
"paymentMethod": "COD",
"totalAmount": 100,
"orderItems": [
{
"variantId": "123",
"title": "test",
"description": "testing",
"brandName": "test",
"quantity": 1,
"price": 1
}
]
}
],
"pagination": {
"totalItems": 10,
"currentPage": 1,
"totalPages": 1,
"pageSize": 10
}
},
"source": "unisouk"
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or validation failed |
| 401 | Unauthorized - Authentication token is missing or invalid |
| 403 | Forbidden - Insufficient permissions |
| 500 | Internal Server Error - Something went wrong on the server |