Sales Orders
GET https://leads.qreq.com/api/sales-orders
curl --request GET \
--url 'https://leads.qreq.com/api/sales-orders' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Sales orders retrieved successfully.",
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Order #001",
"status": "draft",
"account": { "id": 1, "name": "Customer A" },
"assigned_to": 3,
"order_date": "2025-11-03",
"delivery_date": "2025-11-10",
"created_by": 1,
"products": [
{
"product_id": 1,
"quantity": 2,
"unit_price": 100,
"discount_type": "percentage",
"discount_value": 10
}
]
}
],
"per_page": 10,
"total": 1
}
}
POST https://leads.qreq.com/api/sales-orders
| Parameters | Details | Description |
|---|---|---|
| name | Required String | Sales order name |
| order_date | Required Date | Order date |
| delivery_date | Optional Date | Delivery date |
| status | Optional String | Order status (draft, confirmed, etc.) |
| products | Optional Array | Array of products with quantity, unit_price, discount_type, discount_value |
curl --request POST \
--url 'https://leads.qreq.com/api/sales-orders' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Order #001", "order_date": "2025-11-03", "delivery_date": "2025-11-10", "status": "draft", "products": [ { "product_id": 1, "quantity": 2, "unit_price": 100, "discount_type": "percentage", "discount_value": 10 } ] }'
--url 'https://leads.qreq.com/api/sales-orders' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Order #001", "order_date": "2025-11-03", "delivery_date": "2025-11-10", "status": "draft", "products": [ { "product_id": 1, "quantity": 2, "unit_price": 100, "discount_type": "percentage", "discount_value": 10 } ] }'
{
"status": "success",
"message": "Sales order created successfully.",
"data": {
"id": 1,
"name": "Order #001",
"status": "draft",
"products": [
{
"product_id": 1,
"quantity": 2,
"unit_price": 100,
"discount_type": "percentage",
"discount_value": 10
}
]
}
}
PUT https://leads.qreq.com/api/sales-orders/{sales_order_id}
curl --request PUT \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Order #001 Updated", "status": "confirmed" }'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Order #001 Updated", "status": "confirmed" }'
{
"status": "success",
"message": "Sales order updated successfully.",
"data": {
"id": 1,
"name": "Order #001 Updated",
"status": "confirmed"
}
}
DELETE https://leads.qreq.com/api/sales-orders/{sales_order_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Sales order deleted successfully."
}
PATCH https://leads.qreq.com/api/sales-orders/{sales_order_id}/toggle-status
curl --request PATCH \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Sales order status updated successfully.",
"data": {
"id": 1,
"name": "Order #001",
"status": "confirmed"
}
}
PATCH https://leads.qreq.com/api/sales-orders/{sales_order_id}/assign-user
assigned_to: Required, user ID to assign
curl --request PATCH \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/assign-user' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "assigned_to": 3 }'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/assign-user' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "assigned_to": 3 }'
{
"status": "success",
"message": "User assigned to sales order successfully."
}
DELETE https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities
curl --request DELETE \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "All activities deleted successfully."
}
DELETE https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities/{activity_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities/{activity_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders/{sales_order_id}/activities/{activity_id}' \
--header 'Authorization: Bearer {api_key}'
{
"status": "success",
"message": "Activity deleted successfully."
}
GET https://leads.qreq.com/api/sales-orders/quote-details/{quote_id}
curl --request GET \
--url 'https://leads.qreq.com/api/sales-orders/quote-details/{quote_id}' \
--header 'Authorization: Bearer {api_key}'
--url 'https://leads.qreq.com/api/sales-orders/quote-details/{quote_id}' \
--header 'Authorization: Bearer {api_key}'
{
"account_id": 1,
"billing_contact_id": 2,
"shipping_contact_id": 3,
"billing_address": "123 Main St",
"billing_city": "City",
"billing_state": "State",
"billing_postal_code": "12345",
"billing_country": "Country",
"shipping_address": "456 Another St",
"shipping_city": "City",
"shipping_state": "State",
"shipping_postal_code": "67890",
"shipping_country": "Country",
"shipping_provider_type_id": 1,
"products": [
{
"product_id": 1,
"quantity": 2,
"unit_price": 100,
"discount_type": "percentage",
"discount_value": 10
}
]
}