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 |
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) |
Response Format
Success Response (200 OK)
| Field | Type | Description |
|---|---|---|
message | String | Status message indicating the result of the operation |
data | Data | Contains all details about the order |
source | String | Source of the order data (e.g., "unisouk") |
Data 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 |
channelType | Enum(DEFAULT,ONDC) | Channel through which order was placed |
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") |
paymentDetail | PaymentDetail | Detailed payment information |
buyerInfo | BuyerInfo | Buyer's contact and address information |
shippingDetail | ShippingDetail | Shipping address details |
address | Address | Primary address associated with the order |
packageMeasurement | Object | Package dimensions and weight (if available) |
totalAmount | Number | Total amount of the order |
externalOrderId | String | External reference ID for the order |
externalOrderStatus | String | Status from external system (if applicable) |
extraData | Object | Additional custom data |
orderItems | Array(OrderItem) | List of items in the order |
PaymentDetail Properties
| Field | Type | Description |
|---|---|---|
subTotalAmount | Number | Order subtotal before charges |
charges | Charges | Breakdown of additional charges |
totalAmount | Number | Final amount after all charges |
Charges Properties
| Field | Type | Description |
|---|---|---|
delivery | Number | Delivery charges |
tax | Number | Tax amount |
packing | Number | Packing charges |
BuyerInfo Properties
| Field | Type | Description |
|---|---|---|
firstName | String | Buyer's first name |
lastName | String | Buyer's last name |
building | String | Building/street address |
address | String | Additional address information |
city | String | City name |
pincode | Number | Postal/ZIP code |
state | String | State/province |
country | String | Country |
email | String | Contact email |
phone | String | Contact phone number |
isShippingSame | Boolean | Whether shipping address matches billing |
ShippingDetail Object
| Parameter | Type | Required | Description |
|---|---|---|---|
firstName | String | Yes | Recipient's first name |
lastName | String | Yes | Recipient's last name |
address | String | Yes | Shipping street address |
city | String | Yes | Shipping city |
pincode | Number | Yes | Shipping postal/ZIP code |
state | String | Yes | Shipping state/province |
country | String | Yes | Shipping country |
email | String | Yes | Recipient's email address |
phone | String | Yes | Recipient's phone number |
Address Object
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Full name |
address | String | Yes | Street address |
city | String | Yes | City |
pincode | Number | Yes | Postal/ZIP code |
state | String | Yes | State/province |
country | String | Yes | Country |
email | String | Yes | Email address |
phone | String | Yes | Phone number |
OrderItem Properties
| Field | Type | Description |
|---|---|---|
variantId | String | ID of the product variant |
productId | String | ID of the parent product |
title | String | Product title |
description | String | Product description |
brandName | String | Brand name of the product |
sku | String | Stock keeping unit |
quantity | Number | Quantity ordered |
price | Number | Price per unit |
images | Array(Image) | Product images |
Image Properties
| Field | Type | Description |
|---|---|---|
position | Number | Display order of image |
url | String | URL of the image |
Examples
cURL
curl -X GET "https://dev-sfapi.unisouk.com/order/30256970401565696" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-H "x-store-id: <STORE_ID>"
Javascript (React)
import axios from "axios";
const fetchOrderDetails = async (orderId) => {
try {
const response = await axios.get(`https://dev-sfapi.unisouk.com/order/${orderId}`, {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <TOKEN>",
"x-store-id": "<STORE_ID>",
},
});
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 |