List Orders
Retrieve a paginated list of orders for a specific store.
HTTP Method & Endpoint
GET | /order
Request
Headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json | Specifies that the response will be in JSON format |
Authorization | Bearer {token} | Authentication token (replace {token} with your actual token) |
x-store-id | {storeId} | StoreId (replace {storeId} with your actual storeId) |
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 |
Order Object Properties
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier for the order |
storeId | String | Store ID associated with the order |
customerId | String | Customer's unique identifier |
status | String | Order status (e.g., "PENDING") |
fulfillmentStatus | String | Fulfillment status (e.g., "PENDING") |
purchaseDate | String | ISO timestamp of when order was placed |
paymentMethod | enum(COD,CVS) | Payment method used (e.g., "COD") |
totalAmount | Number | Total amount of the order |
orderItems | Array(OrderItem) | List of items in the order |
OrderItem Properties
| Field | Type | Description |
|---|---|---|
variantId | String | ID of the product variant |
title | String | Product title |
description | String | Product description |
brandName | String | Brand name of the product |
quantity | Number | Quantity ordered |
price | Number | Price per unit |
Pagination Object Properties
| Field | Type | Description |
|---|---|---|
totalItems | Number | Total number of items available |
currentPage | Number | Current page number |
totalPages | Number | Total number of pages |
pageSize | Number | Number of items per page |
Examples
cURL
curl -X GET "https://dev-sfapi.unisouk.com/order?page=1&limit=10" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-H "x-store-id: <STORE_ID>"
Javascript (React)
import axios from "axios";
const fetchOrders = async () => {
try {
const response = await axios.get("https://dev-sfapi.unisouk.com/order?page=1&limit=10", {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <TOKEN>",
"x-store-id": "<STORE_ID>",
},
});
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 |