setActiveAddress
Requires a customer (portal or buyer app) session.
Records the active address server-side for analytics + cart restoration.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SetActiveAddress($addressId: ID!) {
setActiveAddress(addressId: $addressId)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetActiveAddress($addressId: ID!) {\n setActiveAddress(addressId: $addressId)\n}",
"variables": {
"addressId": "id"
}
}
EOF
Variables:
{
"addressId": "id"
}
Response:
{
"data": {
"setActiveAddress": true
}
}
setActiveAddress(
addressId: ID!
): Boolean!
Arguments
setActiveAddress.addressId ● ID! non-null scalar
The ID of the address.
Type
Boolean scalar
The Boolean scalar type represents true or false.