Issue an invoice
POST
/api/v1/billing/invoices
prm_billing
Creates an invoice against a named subscriber from line items. discount and vat are percentages from 0 to 100, and the total is computed from the items — never taken from the request.
discount and vat are PERCENTAGES, and the validator rejects anything above 100. Sending 171.00 in the vat field to mean "171 in tax" is a 400, not a silently large invoice.
نظرة سريعة
- المصادقة
- رمز موظّف أو جلسة
- تتطلب صلاحية
-
prm_billingBilling & invoices - حد المعدل
t_mutate
المعاملات
| المعامل | الوصف |
|---|---|
user_idمطلوب
body · integer
|
The subscriber being invoiced. |
itemsمطلوب
body · array
|
At least one line, each with name, qty, unit_price and an optional per-line tax. |
discount
body · number
|
Percentage from 0 to 100, not an amount. |
vat
body · number
|
Percentage from 0 to 100, not an amount. |
due_date
body · string
|
yyyy-MM-dd HH:mm:ss in UTC. |
mark_paid
body · boolean
|
Record the new invoice as already settled. |
الأخطاء
| الرمز | متى تُرجَع |
|---|---|
ERR_VALIDATION400
|
user_id missing, no items, an unnamed item, or a discount or VAT outside 0 to 100 |
ERR_NOT_FOUND404
|
the subscriber does not exist or is outside the caller's subtree |