Skip to main content

Get All Orders

The GET endpoint retrieves a list of orders with pagination.

Endpoint

  • URL: /open-api/api/orders
  • Method: GET

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Query Parameters

Query ParameterTypeDescription
pagenumberSpecifies the current page number for pagination. Default is 1 if not specified.
limitnumberSets the number of results per page for pagination.
entityIdstringFilters results by the specific order entity ID.
entityId:instringComma-separated list of entity IDs to filter multiple order entities.
paymentStatusstringFilters results by a specific payment status.
paymentStatus:instringComma-separated list of payment statuses to filter multiple statuses.
orderStatusstringFilters results by a specific order status.
orderStatus:instringComma-separated list of order statuses to filter multiple statuses.
approvedbooleanFilters results based on approval status.
idstringFilters results by a specific unique identifier of the order.
id:instringComma-separated list of IDs to filter multiple orders.
companystringFilters results by a specific company ID.
company:instringComma-separated list of company IDs to filter multiple companies.
customerstringFilters results by a specific customer ID.
customer:instringComma-separated list of customer IDs to filter multiple customers.
date_modified:mindateFilters orders modified after a specific date.
date_modified:maxdateFilters orders modified before a specific date.
date_created:mindateFilters orders created after a specific date.
date_created:maxdateFilters orders created before a specific date.

Notes

  • For parameters like :in, provide a comma-separated list of values.
  • Dates must be in a recognizable format for the date filtering to work correctly.
  • Ensure that parameters are accurately named to match the implementation in the filtering logic.

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Sample Request

curl --location '<BASE-URL>/orders?page=1&limit=10' \
--header 'accessToken: <ACCESS_TOKEN>'

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",
"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"
},
"metaFields": [],
"fulfilledItems": [],
"payments": [],
"refunds": [],
"createdAt": "2024-05-23T11:05:52.550Z",
"updatedAt": "2024-08-29T09:13:33.301Z",
"isCompanyDeleted": true,
"id": "664f2310d5775459152d6dd8"
}
],
"pagination": {
"page": 1,
"total": 13,
"count": 1
}
}

Success Response Body

FieldTypeDescription
successbooleanIndicates the success status of the request, typically true for a successful operation.
dataarrayContains an array of orders retrieved based on the query parameters.
paginationobjectContains pagination information such as page, total, and count.

Order Object

Each order object in the data array contains the following fields:

FieldTypeDescription
entityIdstringThe unique identifier for the order.
checkoutstringIdentifier for the checkout process.
companystringIdentifier for the company.
customerstringIdentifier for the customer.
customerDetailsobjectObject containing customer information, such as firstName, lastName, email, and phoneNumber.
paymentTermsobjectObject containing payments details information, such as paymentTerm, depositRequired, depositPercentage
companyDetailsobjectObject containing company information, such as name, email, and phoneNumber.
guestOrderbooleanIndicates if the order was placed as a guest (no account).
orderedAtstringThe date and time when the order was placed.
shippingAddressobjectObject containing details of the shipping address, such as companyName, companyEmail, firstName, lastName, address, phoneNumber, and city.
billingAddressobjectObject containing details of the billing address, similar to shippingAddress.
lineItemsarrayArray of items that were ordered, each with details such as productId, name, sku, quantity, price, and groupedProducts.
currencyobjectObject containing currency information, like currency and symbol.
shipmentDetailsobjectDetails of the shipment, including shippingMethod which contains name, label, and shippingMethodId.
paymentDetailsArrayDetails of the payment, including paymentGateway, paymentType, and amount.
paymentStatusstringStatus of the payment.
orderStatusstringCurrent status of the order.
shippingCostnumberCost of shipping for the order.
taxAmountnumberTax amount applied to the order.
totalnumberTotal amount for the order.
subTotalnumberSubtotal amount for the order, before tax and shipping.
approvedbooleanIndicates if the order has been approved.
approvalByobjectInformation about the approver, including name and user.
createdByobjectObject indicating who created the order, including id and name.
metaFieldsarrayAdditional metadata for the order (currently empty).
fulfilledItemsarrayArray of items that have been fulfilled (currently empty).
paymentsarrayArray of payment records, if any (currently empty).
refundsarrayArray of refund records, if any (currently empty).
createdAtstringTimestamp of when the order was created.
updatedAtstringTimestamp of the last update to the order.
isCompanyDeletedbooleanIndicates if the company has been deleted.
idstringUnique identifier for the order within the response.

Pagination Object

The pagination object contains the following fields:

FieldTypeDescription
pagenumberThe current page number of the result set.
totalnumberThe total number of entries available.
countnumberThe number of entries on the current page.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal Server Error: An error occurred on the server.

Notes

  • Ensure you provide a valid and active access token in the request header to authenticate your request.
  • Use the query parameters to navigate through different pages of order data.