businessUnit
Get a specific business unit by ID
Arguments
| Argument | Type | Description |
|---|---|---|
id | ID! |
Returns
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier for the business unit |
name | String! | Name of the business unit |
cocNumber | String | Chamber-of-commerce registration of the company. Null where the project does not record one. |
vatNumber | String | VAT registration of the company. Null where the project does not record one. |
vatNumbers | [String!]! | Every VAT registration of the company, vatNumber among them: one per member state it is registered in. A delivery to a member state the company is registered in, other than the seller's, is reverse-charged. Empty where the project records none. |
eoriNumber | String | The company's EORI number, which customs need to clear its exports. Null where the project does not record one. |
credit | BusinessUnitCredit | What the company may buy on account and how much of that it has used. Null where the project records no credit limit for the company. |
oneOffShippingAddressesAllowed | Boolean! | Whether a checkout may ship to an address outside the company's address book, typed in for one order. True unless a company administrator turned one-off addresses off; a cart is then shipped to one of the book's addresses only, and any other is refused. |
paymentTerms | BusinessUnitPaymentTerms | When the company pays for what it buys on account, for a checkout to state beside the price. Null where the project records no payment terms for the company. |
stores | [Store!] | Stores assigned to the business unit |
address | Address | Address of the business unitArguments: id |
billingAddress | Address | Billing address of the business unit |
defaultShippingAddress | Address | The address the unit ships to unless told otherwise. Null where nobody has chosen one. Never simply the first entry of a book that holds several: with dozens of addresses in no meaningful order, that is a guess a checkout would present as the company's decision. |
addresses | AddressResult! | Addresses of the business unit. A search term narrows the book by name,
company, street, postal code, city or region; every word must appear,
in any order.Arguments: page, pageSize, searchTerm |
associate | BusinessUnitAssociate | An associate of the business unitArguments: id |
currentAssociate | BusinessUnitAssociate | The associate the signed-in caller is within this business unit. Null when the caller is not an associate of the unit. Answering this by reading the associate list is unreliable as well as slow: that collection is paginated and cannot be filtered to the caller, so beyond the first page the caller finds no capabilities and every gated control disappears without an error. |
associates | BusinessUnitAssociateResult! | Associates of the business unit. A search term narrows the list by
email address, given name or family name; every word must appear, in
any order.Arguments: page, pageSize, searchTerm |
availableRoles | [BusinessUnitRole!]! | Available roles that can be assigned to customers in this business unit |
pendingInvitations | BusinessUnitInvitationResult! | Invitations whose invitee has not yet set up their account, the most
recent first. An invitation to someone who already had an account is
accepted at once and is never pending. Empty where the engine adds
associates without an invitation step.Arguments: page, pageSize |
shoppingList | ShoppingList | A shopping list of the business unitArguments: id |
shoppingLists | ShoppingListResult | Shopping lists of the business unitArguments: page, pageSize |
invoice | Invoice | One invoice of this company, by idArguments: id |
invoices | InvoiceResult! | Invoices billed to this company, newest first. Visible to whoever may see
the company's orders: a standalone invoice belongs to no order, so whether
it is the caller's own cannot be asked of it.Arguments: page, pageSize, searchTerm, status, invoiceDateFrom, invoiceDateUntil |
carts | CartResult! | Every cart in this business unit the caller is allowed to see, which includes
colleagues' carts where their role permits it, most recently touched first.
Active carts only unless status asks for archived ones too.Arguments: page, pageSize, status |
orderB2B | Order | One order, by the number a buyer quotes or by its id. Give exactly one --
giving both, or neither, is an error rather than a silent preference.
The id is what a payment provider hands back on its return URL, so it is the
key a buyer arrives with after paying. The order number is the one they read
off a confirmation.Arguments: orderNumber, id |
ordersB2B | OrderResult | This business unit's orders, newest first. Cancelled ones are left out
unless asked for by name: a cancelled order is not something that was
bought, and reopening an unpaid order for editing cancels it, so the list
would otherwise fill with twins.
A search term matches the order number, the purchase-order reference, or
the SKU of a line item. All three are matched in full rather than as a
prefix: they are codes read off a confirmation, a purchase order or a
packing slip and pasted in, not phrases to type part of.
Product names are deliberately not searched. Free text over what an order
contains needs a separate search index, and an order history that quietly
stops finding anything the day that index is rebuilt is worse than one
that never claimed to.Arguments: page, pageSize, searchTerm, status, createdFrom, createdUntil, placedByMe |
orderApprovals | OrderApprovalResult! | Approval queue for the business unit, optionally filtered by statusArguments: status, page, pageSize |
orderApprovalRule | OrderApprovalRule | One approval rule of the business unit, or null when it has none by that idArguments: id |
orderApprovalRules | OrderApprovalRuleResult! | Approval rules configured for the business unit, optionally by statusArguments: status, page, pageSize |
quoteRequest | QuoteRequest | Get a specific quote request by its IDArguments: id |
quoteRequests | QuoteRequestResult | Get a paginated list of quote requestsArguments: page, pageSize |
quote | Quote | Get a specific quote by its IDArguments: id |
quotes | QuoteResult | Get a paginated list of quotesArguments: page, pageSize, sort, status |
returns | ReturnResult! | Returns for the unit's orders the associate can see, newest firstArguments: page, pageSize, status |
return | Return | One of the unit's returns the associate can see; null otherwiseArguments: id |
Example
query { businessUnit(id: "bu-123") { id name defaultShippingAddress { id city } addresses(searchTerm: "amsterdam") { items { id givenName familyName city } pagination { totalCount hasNextPage } } associates { items { id email roles { id name } } } } }{ "data": { "businessUnit": { "id": "id-1", "name": "Example", "defaultShippingAddress": { "id": "id-1", "city": "Example" }, "addresses": { "items": [ { "id": "id-1", "givenName": "Example", "familyName": "Example", "city": "Example" } ], "pagination": { "totalCount": 1, "hasNextPage": true } }, "associates": { "items": [ { "id": "id-1", "email": "jane@example.com", "roles": [ { "id": "id-1", "name": "Example" } ] } ] } } }}The query is the example the schema documents. The response shows its shape with placeholder values.
Served by
| @evolve-framework/commercetools | Resolved |
| @evolve-framework/medusa | Resolved |
| @evolve-framework/sfcc | Stub: answers Not implemented |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
GetCarts - @evolve-storefront/feature-invoice:
GetBusinessInvoices,GetBusinessInvoiceStatusCounts,GetBusinessInvoice,GetBusinessInvoicePaymentMethods,GetBusinessInvoiceCredit - @evolve-storefront/feature-order:
GetBusinessOrderDeliveryPlan,GetBusinessOrderPaymentMethods,GetBusinessOrders,GetBusinessOrderStatusCounts,GetBusinessOrder,GetBusinessOrderLineReviews - @evolve-storefront/feature-organization:
GetOrderApprovals,GetOrderApprovalRules,GetOrderApprovalRule,GetBusinessUnit,GetBusinessUnitAddresses,GetCurrentAssociateCapabilities - @evolve-storefront/feature-quote:
GetQuoteRequests,GetQuotes,GetQuoteCounts,GetQuoteRequest,GetQuote - @evolve-storefront/feature-return:
GetBusinessReturns,GetBusinessReturn,GetBusinessReturnableLines,GetBusinessReturnableOrders - @evolve-storefront/feature-shopping-list:
GetBusinessShoppingLists,GetBusinessShoppingListDetail

