Skip to main content

setBranchFlag

Requires a customer (portal or buyer app) session.

flag/un-flag an existing same-partner address as a branch (CUSTOMER_ADMIN only). Flagging requires a unique label (BRANCH_LABEL_REQUIRED / BRANCH_LABEL_CONFLICT); un-flagging runs the in-use guard and nulls the order limit.

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:

mutation SetBranchFlag($addressId: ID!, $isBranch: Boolean!) {
setBranchFlag(addressId: $addressId, isBranch: $isBranch) {
id
approverCount
isActive
isBranch
label
memberCount
approvers {
firstName
lastName
email
role
userId
}
}
}

Variables:

{
"addressId": "id",
"isBranch": true
}

Response:

{
"data": {
"setBranchFlag": {
"id": "id",
"approverCount": 0,
"isActive": true,
"isBranch": true,
"label": "string",
"memberCount": 0,
"approvers": [
{
"firstName": "string",
"lastName": "string",
"email": "string",
"role": "string",
"userId": "id"
}
]
}
}
}
setBranchFlag(
addressId: ID!
isBranch: Boolean!
): CustomerBranch!

Arguments​

setBranchFlag.addressId ● ID! non-null scalar​

The ID of the address.

setBranchFlag.isBranch ● Boolean! non-null scalar​

True to mark the address as a branch, false to unmark it.

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).