confirmStockInExternalSystem mutation
confirmStockInExternalSystem is a GraphQL mutation of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Records that the external system that manages the warehouse holds these receipts, issues and
transfers up to their stockVersion, as of its own clock. Call it after you write a MAX
document into the external system, and before you send a snapshot that contains it.
syncStockLevels adds every document that the external system has not confirmed
to the snapshot's quantities, so a snapshot never undoes a document the external system did not
have yet.
Permissions
Requires the stock.sync permission.
Repeated calls
A repeat, or a delayed confirmation of an older version, changes nothing.
Errors
The call runs in one transaction: after any of these errors, nothing is confirmed.
| Code | Reason | When |
|---|---|---|
NOT_FOUND | The document does not exist or is outside your API key's scope. | |
VALIDATION | STOCK_VERSION_UNKNOWN | The document never had this stockVersion. |
VALIDATION | DOCUMENT_HAS_EXTERNAL_ISSUE | The document is an order's issue, and the order has an external issue in the warehouse (reportExternalIssue). The field is documents[i].documentId. |
VALIDATION | The document is not a receipt, an issue or a transfer, or side is sent for a document that is not a transfer. | |
VALIDATION | No external system manages the document's warehouse. |
Good to know
- An order's issue whose order has an external issue in the warehouse is never confirmed. MAX offsets it against what the external system reported.
- A transfer with only one end in your API key's scope confirms only that end.
An error whose path runs below this field does not mean the call failed: the documents were confirmed, so do not retry. See
Mutation.
Costs 1 point plus 1 per document, plus its selection.
Arguments
input:ConfirmStockInExternalSystemInput!· required
Returns
ConfirmStockInExternalSystemResult!
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.