updateSalesOrderDetails mutation
updateSalesOrderDetails 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.
Updates the order's notes, contact, carrier and payment method with the external source's current values. Call it when any of them changes in the external source after the order was placed, and send only what changed.
For addresses, use updateSalesOrderAddresses.
- Notes and contact belong to the external source. MAX writes them as sent, except on cancelled and merged orders.
- Carrier (the route your delivery method maps to) and payment method: MAX writes them unless a user changed the value in MAX since, the parcel is packed (for the payment method: a label is made), money is already committed under the old payment method, or your value maps to nothing in MAX.
When MAX does not write a carrier or payment method, it keeps its own value and opens a
SHOP_CHANGE_* exception on the order, with your value in the exception's data. The
exception blocks the order, except for a warning after shipping and a refusal (REFUSED).
The result says what happened to each group you sent.
Permissions
Requires the order.write and order.read permissions.
Repeated calls
A repeat changes nothing and returns UNCHANGED.
Errors
CONFLICTwhen the order is cancelled or merged.NOT_FOUNDwhen the order does not exist or your API key cannot see it.VALIDATIONwhen a text is too long, an item note has noexternalId, or you send more than 500 item notes.
Good to know
- An erased customer's order keeps its notes and contact as they are.
An error whose path runs below this field does not mean the call failed: the changes were processed, so do not retry. See
Mutation.
Costs 1 point plus 1 per item note, plus its selection.
Arguments
ref:SalesOrderRefInput!· requiredinput:SalesOrderDetailsInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.