Restaurant - Invoice
InvoiceController_create
POST
/restaurant/invoices
const url = 'https://api.inspow.tech/api/v1/restaurant/invoices';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"subscription":"645cc3d3f8a9c9a2b88a22f1","dueDate":"2025-05-10T23:59:59.000Z","amount":45000,"status":"PAID","createdBy":"645cc3d3f8a9c9a2b88a22c4","updatedBy":"645cc3d3f8a9c9a2b88a22c5","paymentReference":"REF123456","periodStart":"2024-01-01T00:00:00.000Z","periodEnd":"2024-01-31T23:59:59.999Z","businessDaysCount":20}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.inspow.tech/api/v1/restaurant/invoices \ --header 'Content-Type: application/json' \ --data '{ "subscription": "645cc3d3f8a9c9a2b88a22f1", "dueDate": "2025-05-10T23:59:59.000Z", "amount": 45000, "status": "PAID", "createdBy": "645cc3d3f8a9c9a2b88a22c4", "updatedBy": "645cc3d3f8a9c9a2b88a22c5", "paymentReference": "REF123456", "periodStart": "2024-01-01T00:00:00.000Z", "periodEnd": "2024-01-31T23:59:59.999Z", "businessDaysCount": 20 }'Request Body required
Sección titulada «Request Body required » Media type application/json
object
subscription
required
The ID of the subscription this invoice covers.
string
Example
645cc3d3f8a9c9a2b88a22f1 dueDate
Due date for payment (will be auto-calculated if not provided based on INVOICE_DUE_DAYS env variable)
string format: date-time
Example
2025-05-10T23:59:59.000Z amount
Amount billed in this invoice.
number
Example
45000 status
Status of the payment.
string
Example
PENDING createdBy
The ID of the user who created this record.
string format: MongoId
Example
645cc3d3f8a9c9a2b88a22c4 updatedBy
The ID of the user who last updated this record.
string format: MongoId
Example
645cc3d3f8a9c9a2b88a22c5 paymentReference
Payment reference number
string
Example
REF123456 periodStart
Start date of the billing period
string format: date-time
Example
2024-01-01T00:00:00.000Z periodEnd
End date of the billing period
string format: date-time
Example
2024-01-31T23:59:59.999Z businessDaysCount
Número de días hábiles facturados (editable para ajustar según asistencia)
number
Example
20 pricePerDay
Precio por día (referencia del plan, solo lectura)
number
Example
14000