addDocumentVersion mutation
addDocumentVersion 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.
Makes an uploaded file the document's next version, which becomes its current version. Call it when a document you attached changes, for example a corrected delivery note.
Permissions
Requires the permission to write the document's target, with that target in your API key's scope:
order.writefor a sales order's document.invoice.syncfor an invoice's document.
Without it, the document is NOT_FOUND on documentId.
Repeated calls
requestId works as on attachDocument. The same bytes as the current version
return applied: false and make no version.
Errors
CONFLICTwithextensions.reasonDOCUMENT_REMOVEDwhen the document was removed.- Otherwise the same refusals as
attachDocument:ORDER_STATUS,FILE_ALREADY_ATTACHED,NOT_FOUNDwith fielddocumentIdorfileId, andREQUEST_ID_REUSED. - On an invoice's document, the refusals of
attachInvoiceDocumentapply instead ofORDER_STATUS:CONFLICTwithextensions.reasonINVOICE_REMOVEDwhen the invoice was removed in its accounting system.
Good to know
- On an invoice's document, a new version brings the document's
externalIdandexternalNumberup to date with the invoice's.
An error whose path runs below this field does not mean the call failed: the version was added, so do not retry. See
Mutation.
Arguments
input:AddDocumentVersionInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.