modifySalesOrderTags mutation
modifySalesOrderTags 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.
Adds, removes and clears several of the order's tags in one call, all or nothing. Tags and
groups are named by their codes, as tags lists them. Tags you name nowhere stay as
they are.
toAdd: every code must be a live tag in MAX, else nothing changes and the call fails. A tag of a group that holds one tag at a time replaces the order's other tag of that group.toRemove: every tag on the order with the code is taken off, an archived one too. A tag the order does not have, or a code no tag has, is skipped.clearGroups: every tag on the order in the group is taken off, also when the group is archived. Use it when the external source moves to a state with no tag in MAX.
At most 50 codes in each list.
The call is not deduplicated by an Idempotency-Key: a repeat applies the same change to the
order as it is then. A retry after a lost answer is safe; a retry after another writer moved the
order to a different tag of the same group moves it back.
Permissions
Requires the order.write and order.read permissions.
Repeated calls
A call that finds the order's tags already as requested changes nothing and returns
changed: false.
Errors
VALIDATIONwith reasonTAG_NOT_FOUNDand fieldinput.toAddwhen a code intoAddis no live tag in MAX. The message lists the codes.VALIDATIONwith reasonTAG_GROUP_NOT_FOUNDand fieldinput.clearGroupswhen a code there is no tag group in MAX.VALIDATIONwhen a code is blank, a list is longer than 50, a code is in bothtoAddandtoRemove,toAddnames two tags of one group that holds one at a time or a tag of a group inclearGroups, or a tag is not used on sales orders.NOT_FOUNDwhen the order does not exist or your API key cannot see it.
Arguments
ref:SalesOrderRefInput!· requiredinput:SalesOrderTagsInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.