API guide
The Sancho API exposes over HTTP the same data you see in the app: products, warehouses, counterparties, employees, warehouse documents, invoices, purchase orders, storage locations, quality controls, assets and tags. The data comes from the ERP systems connected to your account, so one client works the same way with Comarch Optima, ERPNext and Fakturownia.
The API reads all of this data. It writes goods received notes (PZ and PW), goods issued notes (WZ and RW), transfers (MM), products, warehouses, counterparties, accounts in Optima’s chart of accounts, fixed assets and equipment in Optima, and how goods are spread over storage locations. It updates and deletes tags but does not create them. It does not write invoices, purchase orders, quality controls or the storage location tree yet.
Every method, its parameters and its response are described in the reference. The reference is generated from the OpenAPI file, and its method descriptions are in English. You can download the file from https://sancho-wms.pl/openapi/v1.json, for example to generate a client. Error codes are described on the Errors and limits page.
Address and request format
Section titled “Address and request format”The base URL is https://api.sancho-wms.pl/v1. On a self-hosted server it is https://<your-host>/v1, where the host is the value of DEPLOY_HOSTNAME.
Every method is POST /v1/<resource>.<action>, for example POST /v1/products.list. The request body is JSON with the method’s parameters, and the header is Content-Type: application/json. A method without parameters, such as integrations.list, can be called with no body and no Content-Type header, or with the body {}. An empty body with a JSON header fails with 400, and any other content type fails with 415.
The request body can be at most 64 KiB.
Send values in the types the reference gives: numbers as JSON numbers, flags as true or false, dates as text. The API does not promise to accept a number written as text.
curl https://api.sancho-wms.pl/v1/warehouses.list \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{}'The API sends no CORS headers. The key is a secret, so call the API from a server, not from a browser.
Keys and scopes
Section titled “Keys and scopes”You create a key in the app under Account > API keys. When creating it you choose:
- the key’s scopes, for example
product:readorgoodsReceivedNote:read; - the integrations the key can access. The list is required, a key does not cover the whole account;
- an optional expiry date.
The full key is shown only once, right after it is created. You send it in the Authorization: Bearer sk_live_... header. We do not accept the key in the URL.
Keys are created by an administrator, who can grant any scope from the list except the administration:* group. A key sees prices if it has the scope for the method.
Methods require the scopes in the table below. integrations.list needs none beyond a valid key, and tags.get accepts any of those listed. A missing scope returns 403 with the scope’s name.
| Methods | Scope |
|---|---|
integrations.list |
a valid key only |
warehouses.list, warehouses.get |
warehouse:read |
warehouses.create |
warehouse:create |
warehouses.update, warehouses.makeVirtual, warehouses.makeReal |
warehouse:update |
warehouses.delete |
warehouse:delete |
products.list, products.get |
product:read |
products.create |
product:create |
products.update |
product:update or product:annotate |
products.listPlacements |
warehouse:read |
products.assignPlacements, products.pickPlacements |
warehouse:update |
counterParties.list, counterParties.get |
counterParty:read |
counterParties.create |
counterParty:create |
counterParties.update |
counterParty:update |
counterParties.delete |
counterParty:delete |
employees.list |
employee:read |
goodsReceivedNotes.list, goodsReceivedNotes.get |
goodsReceivedNote:read |
goodsReceivedNotes.create |
goodsReceivedNote:create |
goodsReceivedNotes.update |
goodsReceivedNote:update or goodsReceivedNote:annotate |
goodsReceivedNotes.delete, goodsReceivedNotes.cancel |
goodsReceivedNote:delete |
goodsIssuedNotes.list, goodsIssuedNotes.get |
goodsIssuedNote:read |
goodsIssuedNotes.create |
goodsIssuedNote:create |
goodsIssuedNotes.update |
goodsIssuedNote:update or goodsIssuedNote:annotate |
goodsIssuedNotes.delete, goodsIssuedNotes.cancel |
goodsIssuedNote:delete |
goodsTransferNotes.list, goodsTransferNotes.get |
goodsTransferNote:read |
goodsTransferNotes.create |
goodsTransferNote:create |
goodsTransferNotes.update |
goodsTransferNote:update or goodsTransferNote:annotate |
goodsTransferNotes.delete, goodsTransferNotes.cancel |
goodsTransferNote:delete |
invoices.list, invoices.get |
invoice:read |
purchaseOrders.list, purchaseOrders.get |
purchaseOrder:read |
storageLocations.list, storageLocations.get |
warehouse:read |
qualityControls.list, qualityControls.get |
qualityControl:read |
assets.list, assets.get |
asset:read |
assets.create |
asset:create |
assets.update |
asset:update or asset:annotate |
assets.dispose, assets.delete |
asset:delete |
tags.get |
tag:read, the scope to change goods received, goods issued or transfer notes, asset:update, asset:annotate, product:update or product:annotate |
tags.list |
tag:read |
tags.update |
tag:update |
tags.delete |
tag:delete |
accounting.profile, fiscalYears.list, ledgerAccounts.list, ledgerAccounts.get, journals.list, vatRegisters.list, cashAccounts.list, paymentMethods.list, accountingCategories.list |
accounting:read |
ledgerAccounts.create, ledgerAccounts.ensureSubledgerAccount |
ledgerAccount:create |
ledgerSettlementItems.list |
accounting:read |
cashFlowItems.list, cashFlowItems.changes, settlements.list |
accounting:read or cash:read |
cashStatements.list, cashTransactions.list, cashTransactions.get, cashTransactions.changes |
cash:read |
cashTransactions.create, settlements.create |
cash:create |
cashTransactions.delete, settlements.delete |
cash:delete |
accountingDocuments.list, accountingDocuments.get, accountingDocuments.changes |
accountingDocument:read |
accountingDocuments.create |
accountingDocument:create |
accountingDocuments.update |
accountingDocument:update |
accountingDocuments.post |
accountingDocument:post |
accountingDocuments.delete |
accountingDocument:delete |
When you grant a key a write, the key page also stores the read of the same area; the server drops a write sent without its read.
The key’s integrations
Section titled “The key’s integrations”A key sees data only from its own integrations.
- A list called without an integration filter searches all of the key’s integrations.
- A filter that names several integrations, some outside the key, is narrowed to the key’s integrations without notice.
- A filter only on integrations outside the key returns 404, and so does fetching a document from such an integration.
- The list of related documents in a document’s details is complete and may point to a document in an integration outside the key. Fetching such a document returns 404.
- A quality control is visible to the key when every integration it refers to is on the key’s list.
- A tag is visible when its integration is on the key’s list. Otherwise
tags.getreturnsnull, as for a code that does not exist, andtags.updateandtags.deletereturn 404. Moving a tag to another integration needs both integrations on the key’s list.
integrations.list returns the key’s integrations. You take the integrationId needed by the other methods from it.
API add-on
Section titled “API add-on”Access through keys is a paid add-on. It costs PLN 400 net per month for the whole organization, regardless of the number of keys and requests. Without the add-on, every request with a key gets a 402 response. The exception is a self-hosted server, where the add-on is not needed. The MCP server is a separate add-on, which the API add-on does not include.
You enable every add-on on the Account > Billing page, below the payment method: this one with the Enable API button. You disable it in the same place, with the Disable API button and a confirmation. The add-on then leaves the subscription, and the keys stay saved and work again once the API is enabled again. A person with permission to change the account’s administration settings can enable and disable the add-on. While the add-on is off, the Account > API keys page reminds you of it.
- Enabling requires a payment card saved under Payment method on the same page. Without a card the app asks for one.
- Adding a card ends the trial period and starts the paid Sancho subscription. So enabling the API during the trial ends the trial.
- If the payment for the add-on does not go through right away, the API starts working once it is confirmed.
Sancho checks an account’s access at most once a minute, so enabling and disabling the add-on takes effect with a delay of up to a minute. Requests rejected with 402 do not count toward the request limit.
Most *.list methods return a page:
{ "items": [], "nextCursor": "eyJ...", "failedIntegrationIds": []}itemsare the page’s elements. Each carriesintegrationIdandid, and documents alsokind, which is what you need for the*.getmethod. The exceptions are quality controls, which have anidbut nointegrationId, and tags, whichtags.getlooks up bycode.nextCursoris in the response when there are more pages. Pass it in the next request ascursor, with the same filters and sorting. A missing field means the last page. The value is opaque, so do not build it yourself.failedIntegrationIdslists the integrations that did not respond. The list is then incomplete, but the request still ends with 200. An empty array means all of them responded. Check this field on every page, because an empty list of items looks the same as having no data.
The quality control and tag lists have no failedIntegrationIds field, because quality controls and tags are Sancho data, not ERP data.
Two methods do not return a page but a plain array, without items, nextCursor, failedIntegrationIds or limit:
integrations.listreturns all of the key’s integrations;storageLocations.listreturns the locations of one warehouse and requires thewarehouseIdandintegrationIdfields.
limit defaults to 100. The maximum allowed is 100, and 2000 for products and warehouses. If a list searches several integrations, each adds its own portion, so a page can have more elements than limit. We do not give the total number of elements or pages. Read until nextCursor disappears.
counterParties.list and employees.list take a single integration in the top-level integrationId field, not in the filters, and have no sorting or limit.
Search
Section titled “Search”The q field searches text in the list. The result is one page of the best matches, at most 200, without nextCursor. A search has no further pages, so narrow the query if there are too many results.
Filters and sorting
Section titled “Filters and sorting”Filters have the same shape as in the app. The filters field is an object in which a field name points to a value (equality) or to operators:
{ "filters": { "documentDate": { "$gte": "2026-10-01" }, "status": "committed", "warehouseId": { "$in": [1, 2] } }, "sort": { "field": "documentDate", "dir": "desc" }, "limit": 50}The comparison operators are $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin and $exists. Conditions on several fields must all hold at once; $and, $or, $nor and $not are not supported. The fields you can filter and sort by are described for each method in the reference.
For text there is also $regex, but it is not a regular expression. It looks for the given text in the value, ignoring case. A leading ^ matches the start of the value and a trailing $ its end, e.g. { "code": { "$regex": "^DENNICA" } }. Put a backslash before any other regular-expression character (., *, +, ?, (, ), [, ], {, }, |, \, and ^ or $ in the middle of the text), or the API answers with a 400 error. In a JSON body the backslash is written twice, e.g. { "$regex": "1\\.5" }. $options is accepted but changes nothing.
Dates in filters have the precision of the given ERP. Optima and Fakturownia give a day (2026-10-01). ERPNext gives an instant for warehouse documents and invoices.
You can sort by one field: { "field": "...", "dir": "asc" | "desc" }. Read further pages with the same sorting and filters you received the cursor with.
Documents and details
Section titled “Documents and details”A *.get method takes the integrationId and id from a list element. The details of goods received (goodsReceivedNotes.get), goods issued (goodsIssuedNotes.get) and invoices (invoices.get) also need the kind field:
- goods received and goods issued:
externalorinternal; - invoices:
purchaseorsales.
The details of transfers and purchase orders have no kind field. For a document that does not exist, or whose integration the key does not cover, the API responds with 404.
Accounting
Section titled “Accounting”Accounting dictionaries and the chart of accounts, accounting documents, cash and bank, and change tracking are described on a separate page: Accounting. The rules that apply only to Comarch Optima are there in the Comarch Optima section.
Writing
Section titled “Writing”Write methods take the same data the app sends and wait until the ERP has saved the document. Methods that create, change or cancel a document, a product card, a warehouse or a tag answer { "result": …, "warnings": […] }. result is the state after the save in the shape of the get response, so you do not need to read it separately. The delete methods and products.pickPlacements answer { "success": true }.
Who writes
Section titled “Who writes”A key writes as the person who created it. Their name shows in the history of the document or product, and in Optima the document gets their operator if the integration settings assign one. The account’s audit log shows the key’s name next to the entry. If that person leaves the account or their account is deleted, every write with the key gets 403. Create a new key then.
Whole replacement and version
Section titled “Whole replacement and version”The update methods replace the whole document or the whole product card, so you send every field, not only the changed ones. Start from the get response, change what you need in it, and send everything back.
- A document saved in Sancho before keeps its last save in
customFields:goodsReceivedSnapshot,goodsIssuedSnapshotorgoodsTransferSnapshot. Itsvalueholds thevaluesandtagsyou can send back. tagsdecides the document’s tags. A tag you leave out is detached, and an empty list detaches them all.items[].allocationsis how the goods are spread over storage locations. Emptyallocationsundo a line’s put-away.- Documents require
expectedSavedAtandexpectedModifiedAt. Fill them withsnapshotSavedAtandmodifiedAtfrom thegetresponse. A product has onlyexpectedSavedAt. If someone changed the data after your read, the API responds with 409 and saves nothing. You also get 409 when someone is saving the same document at that moment. Read it again and retry. - A committed document in Optima and ERPNext can no longer change in the ERP.
updatethen saves only storage locations, links and tags, and leaves the other fields as the ERP has them. It reports no error, so compare the response with what you sent.
Every { "result": …, "warnings": […] } response has the warnings field. For create and update of notes, products and assets it lists what Sancho keeps beside the ERP data and could not save: storage locations, document links, tags, images. For a cash transaction and a settlement it concerns the ledger settlements in the ERP’s books (see Cash and bank). The ERP data is saved in that case, and the warning says what is missing. For the cancel methods, assets.dispose, warehouses, tags.update, accounting documents, counterparties and ledger accounts, warnings is always empty for now. products.assignPlacements answers the list of storage locations holding the goods, with no warnings.
Accounting writes (accounting documents, cash and bank), a counterparty and an asset in Optima take an optional importSource, an import mark Optima keeps on the document or card. The Accounting page describes it.
Goods received notes
Section titled “Goods received notes”Through the API you create, update, delete and cancel an external (PZ) or internal (PW) goods received note. The typical case is a purchasing system that creates a draft PZ. The warehouse then counts the goods in Sancho, puts them away into storage locations and commits the document.
curl https://api.sancho-wms.pl/v1/goodsReceivedNotes.create \ -H "Authorization: Bearer sk_live_..." \ -H "Content-Type: application/json" \ -d '{ "integrationId": 13, "status": "draft", "tags": [], "values": { "kind": "external", "documentSymbol": "PZ", "supplier": { "id": 41, "name": "Dostawca Sp. z o.o." }, "warehouse": { "id": 1, "name": "Magazyn główny" }, "purchaseCategory": null, "operator": null, "issueDate": "2026-10-27", "receiptDate": "2026-10-27", "inflowDate": "2026-10-27", "externalNumber": "FV/58812/2026", "currency": "PLN", "deliveryCost": 0, "items": [{ "productId": 501, "productCode": "SRUBA-M8", "productName": "Śruba M8", "quantity": 100, "unit": "szt", "priceNet": 0.35, "priceNetBeforeTransport": 0.35, "vatRate": 23 }] } }'The values field has the same shape as the goods received form in the app. The reference describes every field. The main rules:
status: "draft"creates a draft, and"committed"commits the document straight away. Fakturownia has no drafts, so a note there is always committed.- From
supplier,warehouseandpurchaseCategorySancho takes only theid. Get the ids fromcounterParties.listandwarehouses.list.operatorcan benull. documentSymbolis the symbol of the document definition in the ERP. It defaults toPZ, so for a PW (kind: "internal") send the symbol of your PW definition. The API does not list the definitions yet.- Optima and Fakturownia take dates as a day (
2026-10-27), ERPNext as an instant (2026-10-27T08:00:00.000Z). - Each ERP recognizes a line’s product by its
productId. Optima and Fakturownia read it as a number (Fakturownia also requirespriceNet), and ERPNext reads it as text. Sancho skips a line the ERP does not recognize without an error, so compareresult.itemsin the response with what you sent. - In Optima, a document in a currency other than PLN needs
exchangeRate. Without it the API responds with 400. tagsare the QR and NFC tags attached to the lines. Send[]when creating.
The response is { "result": …, "warnings": […] }. result has the same shape as the goodsReceivedNotes.get response.
goodsReceivedNotes.delete deletes a draft. In Fakturownia, which has no drafts, it deletes a committed note. goodsReceivedNotes.cancel cancels a committed note in Optima and ERPNext. Fakturownia has no cancellation. Both methods take integrationId, id and kind.
Goods issued notes and transfers
Section titled “Goods issued notes and transfers”Goods issued notes (goodsIssuedNotes.*, WZ and RW) and transfers (goodsTransferNotes.*, MM) have the same methods as goods received notes: create, update, delete and cancel. create, update and cancel answer { "result": …, "warnings": […] }, and delete answers { "success": true }. Their values have the shape of the app’s goods issued and transfer forms, described in the reference.
- On a goods issued note,
subjectis the recipient: a counterparty (kind: "counterparty") or an employee (kind: "employee"). Sancho takes itskindandid. - A goods issued note requires
documentSymbol. Send the symbol of the WZ or RW definition in your ERP. A transfer defaults toMM. - A transfer requires
sourceWarehouseanddestinationWarehouse. Without them the API responds with 400. - A committed goods issued note takes the goods off the storage locations named in
items[].allocations. A transfer takes them off the source locations and puts them on the destination ones. deleteandcancelof a goods issued note takeintegrationId,idandkind. A transfer has nokind.
A key cannot confirm receipt of a goods issued note. The person the document names confirms it.
Products
Section titled “Products”products.create creates a product card in the ERP, and products.update changes it. The values field is the whole card in the shape of the app’s product form, described in the reference. Some fields apply to one ERP only, for example url in Optima and purchasePriceGross in Fakturownia.
updaterequiresexpectedSavedAtequal tosnapshotSavedAtfromproducts.get.imagesare paths of images already in Sancho. A key cannot upload images, so on update send back the list fromproducts.get.- The response is
{ "result": …, "warnings": […] }, whereresulthas the shape of theproducts.getresponse.
Warehouses
Section titled “Warehouses”warehouses.create and warehouses.update take a data field in your ERP’s variant, recognized by integrationType. They respond with { "result": …, "warnings": [] }, where result is the warehouse in the shape of the warehouses.get response. warehouses.delete deletes the warehouse in the ERP. Its storage locations and the goods spread over them are then left without a warehouse, so empty them first.
warehouses.makeVirtual takes warehouseId and sourceWarehouseId. A virtual warehouse has no storage locations of its own and uses those of the source warehouse. warehouses.makeReal undoes this. Both respond with the warehouse after the change, as warehouses.update does, or with 409 if the warehouse has goods spread over storage locations.
Counterparties
Section titled “Counterparties”counterParties.create creates a counterparty card, and counterParties.update changes it. The data field is the whole card in your ERP’s variant, recognized by integrationType. Both methods answer { "result": …, "warnings": [] }, where result is the card in the shape of the counterParties.get response and warnings is always empty for now.
importSource(Optima only, optional) is your application and the card’s key in it, as in accounting writes. Optima stores them on the card as its import mark and keeps each key once. In ERPNext and Fakturownia sendnull.- The ERP decides conflicts. Optima refuses a code another card already has. Sancho does not compare tax ids (NIP), so if a NIP must not land on a second card, search for it first in
counterParties.listwithfilters.taxIdand$eq. The filter compares the NIP exactly with what the card’staxIdfield returns, so send it in the same form the cards keep it. updaterequiresexpectedModifiedAtequal tomodifiedAtfromcounterParties.getor from theresultof thecreateresponse. If an accountant changed the card in Optima after your read, the API answers 409documentConflictand saves nothing. ERPNext and Fakturownia give nomodifiedAt, so you sendnull.updatedoes not change the card’simportSource.
counterParties.delete deletes the card in Optima. It takes integrationId, id and expectedModifiedAt equal to modifiedAt from your read. If the card changed after your read, the API answers 409 and deletes nothing.
Optima decides whether the card goes, the same way as the Delete button on its counterparty list. Sancho checks nothing first. Whether the card is active, or whether the API created it, makes no difference. Optima refuses a card that a document, VAT record, payment, journal entry, product card or another Optima table still names. The API then answers 422 with the reason inUse. subject holds the code of the Optima rule, for example OPT32226 when another table names the card, or OPT32334 for the default counterparty card. Optima does not pass on the table’s name. When a database foreign key stops the delete rather than an Optima rule, the answer is 422 with no reason, with data.cause.type relayedFailure. A card you no longer want to use but Optima will not delete can be marked inactive with update (active: false). The page Optima accounting in the API lists Optima’s rules.
ERPNext and Fakturownia do not delete counterparties through the API. Their integrations lack the scope, so counterParties.delete answers 403.
Assets
Section titled “Assets”Assets are fixed assets (kind: "fixedAsset"), equipment (equipment) and tools (tool). Fixed assets and equipment come from Comarch Optima, tools from the tool room in the DMS system. You address an asset by integrationId, kind and id, because each register numbers its cards apart.
The API writes ERP cards in Optima only. It creates, changes, liquidates or sells, and deletes fixed assets and equipment. A tool’s card belongs to the DMS system, so for a tool the API changes only the tags and photos Sancho keeps.
Writing a card, disposing of it and deleting it need two grants. The key needs the scope from the table in Keys and scopes. The Optima integration needs the same scope among its own scopes: asset:create, asset:update or asset:delete. An integration that only reads assets answers these writes with 403 Integration does not grant this scope until an administrator adds the scope in the integration’s settings. assets.update takes a key with asset:update or asset:annotate and always saves the tags and photos. It writes the card, the holder and place of use included, only for a key with asset:update; without it data is ignored. The integration needs asset:update for every save, a change to tags or photos alone included, on a tool as well.
Sancho checks no module when a fixed-asset card is written, and the customer’s Optima licence covers what the connector writes.
The page Optima accounting in the API shows which card field goes to which Optima column.
Creating and changing
Section titled “Creating and changing”assets.create creates a card in Optima. data is the whole card in the comarch-optima variant, and kind inside data picks the register: fixedAsset or equipment. tags and images work as in update. An integration other than Comarch Optima answers 403, or 400 if it holds asset:create.
importSource(optional) is your application and the card’s key in it, as in accounting writes. Optima stores them on the card as its import mark, andassets.getreturns them asimportSource. Each register keeps arowIdonce: a key Optima already holds on another card of that register gives 422duplicateDocument.- The API retries nothing. After a dropped connection or a 500, check in
assets.listby the inventory number whether the card was created before you sendcreateagain. A write that does not start within a minute gets 503 and is not written. updatedoes not change the card’simportSource.- The response is
{ "result": …, "warnings": […] }, whereresulthas the shape of theassets.getresponse.
assets.update saves the asset’s whole image: the card in data, the tags in tags and the photos in images. It also takes integrationId, kind and id.
- Build
datafrom theassets.getresponse and change what you need. The fixed-asset fields underfixedAssetsit beside the other fields in the write.holder.idbecomesholder.employeeId, andplaceOfUsewithplaceOfUseSincebecomesplaceOfUse: { "name": …, "since": … }. A tool’sdatais{ "integrationType": "gascontrol-dms" }. - The API sends the card to Optima only when
datadiffers from the card as read. A save that changes only the tags or photos does not touch Optima. Optima writes a card it gets as sent. expectedModifiedAtismodifiedAtfromassets.get(nullfor a tool), andexpectedSavedAtissnapshotSavedAt. If the card changed after your read, or someone saved the asset in Sancho (tags, photos), the API answers 409 and saves nothing.tagsis the asset’s whole tag list:code,type,identifierandnote. A tag you leave out is taken off the asset and retired. A tag that is also on a document line cannot be taken off here (400). A tag from elsewhere moves to this asset and loses its other links.imagesis the whole photo list, the first one the main photo. Each photo is a/api/images/Npath read fromassets.getor anhttps://address. A key cannot upload photos, and it cannot open/api/images/Npaths, because they need an app session. It can only send them back unchanged.status,liquidationDateand the liquidation reason are not part of the image. Onlydisposechanges them.- You set the category with
categoryId. Thecategorytext in the read is for display only. taxDepreciation: nullmeans one depreciation plan serves the balance sheet and tax. A separate tax plan goes intaxDepreciation, with its value and start date.- The person responsible (
holder) and the place of use (placeOfUse) have periods. A newsincecloses the current period the day before and opens a new one. The samesince, ornull, corrects the current period. A first period withoutsincestarts today, as a new row on the card does in Optima.holder: nullorplaceOfUse: nulldeletes the current period, as deleting the row on the card does in Optima. - The API checks no other rule of the card. When Optima refuses the write, the answer is 422. Sancho does not recognize the reason, so
data.causehas the typerelayedFailure, andmessageis always the same. - A
warningsentry with stageassetExtrasmeans the card in Optima is saved, but the tags and photos are not. Sendupdateagain, withmodifiedAtandsnapshotSavedAtfromresult.
The request body can be at most 64 KiB. That holds about 400 tags or about 30 long photo addresses per write.
Disposal and deletion
Section titled “Disposal and deletion”assets.dispose takes a fixed asset or a piece of equipment out of use. It takes integrationId, kind, id, expectedModifiedAt, status (liquidated or sold), date and reason (up to 50 characters). It needs the asset:delete scope, like a delete.
expectedModifiedAtismodifiedAtfromassets.get. If the card changed after your read, the API answers 409 and saves nothing.deleteworks the same way.- For a fixed asset Optima creates a liquidation document (LT), unposted. The accountant posts it.
- Only Optima can reverse a disposal. The API cannot.
- When Optima refuses the disposal, the answer is 422 with
data.cause.typerelayedFailure. - The response is
{ "result": …, "warnings": [] }, whereresulthas the shape of theassets.getresponse.
assets.delete deletes the card from Optima. It takes integrationId, kind, id and expectedModifiedAt and answers { "success": true }.
- Optima does not delete a card something still refers to. The answer is then 422
inUse, andsubjectholds the code of the Optima rule:OPTand its number. Liquidate or sell such an asset withdisposeinstead. - When a database foreign key stops the delete rather than an Optima rule, the answer is 422 with no reason, with
data.cause.typerelayedFailure. - After the card is deleted, Sancho retires the asset’s tags and drops its photo list. A tag that is also on a document line stays on that line and loses only its link to the asset. If this cleanup fails, the response does not say so.
Goods on storage locations
Section titled “Goods on storage locations”products.assignPlacements puts goods on storage locations, and products.pickPlacements takes them off. Both take integrationId, the warehouseId of the document’s warehouse, and a list of items with storageLocationId, product, productBatchId and a positive quantity.
- Quantities are increments. Retrying the request adds or removes the goods a second time.
pickPlacementsreports no error when the location holds none of the goods. It takes off as much as there is.- Committed goods received, goods issued and transfer notes put away and take off goods by
items[].allocationsthemselves. A draft does not, except in Fakturownia, which has no drafts. Use these methods for movements no document describes.
tags.update replaces a tag’s whole writable state, like a document’s update. Read the tag with tags.get or tags.list, change what you need and send every field back. The response is { "result": …, "warnings": [] }, where result is the tag after the write in the shape of the tags.get response.
- An update can move the tag to another product, document line, batch, asset or integration.
- You address an asset (a fixed asset, equipment or a tool) with
assetKindandassetId, always together.assetKeymust benull. assetName, likeproductNameanddocumentName, is a display name you supply. Sancho stores it as sent and does not check it against the ERP. When you change the asset, send its name too.- An empty string (
"") clearsidentifierandnote. - Sancho sets
code,type, the author and the dates. - A tag on a document must name
documentType,documentKindanddocumentLineIndex. Without them the API returns 400.
tags.delete takes an id and retires the tag. tags.get and tags.list still return it, with deletedAt set. tags.update on a retired tag restores it with the new state, for example when an NFC tag goes on another product. Send null for the links you are leaving: otherwise the tag comes back with its old document line and asset. Deleting a retired tag again returns 404.
tags.list includes retired tags (with deletedAt set). Skip them unless you mean to restore one: tags.update on such a tag restores it.
Read limitations
Section titled “Read limitations”Responses are the same as the ones the app gets. When we change the app, API responses can change with the release. We do not add a separate compatibility layer, so after an update check in the reference that the fields you use still exist. The reference and the OpenAPI file always describe the current version.
Fakturownia
Section titled “Fakturownia”- Product and counterparty lists show changes with a delay. A single write reaches the list after several dozen minutes, and a batch of about 2000 products after about an hour and a half. Stock levels refresh after about two hours. Documents and warehouses have no delay.
- On the product list, Fakturownia gives only the total quantity (
totalQuantity). The per-warehouse breakdown (stock) is empty. The breakdown is in the product details.lastStockChangeAtis alwaysnull. - Fakturownia applies most filters after fetching the page. A page can be shorter than
limitafter filtering, or even empty, whilenextCursorstill points to further pages. Read to the end.
Comarch Optima
Section titled “Comarch Optima”Optima skips some filters and sorts instead of reporting an error:
- sorting by
statuson the goods received, transfer and purchase order lists; - sorting by
activeon the product and warehouse lists; - the
statusfilter on the counterparty list.
Filtering goods received by supplier.name fails on the Optima side. The integration then lands in failedIntegrationIds, and the response has code 200.
Filter values
Section titled “Filter values”The values of the status and kind filters are not checked. A typo does not cause an error, it returns a result without that filter. If a list looks unfiltered, check the spelling.
Request limit
Section titled “Request limit”An account can send 100 requests per second. All of the account’s keys count together, and the limit covers every /v1 method and the MCP server /v1/mcp. When exceeded, the API responds with 429 and a Retry-After header. Responses carry the RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers.
Every read and write reaches your ERP through a connector that also serves the work in the warehouse. The limit protects that work from an excess of API requests. When reading all the data, fetch pages one after another, without parallel requests.
Sandbox
Section titled “Sandbox”We do not publish a test key. For trying things out, create your own key with access to a test integration only and a short expiry. Give it write scopes only when you test writing, and only on the test integration, because every write lands in a real ERP. The API add-on is required for tests as well.