Get Order Details
Retrieve detailed information for a specific order using its ID.
HTTP Method & Endpoint
GET | /order/{orderId}
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId | String | Yes | Unique identifier of the order |
Response Format
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
message | String | Status message indicating the result of the operation |
data | Order Data | Contains all details about the order |
source | String | Source of the order data (e.g., "unisouk") |
Examples
Javascript (React)
import axios from "axios";
import { api } from "../constant";
const getOrderDetails = async (orderId) => {
try {
const response = await api.get(`/order/${orderId}`);
console.log("Order details:", response.data);
} catch (error) {
console.error("Error fetching order:", error.response?.data || error.message);
}
};
Sample Response
Click to view Sample Response
{
"message": "Order fetched successfully",
"data": {
"id": "30256970401565696",
"storeId": "30182834660443136",
"customerId": "30182834660443136",
"channelType": "DEFAULT",
"status": "PENDING",
"fulfillmentStatus": "PENDING",
"purchaseDate": "2025-03-25T11:50:23.888Z",
"paymentMethod": "COD",
"paymentDetail": {
"subTotalAmount": 0,
"charges": {
"delivery": 0,
"tax": 0,
"packing": 0
},
"totalAmount": 0
},
"buyerInfo": {
"firstName": "Aman",
"lastName": "Tiwari",
"building": "22 shiv nagar",
"address": "katargam",
"city": "surat",
"pincode": 395004,
"state": "gujarat",
"country": "india",
"email": "abc@gmail.com",
"phone": "9876543210",
"isShippingSame": false
},
"shippingDetail": {
"firstName": "Aman",
"lastName": "Tiwari",
"building": "22 shiv nagar",
"address": "katargam",
"city": "surat",
"pincode": 395004,
"state": "gujarat",
"country": "india",
"email": "abc@gmail.com",
"phone": "9876543210"
},
"address": {
"name": "Aman",
"building": "22 shiv nagar",
"address": "katargam",
"city": "surat",
"pincode": 395004,
"state": "gujarat",
"country": "india",
"email": "abc@gmail.com",
"phone": "9876543210"
},
"packageMeasurement": {},
"totalAmount": 50000,
"externalOrderId": "123",
"externalOrderStatus": "PENDING",
"extraData": {},
"orderItems": [
{
"variantId": "12",
"productId": "21",
"title": "test",
"description": "tesing",
"brandName": "test",
"sku": "SH-01",
"quantity": 1,
"price": 1,
"images": [
{
"position": 1,
"url": "http://test.com"
}
]
}
]
},
"source": "unisouk"
}
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid order ID |
| 401 | Unauthorized - Authentication token is missing or invalid |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Order with specified ID was not found |
| 500 | Internal Server Error - Something went wrong on the server |