updateSalesOrderAddresses mutation
updateSalesOrderAddresses 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 billing address, delivery address or collection point with the external source's current values. Call it when one of them changes in the external source after the order was placed, and send only what changed.
MAX takes the new address unless a user changed that address in MAX since, or the parcel is already packed or shipped. In those cases MAX keeps its own address and opens an exception on the order, with your address in the exception's data, for a user in MAX to resolve.
| Code | Blocks the order | When |
|---|---|---|
SHOP_ADDRESS_CONFLICT | When the parcel goes to that address | A user changed the address in MAX. |
SHOP_ADDRESS_CHANGED_AFTER_PACKING | When the parcel goes to that address | The parcel is packed. |
SHOP_ADDRESS_CHANGED_AFTER_SHIPPING | No | The parcel has shipped. |
The result says what happened to each address 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 an address has no street, city, postal code or country, when a field is too long, or when a collection point has no code or comes with a delivery address.FORBIDDEN_ROLE(partner.write) when a new address must be added to the customer's address book.
Good to know
- An erased customer's order keeps its addresses and returns
UNCHANGED.
An error whose path runs below this field does not mean the call failed: the addresses were processed, so do not retry. See
Mutation.
Arguments
ref:SalesOrderRefInput!· requiredinput:SalesOrderAddressesInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.