Download OpenAPI specification:
Documents of Forbix Open-APIs
The OpenAPI Banking section provides comprehensive APIs for accessing and managing banking services. These endpoints allow you to retrieve account information, check balances, view transaction statements, and access deposit details. All banking operations are secured with proper authentication and authorization mechanisms to ensure data privacy and compliance with banking regulations.
By calling this API, you can receive the list of company connected accounts, including customer number, account title, and connected deposit numbers.
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- {
- "cif": "123566",
- "accountTitle": "My Test Account 1",
- "accountDepositNumbers": "[\"1234-123-567\",\"1234-123-567\"]"
}
]
}By calling this API, you can receive general information related to the entered deposit number.
| depositNumber required | string Example: 1020-10-2008748-1 Deposit Number |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- {
- "depositType": 10,
- "branchCode": "1020",
- "ibanNumber": "IR960580102001002008748001",
- "depositNumber": "1020-10-2008748-1",
- "currency": "IRR"
}
]
}By calling this API, you can receive the balance of the entered deposit number.
| depositNumber required | string Example: 1020-10-2008748-1 Deposit Number |
{- "data": {
- "balance": {
- "price": "203295123",
- "availablePrice": "203295423"
}, - "currency": "IRR"
}
}By calling this API, you can receive the list of transactions for the entered deposit number.
| depositNumber required | string Example: 1020-10-2008748-1 Deposit Number |
{- "result": {
- "date": "2024-04-24T14:31:18IRST",
- "description": "انتقال از اينترنت 03555555 بانک سرمايه به ک 6396070020002491 ش م 411514715943 ش پ 715943",
- "balance": 203295423,
- "serial": 10453740,
- "registrationNumber": 0,
- "branchCode": "1020",
- "branchName": "سينما آزادي",
- "agentBranchCode": "190",
- "agentBranchName": "کارت - تست",
- "transferAmount": -1000,
- "serialNumber": "0",
- "statementId": "10453740_1713956478000_1020_1",
- "referenceNumber": null,
- "paymentId": null
}
}The OpenAPI Accounting section offers powerful APIs for managing accounting operations including chart of accounts, vouchers, and financial transactions. These endpoints enable automated bookkeeping, financial record management, and accounting data integration. All accounting operations maintain data integrity and follow standard accounting principles.
This endpoint allows you to create a new voucher in the system
| companyId required | string |
| companyFinancialYearId required | string |
| number | number |
| description required | string |
| createDate | number |
| type | string Enum: "MANUAL" "AUTO" |
| autoOptions | object |
| deletedBy | number |
required | Array of objects (EachVoucherItemDto) |
| creatorId | string |
| isOpenningVoucher | boolean |
| voucherKind | string Enum: "DRAFT" "REGULAR" "OPENNING_BALANCE" "CLOSING_TEMPORARY_ACCOUNTS" "CLOSING_BALANCE" |
{- "companyId": "string",
- "companyFinancialYearId": "string",
- "number": 0,
- "description": "string",
- "createDate": 0,
- "type": "MANUAL",
- "autoOptions": { },
- "deletedBy": 0,
- "voucherItems": [
- {
- "generalType": "string",
- "subsidiaryType": "string",
- "detailedType": "string",
- "accountSlug": "string",
- "defaultDebitCredit": "string",
- "accountSlug2": "string",
- "accountSlug4": "string",
- "accountSlug3": "string",
- "debitAmount": 0,
- "creditAmount": 0
}
], - "creatorId": "string",
- "isOpenningVoucher": true,
- "voucherKind": "DRAFT"
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "companyId": "string",
- "companyFinancialYearId": "string",
- "number": 0,
- "description": "string",
- "createDate": 0,
- "type": "MANUAL",
- "autoOptions": { },
- "deletedBy": 0,
- "voucherItems": [
- {
- "generalType": "string",
- "subsidiaryType": "string",
- "detailedType": "string",
- "accountSlug": "string",
- "defaultDebitCredit": "string",
- "accountSlug2": "string",
- "accountSlug4": "string",
- "accountSlug3": "string",
- "debitAmount": 0,
- "creditAmount": 0
}
], - "creatorId": "string",
- "isOpenningVoucher": true,
- "voucherKind": "DRAFT"
}
}Get voucher list with optional filters including accCode for voucher items, date ranges, and advanced search capabilities
| companyFinancialYearId | string Example: companyFinancialYearId=COMPANY_FINANCIAL_YEAR_ID_HERE Company financial year ID (uses default if not provided) |
| accCode | string Example: accCode=1000005 Filter by account code in voucher items |
| page | number Example: page=0 Page number for pagination |
| pageSize | number Example: pageSize=10 Number of items per page |
| sortBy | string Example: sortBy=number Field to sort by |
| order | string Enum: "asc" "desc" Example: order=desc Sort order |
| createDateFrom | number Example: createDateFrom=1640995200000 Filter by create date from (timestamp) |
| createDateTo | number Example: createDateTo=1672531199000 Filter by create date to (timestamp) |
| description | string Example: description=فاکتور فروش Search by voucher description |
| numberFrom | number Example: numberFrom=1 Filter by voucher number from |
| numberTo | number Example: numberTo=100 Filter by voucher number to |
| voucherKind | string Example: voucherKind=REGULAR Filter by voucher kind |
| searchParamName | string Enum: "generalType" "subsidiaryType" "detailedType" "accountSlug" "accountSlug2" Example: searchParamName=generalType The field to search in voucher items (generalType, subsidiaryType, detailedType, accountSlug, accountSlug2) |
| searchParamValue | string Example: searchParamValue=1000 The value to search for in the specified field |
{- "success": true,
- "message": "SUCCESSFUL",
- "items": [
- { }
], - "totalCount": 100,
- "totalPages": 10
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "companyId": "string",
- "companyFinancialYearId": "string",
- "generalTypes": [
- {
- "slug": "string",
- "name": "string",
- "debitCredit": "string",
- "subsidiaryTypes": [
- {
- "slug": "string",
- "name": "string",
- "debitCredit": "string",
- "detailedTypes": [
- {
- "slug": "string",
- "name": "string",
- "debitCredit": "string",
- "pin": false,
- "lock": false,
- "accountSlugs": [
- {
- "slug": null,
- "name": null,
- "debitCredit": null,
- "pin": null,
- "accountType": null,
- "lock": null,
- "quickExpenseFrom": null,
- "quickIncomceTo": null,
- "_id": null
}
], - "_id": "string"
}
], - "lock": true,
- "_id": "string"
}
], - "lock": true,
- "_id": "string"
}
], - "_id": "string"
}
}The OpenAPI Items section provides APIs for managing product and service items within your inventory system. These endpoints allow you to retrieve item information, manage product catalogs, and access item details for integration with sales and inventory management systems.
Create a new item for the authenticated company.
| name required | string The name of the item |
| type required | string Enum: "PRODUCT" "SERVICE" "APPOINTMENT" The type of the item (PRODUCT, SERVICE, APPOINTMENT) |
object Barcode information for the main item. Will be overridden by variant barcode if specified for a variant. | |
| imageUrl | string URL of the main image for the item. |
| isInternalUseOnly | boolean Default: false Whether the item is for internal use only (not for sale) |
| description | string Description of the item |
| catalogDescription | string Description for catalog display(Not used currently) |
| sku | string Stock Keeping Unit |
| inventoryCount | number Current inventory count |
| unitPrice | number Unit price of the item |
| purchaseUnitPrice | number Purchase unit price of the item |
| unit | string Unit of measurement |
| taxable | object Tax information (string for backward compatibility, or number for rate) |
| itemCategory | string Item category |
| itemSubCategory | string Item subcategory |
| minimumStockAlert | string Minimum stock alert threshold |
| openingStockDate | number Opening stock date timestamp |
| discountRate | number Discount rate percentage |
| discountFlat | number Flat discount amount |
| images | Array of strings Array of image URLs |
| attachments | Array of strings Array of attachment URLs |
| hideInCatalog | boolean Whether to hide the item in catalog |
| doNotSave | boolean Default: false If true, this item might be a temporary item or not meant to be saved permanently (e.g. in drafts). |
Array of objects (AvailableVariantItemDto) Array of available variants for this item. Each variant can have its own pricing, stock, and attributes. | |
| appointmentPlans | Array of objects Appointment plans for appointment-type items. |
| govId required | string the government ID of the item, used for tax purposes |
{- "name": "Product Name",
- "type": "PRODUCT",
- "barcode": {
- "type": "EAN-13",
- "data": "9780201379624"
}, - "imageUrl": "media/image.jpg",
- "isInternalUseOnly": false,
- "description": "This is a detailed description of the product",
- "catalogDescription": "Catalog description of the product",
- "sku": "SKU123456",
- "inventoryCount": 100,
- "unitPrice": 99.99,
- "purchaseUnitPrice": 99.99,
- "unit": "piece",
- "taxable": "10",
- "itemCategory": "Electronics",
- "itemSubCategory": "Smartphones",
- "minimumStockAlert": "10",
- "openingStockDate": 1646092800000,
- "discountRate": 10,
- "discountFlat": 5,
- "hideInCatalog": false,
- "doNotSave": false,
- "availableVariants": [
- {
- "variantInfo": {
- "color": "Red",
- "size": "M"
}, - "inventoryCount": 10,
- "unitPrice": 109.99,
- "discountRate": 5,
- "discountFlat": 2.5,
- "barcode": {
- "type": "EAN-13",
- "data": "9780201379624"
}, - "purchaseUnitPrice": 80
}
], - "appointmentPlans": [
- { }
], - "govId": "1231fsdf234553426"
}{- "success": true,
- "message": "SUCCESSFUL",
- "_id": "60d21b4667d0d8992e610c85"
}Retrieve a paginated list of items for the authenticated company.
| page | number Default: 0 Page number |
| pageSize | number Default: 10 Number of items per page |
| sortBy | string Field to sort by |
| order | string Enum: "asc" "desc" Sort order |
| createDateFrom | number Filter by creation date from |
| createDateTo | number Filter by creation date to |
| barcodeData | string Filter by barcode data |
| name | string Filter by name |
| sku | string Filter by SKU |
| type | string Filter by type, it can be single or an array joined by , like: a,b,c |
| category | string Filter by category |
| unit | string Filter by unit |
| unitPrice | string Filter by unit price |
| openingStockDateFrom | number Filter by opening stock date from |
| openingStockDateTo | number Filter by opening stock date to |
| inventoryCountFrom | number Filter by inventory count from |
| inventoryCountTo | number Filter by inventory count to |
| itemCategory | string Filter by item category |
| itemSubCategory | string Filter by item sub-category |
| fromPrice | number Filter by price from |
| toPrice | number Filter by price to |
| isArchived | boolean Is the item archived |
| creatorUserId | string ID of the creator user |
| isInternalUseOnly | boolean Filter by whether the item is for internal use only (e.g., true or false). If not provided, items are not filtered by this property. |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- { }
], - "totalCount": 10,
- "totalPages": 10
}Update an existing item for the authenticated company.
| itemId required | string ID of the item to update |
| name required | string The name of the item |
| type required | string The type of the item (PRODUCT, SERVICE, APPOINTMENT) |
object Barcode information for the main item. Will be overridden by variant barcode if specified for a variant. | |
| barcodeUrl | string URL of the barcode image for the main item. Send null to delete. |
| imageUrl | string URL of the main image for the item. Send null to delete. |
| appointmentPlans | Array of objects Appointment plans for appointment-type items. |
| isInternalUseOnly | boolean Whether the item is for internal use only (not for sale) |
| description | string Description of the item |
| catalogDescription | string Description for catalog display |
| sku | string Stock Keeping Unit |
| inventoryCount | number Current inventory count |
| unitPrice | number Unit price of the item |
| purchaseUnitPrice | number Purchase unit price of the item |
| unit | string Unit of measurement |
| taxable | object Tax information (string for backward compatibility, or number for rate) |
| itemCategory | string Item category |
| itemSubCategory | string Item subcategory |
| minimumStockAlert | string Minimum stock alert threshold |
| openingStockDate | number Opening stock date timestamp |
| discountRate | number Discount rate percentage |
| discountFlat | number Flat discount amount |
| images | Array of strings Array of image URLs |
| attachments | Array of strings Array of attachment URLs |
| hideInCatalog | boolean Whether to hide the item in catalog |
| isArchived | boolean Whether the item is archived |
Array of objects (AvailableVariantItemDto) Array of available variants for this item. Each variant can have its own pricing, stock, and attributes. | |
| doNotSave | boolean Default: false If true, the item will not be saved to the database. Useful for validation or testing purposes. |
{- "name": "Product Name",
- "type": "PRODUCT",
- "barcode": {
- "type": "EAN-13",
- "data": "9780201379624"
}, - "barcodeUrl": "media/barcode.png",
- "imageUrl": "media/image.jpg",
- "appointmentPlans": [
- { }
], - "isInternalUseOnly": false,
- "description": "This is a detailed description of the product",
- "catalogDescription": "Catalog description of the product",
- "sku": "SKU123456",
- "inventoryCount": 100,
- "unitPrice": 99.99,
- "purchaseUnitPrice": 99.99,
- "unit": "piece",
- "taxable": "10",
- "itemCategory": "Electronics",
- "itemSubCategory": "Smartphones",
- "minimumStockAlert": "10",
- "openingStockDate": 1646092800000,
- "discountRate": 10,
- "discountFlat": 5,
- "hideInCatalog": false,
- "isArchived": false,
- "availableVariants": [
- {
- "variantInfo": {
- "color": "Red",
- "size": "M"
}, - "inventoryCount": 10,
- "unitPrice": 109.99,
- "discountRate": 5,
- "discountFlat": 2.5,
- "barcode": {
- "type": "EAN-13",
- "data": "9780201379624"
}, - "purchaseUnitPrice": 80
}
], - "doNotSave": false
}{- "success": true,
- "message": "SUCCESSFUL",
- "_id": "60d21b4667d0d8992e610c85"
}The OpenAPI Customers section offers comprehensive customer relationship management APIs. These endpoints enable you to create, retrieve, update customer information, manage customer data, and integrate customer records with your CRM systems. All customer operations ensure data privacy and security compliance.
Create a new customer for the authenticated company.
| type required | string Enum: "BUSINESS" "INDIVIDUAL" |
| customerDisplayName required | string |
| companyName | string |
string | |
| phone | string |
| mobile | string |
| salutation | string Enum: "MR" "MRS" |
| nationalId | string |
| economicId | string |
Array of objects (ContactPersonDto) | |
| avatarUrl | string URL of the customer avatar |
Array of objects (Field) | |
object (Address) | |
object (Address) | |
| crmGroupId required | Array of strings CRM group IDs |
| isEmployee | boolean Default: false Whether the customer is an employee |
| employeeTitle | string Employee title/position |
{- "type": "BUSINESS",
- "customerDisplayName": "John Doe",
- "companyName": "Johns Company",
- "email": "john.doe@example.com",
- "phone": "1234567890",
- "mobile": "1234567890",
- "salutation": "MR",
- "nationalId": "1234567890",
- "economicId": "1234567890",
- "contacts": [
- {
- "firstName": "John",
- "salutation": "Mr.",
- "lastName": "Doe",
- "workPhone": "+1234567890",
- "mobile": "+1234567890",
- "designation": "Sales Manager",
- "department": "Sales",
- "email": "john.doe@example.com"
}
], - "avatarUrl": "string",
- "customFields": [
- {
- "fieldId": "1234567890",
- "name": "John Doe",
- "type": "TEXT",
- "value": "John Doe"
}
], - "billingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "shippingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "crmGroupId": [
- "string"
], - "isEmployee": false,
- "employeeTitle": "string"
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "RANDOM_MONGO_ID"
}
}Retrieve a paginated list of customers for the authenticated company.
| page | number Default: 0 Page number |
| pageSize | number Default: 10 Number of items per page |
| sortBy | string Field to sort by |
| order | string Enum: "asc" "desc" Sort order |
| createDateFrom | number Filter by creation date from |
| createDateTo | number Filter by creation date to |
| fullName | string Full name filter |
string Email filter | |
| phone | string Phone filter |
| mobile | string Mobile filter |
| type | string Type filter |
| balanceFinancialYearId | string balanceFinancialYearId |
| customerCategory | string Customer category filter |
| crmGroupId required | string CRM group IDs filter |
| isEmployee | boolean Filter by employee status |
| isUser | boolean Filter by whether isUser field exists |
| accCode | string Filter by account code |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- {
- "_id": "string",
- "type": "BUSINESS",
- "companyId": "string",
- "salutation": "MR",
- "firstName": "string",
- "lastName": "string",
- "companyName": "string",
- "customerDisplayName": "string",
- "email": "string",
- "phone": "string",
- "mobile": "string",
- "nationalId": "string",
- "economicId": "string",
- "billingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "shippingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "contactPerson": {
- "salutation": "string",
- "firstName": "string",
- "lastName": "string",
- "workPhone": "string",
- "mobile": "string",
- "designation": "string",
- "department": "string",
- "email": "string"
}, - "contacts": [
- {
- "salutation": "string",
- "firstName": "string",
- "lastName": "string",
- "workPhone": "string",
- "mobile": "string",
- "designation": "string",
- "department": "string",
- "email": "string"
}
], - "creatorUserId": "string",
- "createDate": 0,
- "deleted": true,
- "deletedAt": 0,
- "deletedById": "string",
- "comments": [
- {
- "description": "string",
- "creatorId": "string",
- "id": "string",
- "createDate": 0
}
], - "customerCategory": "CUSTOMER",
- "crmGroupId": [
- "string"
], - "customFields": [
- { }
], - "rfiUpdatable": true,
- "accCode": 0,
- "avatarUrl": "string",
- "isEmployee": true,
- "employeeTitle": "string",
- "isUser": "SUBMITTED"
}
], - "totalCount": 10,
- "totalPages": 10
}Retrieve a specific customer by its ID for the authenticated company.
| customerId required | string ID of the customer to retrieve |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "string",
- "type": "BUSINESS",
- "companyId": "string",
- "salutation": "MR",
- "firstName": "string",
- "lastName": "string",
- "companyName": "string",
- "customerDisplayName": "string",
- "email": "string",
- "phone": "string",
- "mobile": "string",
- "nationalId": "string",
- "economicId": "string",
- "billingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "shippingAddress": {
- "street1": "string",
- "street2": "string",
- "city": "string",
- "countryRegion": "string",
- "state": "string",
- "zipCode": "string",
- "phone": "string"
}, - "contactPerson": {
- "salutation": "string",
- "firstName": "string",
- "lastName": "string",
- "workPhone": "string",
- "mobile": "string",
- "designation": "string",
- "department": "string",
- "email": "string"
}, - "contacts": [
- {
- "salutation": "string",
- "firstName": "string",
- "lastName": "string",
- "workPhone": "string",
- "mobile": "string",
- "designation": "string",
- "department": "string",
- "email": "string"
}
], - "creatorUserId": "string",
- "createDate": 0,
- "deleted": true,
- "deletedAt": 0,
- "deletedById": "string",
- "comments": [
- {
- "description": "string",
- "creatorId": "string",
- "id": "string",
- "createDate": 0
}
], - "customerCategory": "CUSTOMER",
- "crmGroupId": [
- "string"
], - "customFields": [
- { }
], - "rfiUpdatable": true,
- "accCode": 0,
- "avatarUrl": "string",
- "isEmployee": true,
- "employeeTitle": "string",
- "isUser": "SUBMITTED"
}
}Update an existing customer for the authenticated company.
| customerId required | string ID of the customer to update |
| type | string Enum: "BUSINESS" "INDIVIDUAL" |
| customerDisplayName | string |
| companyName | string |
string | |
| phone | string |
| mobile | string |
| salutation | string Enum: "MR" "MRS" |
| nationalId | string |
| economicId | string |
Array of objects (ContactPersonDto) | |
| avatarUrl | string URL of the customer avatar |
Array of objects (Field) | |
| isEmployee | boolean Default: false Whether the customer is an employee |
| employeeTitle | string Employee title/position |
{- "type": "BUSINESS",
- "customerDisplayName": "John Doe",
- "companyName": "Johns Company",
- "email": "john.doe@example.com",
- "phone": "1234567890",
- "mobile": "1234567890",
- "salutation": "MR",
- "nationalId": "1234567890",
- "economicId": "1234567890",
- "contacts": [
- {
- "firstName": "John",
- "salutation": "Mr.",
- "lastName": "Doe",
- "workPhone": "+1234567890",
- "mobile": "+1234567890",
- "designation": "Sales Manager",
- "department": "Sales",
- "email": "john.doe@example.com"
}
], - "avatarUrl": "string",
- "customFields": [
- {
- "fieldId": "1234567890",
- "name": "John Doe",
- "type": "TEXT",
- "value": "John Doe"
}
], - "isEmployee": false,
- "employeeTitle": "string"
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "RANDOM_MONGO_ID"
}
}The OpenAPI Invoices section provides robust APIs for sales invoice management and processing. These endpoints allow you to create, retrieve, update invoices, manage billing processes, and integrate invoice data with accounting and payment systems. Supports both regular and zero-amount invoices for flexible business operations.
Create a new invoice for the authenticated company. Supports zero-amount invoices.
| customerId required | string Id of customer |
| shippingAmount required | number shipping |
| termsAndConditions required | string terms and conditions |
| gatewayIds required | Array of strings |
required | Array of objects (InvoiceItemDto) |
| createDate | number Create date |
| dueDate | number Due date |
| sentDate | number shipping |
| attachments | Array of strings |
| notes | string notes |
| invoiceNumber | string custom invoice number |
| paymentDescription | string payment description |
| referenceNumber | string reference number |
| discountFlat | number discount flat |
| discountRate | number discount flat |
| wasEstimate | boolean |
{- "customerId": "5f4e3f3b8f8b9a001f3b3b3b",
- "shippingAmount": 1000,
- "termsAndConditions": "string",
- "gatewayIds": [
- "EMPTY"
], - "items": [
- {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b",
- "quantity": 1,
- "vatId": "5f4e3f3b8f8b9a001f3b3b3b",
- "variantId": "5f4e3f3b8f8b9a001f3b3b3b",
- "unitPrice": 1,
- "discountRate": 1,
- "discountFlat": 1,
- "comment": "some comment"
}
], - "createDate": 1598947200000,
- "dueDate": 1598947200000,
- "sentDate": "0",
- "attachments": [
- "string"
], - "notes": "this is a note",
- "invoiceNumber": "INV-1234",
- "paymentDescription": "this is a payment description",
- "referenceNumber": "12231",
- "discountFlat": 0,
- "discountRate": 0,
- "wasEstimate": true
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b"
}
}Retrieve a paginated list of invoices for the authenticated company.
| estimateNumber | string Estimate number for search |
| invoiceNumber | string Invoice number for search |
| referenceNumber | string Reference number for search |
| creatorUserId | string ID of the creator user |
| customerId | string ID of the customer |
| state | string Enum: "UNPAID" "PAID" "PARTIAL_PAYMENT" "OVERDUE" State of the invoice |
| deliveryStatus | string Enum: "NOT_DELIVERED" "PARTIALLY_DELIVERED" "FULLY_DELIVERED" Filter by delivery status |
| debitOrCredit | string Enum: "debit" "credit" debit or credit |
| totalEstimatePrice | number Total estimate price |
| totalInvoicePrice | number Total invoice price |
| totalInvoicePriceFrom | number Total invoice price from |
| totalInvoicePriceTo | number Total invoice price to |
| discountFlat | number Flat discount amount |
| discountRate | number Discount rate |
| sentDateFrom | number Sent date from |
| sentDateTo | number Sent date to |
| dueDateFrom | number Due date from |
| dueDateTo | number Due date to |
| createDateFrom | number create date from |
| createDateTo | number create date to |
| isArchived | boolean Is the invoice archived |
| hasReturns | boolean the invoices has returns from sale |
| hasOfficialTaxInfo | boolean the invoices has officialTaxInfo |
| page | number Default: 0 page number |
| pageSize | number Default: 10 page size |
| sortBy | string sort key |
| order | string Enum: "asc" "desc" sort order |
| search | string search based on customer name or invoice number |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- {
- "_id": "string",
- "companyId": "string",
- "customerId": "string",
- "state": "string",
- "deliveryStatus": "NOT_DELIVERED",
- "totalInvoicePrice": 0,
- "invoiceNumber": "string",
- "createDate": 0
}
], - "totalCount": 10,
- "totalPages": 10
}Retrieve a specific invoice by its ID for the authenticated company.
| invoiceId required | string ID of the invoice to retrieve |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "60d21b4667d0d8992e610c87",
- "type": "INVOICE",
- "invoiceNumber": "INV-2023-0001",
- "generatedNumber": "INV-2023-0001",
- "number": 42,
- "companyInfo": { },
- "customerInfo": { },
- "referenceNumber": "REF-2023-001",
- "creator": {
- "_id": "60d21b4667d0d8992e610c85",
- "fullname": "John Doe",
- "email": "john.doe@example.com",
- "role": "admin"
}, - "returnsCount": 0,
- "attachmentUrl": "media/invoices/60d21b4667d0d8992e610c87/invoice.pdf",
- "attachments": [
- "media/invoices/60d21b4667d0d8992e610c87/attachment1.pdf",
- "media/invoices/60d21b4667d0d8992e610c87/attachment2.docx"
], - "items": [
- {
- "_id": "60d21b4667d0d8992e610c86",
- "name": "Web Development Service",
- "price": 100.5,
- "quantity": 2,
- "vatPercent": 20,
- "imageUrl": "media/items/60d21b4667d0d8992e610c86/main-image.jpg"
}
], - "sentDate": "2023-01-15T00:00:00.000Z",
- "dueDate": "2023-02-15T00:00:00.000Z",
- "subTotal": 201,
- "tax": "20%",
- "debitOrCredit": "debit",
- "discounts": "10%",
- "discountFlat": 20,
- "discountRate": 10,
- "shippingAmount": 15.5,
- "payments": 250,
- "paymentDescription": "Paid via bank transfer",
- "amountDue": 0,
- "gatewayIds": [
- "gateway123",
- "gateway456"
], - "termsAndConditions": "Payment due within 30 days...",
- "notes": "Thank you for your business",
- "totalPrice": 201,
- "totalVat": 40.2,
- "state": "sent",
- "deleted": false,
- "wasEstimate": false,
- "customerClubEmail": "customer@example.com",
- "customerClubAppointmentId": "appt123",
- "customerClubAppointmentDay": 1622505600000,
- "customerClubAppointmentFromTime": "09:00",
- "customerClubAppointmentToTime": "10:00",
- "customerClubAppointmentPrice": 50,
- "createDate": 1623505600000,
- "deletedAt": 1623505600000,
- "deletedById": "60d21b4667d0d8992e610c85",
- "isArchived": false,
- "voucherId": "60d21b4667d0d8992e610c90",
- "deliveryNotes": [
- "string"
], - "totalInvoicePrice": 241.2
}
}Update an existing invoice for the authenticated company.
| invoiceId required | string ID of the invoice to update |
| _id required | string Id of invoice |
| companyId required | string Id of company |
| customerId | string Id of customer |
| shippingAmount | number shipping |
| termsAndConditions | string terms and conditions |
| gatewayIds | Array of strings if array is empty, it will delete all gateways |
Array of objects (InvoiceItemDto) | |
| dueDate | number Due date |
| sentDate | number shipping |
| createDate | number Create date |
| attachments | Array of strings if attachments array is empty, it will delete all attachments |
| notes | string notes |
| invoiceNumber | string custom invoice number |
| paymentDescription | string payment description |
| referenceNumber | string reference number |
| discountFlat | number discount flat |
| discountRate | number discount flat |
| isArchived | boolean is archived |
{- "_id": "5f4e3f3b8f8b9a001f3b3b3b",
- "companyId": "5f4e3f3b8f8b9a001f3b3b3b",
- "customerId": "5f4e3f3b8f8b9a001f3b3b3b",
- "shippingAmount": 1000,
- "termsAndConditions": "string",
- "gatewayIds": [
- "EMPTY"
], - "items": [
- {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b",
- "quantity": 1,
- "vatId": "5f4e3f3b8f8b9a001f3b3b3b",
- "variantId": "5f4e3f3b8f8b9a001f3b3b3b",
- "unitPrice": 1,
- "discountRate": 1,
- "discountFlat": 1,
- "comment": "some comment"
}
], - "dueDate": 1598947200000,
- "sentDate": "0",
- "createDate": 1598947200000,
- "attachments": [
- "string"
], - "notes": "this is a note",
- "invoiceNumber": "INV-1234",
- "paymentDescription": "this is a payment description",
- "referenceNumber": "12231",
- "discountFlat": 0,
- "discountRate": 0,
- "isArchived": true
}{- "success": true,
- "message": "SUCCESSFUL",
- "data": {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b"
}
}The OpenAPI Invoice Purchase section offers APIs for managing purchase invoices and supplier billing. These endpoints enable you to create, retrieve, and update purchase invoices, manage supplier transactions, and integrate purchase data with accounting and procurement systems. Supports comprehensive purchase invoice lifecycle management.
Create a new purchase invoice for the authenticated company. Supports zero-amount invoices.
| invoiceNumber | string custom invoice number |
| supplierId required | string Supplier/Vendor ID |
| dueDate | number Due date |
| sentDate | number shipping |
| createDate | number Create date |
required | Array of objects (PurchaseInvoiceItemDto) |
| attachments | Array of strings |
| discountFlat | number Flat discount amount |
| discountRate | number Discount rate percentage |
| referenceNumber | string reference number |
| shippingAmount required | number shipping |
| termsAndConditions required | string terms and conditions |
| notes | string notes |
{- "invoiceNumber": "INV-1234",
- "supplierId": "5f4e3f3b8f8b9a001f3b3b3b",
- "dueDate": 1598947200000,
- "sentDate": "0",
- "createDate": 1598947200000,
- "items": [
- {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b",
- "purchaseQuantity": 1,
- "vatId": "5f4e3f3b8f8b9a001f3b3b3b",
- "variantId": "5f4e3f3b8f8b9a001f3b3b3b",
- "purchaseUnitPrice": 100000,
- "purchaseDiscountRate": 0,
- "purchaseDiscountFlat": 0,
- "comment": "some comment"
}
], - "attachments": [
- "string"
], - "discountFlat": 0,
- "discountRate": 0,
- "referenceNumber": "12231",
- "shippingAmount": 1000,
- "termsAndConditions": "string",
- "notes": "this is a note"
}{- "success": true,
- "message": "SUCCESSFUL",
- "_id": "60d21b4667d0d8992e610c85"
}Retrieve a paginated list of purchase invoices for the authenticated company.
| invoiceNumber | string Invoice number for search |
| creatorUserId | string ID of the creator user |
| customerId | string ID of the customer |
| state | string state of invoice purchase |
| debitOrCredit | string Enum: "debit" "credit" debit or credit |
| totalInvoicePrice | number Total invoice price |
| discountFlat | number Flat discount amount |
| discountRate | number Discount rate |
| sentDateFrom | number Sent date from |
| sentDateTo | number Sent date to |
| dueDateFrom | number Due date from |
| dueDateTo | number Due date to |
| createDateFrom | number create date from |
| createDateTo | number create date to |
| isArchived | boolean Is the invoice archived |
| page | number Default: 0 page number |
| pageSize | number Default: 10 page size |
| sortBy | string sort key |
| order | string Enum: "asc" "desc" sort order |
| search | string search based on customer name or invoice number |
{- "success": true,
- "message": "SUCCESSFUL",
- "data": [
- { }
], - "totalCount": 10,
- "totalPages": 10
}Update an existing purchase invoice for the authenticated company.
| invoiceId required | string ID of the purchase invoice to update |
| invoiceId required | string ID of the invoice to update |
| supplierId required | string Supplier/Vendor ID |
| dueDate | number Due date |
| sentDate | number shipping |
| createDate | number Create date |
required | Array of objects (PurchaseInvoiceItemDto) |
| attachments | Array of strings |
| discountFlat | number Flat discount amount |
| discountRate | number Discount rate percentage |
| referenceNumber | string reference number |
| shippingAmount required | number shipping |
| termsAndConditions required | string terms and conditions |
| notes | string notes |
| isArchived | boolean is archived |
{- "invoiceId": "5f4e3f3b8f8b9a001f3b3b3b",
- "supplierId": "5f4e3f3b8f8b9a001f3b3b3b",
- "dueDate": 1598947200000,
- "sentDate": "0",
- "createDate": 1598947200000,
- "items": [
- {
- "_id": "5f4e3f3b8f8b9a001f3b3b3b",
- "purchaseQuantity": 1,
- "vatId": "5f4e3f3b8f8b9a001f3b3b3b",
- "variantId": "5f4e3f3b8f8b9a001f3b3b3b",
- "purchaseUnitPrice": 100000,
- "purchaseDiscountRate": 0,
- "purchaseDiscountFlat": 0,
- "comment": "some comment"
}
], - "attachments": [
- "string"
], - "discountFlat": 0,
- "discountRate": 0,
- "referenceNumber": "12231",
- "shippingAmount": 1000,
- "termsAndConditions": "string",
- "notes": "this is a note",
- "isArchived": true
}{- "success": true,
- "message": "SUCCESSFUL"
}