GET /api/credit-notes
List credit notes
Needs the creditNotes.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/credit-notes
Create a credit note
Needs the creditNotes.write permission on the API key's role.
JSON request schema
{
"type": "object",
"properties": {
"clientId": {
"type": "string",
"minLength": 1
},
"invoiceId": {
"type": [
"string",
"null"
]
},
"projectId": {
"type": [
"string",
"null"
]
},
"items": {
"minItems": 1,
"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"
}
]
},
"reason": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"internalNotes": {
"type": [
"string",
"null"
]
}
},
"required": [
"clientId",
"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/credit-notes/{id}
Read a credit note
Needs the creditNotes.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/credit-notes/{id}
Change a credit note
Needs the creditNotes.write permission on the API key's role.
Path parameters
id— required path parameter
JSON request schema
{
"type": "object",
"properties": {
"clientId": {
"type": "string"
},
"invoiceId": {
"type": [
"string",
"null"
]
},
"projectId": {
"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"
}
]
},
"reason": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"internalNotes": {
"type": [
"string",
"null"
]
}
}
}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/credit-notes/{id}
Delete a credit note
Needs the creditNotes.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.