Tuesday, 1 April 2025, 7:43 PM
Created by: Ruvenss G. Wilches
Data Structure
| Field Name | Type | Length | Allow Null | Default Value |
|---|---|---|---|---|
| id | int | - | No | AUTO_INCREMENT |
| type | enum | - | No | 'invoice' |
| client_id | int | - | No | - |
| project_id | int | - | No | 0 |
| bill_date | date | - | No | - |
| due_date | date | - | No | - |
| note | mediumtext | - | Yes | - |
| labels | text | - | Yes | - |
| last_email_sent_date | date | - | Yes | NULL |
| status | enum | - | No | 'draft','not_paid','cancelled','credited' |
| tax_id | int | - | No | 0 |
| discount_amount | double | - | No | - |
| discount_amount_type | enum | - | No | - |
| cancelled_at | datetime | - | Yes | NULL |
| invoice_total | double | - | No | - |
| invoice_subtotal | double | - | No | - |
| deleted | tinyint(1) | - | No | 0 |
| display_id | text | - | No | - |
| number_year | int | - | Yes | NULL |
| number_sequence | int | - | Yes | NULL |
The field Type and must be `credit_note` and the field status must be `credited`
In order to search, or get the list of invoices you can use a simple GET Rest API call such as this one below
const axios = require('axios');
let data = JSON.stringify({
"module": "invoices",
"data": {}
});
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://api.nizu.io/v2/',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR TOKEN'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});