Purchase Orders

GET https://leads.qreq.com/api/purchase-orders
curl --request GET \
--url 'https://leads.qreq.com/api/purchase-orders' \
--header 'Authorization: Bearer {api_key}'
{ "success": true, "data": { "current_page": 1, "data": [], "first_page_url": "https://leads.qreq.com/api/purchase-orders?page=1", "from": null, "last_page": 1, "last_page_url": "https://leads.qreq.com/api/purchase-orders?page=1", "links": [ { "url": null, "label": "« Previous", "page": null, "active": false }, { "url": "https://leads.qreq.com/api/purchase-orders?page=1", "label": "1", "page": 1, "active": true }, { "url": null, "label": "Next »", "page": null, "active": false } ], "next_page_url": null, "path": "https://leads.qreq.com/api/purchase-orders", "per_page": 10, "prev_page_url": null, "to": null, "total": 0 } }
GET https://leads.qreq.com/api/purchase-orders/{id}
curl --request GET \
--url 'https://leads.qreq.com/api/purchase-orders/{id}' \
--header 'Authorization: Bearer {api_key}'
{ "success": true, "data": { "id": 1, "purchase_number": "PO-001", "vendor": { "id": 3, "name": "Supplier Co." }, "status": "pending", "total_amount": 2500.00, "created_at": "2025-11-06T09:00:00Z", "items": [ { "product_id": 1, "name": "Widget A", "quantity": 5, "unit_price": 100.00 } ], "comments": [], "activities": [] } }
POST https://leads.qreq.com/api/purchase-orders
Parameters Details Description
vendor_idRequiredintVendor / supplier account id
order_dateRequireddateOrder date
expected_dateOptionaldateExpected delivery date
statusOptionalStatus: pending, approved, received, cancelled
itemsRequiredarrayArray of {product_id, quantity, unit_price}
curl --request POST \
--url 'https://leads.qreq.com/api/purchase-orders' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "vendor_id": 3, "order_date": "2025-11-06", "expected_date": "2025-11-15", "status": "pending", "items": [ { "product_id": 1, "quantity": 5, "unit_price": 100.00 } ] }'
{ "success": true, "message": "Purchase order created successfully.", "data": { "id": 1, "purchase_number": "PO-001", "status": "pending" } }
PUT https://leads.qreq.com/api/purchase-orders/{id}
curl --request PUT \
--url 'https://leads.qreq.com/api/purchase-orders/{id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "status": "approved" }'
{ "success": true, "message": "Purchase order updated successfully.", "data": { "id": 1, "status": "approved" } }
DELETE https://leads.qreq.com/api/purchase-orders/{id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/purchase-orders/{id}' \
--header 'Authorization: Bearer {api_key}'
{ "success": true, "message": "Purchase order deleted successfully." }
PUT https://leads.qreq.com/api/purchase-orders/{id}/toggle-status
curl --request PUT \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
{ "success": true, "message": "Purchase order status updated successfully.", "data": { "id": 1, "status": "received", "updated_at": "2025-11-06T10:00:00Z" } }
PUT https://leads.qreq.com/api/purchase-orders/{id}/add-sales-order
curl --request PUT \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/add-sales-order' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "sales_order_id": 5 }'
{ "success": true, "message": "Sales order linked to purchase order successfully.", "data": { "id": 1, "sales_order_id": 5 } }
PUT https://leads.qreq.com/api/purchase-orders/{id}/assign-user
curl --request PUT \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/assign-user' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "assigned_to": 7 }'
{ "success": true, "message": "User assigned to purchase order successfully.", "data": { "id": 1, "assigned_to": 7 } }
POST https://leads.qreq.com/api/purchase-orders/{id}/comments
curl --request POST \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/comments' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "message": "Please confirm delivery date." }'
{ "success": true, "message": "Comment added successfully.", "data": { "id": 101, "purchase_order_id": 1, "message": "Please confirm delivery date.", "created_at": "2025-11-06T10:05:00Z" } }
PUT https://leads.qreq.com/api/purchase-orders/{id}/activities/{activity_id}/comment
curl --request PUT \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/activities/{activity_id}/comment' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "comment": "Updated comment text" }'
{ "success": true, "message": "Activity comment updated successfully.", "data": { "activity_id": 55, "comment": "Updated comment text", "updated_at": "2025-11-06T10:15:00Z" } }
DELETE https://leads.qreq.com/api/purchase-orders/{id}/activities
curl --request DELETE \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/activities' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "activity_ids": [10, 11, 12] }'
{ "success": true, "message": "Activities deleted successfully.", "data": { "deleted_ids": [10,11,12] } }
DELETE https://leads.qreq.com/api/purchase-orders/{id}/activities/{activity_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/purchase-orders/{id}/activities/{activity_id}' \
--header 'Authorization: Bearer {api_key}'
{ "success": true, "message": "Activity deleted successfully.", "data": { "activity_id": 55 } }