Invoices

GET https://leads.qreq.com/api/invoices
curl --request GET \
--url 'https://leads.qreq.com/api/invoices' \
--header 'Authorization: Bearer {api_key}'
{ "status": "success", "message": "Invoices retrieved successfully.", "data": [ { "id": 1, "invoice_number": "INV-001", "name": "Sample Invoice", "status": "draft", "total_amount": 1000.00, "account": { "id": 1, "name": "Test Account" }, "contact": { "id": 1, "name": "John Doe" }, "created_by": 33, "created_at": "2025-11-03T08:00:00.000000Z", "updated_at": "2025-11-03T08:00:00.000000Z" } ] }
GET https://leads.qreq.com/api/invoices/{invoice_id}
curl --request GET \
--url 'https://leads.qreq.com/api/invoices/{invoice_id}' \
--header 'Authorization: Bearer {api_key}'
{ "status": "success", "message": "Invoice retrieved successfully.", "data": { "id": 1, "invoice_number": "INV-001", "name": "Sample Invoice", "status": "draft", "total_amount": 1000.00, "account": { "id": 1, "name": "Test Account" }, "contact": { "id": 1, "name": "John Doe" }, "products": [ { "id": 1, "name": "Product 1", "quantity": 2, "unit_price": 250, "total_price": 500, "discount_type": "none", "discount_value": 0 } ], "payments": [], "created_by": 33, "created_at": "2025-11-03T08:00:00.000000Z", "updated_at": "2025-11-03T08:00:00.000000Z" } }
POST https://leads.qreq.com/api/invoices
Parameter Einzelheiten Beschreibung
name ErforderlichZeichenfolge Invoice name
account_id OptionalGanzzahl Associated account ID
contact_id OptionalGanzzahl Associated contact ID
invoice_date ErforderlichDate Invoice date
due_date ErforderlichDate Due date
status OptionalZeichenfolge Invoice status: draft, sent, paid, etc.
products OptionalArray Array of products with quantity, unit_price, discount_type/value
curl --request POST \
--url 'https://leads.qreq.com/api/invoices' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Sample Invoice", "account_id": 1, "contact_id": 1, "invoice_date": "2025-11-03", "due_date": "2025-11-10", "status": "draft", "products": [ { "product_id": 1, "quantity": 2, "unit_price": 250, "discount_type": "none", "discount_value": 0 } ] }'
{ "status": "success", "message": "Invoice created successfully.", "data": { "id": 1, "name": "Sample Invoice", "status": "draft", "total_amount": 500, "account_id": 1, "contact_id": 1, "products": [ { "product_id": 1, "quantity": 2, "unit_price": 250, "total_price": 500, "discount_type": "none", "discount_value": 0 } ], "created_by": 33, "created_at": "2025-11-03T08:00:00.000000Z", "updated_at": "2025-11-03T08:00:00.000000Z" } }
PUT https://leads.qreq.com/api/invoices/{invoice_id}
curl --request PUT \
--url 'https://leads.qreq.com/api/invoices/{invoice_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "name": "Updated Invoice Name", "status": "sent", "due_date": "2025-11-15" }'
{ "status": "success", "message": "Invoice updated successfully.", "data": { "id": 1, "name": "Updated Invoice Name", "status": "sent", "total_amount": 500, "updated_at": "2025-11-03T09:00:00.000000Z" } }
DELETE https://leads.qreq.com/api/invoices/{invoice_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/invoices/{invoice_id}' \
--header 'Authorization: Bearer {api_key}'
{ "status": "success", "message": "Invoice deleted successfully." }
PATCH https://leads.qreq.com/api/invoices/{invoice_id}/toggle-status
curl --request PATCH \
--url 'https://leads.qreq.com/api/invoices/{invoice_id}/toggle-status' \
--header 'Authorization: Bearer {api_key}'
{ "status": "success", "message": "Invoice status updated successfully.", "data": { "id": 1, "status": "paid", "updated_at": "2025-11-03T09:10:00.000000Z" } }
PATCH https://leads.qreq.com/api/invoices/{invoice_id}/assign-user
curl --request PATCH \
--url 'https://leads.qreq.com/api/invoices/{invoice_id}/assign-user' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "user_id": 5 }'
{ "status": "success", "message": "Invoice assigned to user successfully.", "data": { "id": 1, "assigned_user_id": 5, "updated_at": "2025-11-03T09:15:00.000000Z" } }