Skip to main content

Version: v1

List Orders

Retrieve a paginated list of orders for a specific store.


HTTP Method & Endpoint

GET | /order


Request

Query Parameters

ParameterTypeRequiredDescription
pageNumberNoPage number to fetch (default: 1)
limitNumberNoNumber of items per page (default: 10)

Response Format

Success Response (200 OK)

FieldTypeDescription
messageStringStatus message indicating the result of the operation
dataDataContains the list of orders and pagination details
sourceStringSource of the order data (e.g., "db")

Data Object Properties

FieldTypeDescription
ordersArray(Order)List of order objects
paginationPaginationPagination 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 CodeDescription
400Bad Request - Invalid parameters or validation failed
401Unauthorized - Authentication token is missing or invalid
403Forbidden - Insufficient permissions
500Internal Server Error - Something went wrong on the server