Interface
Versionsβ
Curerrent unified version:
| Version | Date | Changes |
|---|---|---|
| 01-06-2025 | Initial Release |
Fieldsβ
| Field | Type | Description |
|---|---|---|
| invoice_from | string | The name of the company that issues the invoice |
| invoice_type | string | The type of invoice (sales or purchase) |
| invoice_client_name | string | The name of the client |
| invoice_client_company | string | The company name of the client |
| invoice_client_billing_auto | boolean | Whether the client is billed automatically or not |
| invoice_client_billing_period | string | The billing period of the client |
| invoice_reference | string | The reference of the invoice |
| invoice_date | string | The date of the invoice |
| invoice_items | ccsInvoiceItems[] | The items of the invoice |
| invoice_due_date | string | The due date of the invoice |
| ccsInvoiceItems | ||
| item_description | string | The description of the item |
| item_quantity | number | The quantity of the item |
| item_price | number | The price of the item |
| item_period | string | The period of the item |
| item_tax_rate | string | The tax rate of the item |
| item_ledger_account | string | The ledger account of the item |
Functionsβ
| Function | Description |
|---|---|
| createSalesInvoice | Creates a sales invoice |
| getPurchaseInvoiceDocument | Gets the purchase invoice document |
| createPurchaseInvoice | Creates a purchase invoice |
| updatePurchaseInvoice | Updates a purchase invoice |
| mapSalesInvoiceData | Maps the sales invoice data |
| mapPurchaseInvoiceData | Maps the purchase invoice data |
All functions require the following parameters:
payload: The payload of the invoice, this can be ccsSalesInvoice or ccsPurchaseInvoiceauth_fields: The authentication fields, this can be admin_id and token
All functions return the following:
response: The response of the function which contains status and data an example can be seen below
If the function is successful, it returns the following:
{
"status": "success",
"data": {
// data
}
}
If the function fails, it returns the following:
{
"status": "error",
"error": "error message"
}
TS interfaceβ
export interface ccsSalesInvoice {
invoice_from: string,
invoice_type: string,
invoice_client_name: string,
invoice_client_company: string,
invoice_client_billing_auto: boolean,
invoice_client_billing_period: string,
invoice_reference: string,
invoice_date: string,
invoice_items: ccsInvoiceItems[]
}
export interface ccsPurchaseInvoice {
invoice_from: string,
invoice_type: string,
invoice_reference: string,
invoice_date: string,
invoice_due_date: string,
invoice_items: ccsInvoiceItems[]
}
export interface ccsInvoiceItems {
item_description: string,
item_quantity: number,
item_price: number,
item_period?: string
item_tax_rate: string
item_ledger_account: string
}