Shop / Get Orders
### API Endpoint: Retrieve Orders This endpoint allows you to retrieve a list of orders from the system. It utilizes a GET request to fetch the relevant data based on the specified parameter
Body parameters
module
|
string |
Example: orders
|
data
|
object |
Example:
|
### API Endpoint: Retrieve Orders
This endpoint allows you to retrieve a list of orders from the system. It utilizes a GET request to fetch the relevant data based on the specified parameters.
#### Request Parameters
The request body should be in JSON format and includes the following parameters:
- **module** (string): Specifies the module to interact with. In this case, it should be set to `"orders"`.
- **data** (object): An empty object is provided, indicating that no additional filters or parameters are applied to the request.
**Example Request Body:**
``` json
{
"module": "orders",
"data": {}
}
#### Expected Response
Upon a successful request, the API will return a JSON response with the following structure:
- **success** (boolean): Indicates whether the request was successful.
- **data** (object): Contains the order data.
- **content** (array): An array of order objects, each containing:
- **id** (string): Unique identifier for the order.
- **client_id** (string): Identifier for the client associated with the order.
- **order_date** (string): Date when the order was placed.
- **note** (string): Any additional notes related to the order.
- **status_id** (string): Identifier for the current status of the order.
- **tax_id** (string): Identifier for the primary tax applied to the order.
- **tax_id2** (string): Identifier for any secondary tax applied.
- **discount_amount** (string): Amount of discount applied to the order.
- **discount_amount_type** (string): Type of discount amount (e.g., fixed or percentage).
- **discount_type** (string): Type of discount (e.g., 'amount' or 'percentage').
- **created_by** (string): Identifier for the user who created the order.
- **project_id** (string): Identifier for the project associated with the order.
- **files** (string): Any files associated with the order.
- **company_id** (string): Identifier for the company related to the order.
- **deleted** (boolean): Indicates if the order has been marked as deleted.
- **created_by_hash** (string): A hash of the creator's identifier for security purposes.
- **total** (integer): Total number of orders retrieved.
**Example Response:**json
{
"success": true,
"data": {
"content": [
{
"id": "",
"client_id": "",
"order_date": "",
"note": "",
"status_id": "",
"tax_id": "",
"tax_id2": "",
"discount_amount": "",
"discount_amount_type": "",
"discount_type": "",
"created_by": "",
"project_id": "",
"files": "",
"company_id": "",
"deleted": "",
"created_by_hash": ""
}
],
"total": 0
}
}
```
#### Notes
- Ensure that the request is properly formatted as JSON.
- The response will contain an array of orders, which may be empty if no orders exist.
- Check the `success` field in the response to confirm that the request was processed correctly.