Controlata API Documentation
Search for the articles here or browse the categories below.
Browse by topic
Find guides, tutorials, and answers organised by category.
Getting Started
Connecting, authorization, request format and reference data
Browse
Materials
Browse
Products
Methods for products and stock levels
Browse
Resources
Browse
Customers
Browse
Sales
Browse
Suppliers
Browse
Purchases
Browse
Production
Browse
Write-offs
Browse
Transfers
Browse
Audits
Browse
Categories
Browse
Storage Locations
Browse
Units of Measure
Browse
Popular articles
What other people are reading right now.
Retrieving a List of Products
Returns the products stocked at a storage location (including those with zero stock), sorted by name. Archived products are included too. v1/products/get_list.php Parameters Field Type Required Description storage_id int Yes Storage location ID limit int No Page size, from 1 to 1000 offset int No How many records to skip Without limit the whole list is returned. See Common Rules for pagination. Response An array products with the product's fields and its stock at storage location storage_id, without alternative SKUs and components: Field Type Description id int Product ID name string Name sku string SKU unit string Unit of measure, a code from Units of Measure price float Sale price per unit cost float Cost per unit batch_size float Batch size: the product quantity the components are given for notes string Notes status int Always 1: deleted products are not returned archived int 1 if the product is archived stock float Stock at storage location storage_id minimum float Minimum stock at storage location storage_id planned float Stock change from operations in the Planned status. null if there are none categories array The product's categories: objects with id and name suppliers array The product's suppliers: objects with id and name The total field holds the total number of products at the storage location. Example request { "storage_id": 3999, "limit": 100, "offset": 0 } Example response { "success": true, "products": [ { "id": 3120, "name": "Dining table", "sku": "P100", "price": 45000, "cost": 13604.25, "batch_size": 10, "notes": "", "status": 1, "archived": 0, "stock": 12, "minimum": 3, "planned": null, "unit": "pcs", "categories": [ { "id": 21, "name": "Furniture" } ], "suppliers": [ { "id": 52, "name": "Furniture Factory" } ] } ], "total": 1 } Errors Error Reason No storage_id in input storage_id is missing Storage ID not found Storage location not found or deleted Invalid limit value. Must be between 1 and 1000 Invalid limit Offset requires limit offset passed without limit
PurchasesRetrieving a Purchase
Returns a purchase's details and its lines. v1/purchases/get_entry.php Parameters Field Type Required Description purchase_id int Yes Purchase ID Response An object purchase with the purchase's fields: Field Type Description id int Purchase ID status int Status, a code from Changing the Purchase Status payment int Payment status, a code from Changing the Payment Status date_placed string Purchase order date date_received string Received date. Empty string if not set supplier_id int Supplier ID supplier_name string Supplier name materials_storage_id int Materials storage location materials_storage_name string Materials storage location name products_storage_id int Products storage location products_storage_name string Products storage location name subtotal float Sum of the lines delivery_price float Delivery cost discount float Discount total float Total: subtotal plus delivery_price minus discount amount float Total quantity if all lines share one unit, otherwise null lines int Number of lines notes string Notes And two arrays of purchase lines: materials and products. Line fields: Field Type Description id int Material or product ID sku string SKU name string Name amount float Quantity unit string Unit of measure total float Line total price float Price per unit: total divided by amount cost float Line cost position int Line number in the purchase card, from 0 notes string Comment on the line. Empty string if there is none The position numbering is shared across both arrays: it restores the line order as in the purchase card. The lines from the response can be sent to v1/purchases/edit unchanged: extra fields are ignored. Example request { "purchase_id": 29645 } Example response { "success": true, "purchase": { "id": 29645, "status": 1, "payment": 0, "date_placed": "2026-10-06", "date_received": "", "supplier_id": 45, "supplier_name": "Woodtrade Ltd", "materials_storage_id": 3998, "materials_storage_name": "Main location", "products_storage_id": 3998, "products_storage_name": "Main location", "subtotal": 30000, "delivery_price": 1500, "discount": 0, "total": 31500, "amount": null, "lines": 2, "notes": "Invoice No. 118", "materials": [ { "id": 2051, "sku": "M010", "name": "Oak board", "amount": 0.2, "cost": 27300, "unit": "cu m", "position": 0, "total": 26000, "price": 130000, "notes": "Check the thickness" }, { "id": 2052, "sku": "M011", "name": "Wood glue", "amount": 10, "cost": 4200, "unit": "kg", "position": 1, "total": 4000, "price": 400, "notes": "" } ], "products": [] } } Errors Error Reason No purchase_id in input purchase_id is missing Purchase not found or access denied Purchase not found or deleted
Getting StartedCommon Rules
Rules that work the same way across all API methods. Number precision Quantities are stored with up to 3 decimal places, amounts and prices to the cent. The API rounds incoming values the same way the Controlata interface does: 0.3333 is saved as 0.333, 10.125 as 10.13. A quantity in operation lines must stay above zero after rounding: 0.0004 is rejected. Editing edit methods change only the fields you pass. Only the record ID is required, the other fields keep their current values. - Arrays (operation lines, categories, suppliers, product components) are replaced as a whole when passed. To clear an array, pass an empty array. - If at least one of the materials and products arrays is passed, the operation lines are replaced as a whole, and the array that is not passed is treated as empty. If neither is passed, the lines stay unchanged. For example, to change only a purchase's notes, pass purchase_id and notes: the lines, dates, storage locations and supplier stay as they were. Pagination get_list methods accept optional pagination parameters. Exception: small reference lists (units of measure, categories and storage locations) are always returned in full and do not accept these parameters. Field Type Description limit int Page size, from 1 to 1000 offset int How many records to skip. Passed together with limit Without limit the whole list is returned. The response has a total field with the total number of records matching the filters. Error Reason Invalid limit value. Must be between 1 and 1000 Invalid limit Invalid offset value. Must be 0 or greater Invalid offset Offset requires limit offset passed without limit
CustomersCreating a Customer
Creates a customer. v1/customers/add.php Parameters Field Type Required Description name string Yes Name email string No Email phone string No Phone address_legal string No Legal address address_real string No Delivery address agreement string No Agreement manager_name string No Manager manager_post string No Manager's position notes string No Notes A customer can also be created together with a sale, see v1/orders/add. Example request { "name": "Furniture Yard", "email": "orders@furnitureyard.com", "phone": "+1 212 555-0123", "address_legal": "5 Forest St, New York", "address_real": "12 Warehouse Rd, New York", "agreement": "No. 15 of 10 Jan 2026", "manager_name": "Peter Johnson", "manager_post": "CEO" } Example response { "success": true, "customer_id": 512 } Errors Error Reason No name in input name is missing or null Name must not be empty Empty name Name must be a string name passed as an array or object
ResourcesEditing a Resource
Updates a resource. Only the fields you pass are changed, the rest stay as they were. v1/resources/edit.php Parameters Field Type Required Description resource_id int Yes Resource ID name string No Name type string No Calculation type: "rate", "percent" or "amortized" dynamic int No 1: the price or percentage is specified in the product components unit string No Unit of measure. Used only for a fixed rate and depreciation price float No Price per unit base string No Calculation basis: "cost" or "price" percent float No Percentage initial_cost float No Initial cost useful_life float No Useful life, in the resource's units notes string No Notes categories array No Categories: objects with id or name. Replace the current ones as a whole Which fields each type needs is described in Creating a Resource. When changing type, pass the fields the resource does not have yet: unit for a fixed rate and depreciation, base and percent for a percentage, initial_cost and useful_life for depreciation. The resource's quantity in product components is not recalculated, so check it after the change. For a resource that has already been consumed in production, the calculation type cannot be changed, and for a depreciated resource the initial cost, useful life and unit cannot either. The other fields can be changed. Example request { "resource_id": 57, "price": 650 } Example response { "success": true } Errors Error Reason No resource_id in input resource_id is missing Resource not found or access denied Resource not found or deleted Name must not be empty An empty name was passed Name must be a string Name passed not as a string, e.g. as an array Invalid type value. Must be one of: rate, percent, amortized Invalid type No unit in input Type changed to a fixed rate or depreciation, but the resource has no unit Unit not set An empty unit of measure was passed Unit not found Unknown unit of measure Unit cannot be changed to another unit group: the resource is used in components of products Changing the unit group of a resource used in product components Invalid price value. Must be a number, 0 or greater Price is not a number or below 0 (same for initial_cost) Invalid base value. Must be one of: cost, price Invalid calculation basis, or it was not passed when changing the type to percentage Percent must be greater than 0 and not exceed 100 Percentage out of range, or not passed when changing the type to percentage Useful life must be greater than 0 Useful life is 0 or less, or not passed when changing the type to depreciation The resource is already used in production, so these fields cannot be changed: type, useful_life The resource has already been consumed in production. The fields that cannot be changed are listed at the end: type, initial_cost, useful_life, unit Category 12 not found Category not found
MaterialsCreating a Material
Creates a material. The material appears at storage location storage_id and at any storage location that stores all materials or its categories. v1/materials/add.php Parameters Field Type Required Description name string Yes Name unit string Yes Unit of measure, a code from Units of Measure storage_id int Yes Storage location where the stock is created sku string No SKU price float No Price per unit. Default 0 stock float No Initial stock at storage location storage_id. Default 0 minimum float No Minimum stock at storage location storage_id. Default 0 notes string No Notes categories array No Categories: objects with id or name suppliers array No Suppliers: objects with id A category can be passed by name: if there is no such category, it is created. The IDs of existing categories and suppliers are returned by v1/categories/get_list and v1/suppliers/get_list. SKU uniqueness is not checked. Example request { "name": "Oak board", "sku": "M010", "unit": "cu m", "price": 130000, "storage_id": 3998, "stock": 2.5, "minimum": 0.5, "categories": [{ "id": 12 }, { "name": "Hardware" }], "suppliers": [{ "id": 45 }] } Example response { "success": true, "material_id": 2051 } Errors Error Reason No name in input A required field is missing (instead of name, the field's name) Name must not be empty Empty name Unit not found Unknown unit of measure, or a resources-only unit Storage ID not found Storage location not found or deleted Invalid price value. Must be a number The value is not a number, e.g. "12,5" (same for stock and minimum) Category 12 not found Category not found Supplier not found or access denied Supplier not found or deleted