Get Order
The GET endpoint retrieves details of an order specified by the orderId.
Endpoint
- URL:
/orders/{orderId} - Method:
GET
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
orderId | string | The unique identifier of the order. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. |
Request Body
- None
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"data": {
"entityId": "100",
"checkout": "664f2308d5775459152d6d2e",
"company": "664dec6cd5775459152d4922",
"customer": "664dec6cd5775459152d4926",
"customerDetails": {
"firstName": "riya",
"lastName": " c",
"email": "riya@gmail.com",
"phoneNumber": "23243244"
},
"companyDetails": {
"name": "Axim",
"email": "riya@gmail.com",
"phoneNumber": "23243244"
},
"guestOrder": false,
"orderedAt": "2024-05-23T11:05:52.545Z",
"shippingAddress": {
"shippingAddressId": "664dec6cd5775459152d4924",
"firstName": "riya",
"lastName": " c",
"address1": "23",
"address2": "",
"phoneNumber": "23243244",
"city": "texas",
"state": {
"name": "Alabama",
"code": "AL"
},
"country": {
"name": "United States",
"code": "US"
},
"zipcode": "23323444",
"id": "664dec6cd5775459152d4924"
},
"billingAddress": {
"billingAddressId": "664dec6cd5775459152d4923",
"firstName": "riya",
"lastName": " c",
"address1": "23",
"address2": "",
"phoneNumber": "23243244",
"city": "texas",
"state": {
"name": "Alabama",
"code": "AL"
},
"country": {
"name": "United States",
"code": "US"
},
"zipcode": "23323444",
"id": "664f2308d5775459152d6d2f"
},
"lineItems": [
{
"productId": "664f225659d877d2f49557b5",
"variantId": null,
"name": "groupproduct233",
"image": null,
"sku": "grp32434",
"bundledProducts": null,
"groupedProducts": [
{
"productId": "663a0cbe516313e5bc94ab30",
"name": "Safety Glasses",
"image": "https://assets.mydckapcommerce.com/645dd1e15e18e9b58c2e97a8/images/Frame86_2023_05_13_09_42_57.webp",
"sku": "sfty-4006",
"quantity": 12,
"price": 45,
"extendedTotalPrice": 540,
"_id": "664f2310d5775459152d6ddc"
},
{
"productId": "663a0cbe516313e5bc94ab2c",
"name": "Safety Work Gloves Green",
"image": "https://assets.mydckapcommerce.com/645dd1e15e18e9b58c2e97a8/images/Frame83_2023_05_13_09_39_47.webp",
"sku": "sfty-4005",
"quantity": 12,
"price": 30,
"extendedTotalPrice": 360,
"_id": "664f2310d5775459152d6ddd"
}
],
"quantity": 1,
"options": null,
"discounts": [],
"price": 900,
"extendedTotalPrice": 900,
"fulfilledQuantity": 0,
"returned": false,
"id": "664f2310d5775459152d6ddb"
}
],
"currency": {
"currency": "USD",
"symbol": "$"
},
"shipmentDetails": {
"shippingMethod": {
"name": "freeShipping",
"label": "Free Shipping",
"shippingMethodId": "663a0afe4587085935a4fa0d",
"type": {
"name": null,
"value": null,
"_id": "664f2310d5775459152d6de0"
},
"_id": "664f2310d5775459152d6ddf"
},
"_id": "664f2310d5775459152d6dde"
},
"paymentDetails": [
{
"paymentMethodId": "664f2310d5775459152d6dde",
"paymentType": "offline",
"paymentMethodType": "cash",
"paymentGateway": "Pay Later",
"paymentStatus": null,
"amount": 900,
"paymentCharge": null,
"paymentAdditionalDetails": {
"paymentId": null
}
}
],
"paymentStatus": "refunded",
"orderStatus": "partially fulfilled",
"shippingMethod": "663a0afe4587085935a4fa0d",
"shippingZone": "663a0afe4587085935a4fb84",
"paymentMethod": "663a0afe4587085935a4fa0b",
"shippingCost": 0,
"taxAmount": 0,
"total": 900,
"subTotal": 900,
"approved": true,
"approvalBy": {
"name": "riya c",
"user": "664dec6cd5775459152d4926",
"type": "customer"
},
"createdBy": {
"id": "664dec6cd5775459152d4926",
"name": "riya c",
"type": "store"
},
"timeline": [
{
"comment": null,
"type": "event",
"event": {
"subject": "{{name}} placed an order",
"description": "{{name}} created a new order for total $900.00"
},
"isCustomer": true,
"customer": "664dec6cd5775459152d4926",
"user": null,
"id": "664f2310d5775459152d6de1",
"createdAt": "2024-05-23T11:05:52.550Z",
"updatedAt": "2024-05-23T11:05:52.550Z"
}
// Additional timeline events here...
],
"fulfilledItems": [],
"payments": [],
"refunds": [],
"createdAt": "2024-05-23T11:05:52.550Z",
"updatedAt": "2024-08-29T09:13:33.301Z",
"isCompanyDeleted": true,
"id": "664f2310d5775459152d6dd8"
}
}
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates the success status of the request, typically true. |
data | object | Contains detailed order information. |
Data Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the order within the response. |
entityId | string | The unique identifier for the order. |
checkout | string | Identifier for the checkout process. |
company | string | Identifier for the company. |
customer | string | Identifier for the customer. |
customerDetails | object | Object containing customer information, such as firstName, lastName, email, and phoneNumber. |
paymentTerms | object | Object containing payments details information, such as paymentTerm, depositRequired, depositPercentage |
companyDetails | object | Object containing company information, such as name, email, and phoneNumber. |
guestOrder | boolean | Indicates if the order was placed as a guest (no account). |
orderedAt | string | The date and time when the order was placed. |
shippingAddress | object | Object containing details of the shipping address, such as companyName, companyEmail, firstName, lastName, address, phoneNumber, and city. |
billingAddress | object | Object containing details of the billing address, similar to shippingAddress. |
lineItems | array | Array of items that were ordered, each with details such as productId, name, sku, quantity, price, and groupedProducts. |
currency | object | Object containing currency information, like currency and symbol. |
shipmentDetails | object | Details of the shipment, including shippingMethod which contains name, label, and shippingMethodId. |
paymentDetails | object | Details of the payment, including paymentGateway, paymentType, and amount. |
paymentStatus | string | Status of the payment. |
orderStatus | string | Current status of the order. |
shippingCost | number | Cost of shipping for the order. |
taxAmount | number | Tax amount applied to the order. |
total | number | Total amount for the order. |
subTotal | number | Subtotal amount for the order, before tax and shipping. |
approved | boolean | Indicates if the order has been approved. |
approvalBy | object | Information about the approver, including name and user. |
createdBy | object | Object indicating who created the order, including id and name. |
metaFields | array | Additional metadata for the order (currently empty). |
fulfilledItems | array | Array of items that have been fulfilled (currently empty). |
payments | array | Array of payment records, if any (currently empty). |
refunds | array | Array of refund records, if any (currently empty). |
createdAt | string | Timestamp of when the order was created. |
updatedAt | string | Timestamp of the last update to the order. |
isCompanyDeleted | boolean | Indicates if the company has been deleted. |
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request: Invalid input data or missing parameters. |
| 401 | Unauthorized: Access token is invalid or missing. |
| 500 | Internal Server Error: An error occurred on the server. |
Notes
- Ensure you replace
{orderId}in the URL with the actual unique identifier of the order you wish to retrieve. - Provide a valid and active access token in the request header to authenticate your request.