setBranchActive
Requires a customer (portal or buyer app) session.
activate/deactivate a branch (CUSTOMER_ADMIN only). The response carries pendingApprovalCount for the deactivation warning (EDGE #4).
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 SetBranchActive($addressId: ID!, $isActive: Boolean!) {
setBranchActive(addressId: $addressId, isActive: $isActive) {
id
approverCount
isActive
isBranch
label
memberCount
approvers {
firstName
lastName
email
role
userId
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SetBranchActive($addressId: ID!, $isActive: Boolean!) {\n setBranchActive(addressId: $addressId, isActive: $isActive) {\n id\n approverCount\n isActive\n isBranch\n label\n memberCount\n approvers {\n firstName\n lastName\n email\n role\n userId\n }\n }\n}",
"variables": {
"addressId": "id",
"isActive": true
}
}
EOF
Variables:
{
"addressId": "id",
"isActive": true
}
Response:
{
"data": {
"setBranchActive": {
"id": "id",
"approverCount": 0,
"isActive": true,
"isBranch": true,
"label": "string",
"memberCount": 0,
"approvers": [
{
"firstName": "string",
"lastName": "string",
"email": "string",
"role": "string",
"userId": "id"
}
]
}
}
}
setBranchActive(
addressId: ID!
isActive: Boolean!
): CustomerBranch!
Arguments
setBranchActive.addressId ● ID! non-null scalar
The ID of the address.
setBranchActive.isActive ● Boolean! non-null scalar
Whether the record is active.
Type
CustomerBranch object
a partner sales branch — an Address with isBranch = true. The label is the branch name; pendingApprovalCount feeds the deactivation warning (EDGE #4).