OMS Sales APIs v1.0
Overview: This API collection includes functionalities for order extraction and Access tokens are required for API authentication.
- Authentication: Access Token Request Type: POST
- Endpoint https://api-copilot-stage-local.xstak.com/v1/admin/service-account/token
- Description This API allows users to obtain an access token required for further API requests.
- Request Parameters
Query Parameters:
- clientId (string, required): Refers to the unique identifier assigned to a specific user or client.
- clientSecret (string, required): This is the password associated with the user.
- grantType (string, required): This value will always be client_credentials.
- companyCode (string, required): Represents the unique code assigned to a company for identification purposes.
- Request Body The request body should be in JSON format as shown below
{
"clientId": "{{client_id}}",
"clientSecret": "{{client_secret}}",
"grant type": "client_credentials",
"companyCode": "{{realm_id}}"
}- Example Request
curl -X POST "https://api-copilot-stage-local.xstak.com/v1/admin/serviceaccount/token" \
-H "Content-Type: application/json" \
-d '{
"clientId": "your_client_id",
"clientSecret": "your_client_secret",
"grant type": "client_credentials",
"companyCode": "your_company_code" }'Make sure to replace the placeholders {{client_id}}, {{client_secret}}, and {{realm_id}} with actual values. The access token will be returned in the response and should be used in subsequent API requests for authentication
Get Orders APIs
Overview:
This API is used to retrieve sales orders based on certain filtering criteria such as order status, location, and date range.
Get Orders API
- Request Type: GET
- Endpoint
https://oe-unc-stage-local.xstak.com/oe/v2/orders/sales_orders
- Request Parameters
Headers token (string, required): The access token used for authentication.
Query Parameters
- order_status (string, required): Specifies the status of the orders used to identify the tab (e.g., "pending", "completed").
- locationId (string, required): The unique location ID used to filter orders by specific locations.
- location_code (integer, optional): The location code for identifying specific locations.
- start_date (integer, required): The start date used to filter orders within a specified date range. The date must include the time zone.
Note:
Dates should include the time zone. For example: "date": "2024-10-17T05:10:06"
- Example Request
curl -X GET "https://oe-unc-stage-local.xstak.com/oe/v2/orders/sales_orders" \
-H "token: your_access_token" \
-d '{
"order_status": "completed",
"locationId": "12345",
"location_code": 67890,
"start_date": "2024-10-17T05:10:06+5:00" }'- Response The response will return an array of orders along with pagination details.
{
"userName": "String",
"email": "String",
"access_token": "String",
"expires_in": "Integer",
"refresh_expires_in": "Integer",
"token_type": "String”, //{{Bearer}} "not-before-policy": "Integer",
"scope": "String"
}- Example Response
{
"orders": [],
"page": {
"number": 1,
"size": 10,
"totalPages": 1,
"totalElements": 0
} }Ensure to replace placeholders such as your_access_token with the actual values in your API requests. The response contains paginated results of the sales orders.