GET /api/invoices
List invoices
Needs the invoices.read permission on the API key's role.
No request-body schema is supplied for this operation in the registry.
Documented responses
200— OK400— The body is not valid; `error` says why401— No valid API key403— The key's role lacks the permission, or the module is off
POST /api/invoices
Create a invoice
Needs the invoices.write permission on the API key's role.
JSON request schema
{
"type": "object",
"properties": {
"clientId": {
"type": "string",
"minLength": 1
},
"bankAccountId": {
"type": [
"string",
"null"
]
},
"projectId": {
"type": [
"string",
"null"
]
},
"quotationId": {
"type": [
"string",
"null"
]
},
"status": {
"default": "DRAFT",
"type": "string",
"enum": [
"DRAFT",
"SENT",
"PARTIAL",
"PAID",
"OVERDUE",
"CANCELLED"
]
},
"issueDate": {
"type": "string"
},
"dueDate": {
"type": [
"string",
"null"
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"description": {
"type": "string",
"maxLength": 10000
},
"quantity": {
"type": "number",
"minimum": 0,
"maximum": 1000000
},
"unitPrice": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"amount": {
"type": "number",
"minimum": 0
},
"itemType": {
"type": "string",
"enum": [
"standard",
"payment",
"section"
]
},
"percentage": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"taxInclusive": {
"type": "boolean"
},
"taxCode": {
"type": "string",
"maxLength": 50
},
"taxCodeId": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"classificationCode": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d{3}$"
},
{
"type": "string",
"const": ""
}
]
},
"unitCode": {
"type": "string",
"maxLength": 3
},
"taxRate": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"appliedTaxRate": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"taxAmount": {
"type": "number",
"minimum": 0
},
"discountAmount": {
"type": "number",
"minimum": 0
},
"notes": {
"type": "string"
}
},
"required": [
"id",
"description",
"quantity",
"unitPrice",
"amount"
]
}
},
"subtotal": {
"type": "number"
},
"taxRate": {
"default": 0,
"type": "number"
},
"taxAmount": {
"default": 0,
"type": "number"
},
"discount": {
"default": 0,
"type": "number"
},
"total": {
"type": "number"
},
"currency": {
"default": "MYR",
"type": "string"
},
"fxRate": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"notes": {
"type": "string"
},
"terms": {
"type": "string"
},
"internalNotes": {
"type": "string"
},
"purchaseOrderNumber": {
"type": "string"
}
},
"required": [
"clientId",
"issueDate",
"items",
"subtotal",
"total"
]
}Documented responses
200— OK201— Created400— The body is not valid; `error` says why401— No valid API key403— The key's role lacks the permission, or the module is off
GET /api/invoices/{id}
Read a invoice
Needs the invoices.read permission on the API key's role.
Path parameters
id— required path parameter
No request-body schema is supplied for this operation in the registry.
Documented responses
200— OK400— The body is not valid; `error` says why401— No valid API key403— The key's role lacks the permission, or the module is off404— Not found in this company
PATCH /api/invoices/{id}
Change a invoice
Needs the invoices.write permission on the API key's role.
Path parameters
id— required path parameter
JSON request schema
{
"type": "object",
"properties": {
"bankAccountId": {
"type": [
"string",
"null"
]
},
"clientId": {
"type": "string"
},
"projectId": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"DRAFT",
"SENT",
"CANCELLED"
]
},
"issueDate": {
"type": "string"
},
"dueDate": {
"type": [
"string",
"null"
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"description": {
"type": "string",
"maxLength": 10000
},
"quantity": {
"type": "number",
"minimum": 0,
"maximum": 1000000
},
"unitPrice": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"amount": {
"type": "number",
"minimum": 0
},
"itemType": {
"type": "string",
"enum": [
"standard",
"payment",
"section"
]
},
"percentage": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"taxInclusive": {
"type": "boolean"
},
"taxCode": {
"type": "string",
"maxLength": 50
},
"taxCodeId": {
"type": "string",
"minLength": 1,
"maxLength": 40
},
"classificationCode": {
"anyOf": [
{
"type": "string",
"pattern": "^\\d{3}$"
},
{
"type": "string",
"const": ""
}
]
},
"unitCode": {
"type": "string",
"maxLength": 3
},
"taxRate": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"appliedTaxRate": {
"type": "number",
"minimum": 0,
"maximum": 100
},
"taxAmount": {
"type": "number",
"minimum": 0
},
"discountAmount": {
"type": "number",
"minimum": 0
},
"notes": {
"type": "string"
}
},
"required": [
"id",
"description",
"quantity",
"unitPrice",
"amount"
]
}
},
"subtotal": {
"type": "number"
},
"taxRate": {
"type": "number"
},
"taxAmount": {
"type": "number"
},
"discount": {
"type": "number"
},
"total": {
"type": "number"
},
"currency": {
"type": "string"
},
"fxRate": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"notes": {
"type": "string"
},
"terms": {
"type": "string"
},
"internalNotes": {
"type": "string"
},
"purchaseOrderNumber": {
"type": "string"
}
}
}Documented responses
200— OK400— The body is not valid; `error` says why401— No valid API key403— The key's role lacks the permission, or the module is off404— Not found in this company
DELETE /api/invoices/{id}
Delete a invoice
Needs the invoices.write permission on the API key's role.
Path parameters
id— required path parameter
No request-body schema is supplied for this operation in the registry.
Documented responses
200— OK400— The body is not valid; `error` says why401— No valid API key403— The key's role lacks the permission, or the module is off404— Not found in this company
Other policy and state errors may also apply. See API key permissions and limits and the complete OpenAPI document.