BillingNote
8 tools
CreateBillingNote
WHEN TO USE Use when the customer wants one combined bill instead of receiving multiple separate invoices — typically for customers billed on a recurring/batch cycle. BUSINESS RULES & PRE-CONDITIONS All invoices being combined must already exist (Approve status) — resolve each via GetInvoice first. Populate the `transactions` array with each invoice's `code` and `amount`. FALLBACK & ERROR HANDLING An invoice code in the list doesn't resolve → confirm with the user before dropping it silently from the batch. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
3 required · 24 optional
CreateBillingNote
WHEN TO USE Use when the customer wants one combined bill instead of receiving multiple separate invoices — typically for customers billed on a recurring/batch cycle. BUSINESS RULES & PRE-CONDITIONS All invoices being combined must already exist (Approve status) — resolve each via GetInvoice first. Populate the `transactions` array with each invoice's `code` and `amount`. FALLBACK & ERROR HANDLING An invoice code in the list doesn't resolve → confirm with the user before dropping it silently from the batch. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| transactions | array[BillingNoteTransaction] | required | array[BillingNoteTransaction] — docs to invoice. sub-fields: id, code, amount?array[BillingNoteTransaction] fields
|
||||||||
| issuedDate | string | required | Issuance date (yyyyMMdd). | ||||||||
| dueDate | string | required | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||
| withHoldingTaxAmount | string | optional | Withholding tax amount for the document. | ||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||
| accountCode | string | optional | Account code to be used for recording financial transactions | ||||||||
| accountSubId | string | optional | Sub-account ID for recording | ||||||||
| accountSubCode | string | optional | Sub-account code for recording | ||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||
| chequeAccountNo | string | optional | Bank account number | ||||||||
| chequeBranchNo | string | optional | Bank branch number | ||||||||
| chequeNo | string | optional | Cheque number | ||||||||
| chequeAmount | number? | optional | Cheque amount | ||||||||
| chequeDate | string | optional | Cheque date (yyyyMMdd) | ||||||||
| chequeBankId | integer? | optional | Financial institution code (if type=2, required) | ||||||||
| chequePaymentMethodId | string | optional | Payment method ID for the cheque | ||||||||
| chequePaymentMethodCode | string | optional | Payment method code for the cheque | ||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakBillingNotes": {
"resCode": "200",
"resDesc": "PeakBillingNotes have Completed",
"billingNotes": [{
"id": "faa7a1d3-71af-48d0-bdd2-8c262bb15331",
"code": "BAAN01A00039",
"issuedDate": "20211209",
"dueDate": "20211216",
"contactId": "129c968f-23e9-4ee9-9dc7-3f799b47c029",
"contactCode": "C00003",
"transactions": [{ "id": "guid", "code": "IVTZ202112028", "amount": 260 }],
"preTaxAmount": 242.99,
"netAmount": 260,
"vatAmount": 17.01,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 260,
"remainWhtAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
CreateBillingNoteExpense
WHEN TO USE Use when paying several vendor bills together in one batch rather than individually. BUSINESS RULES & PRE-CONDITIONS All expense being combined must already exist (Approve status) — resolve each via GetExpense first. Populate the `transactions` array with each invoice's `code` and `amount`. FALLBACK & ERROR HANDLING An expense code in the list doesn't resolve → confirm with the user before dropping it silently from the batch. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
3 required · 24 optional
CreateBillingNoteExpense
WHEN TO USE Use when paying several vendor bills together in one batch rather than individually. BUSINESS RULES & PRE-CONDITIONS All expense being combined must already exist (Approve status) — resolve each via GetExpense first. Populate the `transactions` array with each invoice's `code` and `amount`. FALLBACK & ERROR HANDLING An expense code in the list doesn't resolve → confirm with the user before dropping it silently from the batch. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| transactions | array[BillingNoteTransaction] | required | array[BillingNoteTransaction] — docs to invoice. sub-fields: id, code, amount?array[BillingNoteTransaction] fields
|
||||||||
| issuedDate | string | required | Issuance date (yyyyMMdd). | ||||||||
| dueDate | string | required | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||
| withHoldingTaxAmount | string | optional | Withholding tax amount for the document. | ||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||
| accountCode | string | optional | Account code to be used for recording financial transactions | ||||||||
| accountSubId | string | optional | Sub-account ID for recording | ||||||||
| accountSubCode | string | optional | Sub-account code for recording | ||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||
| chequeAccountNo | string | optional | Bank account number | ||||||||
| chequeBranchNo | string | optional | Bank branch number | ||||||||
| chequeNo | string | optional | Cheque number | ||||||||
| chequeAmount | number? | optional | Cheque amount | ||||||||
| chequeDate | string | optional | Cheque date (yyyyMMdd) | ||||||||
| chequeBankId | integer? | optional | Financial institution code (if type=2, required) | ||||||||
| chequePaymentMethodId | string | optional | Payment method ID for the cheque | ||||||||
| chequePaymentMethodCode | string | optional | Payment method code for the cheque | ||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakBillingNotesExpenses": {
"resCode": "200",
"resDesc": "PeakBillingNotesExpenses have Completed",
"billingNotesExpenses": [{
"id": "faa7a1d3-71af-48d0-bdd2-8c262bb15331",
"code": "BNX01A00039",
"issuedDate": "20211209",
"dueDate": "20211216",
"contactId": "129c968f-23e9-4ee9-9dc7-3f799b47c029",
"contactCode": "C00003",
"transactions": [{ "id": "guid", "code": "IVTZ202112028", "amount": 260 }],
"preTaxAmount": 242.99,
"netAmount": 260,
"vatAmount": 17.01,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 260,
"remainWhtAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetBillingNoteExpense
WHEN TO USE Use to read ONE purchase-side billing note (ใบรวมจ่าย, CPN) you already have an identifier for — to check status or an outstanding balance before referencing or voiding it. For sales-side billing notes, use GetBillingNote instead. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListBillingNoteExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CPN202605002"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching billing note expense with code, issuedDate, contactId / contactCode, netAmount, remainAmount and documentLink.
0 required · 6 optional
GetBillingNoteExpense
WHEN TO USE Use to read ONE purchase-side billing note (ใบรวมจ่าย, CPN) you already have an identifier for — to check status or an outstanding balance before referencing or voiding it. For sales-side billing notes, use GetBillingNote instead. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListBillingNoteExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CPN202605002"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching billing note expense with code, issuedDate, contactId / contactCode, netAmount, remainAmount and documentLink.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'BNX0600027'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakBillingNotesExpenses": {
"resCode": "200",
"resDesc": "PeakBillingNotesExpenses have Completed",
"totalBillingNoteExpense": 1,
"billingNotesExpenses": [{
"id": "guid",
"code": "BNX0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
ListBillingNoteExpense
WHEN TO USE Use to review purchase-side billing notes (ใบวางบิลซื้อ, BNX) a vendor has issued to this business — to check status, see an outstanding balance, or find a document code before referencing it. For sales-side billing notes issued to customers, use ListBillingNote instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (format yyyyMMdd), status, and searchText (contact name or document code). Use limit and page to paginate — each page returns 10 entries. Read-only; it never changes a document. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before telling the user nothing was found. On several near-matches, show the list (code + issuedDate + contact + netAmount) and let the user pick; don't guess from a partial code. EXPECTED OUTCOME Returns billing note expenses with code, issuedDate, contactId / contactCode, netAmount, and documentLink for sharing with the user.
0 required · 6 optional
ListBillingNoteExpense
WHEN TO USE Use to review purchase-side billing notes (ใบวางบิลซื้อ, BNX) a vendor has issued to this business — to check status, see an outstanding balance, or find a document code before referencing it. For sales-side billing notes issued to customers, use ListBillingNote instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (format yyyyMMdd), status, and searchText (contact name or document code). Use limit and page to paginate — each page returns 10 entries. Read-only; it never changes a document. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before telling the user nothing was found. On several near-matches, show the list (code + issuedDate + contact + netAmount) and let the user pick; don't guess from a partial code. EXPECTED OUTCOME Returns billing note expenses with code, issuedDate, contactId / contactCode, netAmount, and documentLink for sharing with the user.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Start date for filtering billing note expenses (format yyyyMMdd). |
| dateEnd | string | optional | End date for filtering billing note expenses (format yyyyMMdd). |
| status | integer? | optional | Status of the billing note expense for filtering. (0 = None, 1 = Voided, 2 = Draft, 3 = AwaitApproval, 4 = Outstanding, 5 = Overdue, 6 = PaidOrAwaitReceipt) |
| searchText | string | optional | Text to search for in billing note expenses. |
| limit | integer? | optional | Maximum number of entries to retrieve. |
| page | integer? | optional | Page number for displaying data, where each page will show 10 entries. |
Response
{
"PeakBillingNotesExpenses": {
"resCode": "200",
"resDesc": "PeakBillingNotesExpenses have Completed",
"totalBillingNoteExpense": 3,
"billingNotesExpenses": [{
"id": "guid",
"code": "BNX0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetBillingNote
WHEN TO USE Use to read ONE sales billing note (ใบวางบิล) you already have an identifier for — to check status or remaining balance before recording another or before voiding. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListBillingNote instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "BN202601001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching billing note with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetBillingNote
WHEN TO USE Use to read ONE sales billing note (ใบวางบิล) you already have an identifier for — to check status or remaining balance before recording another or before voiding. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListBillingNote instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "BN202601001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching billing note with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'BN0600027'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakBillingNotes": {
"resCode": "200",
"resDesc": "PeakBillingNotes have Completed",
"totalBillingNote": 1,
"billingNotes": [{
"id": "guid",
"code": "BN0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
ListBillingNote
WHEN TO USE Use to check status or remaining balance on billing note already created — e.g. before recording an additional billing note , or before voiding. BUSINESS RULES & PRE-CONDITIONS Filter by date range, status or Search keyword - contact name, document number Default: 1st of last month – End of current month FALLBACK & ERROR HANDLING No match → confirm the filter or date range with the user rather than assuming a typo and guessing a correction. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListBillingNote
WHEN TO USE Use to check status or remaining balance on billing note already created — e.g. before recording an additional billing note , or before voiding. BUSINESS RULES & PRE-CONDITIONS Filter by date range, status or Search keyword - contact name, document number Default: 1st of last month – End of current month FALLBACK & ERROR HANDLING No match → confirm the filter or date range with the user rather than assuming a typo and guessing a correction. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Doc status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakBillingNotes": {
"resCode": "200",
"resDesc": "PeakBillingNotes have Completed",
"totalBillingNote": 3,
"billingNotes": [{
"id": "guid",
"code": "BN0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}]
}
}
VoidBillingNote
WHEN TO USE Only when the user explicitly asks to cancel an existing billing note (ใบวางบิล). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Billing notes cannot be edited — to correct one, void it and issue a replacement with CreateBillingNote. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetBillingNote to look it up. The billing note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this billing note while another document still references it — void the referencing document first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the billing note was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
VoidBillingNote
WHEN TO USE Only when the user explicitly asks to cancel an existing billing note (ใบวางบิล). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Billing notes cannot be edited — to correct one, void it and issue a replacement with CreateBillingNote. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetBillingNote to look it up. The billing note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this billing note while another document still references it — void the referencing document first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the billing note was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the billing note to be voided |
| id | string | optional | The Unique Identifier of the billing note to be voided |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidBillingNoteExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing combine payment note (ใบรวมจ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Combine payment notes cannot be edited — to correct one, void it and issue a replacement with CreateBillingNoteExpense. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetBillingNoteExpense to look it up. The combine payment note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this combine payment note while another document still references it — void the referencing document first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the combine payment note was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
VoidBillingNoteExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing combine payment note (ใบรวมจ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Combine payment notes cannot be edited — to correct one, void it and issue a replacement with CreateBillingNoteExpense. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetBillingNoteExpense to look it up. The combine payment note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this combine payment note while another document still references it — void the referencing document first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the combine payment note was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the combine payment note to be voided |
| id | string | optional | The Unique Identifier of the combine payment note to be voided |
Response
{ "resCode": "200", "resDesc": "Success" }
Classification
3 tools
GetClassificationGroup
WHEN TO USE Call BEFORE `CreateTransactionClassification`, always — classification groups and items are entirely business-defined, there is no universal default to assume. BUSINESS RULES & PRE-CONDITIONS None — no params required. FALLBACK & ERROR HANDLING Empty result → this business hasn't set up classifications; tell the user tagging isn't configured rather than inventing a group. EXPECTED OUTCOME Returns each group's `number`/`name` and nested `classificationItemList` (each with its own `number`/`name`) — both numbers are required inputs for CreateTransactionClassification.
no params
GetClassificationGroup
WHEN TO USE Call BEFORE `CreateTransactionClassification`, always — classification groups and items are entirely business-defined, there is no universal default to assume. BUSINESS RULES & PRE-CONDITIONS None — no params required. FALLBACK & ERROR HANDLING Empty result → this business hasn't set up classifications; tell the user tagging isn't configured rather than inventing a group. EXPECTED OUTCOME Returns each group's `number`/`name` and nested `classificationItemList` (each with its own `number`/`name`) — both numbers are required inputs for CreateTransactionClassification.
No parameters required.
Response
{
"peakClassification": {
"classificationGroup": [
{
"resCode": "string",
"resDesc": "string",
"number": "string",
"name": "string",
"description": "string",
"classificationDocumentFinanceType": 0,
"classificationItemList": [
{
"number": "string",
"name": "string",
"description": "string"
}
]
}
],
"resDesc": "string",
"resCode": "string"
}
}
GetTransactionClassification
WHEN TO USE To verify tagging before adding more, or when the user asks how a transaction is currently tagged. BUSINESS RULES & PRE-CONDITIONS Provide `transactionId` or `transactionCode` + `transactionType`. FALLBACK & ERROR HANDLING No tags found → transaction simply isn't tagged yet, not an error state. EXPECTED OUTCOME Returns the classification group/item(s) currently applied.
0 required · 3 optional
GetTransactionClassification
WHEN TO USE To verify tagging before adding more, or when the user asks how a transaction is currently tagged. BUSINESS RULES & PRE-CONDITIONS Provide `transactionId` or `transactionCode` + `transactionType`. FALLBACK & ERROR HANDLING No tags found → transaction simply isn't tagged yet, not an error state. EXPECTED OUTCOME Returns the classification group/item(s) currently applied.
| Parameter | Type | Description | |
|---|---|---|---|
| transactionId | string | optional | Unique Identifier of the transaction |
| transactionCode | string | optional | Document Number of the transaction |
| transactionType | integer? | optional | Type (101=Quotation,102=Invoice,103=Receipt,104=TaxInvoice,105=CreditNote,106=BillingNote,107=DebitNote,201=PurchaseOrder,202=Expense,205=CreditNoteExpense,206=BillingNoteExpense,207=DebitNoteExpense) |
Response
{
"peakClassification": {
"transactionCode": "string",
"transactionType": 0,
"classifications": [
{
"classificationGroupCode": "string",
"classificationItemList": [
{
"number": "string",
"percent": 0.0
}
]
}
],
"resDesc": "string",
"resCode": "string"
}
}
CreateTransactionClassification
WHEN TO USE After a transaction already exists (Invoice/Expense/etc. already created) and the user wants it tagged for reporting. BUSINESS RULES & PRE-CONDITIONS Requires: (1) the transaction's `transactionId`/`transactionCode` — from the just-created document; (2) valid `classificationGroupCode` + item `number`(s) — from GetClassificationGroup, never guessed. FALLBACK & ERROR HANDLING Invalid group/item number → re-fetch GetClassificationGroup, don't retry with a guessed number. EXPECTED OUTCOME Tags the transaction; does not alter its financial amounts.
3 required · 2 optional
CreateTransactionClassification
WHEN TO USE After a transaction already exists (Invoice/Expense/etc. already created) and the user wants it tagged for reporting. BUSINESS RULES & PRE-CONDITIONS Requires: (1) the transaction's `transactionId`/`transactionCode` — from the just-created document; (2) valid `classificationGroupCode` + item `number`(s) — from GetClassificationGroup, never guessed. FALLBACK & ERROR HANDLING Invalid group/item number → re-fetch GetClassificationGroup, don't retry with a guessed number. EXPECTED OUTCOME Tags the transaction; does not alter its financial amounts.
| Parameter | Type | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|
| transactionType | integer | required | Type (101=Quotation,102=Invoice,103=Receipt,104=TaxInvoice,105=CreditNote,106=BillingNote,107=DebitNote,201=PurchaseOrder,202=Expense,205=CreditNoteExpense,206=BillingNoteExpense,207=DebitNoteExpense) | ||||||
| classificationGroupCode | string | required | Code of the classification group | ||||||
| classificationItemList | array[TransactionClassificationItemEntry] | required | array[TransactionClassificationItemEntry] — sub-fields: number, percent?array[TransactionClassificationItemEntry] fields
|
||||||
| transactionId | string | optional | Unique Identifier of the transaction | ||||||
| transactionCode | string | optional | Document Number of the transaction |
Response
{
"resCode": "200",
"resDesc": "Success"
}
Contact
3 tools
SearchContacts
WHEN TO USE Call this FIRST, always, before CreateInvoice / CreateExpense / CreateQuotation / CreateReceipt / CreatePurchaseOrder / CreateCreditNote whenever a contact name, company name, or Tax ID appears in the input. Never assume a contact exists. BUSINESS RULES & PRE-CONDITIONS Search by `searchText` (name, company, or 13-digit Tax ID) — Tax ID match is the most reliable, name match can be ambiguous (similar company names are common in Thai SME data). If Tax ID is available in the source document, prefer it over name. FALLBACK & ERROR HANDLING Zero results → do NOT invent a contact silently; prepare a `CreateContact` payload and show it to the user in the confirmation preview before calling it. Multiple results → present the list (name + code + Tax ID) and ask the user to pick, don't guess by string similarity alone. EXPECTED OUTCOME Returns `contactId` + `contactCode`, which are required inputs for every downstream document-creation tool.
0 required · 5 optional
SearchContacts
WHEN TO USE Call this FIRST, always, before CreateInvoice / CreateExpense / CreateQuotation / CreateReceipt / CreatePurchaseOrder / CreateCreditNote whenever a contact name, company name, or Tax ID appears in the input. Never assume a contact exists. BUSINESS RULES & PRE-CONDITIONS Search by `searchText` (name, company, or 13-digit Tax ID) — Tax ID match is the most reliable, name match can be ambiguous (similar company names are common in Thai SME data). If Tax ID is available in the source document, prefer it over name. FALLBACK & ERROR HANDLING Zero results → do NOT invent a contact silently; prepare a `CreateContact` payload and show it to the user in the confirmation preview before calling it. Multiple results → present the list (name + code + Tax ID) and ask the user to pick, don't guess by string similarity alone. EXPECTED OUTCOME Returns `contactId` + `contactCode`, which are required inputs for every downstream document-creation tool.
| Parameter | Type | Description | |
|---|---|---|---|
| status | integer? | optional | Filter by contact status (0=All,1=Active,2=Inactive) Default = 1 |
| groupId | string | optional | Filter by Contact group name |
| searchText | string | optional | Search keyword — company name, contact name, or tax number. |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakContacts": {
"resCode": "200",
"resDesc": "PeakContacts have Completed",
"totalContact": 25,
"contacts": [{
"id": "guid",
"code": "C001",
"name": "Company Name",
"type": 1,
"taxNumber": "0123456789012",
"branchCode": "00000",
"email": "[email protected]",
"address": "123 Main St",
"subDistrict": "...",
"district": "...",
"province": "Bangkok",
"postCode": "10110",
"resCode": "200",
"resDesc": "Success"
}]
}
}
CreateContact
WHEN TO USE Only after `SearchContacts` returns zero matches for this name/Tax ID. Never call speculatively "just in case." BUSINESS RULES & PRE-CONDITIONS `name` is the only required field, but for Thai business documents, always try to populate `taxNumber` (13 digits) and `type` — VAT-registered invoices and WHT certificates need these downstream. If the contact is a vendor, consider setting `purchaseAccount`; if a customer, `sellAccount` — this lets PEAK auto-map future transactions. FALLBACK & ERROR HANDLING If Tax ID or address is missing from the source document, do not fabricate placeholder values — leave optional and flag to the user that the contact record is incomplete. EXPECTED OUTCOME Returns `contactId` + `contactCode` for immediate use in the document currently being created. Must always be shown to the user as a "🆕 New contact will be created" notice before this tool is called (never silent).
2 required · 28 optional
CreateContact
WHEN TO USE Only after `SearchContacts` returns zero matches for this name/Tax ID. Never call speculatively "just in case." BUSINESS RULES & PRE-CONDITIONS `name` is the only required field, but for Thai business documents, always try to populate `taxNumber` (13 digits) and `type` — VAT-registered invoices and WHT certificates need these downstream. If the contact is a vendor, consider setting `purchaseAccount`; if a customer, `sellAccount` — this lets PEAK auto-map future transactions. FALLBACK & ERROR HANDLING If Tax ID or address is missing from the source document, do not fabricate placeholder values — leave optional and flag to the user that the contact record is incomplete. EXPECTED OUTCOME Returns `contactId` + `contactCode` for immediate use in the document currently being created. Must always be shown to the user as a "🆕 New contact will be created" notice before this tool is called (never silent).
| Parameter | Type | Description | |
|---|---|---|---|
| name | string | required | Entity / Individual Name e.g., "PEAK" instead of "PEAK Co., Ltd." (Select entity type in the type field). |
| type | integer | required | Type of contact (0=None,1=LLP,2=CompanyLimited,3=PublicCompanyLimited,4=Shop,5=OrdinaryPerson,6=BodyOfPersons,7=Others,8=OrdinaryPartnership,9=Foundation,10=Association,11=JointVenture) |
| prefixNameType | integer? | optional | If type=5 (Person), required. Prefix (0=None,1=Sir,2=Mr,3=Mrs,4=Ms,5=Other) |
| prefixNameOther | string | optional | If prefixNameType=6 (Other), custom prefix |
| taxNumber | string | optional | Tax Identification Number (TIN) |
| branchCode | string | optional | 5-digit branch identifier, Head Office = 00000 |
| address | string | optional | The address registered for the branch. |
| subDistrict | string | optional | Sub-district of the contact's address |
| district | string | optional | District of the contact's address |
| province | string | optional | Province of the contact's address |
| country | string | optional | Country of the contact's address |
| postCode | string | optional | Post code of the contact's address |
| callCenterNumber | string | optional | Call center number. |
| faxNumber | string | optional | Fax number. |
| string | optional | Email address of the contact | |
| website | string | optional | Website URL. |
| contactFirstName | string | optional | First name of the contactable person |
| contactLastName | string | optional | Last name of the contactable person |
| contactNickName | string | optional | Nickname of the contactable person |
| contactPosition | string | optional | Position of the contactable person |
| contactPhoneNumber | string | optional | Phone number of the contactable person |
| contactEmail | string | optional | Email of the contactable person |
| purchaseAccount | string | optional | If expense document , PEAK records the transaction in this account, Leave blank to automatically use the default value. |
| sellAccount | string | optional | If revenue document, PEAK records the transaction in this account, Leave blank to automatically use the default value. |
| bankId | integer? | optional | Financial institution code (if type=2, bankId required) |
| bankBranch | string | optional | Bank branch name. |
| bankAccountNo | string | optional | Bank account number. |
| bankAccountName | string | optional | Bank account name. |
| id | string | optional | Unique Identifier generated by PEAK |
| code | string | optional | Code displayed in PEAK. Auto-generated if blank |
Response
{
"PeakContacts": {
"resCode": "200",
"resDesc": "PeakContacts have Completed",
"contacts": [{
"id": "917c3e8f-b315-4968-b8cc-08e2220d8682",
"code": "C01401",
"name": "Company Name",
"type": 2,
"taxNumber": "0105557083391",
"branchCode": "00000",
"address": "...",
"subDistrict": "...",
"district": "...",
"province": "กรุงเทพมหานคร",
"country": "Thailand",
"postCode": "10220",
"email": "",
"purchaseAccount": "212101",
"sellAccount": "113101",
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetSuggestionAccountCodeExpense
WHEN TO USE Call before CreateExpense once the vendor is known, to narrow the chart of accounts (ผังบัญชี) down to the expense codes that actually fit this vendor instead of choosing from the whole chart. Use the returned code as the accountCode on the expense line item. Prefer this over GetAccountCodes whenever you already have the contact, and fall back to GetAccountCodes only when it returns nothing. BUSINESS RULES & PRE-CONDITIONS You MUST provide at least one of contactId, contactCode, or taxId — calling with none of them returns resCode 400. Resolve contactId or contactCode with SearchContacts first. contactId must be a valid GUID and taxId must be exactly 13 digits. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Two lists come back and they rank differently: 'mostUsed' is what this business has itself recorded for this contact before — the strongest signal, prefer it; 'suggestion' is what other businesses commonly use for this vendor's tax number, and is only returned when the contact has a tax number. Both may be empty for a new vendor: fall back to GetAccountCodes rather than guessing a code. An empty or missing response body means PEAK could not be reached, not that there are no suggestions — never report it to the user as 'no match'. EXPECTED OUTCOME Returns mostUsed and suggestion, each a list of account codes carrying code, name, and nameEn, alongside resCode and resDesc.
0 required · 3 optional
GetSuggestionAccountCodeExpense
WHEN TO USE Call before CreateExpense once the vendor is known, to narrow the chart of accounts (ผังบัญชี) down to the expense codes that actually fit this vendor instead of choosing from the whole chart. Use the returned code as the accountCode on the expense line item. Prefer this over GetAccountCodes whenever you already have the contact, and fall back to GetAccountCodes only when it returns nothing. BUSINESS RULES & PRE-CONDITIONS You MUST provide at least one of contactId, contactCode, or taxId — calling with none of them returns resCode 400. Resolve contactId or contactCode with SearchContacts first. contactId must be a valid GUID and taxId must be exactly 13 digits. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Two lists come back and they rank differently: 'mostUsed' is what this business has itself recorded for this contact before — the strongest signal, prefer it; 'suggestion' is what other businesses commonly use for this vendor's tax number, and is only returned when the contact has a tax number. Both may be empty for a new vendor: fall back to GetAccountCodes rather than guessing a code. An empty or missing response body means PEAK could not be reached, not that there are no suggestions — never report it to the user as 'no match'. EXPECTED OUTCOME Returns mostUsed and suggestion, each a list of account codes carrying code, name, and nameEn, alongside resCode and resDesc.
| Parameter | Type | Description | |
|---|---|---|---|
| contactId | string | optional | Contact ID (GUID) of the vendor/supplier. Get it from SearchContacts. Must be a valid GUID. |
| contactCode | string | optional | Contact code of the vendor/supplier (e.g. 'C001'). Get it from SearchContacts. |
| taxId | string | optional | Tax Identification Number (TIN) of the vendor/supplier. Must be exactly 13 digits. |
Response
{
"PeakContacts": {
"mostUsed": [
{
"code": "C001",
"name": "Sample Name",
"nameEn": "Sample Name"
}
],
"suggestion": [
{
"code": "C001",
"name": "Sample Name",
"nameEn": "Sample Name"
}
],
"resCode": "200",
"resDesc": "Completed"
}
}
CreditNote
8 tools
CreateCreditNote
WHEN TO USE Use when goods are returned, the original price was wrong, or a discount is granted after an invoice already exists — never as a substitute for editing a Draft invoice directly (edit the Draft instead if it hasn't been Approved yet). BUSINESS RULES & PRE-CONDITIONS Requires `transactionId`/`transactionCode` of the original document being corrected — fetch via GetInvoice or GetReceipt first if not already known. `reasonType` should reflect the real cause (goods return, pricing error, damage, etc.) since it appears on the printed document. Line items mirror the original invoice's productCode/accountCode choice. FALLBACK & ERROR HANDLING Original transaction not found → confirm the invoice code with the user before proceeding; don't create a credit note against a guessed transaction ID. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
6 required · 40 optional
CreateCreditNote
WHEN TO USE Use when goods are returned, the original price was wrong, or a discount is granted after an invoice already exists — never as a substitute for editing a Draft invoice directly (edit the Draft instead if it hasn't been Approved yet). BUSINESS RULES & PRE-CONDITIONS Requires `transactionId`/`transactionCode` of the original document being corrected — fetch via GetInvoice or GetReceipt first if not already known. `reasonType` should reflect the real cause (goods return, pricing error, damage, etc.) since it appears on the printed document. Line items mirror the original invoice's productCode/accountCode choice. FALLBACK & ERROR HANDLING Original transaction not found → confirm the invoice code with the user before proceeding; don't create a credit note against a guessed transaction ID. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| transactionType | integer | required | Type (101=Quotation,102=Invoice,103=Receipt,104=TaxInvoice,105=CreditNote,106=BillingNote,107=DebitNote,201=PurchaseOrder,202=Expense,205=CreditNoteExpense,206=BillingNoteExpense,207=DebitNoteExpense) | ||||||||||||||||||||||||||||
| reasonType | integer | required | Reason (0=None,1=PromotionAndMarketing,2=OfficeUse,3=ProductionUse,4=ServiceUse,5=Donation,6=DamageOrLoss,7=Others) | ||||||||||||||||||||||||||||
| reasonDescription | string | required | Description of reason | ||||||||||||||||||||||||||||
| goodsReturn | integer | required | Involves product return (0=No,1=Yes) | ||||||||||||||||||||||||||||
| issuedDate | string | required | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| transactionId | string | optional | Unique Identifier of the transaction | ||||||||||||||||||||||||||||
| transactionCode | string | optional | Document Number of the transaction | ||||||||||||||||||||||||||||
| creditNoteStyleType | integer? | optional | Display type (0=General) | ||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| returnPaymentMethodCode | string | optional | Payment method code for return payment | ||||||||||||||||||||||||||||
| returnPaymentMethodId | string | optional | Unique Identifier of return payment method | ||||||||||||||||||||||||||||
| returnPaymentAmount | number? | optional | Return payment amount | ||||||||||||||||||||||||||||
| returnPaymentDate | string | optional | Return payment date (yyyyMMdd) | ||||||||||||||||||||||||||||
| returnPaymentAccountCode | string | optional | Account code for return payment | ||||||||||||||||||||||||||||
| returnPaymentAccountSubId | string | optional | Sub-account ID for return payment | ||||||||||||||||||||||||||||
| returnPaymentAccountSubCode | string | optional | Sub-account code for return payment | ||||||||||||||||||||||||||||
| returnPaymentNote | string | optional | Notes for the return payment | ||||||||||||||||||||||||||||
| returnPaymentIsCheque | integer? | optional | Return payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| returnPaymentWithHoldingTaxAmount | string | optional | WHT amount for return payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakCreditNotes": {
"resCode": "200",
"resDesc": "PeakCreditNotes have Completed",
"totalCreditNote": 1,
"creditNotes": [{
"id": "5c707ff3-bea4-4475-8595-8d91a592403a",
"code": "CNT0800124",
"issuedDate": "20230815",
"dueDate": "20230815",
"contactId": "guid",
"contactCode": "C00002",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 5140,
"vatAmount": 0,
"netAmount": 5140,
"whtAmount": 154.2,
"paymentAmount": 0,
"remainAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "PP20180917", "accountCode": "410101", "description": "...", "quantity": 21, "price": 220, "vatType": 2 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
CreateCreditNoteExpense
WHEN TO USE Use when goods are returned, the original price was wrong, or a discount is granted after an Expense already exists — never as a substitute for editing a Draft expense directly (edit the Draft instead if it hasn't been Approved yet). BUSINESS RULES & PRE-CONDITIONS Requires `transactionId`/`transactionCode` of the original document being corrected — fetch via GetExpense first if not already known. `reasonType` should reflect the real cause (goods return, pricing error, damage, etc.) since it appears on the printed document. Line items mirror the original invoice's productCode/accountCode choice. FALLBACK & ERROR HANDLING Original transaction not found → confirm the invoice code with the user before proceeding; don't create a credit note against a guessed transaction ID. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
6 required · 40 optional
CreateCreditNoteExpense
WHEN TO USE Use when goods are returned, the original price was wrong, or a discount is granted after an Expense already exists — never as a substitute for editing a Draft expense directly (edit the Draft instead if it hasn't been Approved yet). BUSINESS RULES & PRE-CONDITIONS Requires `transactionId`/`transactionCode` of the original document being corrected — fetch via GetExpense first if not already known. `reasonType` should reflect the real cause (goods return, pricing error, damage, etc.) since it appears on the printed document. Line items mirror the original invoice's productCode/accountCode choice. FALLBACK & ERROR HANDLING Original transaction not found → confirm the invoice code with the user before proceeding; don't create a credit note against a guessed transaction ID. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| transactionType | integer | required | Type (101=Quotation,102=Invoice,103=Receipt,104=TaxInvoice,105=CreditNote,106=BillingNote,107=DebitNote,201=PurchaseOrder,202=Expense,205=CreditNoteExpense,206=BillingNoteExpense,207=DebitNoteExpense) | ||||||||||||||||||||||||||||
| reasonType | integer | required | Reason (0=None,1=PromotionAndMarketing,2=OfficeUse,3=ProductionUse,4=ServiceUse,5=Donation,6=DamageOrLoss,7=Others) | ||||||||||||||||||||||||||||
| reasonDescription | string | required | Description of reason | ||||||||||||||||||||||||||||
| goodsReturn | integer | required | Involves product return (0=No,1=Yes) | ||||||||||||||||||||||||||||
| issuedDate | string | required | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| transactionId | string | optional | Unique Identifier of the transaction | ||||||||||||||||||||||||||||
| transactionCode | string | optional | Document Number of the transaction | ||||||||||||||||||||||||||||
| creditNoteStyleType | integer? | optional | Display type (0=General) | ||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| returnPaymentMethodCode | string | optional | Payment method code for return payment | ||||||||||||||||||||||||||||
| returnPaymentMethodId | string | optional | Unique Identifier of return payment method | ||||||||||||||||||||||||||||
| returnPaymentAmount | number? | optional | Return payment amount | ||||||||||||||||||||||||||||
| returnPaymentDate | string | optional | Return payment date (yyyyMMdd) | ||||||||||||||||||||||||||||
| returnPaymentAccountCode | string | optional | Account code for return payment | ||||||||||||||||||||||||||||
| returnPaymentAccountSubId | string | optional | Sub-account ID for return payment | ||||||||||||||||||||||||||||
| returnPaymentAccountSubCode | string | optional | Sub-account code for return payment | ||||||||||||||||||||||||||||
| returnPaymentNote | string | optional | Notes for the return payment | ||||||||||||||||||||||||||||
| returnPaymentIsCheque | integer? | optional | Return payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| returnPaymentWithHoldingTaxAmount | string | optional | WHT amount for return payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakCreditNotesExpenses": {
"resCode": "200",
"resDesc": "PeakCreditNotesExpenses have Completed",
"totalCreditNoteExpense": 1,
"creditNotesExpenses": [{
"id": "5c707ff3-bea4-4475-8595-8d91a592403a",
"code": "CNX0800124",
"issuedDate": "20230815",
"dueDate": "20230815",
"contactId": "guid",
"contactCode": "C00002",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 5140,
"vatAmount": 0,
"netAmount": 5140,
"whtAmount": 154.2,
"paymentAmount": 0,
"remainAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "PP20180917", "accountCode": "410101", "description": "...", "quantity": 21, "price": 220, "vatType": 2 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetCreditNoteExpense
WHEN TO USE Use to read ONE purchase-side credit note (ใบลดหนี้ซื้อ, CNX) you already have an identifier for — to confirm a reduction, check status, or read its details before voiding. For sales-side credit notes, use GetCreditNote instead. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListCreditNoteExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CNX202601005"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching credit note expense with code, issuedDate, contactId / contactCode, netAmount, remainAmount and documentLink.
0 required · 6 optional
GetCreditNoteExpense
WHEN TO USE Use to read ONE purchase-side credit note (ใบลดหนี้ซื้อ, CNX) you already have an identifier for — to confirm a reduction, check status, or read its details before voiding. For sales-side credit notes, use GetCreditNote instead. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListCreditNoteExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CNX202601005"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching credit note expense with code, issuedDate, contactId / contactCode, netAmount, remainAmount and documentLink.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'CNX202601005'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakCreditNotesExpenses": {
"creditNotesExpenses": [
{
"id": "guid",
"code": "CNX0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalCreditNoteExpense": 1,
"resDesc": "PeakCreditNotesExpenses have Completed",
"resCode": "200"
}
}
ListCreditNoteExpense
WHEN TO USE Use to review purchase-side credit notes (ใบลดหนี้ซื้อ, CNX) a vendor has issued to this business — to confirm a reduction was recorded, check status, or find a document code. For sales-side credit notes issued to customers, use ListCreditNote instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (format yyyyMMdd), status, and searchText (contact name or document code). Use limit and page to paginate — each page returns 10 entries. Read-only; it never changes a document. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. On several near-matches, show the list and let the user pick. EXPECTED OUTCOME Returns credit note expenses with code, issuedDate, contactId / contactCode, netAmount, and documentLink for sharing with the user.
0 required · 6 optional
ListCreditNoteExpense
WHEN TO USE Use to review purchase-side credit notes (ใบลดหนี้ซื้อ, CNX) a vendor has issued to this business — to confirm a reduction was recorded, check status, or find a document code. For sales-side credit notes issued to customers, use ListCreditNote instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (format yyyyMMdd), status, and searchText (contact name or document code). Use limit and page to paginate — each page returns 10 entries. Read-only; it never changes a document. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. On several near-matches, show the list and let the user pick. EXPECTED OUTCOME Returns credit note expenses with code, issuedDate, contactId / contactCode, netAmount, and documentLink for sharing with the user.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Start date for filtering credit note expenses (format yyyyMMdd). |
| dateEnd | string | optional | End date for filtering credit note expenses (format yyyyMMdd). |
| status | integer? | optional | Filter by document status (0 = None, 1 = Voided, 2 = Draft, 3 = AwaitApproval, 4 = Outstanding, 5 = Overdue, 6 = PaidOrAwaitReceipt) |
| searchText | string | optional | Text to search for in credit note expenses. |
| limit | integer? | optional | Maximum number of entries to retrieve. |
| page | integer? | optional | Page number for displaying data, where each page will show 10 entries. |
Response
{
"PeakCreditNotesExpenses": {
"creditNotesExpenses": [
{
"id": "guid",
"code": "CNX0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalCreditNoteExpense": 1,
"resDesc": "PeakCreditNotesExpenses have Completed",
"resCode": "200"
}
}
GetCreditNote
WHEN TO USE Use to read ONE sales credit note (ใบลดหนี้) you already have an identifier for — to check status or remaining balance before recording another or before voiding. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListCreditNote instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CN202604001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching credit note with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetCreditNote
WHEN TO USE Use to read ONE sales credit note (ใบลดหนี้) you already have an identifier for — to check status or remaining balance before recording another or before voiding. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListCreditNote instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "CN202604001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching credit note with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'CNT0600027'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakCreditNotes": {
"creditNotes": [
{
"id": "guid",
"code": "CNT0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalCreditNote": 1,
"resDesc": "PeakCreditNotes have Completed",
"resCode": "200"
}
}
ListCreditNote
WHEN TO USE Use to check status or remaining balance on credit note already created — e.g. before recording an additional credit note , or before voiding. BUSINESS RULES & PRE-CONDITIONS Filter by date range, status or Search keyword - contact name, document number Default: 1st of last month – End of current month FALLBACK & ERROR HANDLING No match → confirm the filter or date range with the user rather than assuming a typo and guessing a correction. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListCreditNote
WHEN TO USE Use to check status or remaining balance on credit note already created — e.g. before recording an additional credit note , or before voiding. BUSINESS RULES & PRE-CONDITIONS Filter by date range, status or Search keyword - contact name, document number Default: 1st of last month – End of current month FALLBACK & ERROR HANDLING No match → confirm the filter or date range with the user rather than assuming a typo and guessing a correction. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Doc status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakCreditNotes": {
"creditNotes": [
{
"id": "guid",
"code": "CNT0600027",
"issuedDate": "20230612",
"contactId": "079fa9e4-de10-4020-b290-eae29cdbc1ca",
"contactCode": "C00002",
"netAmount": 10,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalCreditNote": 1,
"resDesc": "PeakCreditNotes have Completed",
"resCode": "200"
}
}
VoidCreditNote
WHEN TO USE Only when the user explicitly asks to cancel an existing sales credit note (ใบลดหนี้). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Credit notes cannot be edited — to correct one, void it and issue a replacement with CreateCreditNote. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetCreditNote to look it up. The sales credit note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this credit note while another document still references it — void the referencing document first. If the sales credit note has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales credit note was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 3 optional
VoidCreditNote
WHEN TO USE Only when the user explicitly asks to cancel an existing sales credit note (ใบลดหนี้). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Credit notes cannot be edited — to correct one, void it and issue a replacement with CreateCreditNote. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetCreditNote to look it up. The sales credit note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this credit note while another document still references it — void the referencing document first. If the sales credit note has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales credit note was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the sales credit note to be voided |
| id | string | optional | The Unique Identifier of the sales credit note to be voided |
| isVoidETaxInvoice | integer | optional | Set to 1 ONLY to void a document that has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt. Default 0 refuses the void in that case, which is the safe behaviour. Voiding an already-filed e-Tax document is a compliance action and cannot be undone (0 = refuse if already sent as e-Tax, 1 = void anyway) |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidCreditNoteExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing purchase credit note (ใบลดหนี้ค่าใช้จ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Purchase credit notes cannot be edited — to correct one, void it and issue a replacement with CreateCreditNoteExpense. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetCreditNoteExpense to look it up. The purchase credit note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this credit note while another document still references it — void the referencing document first. If the purchase credit note has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase credit note was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 3 optional
VoidCreditNoteExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing purchase credit note (ใบลดหนี้ค่าใช้จ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. Purchase credit notes cannot be edited — to correct one, void it and issue a replacement with CreateCreditNoteExpense. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetCreditNoteExpense to look it up. The purchase credit note is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void this credit note while another document still references it — void the referencing document first. If the purchase credit note has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase credit note was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the purchase credit note to be voided |
| id | string | optional | The Unique Identifier of the purchase credit note to be voided |
| isVoidETaxInvoice | integer | optional | Set to 1 ONLY to void a document that has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt. Default 0 refuses the void in that case, which is the safe behaviour. Voiding an already-filed e-Tax document is a compliance action and cannot be undone (0 = refuse if already sent as e-Tax, 1 = void anyway) |
Response
{ "resCode": "200", "resDesc": "Success" }
DailyJournal
1 tool
GetAccountCodes
WHEN TO USE Call once per session (cache the result) whenever: (a) the document is an Expense, (b) `use_product_code = false`, or (c) a line item fell back from productCode because ListProduct found nothing. Do not call it repeatedly per line item — one call covers the whole chart. BUSINESS RULES & PRE-CONDITIONS If a business-profile.md exists with a pre-mapped account table (e.g. ค่าเช่า → 530201), prefer that mapping over re-deriving one from the raw chart — it reflects this specific business's past decisions. Only fall back to the raw chart when the category isn't already mapped. FALLBACK & ERROR HANDLING No exact category match in either the business profile or common defaults → show the closest 2-3 candidate accounts to the user and ask them to confirm; never silently pick the "closest guess." EXPECTED OUTCOME Returns `code`, `name`, `nameEn` for every account. Common anchors: 410101 = รายได้จากการขาย, 114102 = สินค้าสำเร็จรูป, 212101 = เจ้าหนี้การค้า, 113101 = ลูกหนี้การค้า.
no params
GetAccountCodes
WHEN TO USE Call once per session (cache the result) whenever: (a) the document is an Expense, (b) `use_product_code = false`, or (c) a line item fell back from productCode because ListProduct found nothing. Do not call it repeatedly per line item — one call covers the whole chart. BUSINESS RULES & PRE-CONDITIONS If a business-profile.md exists with a pre-mapped account table (e.g. ค่าเช่า → 530201), prefer that mapping over re-deriving one from the raw chart — it reflects this specific business's past decisions. Only fall back to the raw chart when the category isn't already mapped. FALLBACK & ERROR HANDLING No exact category match in either the business profile or common defaults → show the closest 2-3 candidate accounts to the user and ask them to confirm; never silently pick the "closest guess." EXPECTED OUTCOME Returns `code`, `name`, `nameEn` for every account. Common anchors: 410101 = รายได้จากการขาย, 114102 = สินค้าสำเร็จรูป, 212101 = เจ้าหนี้การค้า, 113101 = ลูกหนี้การค้า.
No parameters required.
Response
{
"PeakAccountCode": {
"resCode": "200",
"resDesc": "Success",
"accountCode": [{
"code": "11000",
"name": "เงินสด",
"nameEn": "Cash"
}]
}
}
Expense
6 tools
CreateExpense
WHEN TO USE Use when the input describes money the business paid or owes to pay: vendor bills, rent, utilities, salaries, service fees. Never use `productCode` on Expense line items — Expense always uses `accountCode`, with no exception, even if the business has `use_product_code = true` for its sales documents. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) resolve each line item's `accountCode` via business-profile.md mapping or GetAccountCodes; (3) if withholding tax applies, prepare both WHT fields together — paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item; there is no document-level WHT field. VAT logic (line-item vatType: 1 = None, 2 = ZeroPercent, 3 = SevenPercent): has tax invoice + 7% VAT stated → `taxStatus=1, vatType=3`; has tax invoice + 0% VAT (zero-rated) → `taxStatus=1, vatType=2`; VAT-exempt item or no tax invoice at all → `taxStatus=1, vatType=1`. Do not use `taxStatus=2` (NonTax) for no-VAT items — some environments compute total as 0. Purchase tax invoice (ลงทะเบียนภาษีซื้อ): when the vendor issued a tax invoice, pass `receivedTaxInvoice` with the number and dates exactly as printed, and set `isTaxInvoice=1` — the line items must carry 7% VAT (`vatType=3`; vatType is 1 = None, 2 = ZeroPercent, 3 = SevenPercent), and never invent a tax invoice number; omit `receivedTaxInvoice` when there is no tax invoice. A duplicate number for the same vendor is only rejected once the expense is approved, not while it is a Draft. FALLBACK & ERROR HANDLING Tax invoice number already registered for this vendor → confirm with the user instead of changing the number. periodDate out of range → it must be the taxInvoiceDate month or up to 6 months after it. VAT total error with receivedTaxInvoice → the expense has no VAT or less VAT than the tax invoice; fix the line items' vatType instead of silently dropping the tax invoice. Locked period → taxInvoiceDate or journalDate falls in a closed accounting period; ask the user for a later date. `"Should be paid full amount"` → WHT present but paymentAmount wasn't reduced; recompute `paymentAmount = netAmount − withHoldingTaxAmount`. `"Invoice net amount less than payment"` → paymentAmount + WHT exceeds netAmount; re-check the formula. `"Bank Account not found"` → payment method code wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use `paymentMethodId`. Product-related error → fall back to accountCode and confirm with the user before retrying. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
1 required · 29 optional
CreateExpense
WHEN TO USE Use when the input describes money the business paid or owes to pay: vendor bills, rent, utilities, salaries, service fees. Never use `productCode` on Expense line items — Expense always uses `accountCode`, with no exception, even if the business has `use_product_code = true` for its sales documents. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) resolve each line item's `accountCode` via business-profile.md mapping or GetAccountCodes; (3) if withholding tax applies, prepare both WHT fields together — paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item; there is no document-level WHT field. VAT logic (line-item vatType: 1 = None, 2 = ZeroPercent, 3 = SevenPercent): has tax invoice + 7% VAT stated → `taxStatus=1, vatType=3`; has tax invoice + 0% VAT (zero-rated) → `taxStatus=1, vatType=2`; VAT-exempt item or no tax invoice at all → `taxStatus=1, vatType=1`. Do not use `taxStatus=2` (NonTax) for no-VAT items — some environments compute total as 0. Purchase tax invoice (ลงทะเบียนภาษีซื้อ): when the vendor issued a tax invoice, pass `receivedTaxInvoice` with the number and dates exactly as printed, and set `isTaxInvoice=1` — the line items must carry 7% VAT (`vatType=3`; vatType is 1 = None, 2 = ZeroPercent, 3 = SevenPercent), and never invent a tax invoice number; omit `receivedTaxInvoice` when there is no tax invoice. A duplicate number for the same vendor is only rejected once the expense is approved, not while it is a Draft. FALLBACK & ERROR HANDLING Tax invoice number already registered for this vendor → confirm with the user instead of changing the number. periodDate out of range → it must be the taxInvoiceDate month or up to 6 months after it. VAT total error with receivedTaxInvoice → the expense has no VAT or less VAT than the tax invoice; fix the line items' vatType instead of silently dropping the tax invoice. Locked period → taxInvoiceDate or journalDate falls in a closed accounting period; ask the user for a later date. `"Should be paid full amount"` → WHT present but paymentAmount wasn't reduced; recompute `paymentAmount = netAmount − withHoldingTaxAmount`. `"Invoice net amount less than payment"` → paymentAmount + WHT exceeds netAmount; re-check the formula. `"Bank Account not found"` → payment method code wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use `paymentMethodId`. Product-related error → fall back to accountCode and confirm with the user before retrying. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| issuedDate | string | optional | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. | ||||||||||||||||||||||||||||
| receivedTaxInvoice | ReceivedTaxInvoiceDetail | optional | Purchase tax invoice to register (ลงทะเบียนภาษีซื้อ) together with this expense. Send only when the vendor issued a tax invoice; omit the whole object otherwise. taxInvoiceNumber, taxInvoiceDate and journalDate are required (yyyyMMdd); periodDate is the optional VAT reporting month — PEAK stores the 1st of that month, and it must be the taxInvoiceDate month or up to 6 months after it.ReceivedTaxInvoiceDetail fields
|
Response
{
"PeakExpenses": {
"resCode": "200",
"resDesc": "Success",
"expenses": [{
"id": "guid",
"code": "EXP20240001",
"status": "Draft",
"issuedDate": "20240101",
"dueDate": "20240108",
"preTaxAmount": 1000.00,
"vatAmount": 70.00,
"netAmount": 1070.00,
"receivedTaxInvoice": {
"taxInvoiceNumber": "IV-0001",
"taxInvoiceDate": "20240101",
"journalDate": "20240101",
"periodDate": "20240101"
}
}]
}
}
GetExpense
WHEN TO USE Use to read ONE expense (บันทึกค่าใช้จ่าย) you already have an identifier for — typically to check its remainAmount, verify it is Approved before a payment is recorded against it, or read its full line items before EditExpense. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "EXP20240001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching expense with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetExpense
WHEN TO USE Use to read ONE expense (บันทึกค่าใช้จ่าย) you already have an identifier for — typically to check its remainAmount, verify it is Approved before a payment is recorded against it, or read its full line items before EditExpense. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListExpense instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "EXP20240001"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching expense with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'EXP20240001'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakExpenses": {
"resCode": "200",
"resDesc": "Success",
"totalExpense": 1,
"expenses": [{
"id": "guid",
"code": "EXP20240001",
"status": "Draft",
"issuedDate": "20240101",
"dueDate": "20240108",
"contactId": "guid",
"contactCode": "C00002",
"isTaxInvoice": 0,
"preTaxAmount": 1000.00,
"vatAmount": 70.00,
"netAmount": 1070.00,
"whtAmount": 0,
"paymentAmount": 1070.00,
"remainAmount": 0,
"remainWhtAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "530101", "description": "...", "quantity": 1, "price": 1000, "vatType": 3 }],
"paidPayments": [{ "paymentDate": "20240101", "paymentTotal": 1070, "payments": [{ "paymentMethodCode": "CSH260", "amount": 1070 }] }],
"journals": [{ "id": "guid", "code": "PV-..." }]
}]
}
}
ListExpense
WHEN TO USE Use to search expenses (บันทึกค่าใช้จ่าย) by date range, status, or keyword — to find a document code, review outstanding/overdue expenses, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching expenses with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListExpense
WHEN TO USE Use to search expenses (บันทึกค่าใช้จ่าย) by date range, status, or keyword — to find a document code, review outstanding/overdue expenses, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching expenses with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Document status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakExpenses": {
"resCode": "200",
"resDesc": "Success",
"totalExpense": 1,
"expenses": [{
"id": "guid",
"code": "EXP20240001",
"status": "Draft",
"issuedDate": "20240101",
"contactId": "guid",
"contactCode": "C00002",
"isTaxInvoice": 0,
"netAmount": 1070.00,
"remainAmount": 0,
"documentLink": "https://..."
}]
}
}
EditExpense
WHEN TO USE Call when the user wants to change an existing Draft expense (บันทึกค่าใช้จ่าย) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidExpense; to move it out of Draft use ApproveExpense. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetExpense to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. If withholding tax applies, send it at both levels: paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item (there is no document-level withholding-tax field). FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the expense was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
4 required · 27 optional
EditExpense
WHEN TO USE Call when the user wants to change an existing Draft expense (บันทึกค่าใช้จ่าย) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidExpense; to move it out of Draft use ApproveExpense. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetExpense to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. If withholding tax applies, send it at both levels: paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item (there is no document-level withholding-tax field). FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the expense was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | The COMPLETE array of products or services for the document. Any existing line omitted here is permanently deleted — copy the full list from GetExpense and modify it. array[InvoiceProduct] — sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| issuedDate | string | required | Document issuance date (yyyyMMdd). REQUIRED on edit: copy the existing value from GetExpense unless you intend to change it, otherwise the document date would be overwritten | ||||||||||||||||||||||||||||
| dueDate | string | required | Document due date (yyyyMMdd), which must be after the document issuance date. REQUIRED on edit: copy the existing value from GetExpense | ||||||||||||||||||||||||||||
| status | string | required | Status of the document (Draft, Approve, Voided, etc). REQUIRED on edit: copy the existing value from GetExpense so the edit does not change the document state | ||||||||||||||||||||||||||||
| code | string | optional | The code of the expense to be edited. Recommended over id: it also preserves the document number | ||||||||||||||||||||||||||||
| id | string | optional | The Unique Identifier of the expense to be edited. Use only when the code is unknown | ||||||||||||||||||||||||||||
| newCode | string | optional | New document number to write into the edited document. Leave blank to keep the existing document number. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact associated with the document | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact associated with the document (If contactId has been assigned a value, contactCode is not required) | ||||||||||||||||||||||||||||
| reference | string | optional | Reference information of the document | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Specify the tax status of the document to indicate whether the price includes tax or the tax is separate (0 = ExcludeTax, 1 = IncludeTax, 2 = NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | The total discount should not exceed the net total of the document or be greater than 100%. Additionally, it can only be applied when the tax type of each item is the same | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Whether the document can be used as a tax invoice (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Label attached to someone or something for the purpose of identification or to give other information | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax is applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | Tax collected from the increased value of products or services (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Total value of the document after tax and discounts have been applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency transactions | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency transactions | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known. Include the existing payment details when editing a document that already has a payment recorded. | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | The Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date in the format yyyyMMdd | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Payment account code. | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub account Unique Identifier to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Additional remarks or notes for that specific payment received | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Whether this payment is made by Cheque (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | Withholding tax amount for the payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakExpenses": {
"resCode": "200",
"resDesc": "Completed",
"totalExpense": 1,
"expenses": [{
"id": "guid",
"code": "EXP20240001",
"issuedDate": "20240101",
"dueDate": "20240108",
"contactId": "guid",
"contactCode": "C00002",
"status": "Draft",
"isTaxInvoice": 0,
"preTaxAmount": 1000,
"vatAmount": 70,
"netAmount": 1070,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 1070,
"remainWhtAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "530101", "description": "...", "quantity": 1, "price": 1000, "vatType": 3 }],
"paidPayments": [],
"journals": [],
"resCode": "200",
"resDesc": "Success"
}]
}
}
ApproveExpense
WHEN TO USE Call when the user asks to approve or confirm a Draft expense (บันทึกค่าใช้จ่าย) — the step that turns a Draft into a live accounting document. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetExpense to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditExpense first — an approved expense can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the expense was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
ApproveExpense
WHEN TO USE Call when the user asks to approve or confirm a Draft expense (บันทึกค่าใช้จ่าย) — the step that turns a Draft into a live accounting document. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetExpense to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditExpense first — an approved expense can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the expense was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the expense to be approved |
| id | string | optional | The Unique Identifier of the expense to be approved |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing expense (บันทึกค่าใช้จ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditExpense instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetExpense to look it up. The expense is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the expense has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the expense was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 3 optional
VoidExpense
WHEN TO USE Only when the user explicitly asks to cancel an existing expense (บันทึกค่าใช้จ่าย). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditExpense instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetExpense to look it up. The expense is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the expense has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the expense was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the expense to be voided |
| id | string | optional | The Unique Identifier of the expense to be voided |
| isVoidETaxInvoice | integer | optional | Set to 1 ONLY to void a document that has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt. Default 0 refuses the void in that case, which is the safe behaviour. Voiding an already-filed e-Tax document is a compliance action and cannot be undone (0 = refuse if already sent as e-Tax, 1 = void anyway) |
Response
{ "resCode": "200", "resDesc": "Success" }
FileVault
0 toolsFinancialReports
1 tool
GetTrialBalance
WHEN TO USE Use for any period-shaped question about the trial balance (งบทดลอง) — ขอดูงบทดลองเดือนที่แล้ว, what is the trial balance for Q2, ยอดยกมา / ยอดยกไป of an account. This is the report that carries amounts; GetAccountCodes returns only the chart of accounts (ผังบัญชี) with no figures, so never answer a balance question from that one. BUSINESS RULES & PRE-CONDITIONS The period is expressed in whole months: fromMonth and toMonth are both required and must be yyyyMM (e.g. 202607). PEAK expands them to full calendar months — fromMonth starts on the 1st, toMonth runs through its last day — so a part-month range cannot be requested; if the user asks for specific days, say the report is month-granular rather than silently rounding. toMonth must not be earlier than fromMonth. Leave isShowSubAccount = false unless the user explicitly asks for บัญชีย่อย: true makes PEAK run the query twice and multiplies the number of rows returned. Read-only — it never changes a document. The endpoint is rate limited to 10 calls per minute per user and refuses concurrent calls, so ask for the whole range in one call instead of looping month by month. FALLBACK & ERROR HANDLING resCode 400 means the input was rejected — a missing or non-yyyyMM month, or toMonth earlier than fromMonth; read resDesc, fix the argument and retry once. resCode 600 means the user's PEAK role is not permitted to view Trial Balance & Financial Statement — say so plainly; do not present it as a business with no data. resCode 429 means the rate or concurrency limit was hit — wait the stated retry-after and never retry in a tight loop. An empty trialBalanceAccount list means there were no entries in that window, not that the chart of accounts is empty — offer to widen the range before concluding anything. Never fabricate, interpolate, or re-derive figures that are not in the response. EXPECTED OUTCOME Returns trialBalanceAccount — one row per account with accountCode / accountName (plus subAccountCode / subAccountName when isSubAccount is true) and three debit/credit pairs: beginningBalance = ยอดยกมา, change = เคลื่อนไหว, endingBalance = ยอดยกไป — plus a summary totalling all three. Self-check before answering: in a correct trial balance the summary debit and credit are equal.
2 required · 1 optional
GetTrialBalance
WHEN TO USE Use for any period-shaped question about the trial balance (งบทดลอง) — ขอดูงบทดลองเดือนที่แล้ว, what is the trial balance for Q2, ยอดยกมา / ยอดยกไป of an account. This is the report that carries amounts; GetAccountCodes returns only the chart of accounts (ผังบัญชี) with no figures, so never answer a balance question from that one. BUSINESS RULES & PRE-CONDITIONS The period is expressed in whole months: fromMonth and toMonth are both required and must be yyyyMM (e.g. 202607). PEAK expands them to full calendar months — fromMonth starts on the 1st, toMonth runs through its last day — so a part-month range cannot be requested; if the user asks for specific days, say the report is month-granular rather than silently rounding. toMonth must not be earlier than fromMonth. Leave isShowSubAccount = false unless the user explicitly asks for บัญชีย่อย: true makes PEAK run the query twice and multiplies the number of rows returned. Read-only — it never changes a document. The endpoint is rate limited to 10 calls per minute per user and refuses concurrent calls, so ask for the whole range in one call instead of looping month by month. FALLBACK & ERROR HANDLING resCode 400 means the input was rejected — a missing or non-yyyyMM month, or toMonth earlier than fromMonth; read resDesc, fix the argument and retry once. resCode 600 means the user's PEAK role is not permitted to view Trial Balance & Financial Statement — say so plainly; do not present it as a business with no data. resCode 429 means the rate or concurrency limit was hit — wait the stated retry-after and never retry in a tight loop. An empty trialBalanceAccount list means there were no entries in that window, not that the chart of accounts is empty — offer to widen the range before concluding anything. Never fabricate, interpolate, or re-derive figures that are not in the response. EXPECTED OUTCOME Returns trialBalanceAccount — one row per account with accountCode / accountName (plus subAccountCode / subAccountName when isSubAccount is true) and three debit/credit pairs: beginningBalance = ยอดยกมา, change = เคลื่อนไหว, endingBalance = ยอดยกไป — plus a summary totalling all three. Self-check before answering: in a correct trial balance the summary debit and credit are equal.
| Parameter | Type | Description | |
|---|---|---|---|
| fromMonth | string | required | First month of the reporting period, format yyyyMM — e.g. 202607. Required. PEAK reads it as the whole calendar month starting on the 1st, and ยอดยกมา is the balance brought forward into it. A missing or malformed value is rejected with resCode 400, not silently accepted. |
| toMonth | string | required | Last month of the reporting period, format yyyyMM — e.g. 202609. Required, and must not be earlier than fromMonth. PEAK includes the entire month through its last day, and ยอดยกไป is the balance at that point. |
| isShowSubAccount | boolean | optional | Whether to break each account down into its sub-accounts (บัญชีย่อย). Defaults to false. Set true only when the user asks for sub-account detail — it makes PEAK run the query twice and multiplies the number of rows returned. |
Invoice
6 tools
CreateInvoice
WHEN TO USE Use when the input describes a sale to a customer that needs a formal bill invoice ใบแจ้งหนี้ or Tax Invoice— either as a standalone invoice BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) For line items: if `use_product_code = true`, try ListProduct per item and use `productCode` on a match; fall back to `accountCode` per item if no match — never send both on the same line item. VAT logic: if organization is not registered VAT isTaxInvoice = 0 is Tax Invoice + VAT ExcludeTax → `isTaxInvoice=1, taxStatus=0; is Tax Invoice + VAT IncludeTax→ `isTaxInvoice=1, taxStatus=1; is not tax invoice at all → `isTaxInvoice=0, taxStatus=2; Do not use `taxStatus=2` (NonTax) for no-VAT items — some environments compute total as 0. If payment happens at issuance, include paymentMethodCode + paymentAmount in the same call rather than a separate step FALLBACK & ERROR HANDLING `"Should be paid full amount"` → WHT present but paymentAmount wasn't reduced; recompute `paymentAmount = netAmount − withHoldingTaxAmount`. `"Invoice net amount less than payment"` → paymentAmount + WHT exceeds netAmount; re-check the formula. `"Bank Account not found"` → payment method code wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use `paymentMethodId`. Product-related error → fall back to accountCode and confirm with the user before retrying. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
1 required · 28 optional
CreateInvoice
WHEN TO USE Use when the input describes a sale to a customer that needs a formal bill invoice ใบแจ้งหนี้ or Tax Invoice— either as a standalone invoice BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) For line items: if `use_product_code = true`, try ListProduct per item and use `productCode` on a match; fall back to `accountCode` per item if no match — never send both on the same line item. VAT logic: if organization is not registered VAT isTaxInvoice = 0 is Tax Invoice + VAT ExcludeTax → `isTaxInvoice=1, taxStatus=0; is Tax Invoice + VAT IncludeTax→ `isTaxInvoice=1, taxStatus=1; is not tax invoice at all → `isTaxInvoice=0, taxStatus=2; Do not use `taxStatus=2` (NonTax) for no-VAT items — some environments compute total as 0. If payment happens at issuance, include paymentMethodCode + paymentAmount in the same call rather than a separate step FALLBACK & ERROR HANDLING `"Should be paid full amount"` → WHT present but paymentAmount wasn't reduced; recompute `paymentAmount = netAmount − withHoldingTaxAmount`. `"Invoice net amount less than payment"` → paymentAmount + WHT exceeds netAmount; re-check the formula. `"Bank Account not found"` → payment method code wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use `paymentMethodId`. Product-related error → fall back to accountCode and confirm with the user before retrying. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| issuedDate | string | optional | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakInvoices": {
"resCode": "200",
"resDesc": "Success",
"invoices": [{
"id": "guid",
"code": "INV20240001",
"status": "Draft",
"issuedDate": "20240101",
"dueDate": "20240108",
"preTaxAmount": 1000.00,
"vatAmount": 70.00,
"netAmount": 1070.00
}]
}
}
GetInvoice
WHEN TO USE Use to read ONE invoice (ใบแจ้งหนี้) you already have an identifier for — typically to check its remainAmount, verify it is Approved before a Receipt is issued against it, or read its full line items before EditInvoice. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListInvoice instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "IVS202308020"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching invoice with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetInvoice
WHEN TO USE Use to read ONE invoice (ใบแจ้งหนี้) you already have an identifier for — typically to check its remainAmount, verify it is Approved before a Receipt is issued against it, or read its full line items before EditInvoice. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListInvoice instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "IVS202308020"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching invoice with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'IVS202308020'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakInvoices": {
"resCode": "200",
"resDesc": "PeakInvoices have Completed",
"totalInvoice": 1,
"invoices": [{
"id": "77dd1ceb-a0f6-44bb-ae9c-525cc8026b34",
"code": "IVS202308020",
"issuedDate": "20230815",
"dueDate": "20230822",
"contactId": "guid",
"contactCode": "C01401",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 300,
"vatAmount": 21,
"netAmount": 321,
"whtAmount": 0,
"paymentAmount": 321,
"remainAmount": 0,
"remainWhtAmount": 0,
"documentLink": "https://...",
"remark": "...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "410101", "description": "...", "quantity": 1, "price": 300, "vatType": 3 }],
"paidPayments": [{ "paymentDate": "20230815", "paymentTotal": 321, "payments": [{ "paymentMethodCode": "CSH260", "amount": 321 }], "journals": [{ "id": "guid", "code": "RV-..." }] }],
"journals": [{ "id": "guid", "code": "SV-..." }]
}]
}
}
ListInvoice
WHEN TO USE Use to search invoices (ใบแจ้งหนี้) by date range, status, or keyword — to find a document code, review outstanding/overdue invoices, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching invoices with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListInvoice
WHEN TO USE Use to search invoices (ใบแจ้งหนี้) by date range, status, or keyword — to find a document code, review outstanding/overdue invoices, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching invoices with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Document status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakInvoices": {
"resCode": "200",
"resDesc": "PeakInvoices have Completed",
"totalInvoice": 1,
"invoices": [{
"id": "77dd1ceb-a0f6-44bb-ae9c-525cc8026b34",
"code": "IVS202308020",
"issuedDate": "20230815",
"contactId": "guid",
"contactCode": "C01401",
"status": "Approve",
"isTaxInvoice": 0,
"netAmount": 321,
"remainAmount": 0,
"documentLink": "https://..."
}]
}
}
EditInvoice
WHEN TO USE Call when the user wants to change an existing Draft invoice (ใบแจ้งหนี้) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidInvoice; to move it out of Draft use ApproveInvoice. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetInvoice to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. If withholding tax applies, send it at both levels: paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item (there is no document-level withholding-tax field). FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the invoice was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
4 required · 27 optional
EditInvoice
WHEN TO USE Call when the user wants to change an existing Draft invoice (ใบแจ้งหนี้) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidInvoice; to move it out of Draft use ApproveInvoice. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetInvoice to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. If withholding tax applies, send it at both levels: paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item (there is no document-level withholding-tax field). FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the invoice was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | The COMPLETE array of products or services for the document. Any existing line omitted here is permanently deleted — copy the full list from GetInvoice and modify it. array[InvoiceProduct] — sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| issuedDate | string | required | Document issuance date (yyyyMMdd). REQUIRED on edit: copy the existing value from GetInvoice unless you intend to change it, otherwise the document date would be overwritten | ||||||||||||||||||||||||||||
| dueDate | string | required | Document due date (yyyyMMdd), which must be after the document issuance date. REQUIRED on edit: copy the existing value from GetInvoice | ||||||||||||||||||||||||||||
| status | string | required | Status of the document (Draft, Approve, Voided, etc). REQUIRED on edit: copy the existing value from GetInvoice so the edit does not change the document state | ||||||||||||||||||||||||||||
| code | string | optional | The code of the invoice to be edited. Recommended over id: it also preserves the document number | ||||||||||||||||||||||||||||
| id | string | optional | The Unique Identifier of the invoice to be edited. Use only when the code is unknown | ||||||||||||||||||||||||||||
| newCode | string | optional | New document number to write into the edited document. Leave blank to keep the existing document number. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact associated with the document | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact associated with the document (If contactId has been assigned a value, contactCode is not required) | ||||||||||||||||||||||||||||
| reference | string | optional | Reference information of the document | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Specify the tax status of the document to indicate whether the price includes tax or the tax is separate (0 = ExcludeTax, 1 = IncludeTax, 2 = NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | The total discount should not exceed the net total of the document or be greater than 100%. Additionally, it can only be applied when the tax type of each item is the same | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Whether the document can be used as a tax invoice (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Label attached to someone or something for the purpose of identification or to give other information | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax is applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | Tax collected from the increased value of products or services (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Total value of the document after tax and discounts have been applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency transactions | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency transactions | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known. Include the existing payment details when editing a document that already has a payment recorded. | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | The Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date in the format yyyyMMdd | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Payment account code. | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub account Unique Identifier to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Additional remarks or notes for that specific payment received | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Whether this payment is made by Cheque (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | Withholding tax amount for the payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakInvoices": {
"resCode": "200",
"resDesc": "Completed",
"totalInvoice": 1,
"invoices": [{
"id": "guid",
"code": "IVS202308020",
"issuedDate": "20230815",
"dueDate": "20230822",
"contactId": "guid",
"contactCode": "C01401",
"status": "Draft",
"isTaxInvoice": 0,
"preTaxAmount": 300,
"vatAmount": 21,
"netAmount": 321,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 321,
"remainWhtAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "410101", "description": "...", "quantity": 1, "price": 300, "vatType": 3 }],
"paidPayments": [],
"journals": [],
"resCode": "200",
"resDesc": "Success"
}]
}
}
ApproveInvoice
WHEN TO USE Call when the user asks to approve or confirm a Draft invoice (ใบแจ้งหนี้) — the step that turns a Draft into a live accounting document. An invoice must be Approved before a Receipt can be issued against it. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetInvoice to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditInvoice first — an approved invoice can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the invoice was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
ApproveInvoice
WHEN TO USE Call when the user asks to approve or confirm a Draft invoice (ใบแจ้งหนี้) — the step that turns a Draft into a live accounting document. An invoice must be Approved before a Receipt can be issued against it. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetInvoice to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditInvoice first — an approved invoice can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the invoice was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the invoice to be approved |
| id | string | optional | The Unique Identifier of the invoice to be approved |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidInvoice
WHEN TO USE Only when the user explicitly asks to cancel an existing invoice (ใบแจ้งหนี้). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditInvoice instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetInvoice to look it up. The invoice is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the invoice has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the invoice was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 3 optional
VoidInvoice
WHEN TO USE Only when the user explicitly asks to cancel an existing invoice (ใบแจ้งหนี้). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditInvoice instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetInvoice to look it up. The invoice is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the invoice has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the invoice was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the invoice to be voided |
| id | string | optional | The Unique Identifier of the invoice to be voided |
| isVoidETaxInvoice | integer | optional | Set to 1 ONLY to void a document that has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt. Default 0 refuses the void in that case, which is the safe behaviour. Voiding an already-filed e-Tax document is a compliance action and cannot be undone (0 = refuse if already sent as e-Tax, 1 = void anyway) |
Response
{ "resCode": "200", "resDesc": "Success" }
PaymentMethod
2 tools
GetPaymentMethod
WHEN TO USE Call whenever the source input specifies how payment was made (cash, bank transfer, named bank account) and the document being created will include `paymentMethodCode`/`paymentAmount`. Call `code` filter if you already have a candidate code from business-profile.md; call with no filter to list all if you need the user to choose. BUSINESS RULES & PRE-CONDITIONS If business-profile.md already lists this business's common payment methods (code + name + bank), match against that list first instead of listing all payment methods in the account, which can number in the hundreds. FALLBACK & ERROR HANDLING No exact match → return the list and ask the user to pick, don't guess by partial name similarity. If a downstream document-creation call later errors with "Bank Account not found," it usually means the code refers to a Cheque-type account — retry using `paymentMethodId` instead of `paymentMethodCode`, or ask the user to confirm the account type in PEAK. EXPECTED OUTCOME Returns `id`, `code`, `name`, `type` (1=Cash, 2=BankAccount, 3=CreditCard, 4=EWallet), `bankName`, `accountNumber`. Use `code` in the document's `paymentMethodCode` field.
0 required · 5 optional
GetPaymentMethod
WHEN TO USE Call whenever the source input specifies how payment was made (cash, bank transfer, named bank account) and the document being created will include `paymentMethodCode`/`paymentAmount`. Call `code` filter if you already have a candidate code from business-profile.md; call with no filter to list all if you need the user to choose. BUSINESS RULES & PRE-CONDITIONS If business-profile.md already lists this business's common payment methods (code + name + bank), match against that list first instead of listing all payment methods in the account, which can number in the hundreds. FALLBACK & ERROR HANDLING No exact match → return the list and ask the user to pick, don't guess by partial name similarity. If a downstream document-creation call later errors with "Bank Account not found," it usually means the code refers to a Cheque-type account — retry using `paymentMethodId` instead of `paymentMethodCode`, or ask the user to confirm the account type in PEAK. EXPECTED OUTCOME Returns `id`, `code`, `name`, `type` (1=Cash, 2=BankAccount, 3=CreditCard, 4=EWallet), `bankName`, `accountNumber`. Use `code` in the document's `paymentMethodCode` field.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Code displayed in PEAK. Auto-generated if blank |
| id | string | optional | Unique Identifier generated by PEAK |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakPaymentMethods": {
"paymentMethods": [
{
"id": "c7fb1bae-ff40-4856-9214-b4e30719f233",
"code": "BSV015",
"name": "TEST GS BANK",
"type": 2,
"memo": "test quick add",
"carringBalanceValue": 5000,
"bankId": 18,
"bankName": "ธนาคารออมสิน",
"accountType": 2,
"accountNumber": "888-999-450",
"isHaveCheque": 1,
"resCode": "200",
"resDesc": "Success"
}
],
"totalPaymentMethod": 973,
"resDesc": "PeakPaymentMethods have Completed",
"resCode": "200"
}
}
CreatePaymentMethod
WHEN TO USE Only when `GetPaymentMethod` confirms the business's stated payment channel (a specific bank account, cash method, etc.) genuinely doesn't exist yet in PEAK — typically only during first-time setup (`/skill.PEAK Start`), rarely mid-workflow. BUSINESS RULES & PRE-CONDITIONS `type` determines which other fields become effectively required: type=2 (BankAccount) needs `bankId` + `accountNumber`; type=4 (EWallet) needs `eWalletId` + `accountCode`; type=0 (Others) needs `bankName`. Don't submit a bank account without a `bankId` — PEAK will reject or mis-file it. FALLBACK & ERROR HANDLING If the user only gave a partial description of the account (e.g. "our Krungsri account" without the number), ask for the missing number rather than submitting an incomplete bank account. EXPECTED OUTCOME Returns the new `code` — usable immediately in Expense/Invoice/Receipt `paymentMethodCode`.
2 required · 11 optional
CreatePaymentMethod
WHEN TO USE Only when `GetPaymentMethod` confirms the business's stated payment channel (a specific bank account, cash method, etc.) genuinely doesn't exist yet in PEAK — typically only during first-time setup (`/skill.PEAK Start`), rarely mid-workflow. BUSINESS RULES & PRE-CONDITIONS `type` determines which other fields become effectively required: type=2 (BankAccount) needs `bankId` + `accountNumber`; type=4 (EWallet) needs `eWalletId` + `accountCode`; type=0 (Others) needs `bankName`. Don't submit a bank account without a `bankId` — PEAK will reject or mis-file it. FALLBACK & ERROR HANDLING If the user only gave a partial description of the account (e.g. "our Krungsri account" without the number), ask for the missing number rather than submitting an incomplete bank account. EXPECTED OUTCOME Returns the new `code` — usable immediately in Expense/Invoice/Receipt `paymentMethodCode`.
| Parameter | Type | Description | |
|---|---|---|---|
| name | string | required | Payment method name default use merchant name |
| type | integer | required | Type (0=Others,1=Cash,2=BankAccount,3=CreditCard,4=eWallet) |
| id | string | optional | Unique Identifier generated by PEAK |
| code | string | optional | Code displayed in PEAK. Auto-generated if blank |
| memo | string | optional | Additional notes |
| carringBalanceValue | integer? | optional | Carrying balance value |
| bankId | integer? | optional | Financial institution code (if type=2, bankId required) |
| eWalletId | integer? | optional | E-Wallet identifier (if type=4, accountCode required) |
| bankName | string | optional | Bank name not in system (if bankID=0, bankName required) |
| accountType | integer? | optional | Bank account type (1=Current,2=Savings,3=FixedDeposit) |
| accountNumber | string | optional | Bank account number |
| isHaveCheque | integer? | optional | Can issue cheques (0=No,1=Yes) |
| accountCode | string | optional | Account to record E-Wallet transactions Leave blank to automatically use the default value. (if type=4, required) |
Response
{
"PeakPaymentMethods": {
"paymentMethods": [
{
"id": "9c6a2aab-0d03-4e65-92fe-fdad517daa69",
"code": "BSV290",
"name": "Payment method's name",
"type": 2,
"carringBalanceValue": 125632,
"bankId": 10,
"bankName": "ธนาคารทิสโก้ จำกัด (มหาชน)",
"accountType": 2,
"accountNumber": "3011199912123",
"isHaveCheque": 1,
"resCode": "200",
"resDesc": "Success"
}
],
"resDesc": "PeakPaymentMethods have Completed",
"resCode": "200"
}
}
Product
3 tools
ListProduct
WHEN TO USE Call once per distinct line-item name whenever the business profile has `use_product_code = true` AND the document being created is NOT an Expense. Never call for Expense documents — Expense always uses `accountCode`, no exceptions. BUSINESS RULES & PRE-CONDITIONS Never assume a line-item description in the source input matches a `productCode` in PEAK — always search first, even if the name looks obviously identical. Search by `searchText` keyword per item, not once for the whole document. Returns products (สินค้า) only — services (บริการ) live in a separate catalog; search them with ListService. To read one product you already have a code or id for, use GetProduct. FALLBACK & ERROR HANDLING Zero matches → do not block the document; fall back to `accountCode` for that line item and mark it ⚠️ in the confirmation preview so the user can correct it. Multiple matches → show the list, let the user choose; do not auto-pick the first result. EXPECTED OUTCOME Returns `productId`, `productCode`, `name`, `price`, `vatType`, `unit` for each match — `productCode` goes directly into the line item; `accountCode` is not needed alongside it. totalProduct is PEAK's count of the whole catalog (products and services together), not the number of matches or of products — never report it as either.
0 required · 4 optional
ListProduct
WHEN TO USE Call once per distinct line-item name whenever the business profile has `use_product_code = true` AND the document being created is NOT an Expense. Never call for Expense documents — Expense always uses `accountCode`, no exceptions. BUSINESS RULES & PRE-CONDITIONS Never assume a line-item description in the source input matches a `productCode` in PEAK — always search first, even if the name looks obviously identical. Search by `searchText` keyword per item, not once for the whole document. Returns products (สินค้า) only — services (บริการ) live in a separate catalog; search them with ListService. To read one product you already have a code or id for, use GetProduct. FALLBACK & ERROR HANDLING Zero matches → do not block the document; fall back to `accountCode` for that line item and mark it ⚠️ in the confirmation preview so the user can correct it. Multiple matches → show the list, let the user choose; do not auto-pick the first result. EXPECTED OUTCOME Returns `productId`, `productCode`, `name`, `price`, `vatType`, `unit` for each match — `productCode` goes directly into the line item; `accountCode` is not needed alongside it. totalProduct is PEAK's count of the whole catalog (products and services together), not the number of matches or of products — never report it as either.
| Parameter | Type | Description | |
|---|---|---|---|
| year | string | optional | Filter by year (e.g. '2024'). |
| searchText | string | optional | Search keyword - product name, product code, SKU |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakProducts": {
"resCode": "200",
"resDesc": "Success",
"totalProduct": 1,
"products": [{
"id": "guid",
"code": "P001",
"name": "Product Name",
"type": 1,
"sellValue": 100.00,
"sellVatType": 3,
"sellAccount": "410101",
"purchaseValue": 80.00,
"purchaseVatType": 3,
"purchaseAccount": "510101"
}]
}
}
CreateProduct
WHEN TO USE Only after ListProduct confirms zero matches for this item, and only when the business actually uses product codes (use_product_code = true). This tool always creates a Product (สินค้า); for a non-stocked service (บริการ) — consulting, maintenance, subscriptions, fees — use CreateService instead. BUSINESS RULES & PRE-CONDITIONS name is the only required field, but set sellAccount (for sale-side items) or purchaseAccount (for purchase-side items) so future documents auto-map correctly — otherwise every future invoice using this product will need manual account selection. Match sellVatType/purchaseVatType to how the business actually prices (7% is the Thai default; use 1=None only for genuinely VAT-exempt items) FALLBACK & ERROR HANDLING If price is unknown from the source document, do not fabricate a value — leave sellValue/purchaseValue unset and flag to the user rather than guessing EXPECTED OUTCOME Returns productId — reference this in the current document's line item as productCode, not accountCode.
1 required · 15 optional
CreateProduct
WHEN TO USE Only after ListProduct confirms zero matches for this item, and only when the business actually uses product codes (use_product_code = true). This tool always creates a Product (สินค้า); for a non-stocked service (บริการ) — consulting, maintenance, subscriptions, fees — use CreateService instead. BUSINESS RULES & PRE-CONDITIONS name is the only required field, but set sellAccount (for sale-side items) or purchaseAccount (for purchase-side items) so future documents auto-map correctly — otherwise every future invoice using this product will need manual account selection. Match sellVatType/purchaseVatType to how the business actually prices (7% is the Thai default; use 1=None only for genuinely VAT-exempt items) FALLBACK & ERROR HANDLING If price is unknown from the source document, do not fabricate a value — leave sellValue/purchaseValue unset and flag to the user rather than guessing EXPECTED OUTCOME Returns productId — reference this in the current document's line item as productCode, not accountCode.
| Parameter | Type | Description | |
|---|---|---|---|
| name | string | required | Product name. |
| code | string | optional | Code displayed in PEAK. Auto-generated if blank |
| description | string | optional | Additional description of the product. |
| sellValue | number | optional | Selling price per unit. |
| sellVatType | integer | optional | Selling tax rate (VAT Type). Default is 3. (1 = None, 2 = ZeroPercent, 3 = SevenPercent) |
| sellAccount | string | optional | If revenue document, PEAK records the transaction in this account, Leave blank to automatically use the default value. |
| purchaseValue | number? | optional | Purchase price per unit. |
| purchaseVatType | integer? | optional | Selling tax rate (VAT Type). Default is 3. (1 = None, 3 = SevenPercent) |
| purchaseAccount | string | optional | If expense document , PEAK records the transaction in this account, Leave blank to automatically use the default value. |
| carryingBalanceValue | number? | optional | Carrying balance value. |
| carryingBalanceAmount | number? | optional | Carrying balance amount. |
| unitId | string | optional | Unit ID. |
| unitCode | string | optional | Unit code. |
| unitNameTh | string | optional | Unit name in Thai. |
| unitNameEn | string | optional | Unit name in English. |
| id | string | optional | Unique Identifier generated by PEAK |
Response
{
"PeakProducts": {
"resCode": "200",
"resDesc": "Success",
"totalProduct": 1,
"products": [{
"id": "guid",
"code": "P001",
"name": "Product Name",
"type": 1
}]
}
}
GetProduct
WHEN TO USE Use to read ONE product (สินค้า) you already have a code or id for — typically to check its prices, VAT types, accounts or unit before putting it on a line item. This tool addresses a product directly; to search by keyword use ListProduct instead. For services (บริการ) use GetService — PEAK keeps them in a separate catalog. BUSINESS RULES & PRE-CONDITIONS Supply code (recommended) or id; one of the two is required. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong or belongs to a service, not that the product must be created: confirm the code with the user or try GetService. Never invent a code or fabricate product details. EXPECTED OUTCOME Returns the matching product (type 1) with id, code, name, sellValue, sellVatType, sellAccount, purchaseValue, purchaseVatType, purchaseAccount and unit.
0 required · 2 optional
GetProduct
WHEN TO USE Use to read ONE product (สินค้า) you already have a code or id for — typically to check its prices, VAT types, accounts or unit before putting it on a line item. This tool addresses a product directly; to search by keyword use ListProduct instead. For services (บริการ) use GetService — PEAK keeps them in a separate catalog. BUSINESS RULES & PRE-CONDITIONS Supply code (recommended) or id; one of the two is required. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong or belongs to a service, not that the product must be created: confirm the code with the user or try GetService. Never invent a code or fabricate product details. EXPECTED OUTCOME Returns the matching product (type 1) with id, code, name, sellValue, sellVatType, sellAccount, purchaseValue, purchaseVatType, purchaseAccount and unit.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Product code to fetch ONE specific product (e.g. 'P00001'). Recommended. |
| id | string | optional | The Unique Identifier of ONE specific product. Use when the code is unknown. |
Response
{
"PeakProducts": {
"resCode": "200",
"resDesc": "Success",
"products": [{
"id": "guid",
"code": "P00001",
"name": "Product Name",
"type": 1,
"sellValue": 100.00,
"sellVatType": 3,
"sellAccount": "410101",
"purchaseValue": 80.00,
"purchaseVatType": 3,
"purchaseAccount": "510101",
"resCode": "200",
"resDesc": "Success"
}]
}
}
PurchaseOrder
6 tools
CreatePurchaseOrder
WHEN TO USE Use when the input is a request/order to a vendor, not yet a paid bill. Workflow: PO → convert to Expense → Expense Payment. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) resolve each line item's `accountCode` via business-profile.md mapping or GetAccountCodes unless the business explicitly tracks stock-in via productCode. ; (3) if withholding tax applies, prepare all 3 WHT fields together (see WHT formula below) — never send only one. FALLBACK & ERROR HANDLING product-not-found → accountCode fallback + user confirmation. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
1 required · 28 optional
CreatePurchaseOrder
WHEN TO USE Use when the input is a request/order to a vendor, not yet a paid bill. Workflow: PO → convert to Expense → Expense Payment. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) resolve each line item's `accountCode` via business-profile.md mapping or GetAccountCodes unless the business explicitly tracks stock-in via productCode. ; (3) if withholding tax applies, prepare all 3 WHT fields together (see WHT formula below) — never send only one. FALLBACK & ERROR HANDLING product-not-found → accountCode fallback + user confirmation. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| issuedDate | string | optional | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakPurchaseOrders": {
"resCode": "200",
"resDesc": "PeakPurchaseOrders have Completed",
"purchaseOrders": [{
"id": "b6dbb6d7-b38e-4e2b-ac44-f321f38b4a3a",
"code": "PO-2023010004",
"issuedDate": "20230817",
"dueDate": "20230818",
"contactId": "917c3e8f-b315-4968-b8cc-08e2220d8682",
"contactCode": "C01401",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 200,
"vatAmount": 0,
"netAmount": 200,
"whtAmount": 0,
"taxStatus": 0,
"products": [{ "id": "guid", "accountCode": "114102", "description": "Design by Peak", "quantity": 1, "price": 200, "vatType": 1 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetPurchaseOrder
WHEN TO USE Use to read ONE purchase order (ใบสั่งซื้อ) you already have an identifier for, with its full line items — do this before calling EditPurchaseOrder, ApprovePurchaseOrder or VoidPurchaseOrder. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListPurchaseOrder instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. 'PO2023080002'), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Do not fall back to a keyword search on your own; a keyword search can return a different document. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching purchase order with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetPurchaseOrder
WHEN TO USE Use to read ONE purchase order (ใบสั่งซื้อ) you already have an identifier for, with its full line items — do this before calling EditPurchaseOrder, ApprovePurchaseOrder or VoidPurchaseOrder. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListPurchaseOrder instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. 'PO2023080002'), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Do not fall back to a keyword search on your own; a keyword search can return a different document. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching purchase order with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'PO2023080002'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakPurchaseOrders": {
"purchaseOrders": [
{
"id": "guid",
"code": "PO2023080002",
"issuedDate": "20230809",
"contactId": "bced4f76-8dbf-4518-ab75-c92437471f08",
"contactCode": "572608351",
"netAmount": 107,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalPurchaseOrder": 1,
"resDesc": "Success",
"resCode": "200"
}
}
ListPurchaseOrder
WHEN TO USE Use to search purchase orders (ใบสั่งซื้อ) by date range, status, or keyword — to find a document code, review open orders, or list activity. This tool returns a filtered LIST; to read ONE document by exact id/code/reference use GetPurchaseOrder instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching purchase orders with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListPurchaseOrder
WHEN TO USE Use to search purchase orders (ใบสั่งซื้อ) by date range, status, or keyword — to find a document code, review open orders, or list activity. This tool returns a filtered LIST; to read ONE document by exact id/code/reference use GetPurchaseOrder instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching purchase orders with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Document status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakPurchaseOrders": {
"purchaseOrders": [
{
"id": "guid",
"code": "PO2023080002",
"issuedDate": "20230809",
"contactId": "bced4f76-8dbf-4518-ab75-c92437471f08",
"contactCode": "572608351",
"netAmount": 107,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalPurchaseOrder": 1,
"resDesc": "Success",
"resCode": "200"
}
}
EditPurchaseOrder
WHEN TO USE Call when the user wants to change an existing Draft purchase order (ใบสั่งซื้อ) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidPurchaseOrder; to move it out of Draft use ApprovePurchaseOrder. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetPurchaseOrder to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the purchase order was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
3 required · 28 optional
EditPurchaseOrder
WHEN TO USE Call when the user wants to change an existing Draft purchase order (ใบสั่งซื้อ) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidPurchaseOrder; to move it out of Draft use ApprovePurchaseOrder. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetPurchaseOrder to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the purchase order was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | The COMPLETE array of products or services for the document. Any existing line omitted here is permanently deleted — copy the full list from GetPurchaseOrder and modify it. array[InvoiceProduct] — sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| issuedDate | string | required | Document issuance date (yyyyMMdd). REQUIRED on edit: copy the existing value from GetPurchaseOrder unless you intend to change it, otherwise the document date would be overwritten | ||||||||||||||||||||||||||||
| contactId | string | required | Unique Identifier of the contact associated with the document. REQUIRED on edit: copy the existing value from GetPurchaseOrder (contactCode alone is not accepted by PEAK on edit) | ||||||||||||||||||||||||||||
| code | string | optional | The code of the purchase order to be edited. Recommended over id: it also preserves the document number | ||||||||||||||||||||||||||||
| id | string | optional | The Unique Identifier of the purchase order to be edited. Use only when the code is unknown | ||||||||||||||||||||||||||||
| newCode | string | optional | New document number to write into the edited document. Leave blank to keep the existing document number. | ||||||||||||||||||||||||||||
| dueDate | string | optional | Document due date, which must be after the document issuance date | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact associated with the document (If contactId has been assigned a value, contactCode is not required) | ||||||||||||||||||||||||||||
| reference | string | optional | Reference information of the document | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Specify the tax status of the document to indicate whether the price includes tax or the tax is separate (0 = ExcludeTax, 1 = IncludeTax, 2 = NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | The total discount should not exceed the net total of the document or be greater than 100%. Additionally, it can only be applied when the tax type of each item is the same | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Whether the document can be used as a tax invoice (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Label attached to someone or something for the purpose of identification or to give other information | ||||||||||||||||||||||||||||
| status | string | optional | Status of the document, which can have multiple states such as Draft, Approve, Voided, etc | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax is applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | Tax collected from the increased value of products or services (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Total value of the document after tax and discounts have been applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency transactions | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency transactions | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known. Include the existing payment details when editing a document that already has a payment recorded. | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | The Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date in the format yyyyMMdd | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Payment account code. | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub account Unique Identifier to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Additional remarks or notes for that specific payment received | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Whether this payment is made by Cheque (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | Withholding tax amount for the payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakPurchaseOrders": {
"resCode": "200",
"resDesc": "Completed",
"totalPurchaseOrder": 1,
"purchaseOrders": [{
"id": "guid",
"code": "PO2023080002",
"issuedDate": "20230809",
"dueDate": "20230816",
"contactId": "guid",
"contactCode": "C01401",
"status": "Draft",
"isTaxInvoice": 0,
"preTaxAmount": 200,
"vatAmount": 0,
"netAmount": 200,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 200,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "accountCode": "114102", "description": "...", "quantity": 1, "price": 200, "vatType": 1 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
ApprovePurchaseOrder
WHEN TO USE Call when the user asks to approve or confirm a Draft purchase order (ใบสั่งซื้อ) — the step that turns a Draft into a live accounting document. The documented workflow is PO → convert to Expense → Expense Payment. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetPurchaseOrder to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditPurchaseOrder first — an approved purchase order can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase order was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
ApprovePurchaseOrder
WHEN TO USE Call when the user asks to approve or confirm a Draft purchase order (ใบสั่งซื้อ) — the step that turns a Draft into a live accounting document. The documented workflow is PO → convert to Expense → Expense Payment. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetPurchaseOrder to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditPurchaseOrder first — an approved purchase order can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase order was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the purchase order to be approved |
| id | string | optional | The Unique Identifier of the purchase order to be approved |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidPurchaseOrder
WHEN TO USE Only when the user explicitly asks to cancel an existing purchase order (ใบสั่งซื้อ). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditPurchaseOrder instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetPurchaseOrder to look it up. The purchase order is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference: if an Expense has been created from this purchase order, void that Expense first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase order was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
VoidPurchaseOrder
WHEN TO USE Only when the user explicitly asks to cancel an existing purchase order (ใบสั่งซื้อ). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditPurchaseOrder instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetPurchaseOrder to look it up. The purchase order is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference: if an Expense has been created from this purchase order, void that Expense first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the purchase order was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the purchase order to be voided |
| id | string | optional | The Unique Identifier of the purchase order to be voided |
Response
{ "resCode": "200", "resDesc": "Success" }
Quotation
6 tools
CreateQuotation
WHEN TO USE Use when the input is a price proposal, not yet a binding bill — customer hasn't committed to purchase. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) For line items: if `use_product_code = true`, try ListProduct per item and use `productCode` on a match; fall back to `accountCode` per item if no match — never send both on the same line item. FALLBACK & ERROR HANDLING product-not-found → accountCode fallback + user confirmation. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
1 required · 28 optional
CreateQuotation
WHEN TO USE Use when the input is a price proposal, not yet a binding bill — customer hasn't committed to purchase. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve `contactId`/`contactCode` via SearchContacts → CreateContact if missing; (2) For line items: if `use_product_code = true`, try ListProduct per item and use `productCode` on a match; fall back to `accountCode` per item if no match — never send both on the same line item. FALLBACK & ERROR HANDLING product-not-found → accountCode fallback + user confirmation. EXPECTED OUTCOME Create the document in "Draft" or "Approved" status, and display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| issuedDate | string | optional | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakQuotations": {
"resCode": "200",
"resDesc": "PeakQuotations have Completed",
"quotations": [{
"id": "b6dbb6d7-b38e-4e2b-ac44-f321f38b4a3a",
"code": "QOU-230817000000012",
"issuedDate": "20230817",
"dueDate": "20230818",
"contactId": "917c3e8f-b315-4968-b8cc-08e2220d8682",
"contactCode": "C01401",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 200,
"vatAmount": 0,
"netAmount": 200,
"whtAmount": 0,
"taxStatus": 0,
"products": [{ "id": "guid", "accountCode": "114102", "description": "Design by Peak", "quantity": 1, "price": 200, "vatType": 1 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetQuotation
WHEN TO USE Use to read ONE sales quotation (ใบเสนอราคา) you already have an identifier for — typically to check its status (Draft/Approved/Void) before it is converted to an Invoice, or read its full line items before EditQuotation. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListQuotation instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "QO202412005"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching quotation with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetQuotation
WHEN TO USE Use to read ONE sales quotation (ใบเสนอราคา) you already have an identifier for — typically to check its status (Draft/Approved/Void) before it is converted to an Invoice, or read its full line items before EditQuotation. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListQuotation instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. "QO202412005"), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching quotation with status (Draft/Approve/Voided), document number, netAmount and remainAmount, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'QO202412005'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakQuotations": {
"resCode": "200",
"resDesc": "PeakQuotations have Completed",
"totalQuotation": 1,
"quotations": [{
"id": "c4311f2f-e2eb-474c-b32a-4db1ce49d974",
"code": "QOU-230118000000000",
"issuedDate": "20230118",
"dueDate": "20230125",
"contactId": "5106bf55-8939-409f-a2d5-ef84f9c4bc9d",
"contactCode": "C00006",
"reference": "...",
"status": "Draft",
"isTaxInvoice": 0,
"isVoid": 0,
"preTaxAmount": 220,
"vatAmount": 7.7,
"netAmount": 227.7,
"whtAmount": 0,
"paymentAmount": 0,
"remainAmount": 227.7,
"remainWhtAmount": 0,
"documentLink": "https://...",
"remark": "...",
"taxStatus": 0,
"discountTotal": "0",
"tags": [],
"products": [{ "id": "guid", "productCode": "P00002", "accountCode": "410101", "description": "...", "quantity": 1, "price": 110, "vatType": 1 }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
ListQuotation
WHEN TO USE Use to search sales quotations (ใบเสนอราคา) by date range, status, or keyword — to find a document code, check which are still Draft/Approved, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching quotations with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListQuotation
WHEN TO USE Use to search sales quotations (ใบเสนอราคา) by date range, status, or keyword — to find a document code, check which are still Draft/Approved, or list recent activity. This tool returns a filtered LIST; it does not read one document by exact id/code/reference. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching quotations with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Displays documents starting from the specified date (Format: yyyyMMdd). |
| dateEnd | string | optional | Displays documents ending on the specified date (Format: yyyyMMdd). |
| status | integer? | optional | Document status (0=None,1=Voided,2=Draft,3=AwaitApproval,4=Outstanding,5=Overdue,6=PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakQuotations": {
"resCode": "200",
"resDesc": "PeakQuotations have Completed",
"totalQuotation": 1,
"quotations": [{
"id": "c4311f2f-e2eb-474c-b32a-4db1ce49d974",
"code": "QOU-230118000000000",
"issuedDate": "20230118",
"contactId": "5106bf55-8939-409f-a2d5-ef84f9c4bc9d",
"contactCode": "C00006",
"status": "Draft",
"netAmount": 227.7,
"documentLink": "https://..."
}]
}
}
EditQuotation
WHEN TO USE Call when the user wants to change an existing Draft sales quotation (ใบเสนอราคา) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidQuotation; to move it out of Draft use ApproveQuotation. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetQuotation to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only Draft quotations can be edited; approved or voided documents are rejected by PEAK. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the sales quotation was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
3 required · 28 optional
EditQuotation
WHEN TO USE Call when the user wants to change an existing Draft sales quotation (ใบเสนอราคา) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidQuotation; to move it out of Draft use ApproveQuotation. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetQuotation to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only Draft quotations can be edited; approved or voided documents are rejected by PEAK. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the sales quotation was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | The COMPLETE array of products or services for the document. Any existing line omitted here is permanently deleted — copy the full list from GetQuotation and modify it. array[InvoiceProduct] — sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| issuedDate | string | required | Document issuance date (yyyyMMdd). REQUIRED on edit: copy the existing value from GetQuotation unless you intend to change it, otherwise the document date would be overwritten | ||||||||||||||||||||||||||||
| contactId | string | required | Unique Identifier of the contact associated with the document. REQUIRED on edit: copy the existing value from GetQuotation (contactCode alone is not accepted by PEAK on edit) | ||||||||||||||||||||||||||||
| code | string | optional | The code of the quotation to be edited (e.g. 'QOU-230118000000000'). Recommended over id: it also preserves the document number | ||||||||||||||||||||||||||||
| id | string | optional | The Unique Identifier of the quotation to be edited. Use only when the code is unknown | ||||||||||||||||||||||||||||
| newCode | string | optional | New document number to write into the edited document. Leave blank to keep the existing document number. | ||||||||||||||||||||||||||||
| dueDate | string | optional | Document due date, which must be after the document issuance date | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact associated with the document (If contactId has been assigned a value, contactCode is not required) | ||||||||||||||||||||||||||||
| reference | string | optional | Reference information of the document | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Specify the tax status of the document to indicate whether the price includes tax or the tax is separate (0 = ExcludeTax, 1 = IncludeTax, 2 = NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | The total discount should not exceed the net total of the document or be greater than 100%. Additionally, it can only be applied when the tax type of each item is the same | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Whether the document can be used as a tax invoice (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Label attached to someone or something for the purpose of identification or to give other information | ||||||||||||||||||||||||||||
| status | string | optional | Status of the document, which can have multiple states such as Draft, Approve, Voided, etc | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax is applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | Tax collected from the increased value of products or services (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Total value of the document after tax and discounts have been applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency transactions | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency transactions | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known. Include the existing payment details when editing a document that already has a payment recorded. | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | The Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date in the format yyyyMMdd | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Payment account code. | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub account Unique Identifier to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Additional remarks or notes for that specific payment received | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Whether this payment is made by Cheque (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | Withholding tax amount for the payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakQuotations": {
"resCode": "200",
"resDesc": "PeakQuotations have Completed",
"quotations": [{
"id": "b6dbb6d7-b38e-4e2b-ac44-f321f38b4a3a",
"code": "QOU-230817000000012",
"status": "Draft",
"netAmount": 200,
"resCode": "200",
"resDesc": "Success"
}]
}
}
ApproveQuotation
WHEN TO USE Call when the user asks to approve or confirm a Draft sales quotation (ใบเสนอราคา) — the step that turns a Draft into a live accounting document. Use this when a quotation was created as a Draft and is now ready to send to the customer. A quotation must be Approved before it can be converted into an Invoice. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetQuotation to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditQuotation first — an approved sales quotation can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales quotation was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
ApproveQuotation
WHEN TO USE Call when the user asks to approve or confirm a Draft sales quotation (ใบเสนอราคา) — the step that turns a Draft into a live accounting document. Use this when a quotation was created as a Draft and is now ready to send to the customer. A quotation must be Approved before it can be converted into an Invoice. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetQuotation to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditQuotation first — an approved sales quotation can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales quotation was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the quotation to be approved (e.g. 'QOU-230118000000000') |
| id | string | optional | The Unique Identifier of the quotation to be approved |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidQuotation
WHEN TO USE Only when the user explicitly asks to cancel an existing sales quotation (ใบเสนอราคา). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditQuotation instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code (e.g. 'QOU-230118000000000') or id; one of the two is required — use GetQuotation to look it up. The sales quotation is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference: if the quotation has already been converted to an Invoice, void that Invoice first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales quotation was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
VoidQuotation
WHEN TO USE Only when the user explicitly asks to cancel an existing sales quotation (ใบเสนอราคา). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditQuotation instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code (e.g. 'QOU-230118000000000') or id; one of the two is required — use GetQuotation to look it up. The sales quotation is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference: if the quotation has already been converted to an Invoice, void that Invoice first. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the sales quotation was NOT voided: report resDesc. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the quotation to be voided (e.g. 'QOU-230118000000000') |
| id | string | optional | The Unique Identifier of the quotation to be voided |
Response
{ "resCode": "200", "resDesc": "Success" }
Receipt
6 tools
GetReceipt
WHEN TO USE Use to read ONE receipt (ใบเสร็จรับเงิน) you already have an identifier for, with its full line items — do this before calling EditReceipt, ApproveReceipt or VoidReceipt. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListReceipt instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. 'RT202608008'), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Do not fall back to a keyword search on your own; a keyword search can return a different document. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching receipt with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
GetReceipt
WHEN TO USE Use to read ONE receipt (ใบเสร็จรับเงิน) you already have an identifier for, with its full line items — do this before calling EditReceipt, ApproveReceipt or VoidReceipt. This tool addresses a document directly by id, code, or reference; to search by date range, status, or keyword use ListReceipt instead. BUSINESS RULES & PRE-CONDITIONS Supply at least one of id, code (e.g. 'RT202608008'), or reference. There is no date filter on this tool. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong, not that the document is absent from PEAK: confirm the code with the user rather than assuming a typo and guessing a correction. Do not fall back to a keyword search on your own; a keyword search can return a different document. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns the matching receipt with status (Draft/Approve/Voided), document number, netAmount, remainAmount and Document Link, including its products array. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Document code to fetch ONE specific document (e.g. 'RTZ202308008'). Recommended — it also identifies the document number |
| id | string | optional | The Unique Identifier of ONE specific document. Use when the code is unknown |
| reference | string | optional | Reference number of ONE specific document |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakReceipts": {
"receipts": [
{
"id": "guid",
"code": "RTZ202308008",
"issuedDate": "20230807",
"contactId": "5b37fe57-aa7d-49ed-ba8b-a01bf2aeee37",
"contactCode": "C02974",
"isTaxInvoice": 0,
"netAmount": 278.2,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalReceipt": 3,
"resDesc": "PeakReceipts have Completed",
"resCode": "200"
}
}
ListReceipt
WHEN TO USE Use to search receipts (ใบเสร็จรับเงิน) by date range, status, or keyword — to find a document code, review recent payments received, or list activity. This tool returns a filtered LIST; to read ONE document by exact id/code/reference use GetReceipt instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching receipts with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
0 required · 6 optional
ListReceipt
WHEN TO USE Use to search receipts (ใบเสร็จรับเงิน) by date range, status, or keyword — to find a document code, review recent payments received, or list activity. This tool returns a filtered LIST; to read ONE document by exact id/code/reference use GetReceipt instead. BUSINESS RULES & PRE-CONDITIONS All filters are optional: dateStart / dateEnd (yyyyMMdd), status, and searchText (contact name or document number). Use limit + page to paginate — each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING Zero results usually means the filter window is wrong, not that the document doesn't exist — widen the date range or drop the status filter before concluding it isn't there. Never invent a code or fabricate document contents. EXPECTED OUTCOME Returns matching receipts with status (Draft/Approve/Voided), document number, netAmount and remainAmount. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |
|---|---|---|---|
| dateStart | string | optional | Filter by document start date (Format: yyyyMMdd). |
| dateEnd | string | optional | Filter by document end date (Format: yyyyMMdd). |
| status | integer? | optional | Filter by document status (0 = None, 1 = Voided, 2 = Draft, 3 = AwaitApproval, 4 = Outstanding, 5 = Overdue, 6 = PaidOrAwaitReceipt) |
| searchText | string | optional | Search keyword - contact name, document number |
| limit | integer? | optional | Maximum number of entries. |
| page | integer? | optional | Page number (each page shows 10 entries). |
Response
{
"PeakReceipts": {
"receipts": [
{
"id": "guid",
"code": "RTZ202308008",
"issuedDate": "20230807",
"contactId": "5b37fe57-aa7d-49ed-ba8b-a01bf2aeee37",
"contactCode": "C02974",
"isTaxInvoice": 0,
"netAmount": 278.2,
"remainAmount": 0,
"documentLink": "https://...",
"resCode": "200",
"resDesc": "Success"
}
],
"totalReceipt": 3,
"resDesc": "PeakReceipts have Completed",
"resCode": "200"
}
}
CreateReceipt
WHEN TO USE Use when the input confirms money was actually received from a customer. A receipt records payment, so do not create one for a document the customer has not actually paid. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve contactId/contactCode via SearchContacts, and CreateContact if the contact is missing; (2) for line items, if the business uses product codes try ListProduct per item and use productCode on a match, falling back to accountCode per item — never send both on the same line item. paymentMethodCode and paymentAmount are effectively required: a receipt without payment data is meaningless. VAT logic: if the organization is not VAT-registered, isTaxInvoice=0; tax invoice + VAT ExcludeTax gives isTaxInvoice=1, taxStatus=0; tax invoice + VAT IncludeTax gives isTaxInvoice=1, taxStatus=1; not a tax invoice at all gives isTaxInvoice=0, taxStatus=2. Do not use taxStatus=2 (NonTax) for no-VAT items — some environments compute the total as 0. Withholding tax on a receipt has NO document-level field: send it as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item, and reduce paymentAmount to match. FALLBACK & ERROR HANDLING This creates a live accounting document — show the user a preview and get confirmation before calling. "Should be paid full amount" means withholding tax is present but paymentAmount was not reduced; recompute paymentAmount = netAmount minus the withholding tax. "Invoice net amount less than payment" means paymentAmount plus withholding tax exceeds netAmount; re-check the formula. "Bank Account not found" means the payment method code is wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use paymentMethodId. A product-related error means falling back to accountCode — confirm with the user before retrying. EXPECTED OUTCOME Creates the document in "Draft" or "Approved" status. Display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
1 required · 28 optional
CreateReceipt
WHEN TO USE Use when the input confirms money was actually received from a customer. A receipt records payment, so do not create one for a document the customer has not actually paid. BUSINESS RULES & PRE-CONDITIONS Before calling: (1) resolve contactId/contactCode via SearchContacts, and CreateContact if the contact is missing; (2) for line items, if the business uses product codes try ListProduct per item and use productCode on a match, falling back to accountCode per item — never send both on the same line item. paymentMethodCode and paymentAmount are effectively required: a receipt without payment data is meaningless. VAT logic: if the organization is not VAT-registered, isTaxInvoice=0; tax invoice + VAT ExcludeTax gives isTaxInvoice=1, taxStatus=0; tax invoice + VAT IncludeTax gives isTaxInvoice=1, taxStatus=1; not a tax invoice at all gives isTaxInvoice=0, taxStatus=2. Do not use taxStatus=2 (NonTax) for no-VAT items — some environments compute the total as 0. Withholding tax on a receipt has NO document-level field: send it as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item, and reduce paymentAmount to match. FALLBACK & ERROR HANDLING This creates a live accounting document — show the user a preview and get confirmation before calling. "Should be paid full amount" means withholding tax is present but paymentAmount was not reduced; recompute paymentAmount = netAmount minus the withholding tax. "Invoice net amount less than payment" means paymentAmount plus withholding tax exceeds netAmount; re-check the formula. "Bank Account not found" means the payment method code is wrong or points to a Cheque-type account; re-fetch via GetPaymentMethod or use paymentMethodId. A product-related error means falling back to accountCode — confirm with the user before retrying. EXPECTED OUTCOME Creates the document in "Draft" or "Approved" status. Display the Document Number, Contact Name, Document Amount, and Document Link. The response carries contactId and contactCode but not the contact name — use the name you already resolved via SearchContacts, or look it up; never print a name as if it came from this response.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | Products/services. array[InvoiceProduct] — line items. sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact (if contactId set, not required), SearchContacts if don't known | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact | ||||||||||||||||||||||||||||
| status | string | optional | Document status: 'Draft' or 'Approve'. Default 'Draft'. | ||||||||||||||||||||||||||||
| code | string | optional | Code displayed in PEAK. Auto-generated if blank | ||||||||||||||||||||||||||||
| issuedDate | string | optional | Issuance date (yyyyMMdd). | ||||||||||||||||||||||||||||
| dueDate | string | optional | Due date (yyyyMMdd). Must be after issuedDate. | ||||||||||||||||||||||||||||
| reference | string | optional | Document reference information, such as purchase order | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes, Leave blank to automatically use the default value. | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Tax status (0=ExcludeTax,1=IncludeTax,2=NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | Total discount. Same tax type only. | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Usable as tax invoice (0=No,1=Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Labels/tags attached to the document. | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax. Auto-calculated if null. | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | VAT amount. Auto-calculated if null. | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Net amount after tax/discounts. Auto-calculated if null. | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date (yyyyMMdd). Default = issuedDate | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub-account ID for recording | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub-account code for recording | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Notes for that payment | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Payment by cheque (0=No,1=Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | WithHoldingTax amount for the payment. | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency. | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency. | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code to reduce response data. |
Response
{
"PeakReceipts": {
"resCode": "200",
"resDesc": "PeakReceipts have Completed",
"receipts": [{
"id": "77dd1ceb-a0f6-44bb-ae9c-525cc8026b34",
"code": "RTZ202308020",
"issuedDate": "20230815",
"dueDate": "20230822",
"contactId": "guid",
"contactCode": "C01401",
"status": "Approve",
"isTaxInvoice": 0,
"preTaxAmount": 300,
"vatAmount": 21,
"netAmount": 321,
"whtAmount": 0,
"paymentAmount": 321,
"remainAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "410101", "description": "...", "quantity": 1, "price": 300, "vatType": 3 }],
"paidPayments": [{ "paymentDate": "20230815", "paymentTotal": 321, "payments": [{ "paymentMethodCode": "CSH260", "amount": 321 }], "journals": [{ "id": "guid", "code": "RV-..." }] }],
"journals": [{ "id": "guid", "code": "SV-..." }],
"resCode": "200",
"resDesc": "Success"
}]
}
}
EditReceipt
WHEN TO USE Call when the user wants to change an existing Draft receipt (ใบเสร็จรับเงิน) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidReceipt; to move it out of Draft use ApproveReceipt. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetReceipt to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the receipt was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
4 required · 27 optional
EditReceipt
WHEN TO USE Call when the user wants to change an existing Draft receipt (ใบเสร็จรับเงิน) — amounts, line items, dates, contact, or payment details. To cancel the document instead use VoidReceipt; to move it out of Draft use ApproveReceipt. BUSINESS RULES & PRE-CONDITIONS This REPLACES the document contents — send the COMPLETE document, never a delta; any product line missing from the products array is permanently deleted. Before calling: (1) call GetReceipt to read the current document; (2) send every field back with your changes applied, including all existing product lines and any payment already recorded; (3) identify the target with code (recommended — it also preserves the document number) or id. Do not rely on omitted fields being preserved by PEAK. Only editable (Draft) documents are accepted; PEAK rejects the edit otherwise. This document type has no document-level withholding-tax field — send withholding tax only as paidPaymentsWithHoldingTaxAmount (payment) and withHoldingTaxAmount on each affected line item. FALLBACK & ERROR HANDLING This overwrites a live document — show the user what will change, before and after, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. The PEAK response is returned as-is, so check resCode yourself: anything other than 200 means the receipt was NOT edited. If PEAK rejects the edit because the document is no longer a Draft, do not retry — tell the user it must be voided and reissued instead. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| products | array[InvoiceProduct] | required | The COMPLETE array of products or services for the document. Any existing line omitted here is permanently deleted — copy the full list from GetReceipt and modify it. array[InvoiceProduct] — sub-fields: id, productId, productCode, description, accountCode, accountSubId, accountSubCode, quantity, price, discount, vatType, isDescription?, withHoldingTaxAmountarray[InvoiceProduct] fields
|
||||||||||||||||||||||||||||
| issuedDate | string | required | Document issuance date (yyyyMMdd). REQUIRED on edit: copy the existing value from GetReceipt unless you intend to change it, otherwise the document date would be overwritten | ||||||||||||||||||||||||||||
| dueDate | string | required | Document due date (yyyyMMdd), which must be after the document issuance date. REQUIRED on edit: copy the existing value from GetReceipt | ||||||||||||||||||||||||||||
| status | string | required | Status of the document (Draft, Approve, Voided, etc). REQUIRED on edit: copy the existing value from GetReceipt so the edit does not change the document state | ||||||||||||||||||||||||||||
| code | string | optional | The code of the receipt to be edited. Recommended over id: it also preserves the document number | ||||||||||||||||||||||||||||
| id | string | optional | The Unique Identifier of the receipt to be edited. Use only when the code is unknown | ||||||||||||||||||||||||||||
| newCode | string | optional | New document number to write into the edited document. Leave blank to keep the existing document number. | ||||||||||||||||||||||||||||
| contactId | string | optional | Unique Identifier of the contact associated with the document | ||||||||||||||||||||||||||||
| contactCode | string | optional | Code of the contact associated with the document (If contactId has been assigned a value, contactCode is not required) | ||||||||||||||||||||||||||||
| reference | string | optional | Reference information of the document | ||||||||||||||||||||||||||||
| remark | string | optional | Additional remarks or notes | ||||||||||||||||||||||||||||
| taxStatus | integer? | optional | Specify the tax status of the document to indicate whether the price includes tax or the tax is separate (0 = ExcludeTax, 1 = IncludeTax, 2 = NonTax) | ||||||||||||||||||||||||||||
| discountTotal | string | optional | The total discount should not exceed the net total of the document or be greater than 100%. Additionally, it can only be applied when the tax type of each item is the same | ||||||||||||||||||||||||||||
| isTaxInvoice | integer? | optional | Whether the document can be used as a tax invoice (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| tags | array[String] | optional | Label attached to someone or something for the purpose of identification or to give other information | ||||||||||||||||||||||||||||
| preTaxAmount | number? | optional | Amount before tax is applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| vatAmount | number? | optional | Tax collected from the increased value of products or services (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| netAmount | number? | optional | Total value of the document after tax and discounts have been applied (If value is null, PEAK will calculate it automatically) | ||||||||||||||||||||||||||||
| currencyId | integer? | optional | Currency ID for foreign currency transactions | ||||||||||||||||||||||||||||
| exchangeRate | number? | optional | Exchange rate for foreign currency transactions | ||||||||||||||||||||||||||||
| paymentMethodCode | string | optional | Code of the payment method (e.g. 'CSH001') (if paymentMethodId set, not required) GetPaymentMethod if don't known. Include the existing payment details when editing a document that already has a payment recorded. | ||||||||||||||||||||||||||||
| paymentMethodId | string | optional | The Unique Identifier of the payment method | ||||||||||||||||||||||||||||
| paymentAmount | number? | optional | Payment amount. = netAmount − withHoldingTaxAmount when WHT present. | ||||||||||||||||||||||||||||
| paymentDate | string | optional | Payment date in the format yyyyMMdd | ||||||||||||||||||||||||||||
| paymentAccountCode | string | optional | Payment account code. | ||||||||||||||||||||||||||||
| paymentAccountSubId | string | optional | Sub account Unique Identifier to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentAccountSubCode | string | optional | Sub account code to be used for recording financial transactions | ||||||||||||||||||||||||||||
| paymentNote | string | optional | Additional remarks or notes for that specific payment received | ||||||||||||||||||||||||||||
| isCheque | integer? | optional | Whether this payment is made by Cheque (0 = No, 1 = Yes) | ||||||||||||||||||||||||||||
| paidPaymentsWithHoldingTaxAmount | string | optional | Withholding tax amount for the payment | ||||||||||||||||||||||||||||
| getResult | integer? | optional | Numeric code used to reduce the amount of response data received |
Response
{
"PeakReceipts": {
"resCode": "200",
"resDesc": "Completed",
"totalReceipt": 1,
"receipts": [{
"id": "guid",
"code": "RTZ202308020",
"issuedDate": "20230815",
"dueDate": "20230822",
"contactId": "guid",
"contactCode": "C01401",
"status": "Draft",
"isTaxInvoice": 0,
"preTaxAmount": 300,
"vatAmount": 21,
"netAmount": 321,
"whtAmount": 0,
"paymentAmount": 321,
"remainAmount": 0,
"remainWhtAmount": 0,
"documentLink": "https://...",
"taxStatus": 0,
"products": [{ "id": "guid", "productCode": "P001", "accountCode": "410101", "description": "...", "quantity": 1, "price": 300, "vatType": 3 }],
"paidPayments": [{ "paymentDate": "20230815", "paymentTotal": 321, "payments": [{ "paymentMethodCode": "CSH260", "amount": 321 }] }],
"journals": [],
"resCode": "200",
"resDesc": "Success"
}]
}
}
ApproveReceipt
WHEN TO USE Call when the user asks to approve or confirm a Draft receipt (ใบเสร็จรับเงิน) — the step that turns a Draft into a live accounting document. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetReceipt to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditReceipt first — an approved receipt can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the receipt was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 2 optional
ApproveReceipt
WHEN TO USE Call when the user asks to approve or confirm a Draft receipt (ใบเสร็จรับเงิน) — the step that turns a Draft into a live accounting document. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetReceipt to look it up. Only Draft documents can be approved. Approving posts the document, so make any corrections with EditReceipt first — an approved receipt can no longer be edited. FALLBACK & ERROR HANDLING This changes a live document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the receipt was NOT approved: report resDesc to the user rather than retrying with the other identifier. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the receipt to be approved |
| id | string | optional | The Unique Identifier of the receipt to be approved |
Response
{ "resCode": "200", "resDesc": "Success" }
VoidReceipt
WHEN TO USE Only when the user explicitly asks to cancel an existing receipt (ใบเสร็จรับเงิน). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditReceipt instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetReceipt to look it up. The receipt is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the receipt has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the receipt was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
0 required · 3 optional
VoidReceipt
WHEN TO USE Only when the user explicitly asks to cancel an existing receipt (ใบเสร็จรับเงิน). This cannot be undone — never void a document to tidy up or to redo it on your own initiative. If the user only wants to change the contents, use EditReceipt instead; a Draft can be edited without voiding. BUSINESS RULES & PRE-CONDITIONS Identify the document with code or id; one of the two is required — use GetReceipt to look it up. The receipt is permanently marked Voided and cannot be edited or reused afterwards. PEAK refuses to void a document that other documents reference (attached credit notes, billing notes or debit notes) — void those referencing documents first. If the receipt has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt, PEAK refuses the void unless isVoidETaxInvoice is set to 1. FALLBACK & ERROR HANDLING This permanently cancels a live accounting document — show the user the document number, contact and amount, and get explicit confirmation before calling. Nothing is changed if neither code nor id is supplied. Any resCode other than 200 means the receipt was NOT voided: report resDesc. Never set isVoidETaxInvoice to 1 as a retry — voiding a document already filed with the Revenue Department is a compliance action the user must explicitly confirm first. EXPECTED OUTCOME Returns status (Draft/Approve/Voided) and display the Document Number, Contact Name, netAmount, remainAmount and Document Link.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | The code of the receipt to be voided |
| id | string | optional | The Unique Identifier of the receipt to be voided |
| isVoidETaxInvoice | integer | optional | Set to 1 ONLY to void a document that has already been submitted to the Revenue Department as an e-Tax Invoice / e-Receipt. Default 0 refuses the void in that case, which is the safe behaviour. Voiding an already-filed e-Tax document is a compliance action and cannot be undone (0 = refuse if already sent as e-Tax, 1 = void anyway) |
Response
{ "resCode": "200", "resDesc": "Success" }
Service
3 tools
CreateService
WHEN TO USE Use to register a new service (บริการ) in the PEAK service catalog — consulting, maintenance, subscriptions, fees: anything billed but not stocked. This tool always creates a Service; for a stocked item (สินค้า) use CreateProduct instead. Call ListService first and only create an entry when the search confirms it does not already exist — ListProduct does not return services. BUSINESS RULES & PRE-CONDITIONS name is required. The purchase and sell sides are independent: purchaseValue / purchaseVatType / purchaseAccount record cost, sellValue / sellVatType / sellAccount record revenue. Set sellAccount so future invoices map to the right GL account, or leave it blank to take the PEAK default. VAT type on both sides is 1 = None, 2 = ZeroPercent, 3 = SevenPercent. FALLBACK & ERROR HANDLING This writes master data the whole organization will reuse — show the user the entry and get explicit confirmation before calling. If a price is unknown leave it blank rather than fabricating a value; the user can set it in PEAK later. Never invent an account code — resolve it with GetAccountCodes or leave it blank for the default. EXPECTED OUTCOME Returns the new service with its id and code (type 2 = Service). Use the id or code as the line-item reference when creating an Invoice, Quotation, or Purchase Order.
1 required · 15 optional
CreateService
WHEN TO USE Use to register a new service (บริการ) in the PEAK service catalog — consulting, maintenance, subscriptions, fees: anything billed but not stocked. This tool always creates a Service; for a stocked item (สินค้า) use CreateProduct instead. Call ListService first and only create an entry when the search confirms it does not already exist — ListProduct does not return services. BUSINESS RULES & PRE-CONDITIONS name is required. The purchase and sell sides are independent: purchaseValue / purchaseVatType / purchaseAccount record cost, sellValue / sellVatType / sellAccount record revenue. Set sellAccount so future invoices map to the right GL account, or leave it blank to take the PEAK default. VAT type on both sides is 1 = None, 2 = ZeroPercent, 3 = SevenPercent. FALLBACK & ERROR HANDLING This writes master data the whole organization will reuse — show the user the entry and get explicit confirmation before calling. If a price is unknown leave it blank rather than fabricating a value; the user can set it in PEAK later. Never invent an account code — resolve it with GetAccountCodes or leave it blank for the default. EXPECTED OUTCOME Returns the new service with its id and code (type 2 = Service). Use the id or code as the line-item reference when creating an Invoice, Quotation, or Purchase Order.
| Parameter | Type | Description | |
|---|---|---|---|
| name | string | required | Service name (required). |
| id | string | optional | The Unique Identifier generated by PEAK to identify data |
| code | string | optional | The code displayed in the PEAK |
| purchaseValue | number? | optional | Purchase price per unit |
| purchaseVatType | integer? | optional | Purchase tax rate (1 = None, 2 = ZeroPercent, 3 = SevenPercent) |
| purchaseAccount | string | optional | Account used to record purchase transactions |
| sellValue | number? | optional | Selling price per unit |
| sellVatType | integer? | optional | Selling tax rate (1 = None, 2 = ZeroPercent, 3 = SevenPercent) |
| sellAccount | string | optional | If revenue document, PEAK records the transaction in this account, Leave blank to automatically use the default value. |
| description | string | optional | Additional description of the service |
| carryingBalanceValue | number? | optional | Carrying balance value |
| carryingBalanceAmount | number? | optional | Carrying balance amount |
| unitId | string | optional | Unit ID |
| unitCode | string | optional | Unit code |
| unitNameTh | string | optional | Unit name in Thai |
| unitNameEn | string | optional | Unit name in English |
Response
{
"PeakServices": {
"resCode": "200",
"resDesc": "PeakServices have Completed",
"services": [{
"id": "09b31e2e-33e0-488c-89a4-a48b8b131475",
"name": "Create Service Example 1",
"code": "P00001",
"type": 2,
"purchaseValue": 10,
"purchaseVatType": 3,
"purchaseAccount": "114102",
"sellValue": 100,
"sellVatType": 3,
"sellAccount": "410101",
"description": "Design by PEAK",
"carryingBalanceValue": 20,
"carryingBalanceAmount": 15,
"remainingBalanceAmount": 20,
"resCode": "200",
"resDesc": "Success"
}]
}
}
ListService
WHEN TO USE Use to look up entries in the PEAK service catalog (บริการ) by keyword — before creating any document that includes service line items, so the correct service id and code go on the line, and before CreateService so an existing service is not duplicated. PEAK keeps services and products (สินค้า) in separate catalogs: ListProduct never returns services and this tool never returns products. To read one service you already have a code or id for, use GetService. BUSINESS RULES & PRE-CONDITIONS searchText matches the service name or related data; year filters by year (e.g. '2024'); limit and page paginate, and each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match does not mean the service must be created: confirm the spelling with the user, try ListProduct in case the item is a product, and fall back to an accountCode line item rather than creating catalog entries on your own initiative. EXPECTED OUTCOME Returns a paginated list of services (type 2) with id, name, code, sellValue, sellVatType, purchaseValue, purchaseVatType, and unit. totalService is PEAK's count of the whole catalog (products and services together), not the number of matches or of services — never report it as either.
0 required · 4 optional
ListService
WHEN TO USE Use to look up entries in the PEAK service catalog (บริการ) by keyword — before creating any document that includes service line items, so the correct service id and code go on the line, and before CreateService so an existing service is not duplicated. PEAK keeps services and products (สินค้า) in separate catalogs: ListProduct never returns services and this tool never returns products. To read one service you already have a code or id for, use GetService. BUSINESS RULES & PRE-CONDITIONS searchText matches the service name or related data; year filters by year (e.g. '2024'); limit and page paginate, and each page returns 10 entries. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match does not mean the service must be created: confirm the spelling with the user, try ListProduct in case the item is a product, and fall back to an accountCode line item rather than creating catalog entries on your own initiative. EXPECTED OUTCOME Returns a paginated list of services (type 2) with id, name, code, sellValue, sellVatType, purchaseValue, purchaseVatType, and unit. totalService is PEAK's count of the whole catalog (products and services together), not the number of matches or of services — never report it as either.
| Parameter | Type | Description | |
|---|---|---|---|
| year | string | optional | Filter by year (e.g. '2024'). |
| searchText | string | optional | Search keyword for service name or related data. |
| limit | integer? | optional | Maximum number of entries to retrieve. |
| page | integer? | optional | Page number for displaying data, where each page will show 10 entries. |
Response
{
"PeakServices": {
"resCode": "200",
"resDesc": "PeakServices have Completed",
"totalService": 2650,
"services": [{
"id": "b0d31e48-a519-49b5-9750-29e9671299d3",
"name": "Service Example 1",
"code": "P00001",
"type": 2,
"resCode": "200",
"resDesc": "Success"
}]
}
}
GetService
WHEN TO USE Use to read ONE service (บริการ) you already have a code or id for — typically to check its prices, VAT types, accounts or unit before putting it on a line item. This tool addresses a service directly; to search by keyword use ListService instead. For products (สินค้า) use GetProduct — PEAK keeps them in a separate catalog. BUSINESS RULES & PRE-CONDITIONS Supply code (recommended) or id; one of the two is required. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong or belongs to a product, not that the service must be created: confirm the code with the user or try GetProduct. Never invent a code or fabricate service details. EXPECTED OUTCOME Returns the matching service (type 2) with id, code, name, sellValue, sellVatType, sellAccount, purchaseValue, purchaseVatType, purchaseAccount and unit.
0 required · 2 optional
GetService
WHEN TO USE Use to read ONE service (บริการ) you already have a code or id for — typically to check its prices, VAT types, accounts or unit before putting it on a line item. This tool addresses a service directly; to search by keyword use ListService instead. For products (สินค้า) use GetProduct — PEAK keeps them in a separate catalog. BUSINESS RULES & PRE-CONDITIONS Supply code (recommended) or id; one of the two is required. Read-only — nothing in PEAK is changed. FALLBACK & ERROR HANDLING No match means the identifier is wrong or belongs to a product, not that the service must be created: confirm the code with the user or try GetProduct. Never invent a code or fabricate service details. EXPECTED OUTCOME Returns the matching service (type 2) with id, code, name, sellValue, sellVatType, sellAccount, purchaseValue, purchaseVatType, purchaseAccount and unit.
| Parameter | Type | Description | |
|---|---|---|---|
| code | string | optional | Service code to fetch ONE specific service, as shown in PEAK or returned by ListService. Recommended. |
| id | string | optional | The Unique Identifier of ONE specific service. Use when the code is unknown. |
Response
{
"PeakServices": {
"resCode": "200",
"resDesc": "Success",
"services": [{
"id": "guid",
"code": "P00001",
"name": "Service Name",
"type": 2,
"sellValue": 1000.00,
"sellVatType": 3,
"sellAccount": "410201",
"purchaseValue": 0,
"purchaseVatType": 3,
"purchaseAccount": "510101",
"resCode": "200",
"resDesc": "Success"
}]
}
}
Tag
2 tools
InsertTag
WHEN TO USE Call after a document exists, when the user asks to label, group, or categorise documents — by period, project, department, branch, or any custom label. If the business has structured classification groups configured, prefer CreateTransactionClassification; tags are the free-form alternative. BUSINESS RULES & PRE-CONDITIONS Requires the transactionId and transactionTypeId of an existing document, so create or fetch the document first. Tags are free text and matched literally — reuse the exact spelling the business already uses, or 'Q1-2025' and 'Q1 2025' become two different tags. One array entry per document; several documents can be tagged in a single call. FALLBACK & ERROR HANDLING This writes to live documents — always show the user which tags go on which documents and get confirmation before calling. Each entry returns its own resCode, so a partial failure is possible: report exactly which documents failed instead of treating the call as all-or-nothing. EXPECTED OUTCOME Returns one result per document with transactionTypeId and resCode. Tagging is additive — tags already on the document are preserved.
1 param
InsertTag
WHEN TO USE Call after a document exists, when the user asks to label, group, or categorise documents — by period, project, department, branch, or any custom label. If the business has structured classification groups configured, prefer CreateTransactionClassification; tags are the free-form alternative. BUSINESS RULES & PRE-CONDITIONS Requires the transactionId and transactionTypeId of an existing document, so create or fetch the document first. Tags are free text and matched literally — reuse the exact spelling the business already uses, or 'Q1-2025' and 'Q1 2025' become two different tags. One array entry per document; several documents can be tagged in a single call. FALLBACK & ERROR HANDLING This writes to live documents — always show the user which tags go on which documents and get confirmation before calling. Each entry returns its own resCode, so a partial failure is possible: report exactly which documents failed instead of treating the call as all-or-nothing. EXPECTED OUTCOME Returns one result per document with transactionTypeId and resCode. Tagging is additive — tags already on the document are preserved.
| Parameter | Type | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| peakTags | array[PeakTagItem] | required | An array of PeakTagItem objects. Each object identifies one document and the tags to insert. Example: [{"transactionId":"123","transactionTypeId":106,"tags":["expense","Q1"]}]array[PeakTagItem] fields
|
Response
{
"PeakTags": [
{
"transactionTypeId": 106,
"resCode": "200",
"resDesc": "Success"
}
]
}
RemoveTag
WHEN TO USE Only when the user explicitly asks to remove a label from specific documents. Never call it to 'tidy up' or correct tags on your own initiative. BUSINESS RULES & PRE-CONDITIONS Requires transactionId, transactionTypeId, and the exact tag strings to remove — matching is literal, so confirm the document's current tags before calling. Removing a tag changes only the labelling, never the document's accounting data. FALLBACK & ERROR HANDLING This writes to live documents — always show which tags will be removed from which documents and get confirmation first. A tag that isn't present is not an error; don't retry with spelling variants. Each entry returns its own resCode, so report partial failures per document. EXPECTED OUTCOME Returns one result per document with transactionTypeId and resCode. Only the named tags are removed; every other tag on the document remains.
1 param
RemoveTag
WHEN TO USE Only when the user explicitly asks to remove a label from specific documents. Never call it to 'tidy up' or correct tags on your own initiative. BUSINESS RULES & PRE-CONDITIONS Requires transactionId, transactionTypeId, and the exact tag strings to remove — matching is literal, so confirm the document's current tags before calling. Removing a tag changes only the labelling, never the document's accounting data. FALLBACK & ERROR HANDLING This writes to live documents — always show which tags will be removed from which documents and get confirmation first. A tag that isn't present is not an error; don't retry with spelling variants. Each entry returns its own resCode, so report partial failures per document. EXPECTED OUTCOME Returns one result per document with transactionTypeId and resCode. Only the named tags are removed; every other tag on the document remains.
| Parameter | Type | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| peakTags | array[PeakTagItem] | required | An array of PeakTagItem objects. Each object identifies one document and the tags to remove. Example: [{"transactionId":"123","transactionTypeId":106,"tags":["expense","Q1"]}]array[PeakTagItem] fields
|
Response
{
"PeakTags": [
{
"transactionTypeId": 106,
"resCode": "200",
"resDesc": "Success"
}
]
}
Enum Reference
All integer enum values used across tools
ContactEnum values for contact parameters
Contact
Enum values for contact parameters
| Parameter | Value | Name |
|---|---|---|
| type | 0 | None |
| 1 | LimitedLiabilityPartnership | |
| 2 | CompanyLimited | |
| 3 | PublicCompanyLimited | |
| 4 | Shop | |
| 5 | OrdinaryPerson | |
| 6 | BodyOfPersons | |
| 7 | Others | |
| 8 | OrdinaryPartnership | |
| 9 | Foundation | |
| 10 | Association | |
| 11 | JointVenture | |
| status | 0 | All |
| 1 | Active | |
| 2 | Inactive | |
| prefixNameType required when type=5 | 0 | None |
| 1 | Sir | |
| 2 | Mr | |
| 3 | Mrs | |
| 4 | Ms | |
| 5 | Other |
Product / ServiceEnum values for product and service parameters
Product / Service
Enum values for product and service parameters
| Parameter | Value | Name |
|---|---|---|
| type | 0 | None |
| 1 | Product | |
| 2 | Service | |
| sellVatType purchaseVatType | 1 | None |
| 2 | ZeroPercent | |
| 3 | SevenPercent |
Document (shared)Enum values shared across Invoice, Expense, Receipt, Quotation, PurchaseOrder, BillingNote, CreditNote
Document (shared)
Enum values shared across Invoice, Expense, Receipt, Quotation, PurchaseOrder, BillingNote, CreditNote
| Parameter | Value | Name |
|---|---|---|
| taxStatus | 0 | ExcludeTax |
| 1 | IncludeTax | |
| 2 | NonTax | |
| isTaxInvoice | 0 | No |
| 1 | Yes | |
| isCheque returnPaymentIsCheque | 0 | No |
| 1 | Yes | |
| status filter in Get methods | 0 | None |
| 1 | Voided | |
| 2 | Draft | |
| 3 | AwaitApproval | |
| 4 | Outstanding | |
| 5 | Overdue | |
| 6 | PaidOrAwaitReceipt |
Transaction TypetransactionType — used in CreditNote and Classification tools
Transaction Type
transactionType — used in CreditNote and Classification tools
| Parameter | Value | Name |
|---|---|---|
| transactionType | 101 | Quotation |
| 102 | Invoice | |
| 103 | Receipt | |
| 104 | Tax invoice | |
| 105 | Credit note | |
| 106 | Billing note | |
| 107 | Debit note | |
| 201 | Purchase order | |
| 202 | Expense | |
| 205 | Credit note expense | |
| 206 | Billing note expense | |
| 207 | Debit note expense |
Credit NoteEnum values specific to credit note parameters
Credit Note
Enum values specific to credit note parameters
| Parameter | Value | Name |
|---|---|---|
| reasonType | 0 | None |
| 1 | PromotionAndMarketing | |
| 2 | OfficeUse | |
| 3 | ProductionUse | |
| 4 | ServiceUse | |
| 5 | Donation | |
| 6 | DamageOrLoss | |
| 7 | Others | |
| creditNoteStyleType | 0 | General |
| 1 | ThaiPopular | |
| goodsReturn | 0 | No |
| 1 | Yes |
Payment MethodEnum values for payment method parameters
Payment Method
Enum values for payment method parameters
| Parameter | Value | Name |
|---|---|---|
| type | 0 | Others (bankName required) |
| 1 | Cash | |
| 2 | BankAccount (bankId required) | |
| 3 | CreditCard | |
| 4 | EWallet (accountCode & eWalletId required) | |
| accountType | 1 | Current |
| 2 | Savings | |
| 3 | FixedDeposit | |
| isHaveCheque | 0 | No |
| 1 | Yes |