Query and manage Business Units, Associates, Quotes, and Order approvals with the Core Subgraph.
Queries
Query Business Units
parentUnit and childUnits.Requires a signed-in Customer.
query GetBusinessUnits {
businessUnits { id key name unitType }
}
{
"data": {
"businessUnits": [
{
"id": "AQQAAaWkpaRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "acme-group",
"name": "Acme Group",
"unitType": "COMPANY"
},
{
"id": "AQQAAVVUVVRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "acme-uk",
"name": "Acme UK Ltd",
"unitType": "DIVISION"
}
]
}
}
Get Business Unit by key
null if the current Associate can't
view it.Requires a signed-in Customer.
| Arguments | |
|---|---|
keyString | Key of the Business Unit. If omitted, returns the active Business Unit of the session. |
query GetBusinessUnit {
businessUnit(key: "acme-uk") {
id
key
name
unitType
parentUnit { key name }
stores { key name }
associates { fullName email }
}
}
{
"data": {
"businessUnit": {
"id": "AQQAAVVUVVRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "acme-uk",
"name": "Acme UK Ltd",
"unitType": "DIVISION",
"parentUnit": { "key": "acme-group", "name": "Acme Group" },
"stores": [{ "key": "uk-store", "name": "UK Store" }],
"associates": [
{ "fullName": "Sam Taylor", "email": "sam.taylor@example.com" },
{ "fullName": "John Smith", "email": "john.smith@example.com" }
]
}
}
}
Get active Business Unit
null if the shopper
isn't signed in or hasn't selected a Business Unit. To select one, call PUT /{project}/main/session/business-unit on the identity host.query GetActiveBusinessUnit {
activeBusinessUnit {
id
key
name
status
currencies
assignableRoles { key name }
}
}
{
"data": {
"activeBusinessUnit": {
"id": "AQQAAVVUVVRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "acme-uk",
"name": "Acme UK Ltd",
"status": "ACTIVE",
"currencies": ["GBP"],
"assignableRoles": [
{ "key": "approver", "name": "Approver" },
{ "key": "buyer", "name": "Buyer" }
]
}
}
}
Query Quote Requests
Returns the Quote Requests of the active Business Unit that the current Associate can view, newest first.
BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
filter | Filters the Quote Requests. |
firstInt | Maximum number of results to return, from Default: 0 to 500. Default: 20.20 |
afterString | Cursor of the item after which the page starts. Take it from edges.cursor or
pageInfo.endCursor. A cursor that this API didn't issue fails the query. |
query GetQuoteRequests {
quoteRequests(filter: {quoteRequestState: [SUBMITTED, ACCEPTED]}, first: 10) {
pageInfo { hasNextPage endCursor }
nodes {
id
quoteRequestState
itemCount
total { formatted }
}
}
}
{
"data": {
"quoteRequests": {
"pageInfo": { "hasNextPage": false, "endCursor": "AW9nZ3NkdDsw" },
"nodes": [
{
"id": "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteRequestState": "SUBMITTED",
"itemCount": 20,
"total": { "formatted": "£1,134.95" }
}
]
}
}
}
Get Quote Request by ID
null if it doesn't
exist or the current Associate can't view it.BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
idID | ID of the Quote Request. |
query GetQuoteRequest {
quoteRequest(
id: "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
) {
id
quoteRequestState
comment
lines { productName quantity }
total { formatted }
}
}
{
"data": {
"quoteRequest": {
"id": "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteRequestState": "SUBMITTED",
"comment": "Can you offer a better price for 10 chairs?",
"lines": [
{ "productName": "Oak Dining Chair", "quantity": 10 },
{ "productName": "Linen Cushion", "quantity": 10 }
],
"total": { "formatted": "£1,134.95" }
}
}
}
Query Quotes
Returns the Quotes of the active Business Unit that the current Associate can view, newest first.
BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
filter | Filters the Quotes. |
firstInt | Maximum number of results to return, from Default: 0 to 500. Default: 20.20 |
afterString | Cursor of the item after which the page starts. Take it from edges.cursor or
pageInfo.endCursor. A cursor that this API didn't issue fails the query. |
query GetQuotes {
quotes(filter: {quoteState: [PENDING]}, first: 10) {
pageInfo { hasNextPage endCursor }
edges {
cursor
node { id quoteState expiresAt }
}
}
}
{
"data": {
"quotes": {
"pageInfo": { "hasNextPage": false, "endCursor": "AW9nZ3NkdDsw" },
"edges": [
{
"cursor": "AW9nZ3NkdDsw",
"node": {
"id": "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteState": "PENDING",
"expiresAt": "2026-10-31T23:59:59.000Z"
}
}
]
}
}
}
Get Quote by ID
null if it doesn't exist or
the current Associate can't view it.BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
idID | ID of the Quote. |
query GetQuote {
quote(id: "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA") {
id
quoteState
expiresAt
lines { productName quantity }
total { formatted }
availableActions
}
}
{
"data": {
"quote": {
"id": "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteState": "PENDING",
"expiresAt": "2026-10-31T23:59:59.000Z",
"lines": [
{ "productName": "Oak Dining Chair", "quantity": 10 },
{ "productName": "Linen Cushion", "quantity": 10 }
],
"total": { "formatted": "£1,134.95" },
"availableActions": ["ACCEPT", "RENEGOTIATE", "DECLINE"]
}
}
}
Query Approval Flows
Returns the Approval Flows of the active Business Unit that the current Associate can view.
BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
filter | Filters the Approval Flows. |
firstInt | Maximum number of results to return, from Default: 0 to 500. Default: 20.20 |
afterString | Cursor of the item after which the page starts. Take it from edges.cursor or
pageInfo.endCursor. A cursor that this API didn't issue fails the query. |
query GetApprovals {
approvals(filter: {approvalState: [PENDING]}, first: 20) {
pageInfo { hasNextPage endCursor }
nodes {
id
approvalState
total { formatted }
requestedBy { fullName }
}
}
}
{
"data": {
"approvals": {
"pageInfo": { "hasNextPage": false, "endCursor": "AW9nZ3NkdDsw" },
"nodes": [
{
"id": "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"approvalState": "PENDING",
"total": { "formatted": "£5,340.00" },
"requestedBy": { "fullName": "John Smith" }
}
]
}
}
}
Get Approval Flow by ID
null if it doesn't
exist or the current Associate can't view it.BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
idID | ID of the Approval Flow. |
query GetApproval {
approval(id: "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA") {
id
approvalState
orderReference
requestedBy { fullName }
matchedRules { name }
currentTierPendingApproverRoles { key name }
availableActions
}
}
{
"data": {
"approval": {
"id": "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"approvalState": "PENDING",
"orderReference": "33333333-3333-4333-a333-333333333333",
"requestedBy": { "fullName": "John Smith" },
"matchedRules": [{ "name": "Orders over £5,000" }],
"currentTierPendingApproverRoles": [
{ "key": "approver", "name": "Approver" }
],
"availableActions": ["APPROVE", "REJECT"]
}
}
}
Query Approval Rules
Returns the Approval Rules of the active Business Unit.
BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
filter | Filters the Approval Rules. |
firstInt | Maximum number of results to return, from Default: 0 to 500. Default: 20.20 |
afterString | Cursor of the item after which the page starts. Take it from edges.cursor or
pageInfo.endCursor. A cursor that this API didn't issue fails the query. |
query GetApprovalRules {
approvalRules(filter: {approvalRuleState: [ACTIVE]}, first: 20) {
totalCount
nodes { id key name approvalRuleState }
}
}
{
"data": {
"approvalRules": {
"totalCount": 1,
"nodes": [
{
"id": "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "orders-over-5000",
"name": "Orders over £5,000",
"approvalRuleState": "ACTIVE"
}
]
}
}
}
Get Approval Rule by ID
null if it doesn't
exist or the current Associate can't view it.BUSINESS_UNIT_REQUIRED error.| Arguments | |
|---|---|
idID | ID of the Approval Rule. |
query GetApprovalRule {
approvalRule(
id: "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
) {
id
name
approvalRuleState
conditions { field operator }
requesterRoles { key }
}
}
{
"data": {
"approvalRule": {
"id": "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"name": "Orders over £5,000",
"approvalRuleState": "ACTIVE",
"conditions": [{ "field": "ORDER_TOTAL", "operator": "GT" }],
"requesterRoles": [{ "key": "buyer" }]
}
}
}
Mutations
Create Business Unit
CreateBusinessUnitInput.| Arguments | |
|---|---|
input | The Division to create. |
mutation CreateBusinessUnit {
createBusinessUnit(
input: {key: "acme-uk-north", name: "Acme UK North", parentUnitKey: "acme-uk", contactEmail: "north@example.com"}
) {
businessUnit { id key name unitType }
userErrors { code message field }
}
}
{
"data": {
"createBusinessUnit": {
"businessUnit": {
"id": "AQQAAbW0tbRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "acme-uk-north",
"name": "Acme UK North",
"unitType": "DIVISION"
},
"userErrors": []
}
}
}
Change Business Unit name
UPDATE_BUSINESS_UNIT_DETAILS permission. Without it, the mutation is refused
with FORBIDDEN_ACTION.| Arguments | |
|---|---|
nameString | New name of the Business Unit. |
mutation ChangeBusinessUnitName {
changeBusinessUnitName(name: "Acme UK Limited") {
businessUnit { id name }
userErrors { code message field }
}
}
{
"data": {
"changeBusinessUnitName": {
"businessUnit": {
"id": "AQQAAVVUVVRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"name": "Acme UK Limited"
},
"userErrors": []
}
}
}
Set Business Unit contact email
UPDATE_BUSINESS_UNIT_DETAILS permission. Without it, the mutation is refused
with FORBIDDEN_ACTION.| Arguments | |
|---|---|
contactEmailString | Email address to set. If omitted or null, the current contact email address is
removed. |
mutation SetBusinessUnitContactEmail {
setBusinessUnitContactEmail(contactEmail: "orders@example.com") {
businessUnit { id contactEmail }
userErrors { code message field }
}
}
{
"data": {
"setBusinessUnitContactEmail": {
"businessUnit": {
"id": "AQQAAVVUVVRVVUVUpVRVVVVUVVQAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"contactEmail": "orders@example.com"
},
"userErrors": []
}
}
}
Add Business Unit address
UPDATE_BUSINESS_UNIT_DETAILS permission. Without it, the mutation is refused
with FORBIDDEN_ACTION.| Arguments | |
|---|---|
input | The address to add. |
mutation AddBusinessUnitAddress {
addBusinessUnitAddress(
input: {name: "Jane Doe", line1: "1 Example Street", city: "London", postalCode: "SW1A 1AA", country: "GB"}
) {
address { id name line1 city postalCode country }
userErrors { code message field }
}
}
{
"data": {
"addBusinessUnitAddress": {
"address": {
"id": "ARMDAVVUVVRVVUVUpVRVVVVUVVQBCGhLN2tMOW1PAAEAAAAAAAEAAAABAAEAAA",
"name": "Jane Doe",
"line1": "1 Example Street",
"city": "London",
"postalCode": "SW1A 1AA",
"country": "GB"
},
"userErrors": []
}
}
}
Update Business Unit address
ADDRESS_NOT_FOUND.| Arguments | |
|---|---|
input | The address to update and its new values. |
mutation UpdateBusinessUnitAddress {
updateBusinessUnitAddress(
input: {addressId: "ARMDAVVUVVRVVUVUpVRVVVVUVVQBCGhLN2tMOW1PAAEAAAAAAAEAAAABAAEAAA", address: {name: "Jane Doe", line1: "1 Example Street", line2: "Floor 3", city: "London", postalCode: "SW1A 1AA", country: "GB"}}
) {
address { id name line1 line2 city }
userErrors { code message field }
}
}
{
"data": {
"updateBusinessUnitAddress": {
"address": {
"id": "ARMDAVVUVVRVVUVUpVRVVVVUVVQBCGhLN2tMOW1PAAEAAAAAAAEAAAABAAEAAA",
"name": "Jane Doe",
"line1": "1 Example Street",
"line2": "Floor 3",
"city": "London"
},
"userErrors": []
}
}
}
Remove Business Unit address
address is
null. An unknown address is refused with ADDRESS_NOT_FOUND.| Arguments | |
|---|---|
idID | ID of the address to remove. |
mutation RemoveBusinessUnitAddress {
removeBusinessUnitAddress(
id: "ARMDAVVUVVRVVUVUpVRVVVVUVVQBCGhLN2tMOW1PAAEAAAAAAAEAAAABAAEAAA"
) {
address { id }
userErrors { code message field }
}
}
{
"data": {
"removeBusinessUnitAddress": { "address": null, "userErrors": [] }
}
}
Add Associate
Adds an existing Customer as an Associate of the active Business Unit, with the given Associate Roles.
UPDATE_ASSOCIATES permission, held directly or inherited. Without
it, the mutation is refused with FORBIDDEN_ACTION, whether or not the email
address exists. An email address without a Customer account is refused with
CUSTOMER_NOT_FOUND.| Arguments | |
|---|---|
input | The Customer to add and the roles to assign. |
mutation AddAssociate {
addAssociate(
input: {email: "john.smith@example.com", roleKeys: ["buyer"], inheritance: ENABLED}
) {
associate {
id
email
roles { key name }
}
userErrors { code message field }
}
}
{
"data": {
"addAssociate": {
"associate": {
"id": "AREDAVVUVVRVVUVUpVRVVVVUVVQAxMTFxERERESlREVERERERAEAAAABAAEAAA",
"email": "john.smith@example.com",
"roles": [{ "key": "buyer", "name": "Buyer" }]
},
"userErrors": []
}
}
}
Update Associate Roles
associateId. Requires the UPDATE_ASSOCIATES permission in that Business
Unit.UPDATE_ASSOCIATES from the last Associate who holds it,
including the current Associate. The Business Unit is then left in the same state
that removeAssociate describes: nobody can manage its Associates through this
API.| Arguments | |
|---|---|
input | The Associate to update and their new roles. |
mutation UpdateAssociateRoles {
updateAssociateRoles(
input: {associateId: "AREDAVVUVVRVVUVUpVRVVVVUVVQAxMTFxERERESlREVERERERAEAAAABAAEAAA", roleKeys: ["buyer", "approver"]}
) {
associate {
id
roles { key name }
}
userErrors { code message field }
}
}
{
"data": {
"updateAssociateRoles": {
"associate": {
"id": "AREDAVVUVVRVVUVUpVRVVVVUVVQAxMTFxERERESlREVERERERAEAAAABAAEAAA",
"roles": [
{ "key": "buyer", "name": "Buyer" },
{ "key": "approver", "name": "Approver" }
]
},
"userErrors": []
}
}
}
Remove Associate
id. Requires the UPDATE_ASSOCIATES permission in that Business Unit. Without
it, the mutation is refused with FORBIDDEN_ACTION. On success, associate is
null.UPDATE_ASSOCIATES remains, directly or
inherited, no mutation in this API can add one back. Child units that inherit
Associates from this Business Unit lose the removed Associate too. Before you remove
the last administrator, read BusinessUnit.associates and assign the roles to
their replacement.| Arguments | |
|---|---|
idID | ID of the Associate to remove. |
mutation RemoveAssociate {
removeAssociate(
id: "AREDAVVUVVRVVUVUpVRVVVVUVVQAxMTFxERERESlREVERERERAEAAAABAAEAAA"
) {
associate { id }
userErrors { code message field }
}
}
{
"data": { "removeAssociate": { "associate": null, "userErrors": [] } }
}
Request Quote
Requests a Quote for the Cart of the current session as it is, with its lines, addresses, Shipping Method, and prices. To quote something else, change the Cart and request again.
The Cart stays active and unchanged. The Quote Request keeps its own copy of the lines and totals, so later Cart changes don't affect it.
EMPTY_CART. A Cart without a shipping address is
refused with SHIPPING_ADDRESS_REQUIRED. A Cart with a Discount Code is refused
with QUOTE_CART_HAS_DISCOUNT_CODES.| Arguments | |
|---|---|
input | Message and purchase order number for the Quote Request. |
mutation RequestQuote {
requestQuote(
input: {message: "Can you offer a better price for 10 chairs?", purchaseOrderNumber: "PO-2026-0917"}
) {
quoteRequest { id quoteRequestState itemCount purchaseOrderNumber }
userErrors { code message field }
}
}
{
"data": {
"requestQuote": {
"quoteRequest": {
"id": "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteRequestState": "SUBMITTED",
"itemCount": 20,
"purchaseOrderNumber": "PO-2026-0917"
},
"userErrors": []
}
}
}
Cancel Quote Request
CANCELLED.SUBMITTED Quote Request can be cancelled. Other states are refused with
QUOTE_REQUEST_NOT_ACTIONABLE. An unknown ID is refused with
QUOTE_REQUEST_NOT_FOUND.| Arguments | |
|---|---|
quoteRequestIdID | ID of the Quote Request to cancel. |
mutation CancelQuoteRequest {
cancelQuoteRequest(
quoteRequestId: "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
) {
quoteRequest { id quoteRequestState }
userErrors { code message field }
}
}
{
"data": {
"cancelQuoteRequest": {
"quoteRequest": {
"id": "AQcAAYiJiImIiEiJqImIiIiJiIkAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteRequestState": "CANCELLED"
},
"userErrors": []
}
}
}
Accept Quote
order.PENDING is refused with QUOTE_NOT_ACTIONABLE, and an
expired Quote with QUOTE_EXPIRED. If the current Associate lacks permission, the
mutation is refused with FORBIDDEN_ACTION. An unknown ID is refused with
QUOTE_NOT_FOUND.| Arguments | |
|---|---|
quoteIdID | ID of the Quote to accept. |
mutation AcceptQuote {
acceptQuote(
quoteId: "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
) {
quote { id quoteState }
order { id fromQuote orderState }
userErrors { code message field }
}
}
{
"data": {
"acceptQuote": {
"quote": {
"id": "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteState": "ACCEPTED"
},
"order": {
"id": "AQIAAdPS09IzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"fromQuote": true,
"orderState": "OPEN"
},
"userErrors": []
}
}
}
Decline Quote
DECLINED.acceptQuote.| Arguments | |
|---|---|
quoteIdID | ID of the Quote to decline. |
reasonString | Reason for declining. Stored as the buyerComment of the Quote. A blank value
is ignored. Passing a reason also requires permission to renegotiate the Quote.
Without it, the mutation is refused with FORBIDDEN_ACTION. |
mutation DeclineQuote {
declineQuote(
quoteId: "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
reason: "We found a better offer."
) {
quote { id quoteState buyerComment availableActions }
userErrors { code message field }
}
}
{
"data": {
"declineQuote": {
"quote": {
"id": "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteState": "DECLINED",
"buyerComment": "We found a better offer.",
"availableActions": []
},
"userErrors": []
}
}
}
Renegotiate Quote
DECLINED_FOR_RENEGOTIATION, and message is stored as its buyerComment.acceptQuote.| Arguments | |
|---|---|
input | The Quote to renegotiate and the message to the Seller. |
mutation RenegotiateQuote {
renegotiateQuote(
input: {quoteId: "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA", message: "Can you include free delivery?"}
) {
quote { id quoteState buyerComment availableActions }
userErrors { code message field }
}
}
{
"data": {
"renegotiateQuote": {
"quote": {
"id": "AQYAAXd2d3Z3d0d2p3Z3d3d2d3YAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"quoteState": "DECLINED_FOR_RENEGOTIATION",
"buyerComment": "Can you include free delivery?",
"availableActions": []
},
"userErrors": []
}
}
}
Approve Order
Records the approval of the current Associate on the Approval Flow of an Order. The Order itself doesn't change.
ORDER_NOT_FOUND. If the flow can't be approved, the mutation is refused with
APPROVAL_NOT_PENDING, or with FORBIDDEN_ACTION if the Associate lacks
permission.| Arguments | |
|---|---|
orderIdID | ID of the Order to approve. |
mutation ApproveOrder {
approveOrder(
orderId: "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
) {
approvalFlow { id approvalState availableActions }
userErrors { code message field }
}
}
{
"data": {
"approveOrder": {
"approvalFlow": {
"id": "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"approvalState": "APPROVED",
"availableActions": []
},
"userErrors": []
}
}
}
Reject Order
OPEN or CONFIRMED.approveOrder.| Arguments | |
|---|---|
orderIdID | ID of the Order to reject. |
reasonString | Reason for the rejection. Returned in rejection.reason of the Approval Flow. A
blank value is refused with APPROVAL_REASON_REQUIRED. |
mutation RejectOrder {
rejectOrder(
orderId: "AQIAATMyMzIzM0MyozIzMzMyMzIAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
reason: "Over the monthly budget."
) {
approvalFlow { id approvalState availableActions }
userErrors { code message field }
}
}
{
"data": {
"rejectOrder": {
"approvalFlow": {
"id": "AQkAAbGzs7XBwk0cjh_x8vP19fcAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"approvalState": "REJECTED",
"availableActions": []
},
"userErrors": []
}
}
}
Create Approval Rule
Creates an Approval Rule in the active Business Unit.
CONDITION_NOT_SUPPORTED, missing approvers with
APPROVER_TIERS_REQUIRED, and unknown role keys with
ASSOCIATE_ROLE_NOT_FOUND.| Arguments | |
|---|---|
input | The Approval Rule to create. |
mutation CreateApprovalRule {
createApprovalRule(
input: {key: "orders-over-5000", name: "Orders over £5,000", description: "Orders above £5,000 need approval from an approver.", conditions: [{field: ORDER_TOTAL, operator: GT, amountInMinorUnits: 500000, currency: "GBP"}], approverTiers: [{groups: [{roleKeys: ["approver"]}]}], requesterRoleKeys: ["buyer"]}
) {
approvalRule { id key name approvalRuleState }
userErrors { code message field }
}
}
{
"data": {
"createApprovalRule": {
"approvalRule": {
"id": "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"key": "orders-over-5000",
"name": "Orders over £5,000",
"approvalRuleState": "ACTIVE"
},
"userErrors": []
}
}
}
Update Approval Rule
createApprovalRule. An unknown ID is refused with
APPROVAL_RULE_NOT_FOUND.| Arguments | |
|---|---|
input | The Approval Rule to update and the fields to change. |
mutation UpdateApprovalRule {
updateApprovalRule(
input: {id: "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA", name: "Orders over £2,500", conditions: [{field: ORDER_TOTAL, operator: GT, amountInMinorUnits: 250000, currency: "GBP"}]}
) {
approvalRule { id name approvalRuleState }
userErrors { code message field }
}
}
{
"data": {
"updateApprovalRule": {
"approvalRule": {
"id": "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"name": "Orders over £2,500",
"approvalRuleState": "ACTIVE"
},
"userErrors": []
}
}
}
Set Approval Rule active
ACTIVE or
INACTIVE. An unknown ID is refused with APPROVAL_RULE_NOT_FOUND.| Arguments | |
|---|---|
idID | ID of the Approval Rule. |
activeBoolean | true for ACTIVE, false for INACTIVE. |
mutation SetApprovalRuleActive {
setApprovalRuleActive(
id: "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA"
active: false
) {
approvalRule { id approvalRuleState }
userErrors { code message field }
}
}
{
"data": {
"setApprovalRuleActive": {
"approvalRule": {
"id": "AQoAAcHDw8XR0k4fnx6hoqOlpacAAAABAAAAAAABAAEAAAAAAAEAAAABAAEAAA",
"approvalRuleState": "INACTIVE"
},
"userErrors": []
}
}
}
Output types
Business Unit
idID | Unique identifier of the Business Unit. |
keyString | User-defined unique and immutable identifier of the Business Unit. |
nameString | Name of the Business Unit. |
unitType | Type of the Business Unit. Can beCOMPANY, or DIVISION |
status | Status of the Business Unit. Can beACTIVE, or INACTIVE |
contactEmailString | Email address of the Business Unit, separate from the email addresses of its
Associates. null if none is set. |
parentUnit | Parent unit of the Business Unit. null for a Company, or if the current
Associate can't view the parent unit. |
childUnitsArray of BusinessUnit | Direct child units of the Business Unit. Returns up to 100 Business Units. |
currenciesArray of String | Currency codes (ISO 4217) that the Business Unit can transact in. This is the list
of currencies configured for the Project, the same list as
Viewer.presentmentOptions.currencies. A Store of the Business Unit might have no
prices in some of these currencies. |
storesArray of Store | Stores the Business Unit is associated with, including Stores inherited from its parent unit. |
addressesArray of SavedAddress | Addresses of the Business Unit. |
associatesArray of Associate | Associates of the Business Unit, including Associates inherited from its parent unit. |
assignableRolesArray of AssociateRole | Associate Roles that can be assigned to Associates of this Business Unit: the roles
the merchant marks as assignable by a Buyer. addAssociate and
updateAssociateRoles accept these keys. |
_ctIdID | Platform identifier (UUID) of the Business Unit, for extensions that key an external
system such as an ERP account by it. The public
id is an opaque global
identifier, so don't parse it.Not part of the public API: an extension can read it with @requires, and it is
removed from the composed API schema. |
Associate
A Customer who acts within a Business Unit. The current Associate comes from the session.
idID | Unique identifier of the Associate within a specific Business Unit. |
firstNameString | First name of the Associate. Empty if no name is recorded. This field never contains
the email address, so use email if you want to show that instead. |
middleNameString | Middle name of the Associate. Empty if they have none, or if no name is recorded. |
lastNameString | Last name of the Associate. Empty if no name is recorded. |
fullNameString | firstName, middleName, and lastName in that order, joined by single
spaces, without the empty parts. For example, Jane Doe for a person without a
middle name. Empty if no name is recorded. If your locale orders names differently,
compose the name from its parts. |
emailString | Email address of the Associate. Empty if it isn't known. |
rolesArray of AssociateRole | Associate Roles that the Associate holds in the Business Unit they were read from, with the permissions each role grants. |
Associate Role
key. BusinessUnit.assignableRoles lists the Associate Roles you can assign.keyString | User-defined unique identifier of the Associate Role. |
nameString | Name of the Associate Role. Empty if no name is set. |
permissionsArray of AssociatePermission | Permissions that the Associate Role grants, sorted and without duplicates. Empty if it grants none. Can beACCEPT_MY_QUOTES, ACCEPT_OTHERS_QUOTES, ADD_CHILD_UNITS, CREATE_APPROVAL_RULES, CREATE_MY_CARTS, CREATE_MY_ORDERS_FROM_MY_CARTS, CREATE_MY_ORDERS_FROM_MY_QUOTES, CREATE_MY_PAYMENT_METHODS, CREATE_MY_QUOTE_REQUESTS_FROM_MY_CARTS, CREATE_MY_SHOPPING_LISTS, CREATE_ORDERS_FROM_OTHERS_CARTS, CREATE_ORDERS_FROM_OTHERS_QUOTES, CREATE_OTHERS_CARTS, CREATE_OTHERS_PAYMENT_METHODS, CREATE_OTHERS_SHOPPING_LISTS, CREATE_QUOTE_REQUESTS_FROM_OTHERS_CARTS, DECLINE_MY_QUOTES, DECLINE_OTHERS_QUOTES, DELETE_MY_CARTS, DELETE_MY_PAYMENT_METHODS, DELETE_MY_SHOPPING_LISTS, DELETE_OTHERS_CARTS, DELETE_OTHERS_PAYMENT_METHODS, DELETE_OTHERS_SHOPPING_LISTS, REASSIGN_MY_QUOTES, REASSIGN_OTHERS_QUOTES, RENEGOTIATE_MY_QUOTES, RENEGOTIATE_OTHERS_QUOTES, UPDATE_APPROVAL_FLOWS, UPDATE_APPROVAL_RULES, UPDATE_ASSOCIATES, UPDATE_BUSINESS_UNIT_DETAILS, UPDATE_MY_CARTS, UPDATE_MY_ORDERS, UPDATE_MY_PAYMENT_METHODS, UPDATE_MY_QUOTE_REQUESTS, UPDATE_MY_SHOPPING_LISTS, UPDATE_OTHERS_CARTS, UPDATE_OTHERS_ORDERS, UPDATE_OTHERS_PAYMENT_METHODS, UPDATE_OTHERS_QUOTE_REQUESTS, UPDATE_OTHERS_SHOPPING_LISTS, UPDATE_PARENT_UNIT, VIEW_MY_CARTS, VIEW_MY_ORDERS, VIEW_MY_PAYMENT_METHODS, VIEW_MY_QUOTE_REQUESTS, VIEW_MY_QUOTES, VIEW_MY_SHOPPING_LISTS, VIEW_OTHERS_CARTS, VIEW_OTHERS_ORDERS, VIEW_OTHERS_PAYMENT_METHODS, VIEW_OTHERS_QUOTE_REQUESTS, VIEW_OTHERS_QUOTES, VIEW_OTHERS_SHOPPING_LISTS, or UNKNOWN |
Business Unit Type
Position of a Business Unit in the hierarchy.
COMPANY- Top-level Business Unit, without a parent unit.
DIVISION- Business Unit with a parent unit, which is a Company or another Division.
Business Unit Status
Status of a Business Unit, which controls whether it can be used in Carts, Orders, Quote Requests, and Quotes.
ACTIVE- The Business Unit can be used.
INACTIVE- The Business Unit can't be used. It isn't deleted.
Associate Permission
availableActions field decides what the Associate can do with it.ACCEPT_MY_QUOTES- The Associate can accept their own Quotes.
ACCEPT_OTHERS_QUOTES- The Associate can accept Quotes that belong to other Associates.
ADD_CHILD_UNITS- The Associate can create a child Business Unit.
CREATE_APPROVAL_RULES- The Associate can create Approval Rules.
CREATE_MY_CARTS- The Associate can create their own Carts.
CREATE_MY_ORDERS_FROM_MY_CARTS- The Associate can create Orders from their own Carts.
CREATE_MY_ORDERS_FROM_MY_QUOTES- The Associate can create Orders from their own Quotes.
CREATE_MY_PAYMENT_METHODS- The Associate can create their own payment methods.
CREATE_MY_QUOTE_REQUESTS_FROM_MY_CARTS- The Associate can create their own Quote Requests from their own Carts.
CREATE_MY_SHOPPING_LISTS- The Associate can create their own Shopping Lists.
CREATE_ORDERS_FROM_OTHERS_CARTS- The Associate can create Orders from Carts that belong to other Associates.
CREATE_ORDERS_FROM_OTHERS_QUOTES- The Associate can create Orders from Quotes that belong to other Associates.
CREATE_OTHERS_CARTS- The Associate can create Carts that belong to other Associates.
CREATE_OTHERS_PAYMENT_METHODS- The Associate can create payment methods that belong to other Associates.
CREATE_OTHERS_SHOPPING_LISTS- The Associate can create Shopping Lists that belong to other Associates.
CREATE_QUOTE_REQUESTS_FROM_OTHERS_CARTS- The Associate can create Quote Requests from Carts that belong to other Associates.
DECLINE_MY_QUOTES- The Associate can decline their own Quotes.
DECLINE_OTHERS_QUOTES- The Associate can decline Quotes that belong to other Associates.
DELETE_MY_CARTS- The Associate can delete their own Carts.
DELETE_MY_PAYMENT_METHODS- The Associate can delete their own payment methods.
DELETE_MY_SHOPPING_LISTS- The Associate can delete their own Shopping Lists.
DELETE_OTHERS_CARTS- The Associate can delete Carts that belong to other Associates.
DELETE_OTHERS_PAYMENT_METHODS- The Associate can delete payment methods that belong to other Associates.
DELETE_OTHERS_SHOPPING_LISTS- The Associate can delete Shopping Lists that belong to other Associates.
REASSIGN_MY_QUOTES- The Associate can reassign their own Quotes to a different Associate.
REASSIGN_OTHERS_QUOTES- The Associate can reassign Quotes that belong to other Associates.
RENEGOTIATE_MY_QUOTES- The Associate can renegotiate their own Quotes.
RENEGOTIATE_OTHERS_QUOTES- The Associate can renegotiate Quotes that belong to other Associates.
UPDATE_APPROVAL_FLOWS- The Associate can update Approval Flows, that is, approve or reject them.
UPDATE_APPROVAL_RULES- The Associate can update Approval Rules.
UPDATE_ASSOCIATES- The Associate can manage other Associates of the Business Unit.
UPDATE_BUSINESS_UNIT_DETAILS- The Associate can edit the details of the Business Unit, such as its name, contact email, and addresses.
UPDATE_MY_CARTS- The Associate can update their own Carts.
UPDATE_MY_ORDERS- The Associate can update their own Orders.
UPDATE_MY_PAYMENT_METHODS- The Associate can update their own payment methods.
UPDATE_MY_QUOTE_REQUESTS- The Associate can update their own Quote Requests.
UPDATE_MY_SHOPPING_LISTS- The Associate can update their own Shopping Lists.
UPDATE_OTHERS_CARTS- The Associate can update Carts that belong to other Associates.
UPDATE_OTHERS_ORDERS- The Associate can update Orders that belong to other Associates.
UPDATE_OTHERS_PAYMENT_METHODS- The Associate can update payment methods that belong to other Associates.
UPDATE_OTHERS_QUOTE_REQUESTS- The Associate can update Quote Requests that belong to other Associates.
UPDATE_OTHERS_SHOPPING_LISTS- The Associate can update Shopping Lists that belong to other Associates.
UPDATE_PARENT_UNIT- The Associate can assign a different parent unit to the Business Unit. The Associate also needs the `ADD_CHILD_UNITS` permission in the new parent unit.
VIEW_MY_CARTS- The Associate can view their own Carts.
VIEW_MY_ORDERS- The Associate can view their own Orders.
VIEW_MY_PAYMENT_METHODS- The Associate can view their own payment methods.
VIEW_MY_QUOTE_REQUESTS- The Associate can view their own Quote Requests.
VIEW_MY_QUOTES- The Associate can view their own Quotes.
VIEW_MY_SHOPPING_LISTS- The Associate can view their own Shopping Lists.
VIEW_OTHERS_CARTS- The Associate can view Carts that belong to other Associates.
VIEW_OTHERS_ORDERS- The Associate can view Orders that belong to other Associates.
VIEW_OTHERS_PAYMENT_METHODS- The Associate can view payment methods that belong to other Associates.
VIEW_OTHERS_QUOTE_REQUESTS- The Associate can view Quote Requests that belong to other Associates.
VIEW_OTHERS_QUOTES- The Associate can view Quotes that belong to other Associates.
VIEW_OTHERS_SHOPPING_LISTS- The Associate can view Shopping Lists that belong to other Associates.
UNKNOWN- A permission that this API doesn't model. Reported so that the permissions of a role are never under-counted. Not actionable.
Associate Role Inheritance Mode
Whether a role assignment is inherited by the child units of the Business Unit it is made on.
ENABLED- Child Business Units inherit the assignment.
DISABLED- Child Business Units don't inherit the assignment.
Business Unit Result
createBusinessUnit, changeBusinessUnitName, and
setBusinessUnitContactEmail.businessUnit | The Business Unit after the mutation. null if the mutation failed. |
userErrorsArray of UserError | Errors that prevented the mutation. Empty on success. |
Associate Result
Quote Request
requestQuote. For more information, see Quotes
overview.idID | Unique identifier of the Quote Request. |
referenceString | Reference to show for the Quote Request: its key, or its platform ID if no key is set. |
quoteRequestState | Current state of the Quote Request. Can beSUBMITTED, UNDER_REVIEW, ACCEPTED, REJECTED, CANCELLED, CLOSED, or UNKNOWN |
businessUnit | Business Unit the Quote Request belongs to. If the session can't read that Business
Unit, this field returns an error, which makes the enclosing Quote Request null. |
itemCountInt | Total quantity of all lines. |
total | Total of the Quote Request, tax included. Same value as totals.grandTotal. |
totals | Price breakdown behind total, computed the same way as for a Cart and an Order.
shipping is null if the Quote Request has no Shipping Method. |
discountsArray of AppliedDiscount | Every applied discount on the request, one entry per discount and target, its amount summed over the request: Product Discounts included where applied. The non-SHIPPING entries add up to totals.discountTotal. |
createdAt | Date and time (UTC) the Quote Request was created. |
requestedBy | Buyer who created the Quote Request, with the Associate Roles they hold in the
Business Unit. null if no Buyer is recorded. If the Buyer has left the Business
Unit, roles is empty. |
linesArray of QuoteLine | Lines for which a Quote is requested, copied from the Cart when the request was created. |
commentString | Message from the Buyer included in the Quote Request. Set from message in
RequestQuoteInput. |
purchaseOrderNumberString | Purchase order number that the Buyer set when requesting the Quote. It can't be changed afterward, and it's copied unchanged to the resulting Quote. |
Quote Line
A line of a Quote Request or Quote. Represents a Line Item or a Custom Line Item.
skuString | SKU of the Product Variant. Empty for a Custom Line Item. |
productNameString | Name of the Product or Custom Line Item in the locale of the session. |
quantityInt | Number of units on the line. |
isGiftBoolean | Whether this is a free Gift Line Item the platform added. Its Portion lists the gift discount that added it, which carries the same id as that discount's entry in discounts. |
unitPriceBeforeDiscount | One unit before any discount: the Line Item's price on the quote. |
priceMode | How the Line Item's price was set; null for a custom line. Can bePLATFORM, EXTERNAL_PRICE, or EXTERNAL_TOTAL |
discountedPrice | One unit after its Product Discount, and the Product Discount behind it; null when none applies. |
portionsArray of Portion | The Line Item's units grouped by what one unit costs after Cart Discounts, a seller's Direct Discounts included; at least one. |
lineTotal | What this Line Item costs after every discount: its Portions' unitPrice times quantity, added up. On an EXTERNAL_TOTAL Line Item it is the total the external system set instead. |
Quote
idID | Unique identifier of the Quote. |
referenceString | Reference to show for the Quote: its key, or its platform ID if no key is set. |
quoteState | Current state of the Quote. Can bePENDING, DECLINED_FOR_RENEGOTIATION, RENEGOTIATION_ADDRESSED, ACCEPTED, DECLINED, WITHDRAWN, or UNKNOWN |
businessUnit | Business Unit the Quote belongs to. If the session can't read that Business Unit,
this field returns an error, which makes the enclosing Quote null. |
itemCountInt | Total quantity of all lines. |
total | Amount the Buyer pays if they accept the Quote, tax included. Same value as
totals.grandTotal. |
totals | Price breakdown behind total, computed the same way as for a Cart and an Order.
shipping is null if the Quote has no Shipping Method. |
discountsArray of AppliedDiscount | Every applied discount on the quote, one entry per discount and target, its amount summed over the quote: Product Discounts included where applied, and a seller's Direct Discounts. The non-SHIPPING entries add up to totals.discountTotal. |
createdAt | Date and time (UTC) the Quote was created. |
expiresAt | Date and time (UTC) the Quote expires.
null if the Seller set no expiry.After this time, the Quote can't be acted on and availableActions is empty.
quoteState doesn't change when the Quote expires, so a PENDING Quote can be
expired. |
requestedBy | Buyer who requested the Quote, with the Associate Roles they hold in the Business
Unit. null if no Buyer is recorded. If the Buyer has left the Business Unit,
roles is empty. |
linesArray of QuoteLine | Lines of the Quote. |
buyerCommentString | Latest message from the Buyer: the message sent with a renegotiation request, or the reason given when declining. |
sellerCommentString | Message from the Seller included in the Quote. |
purchaseOrderNumberString | Purchase order number copied unchanged from the Quote Request. It can't be changed. |
availableActionsArray of QuoteAction | Actions that the current Associate can take on the Quote, based on their permissions
for their own Quotes or for Quotes of other Associates. Empty unless the Quote is
Can be PENDING and hasn't expired. acceptQuote, declineQuote, and
renegotiateQuote refuse an action that isn't listed here.ACCEPT, RENEGOTIATE, or DECLINE |
Quote Request Connection
quoteRequests.edgesArray of QuoteRequestEdge | Quote Requests on this page, with their cursors. |
nodesArray of QuoteRequest | Quote Requests on this page, in the same order as edges. |
pageInfo | Information for getting the next or previous page. |
totalCountInt | Total number of Quote Requests that match the query, across all pages. |
Quote Request Edge
QuoteRequestConnection.node | The Quote Request. |
cursorString | Opaque cursor of this item. Pass it as after to get the items that follow it. |
Quote Connection
quotes.Quote Edge
QuoteConnection.node | The Quote. |
cursorString | Opaque cursor of this item. Pass it as after to get the items that follow it. |
Quote Request State
State of a Quote Request in the negotiation process.
SUBMITTED- The Buyer submitted the Quote Request, and the Seller hasn't accepted or rejected it yet. Initial state of a Quote Request.
UNDER_REVIEW- Reserved state. A Quote Request can report it, but no operation in this API sets it.
ACCEPTED- The Seller accepted the Quote Request and is preparing a Quote for the Buyer.
REJECTED- The Seller rejected the Quote Request, which ends the negotiation.
CANCELLED- The Buyer withdrew the Quote Request, for example with `cancelQuoteRequest`.
CLOSED- Final state. The Seller accepted the Quote Request, and no further action is possible.
UNKNOWN- A state that this API doesn't model. The Quote Request is still listed. Treat it as read-only.
Quote State
Quote.expiresAt.PENDING- The Seller sent the Quote, and the Buyer hasn't replied yet. Only a `PENDING` Quote can be accepted, declined, or renegotiated.
DECLINED_FOR_RENEGOTIATION- The Buyer declined the Quote and asked to renegotiate it. The Seller hasn't answered yet.
RENEGOTIATION_ADDRESSED- The Seller answered the renegotiation request with a new Quote. This Quote offers no actions.
ACCEPTED- The Buyer accepted the Quote. `acceptQuote` also creates an Order from it in the same step.
DECLINED- The Buyer declined the Quote. `buyerComment` holds the reason, if the Buyer gave one.
WITHDRAWN- The Seller withdrew the Quote before the Buyer accepted it.
UNKNOWN- A state that this API doesn't model. The Quote is still listed and offers no `availableActions`. Treat it as read-only.
Quote Action
Quote.availableActions can offer.ACCEPT- Accept the Quote with `acceptQuote`, which also creates an Order from it. Offered only if the Associate has permission both to accept the Quote and to create an Order from it.
RENEGOTIATE- Ask the Seller to renegotiate the Quote with `renegotiateQuote`.
DECLINE- Decline the Quote with `declineQuote`. If `RENEGOTIATE` isn't offered, decline without a `reason`.
Quote Request Result
requestQuote and cancelQuoteRequest.quoteRequest | The Quote Request after the mutation. null if the mutation failed, except for
QUOTE_REQUEST_NOT_ACTIONABLE, which returns the unchanged Quote Request. |
userErrorsArray of UserError | Errors that prevented the mutation. Empty on success. |
Quote Result
acceptQuote, declineQuote, and renegotiateQuote.quote | The Quote after the mutation. If a check before the write refuses the mutation, for
example because of the Quote's state or expiry, or a permission that
availableActions reflects, this is the unchanged Quote. If the platform refuses
the write, quote is null. For example, declineQuote with a reason
but without the permission to renegotiate returns FORBIDDEN_ACTION and a
null Quote. |
order | Order created from the Quote. Set only by a successful acceptQuote. |
userErrorsArray of UserError | Errors that prevented the mutation. Empty on success. |
Approval Flow
idID | Unique identifier of the Approval Flow. |
order | Order that needs approval. null if the current Associate isn't allowed to view
the Order, for example an Order of another Associate without the
VIEW_OTHERS_ORDERS permission. The Approval Flow itself is still returned. |
orderReferenceString | Reference of the Order: its order number, or its platform ID if it has none. |
approvalState | Current state of the Approval Flow. Can bePENDING, APPROVED, or REJECTED |
total | Total of the Order under review. Where prices exclude tax, this is the total before
tax. null under the same conditions as order. |
requestedBy | Associate who placed the Order, with the Associate Roles they hold in the Business
Unit. If the Order can't be read, id holds the Order's id, and the name
fields and roles are empty. If the Associate has left the Business Unit, the
name fields and roles are empty. |
createdAt | Date and time (UTC) the Approval Flow was created. |
matchedRulesArray of ApprovalRule | Approval Rules that the Order matched. All of them must be satisfied. Each rule has its own approver tiers. |
eligibleApproverRolesArray of AssociateRole | Associate Roles that can approve, across all matched Approval Rules. |
pendingApproverRolesArray of AssociateRole | Associate Roles still required for approval, across all remaining tiers. |
currentTierPendingApproverRolesArray of AssociateRole | Associate Roles required by the currently active tiers. More than one tier can be active at once, one for each matched Approval Rule. |
decisionsArray of ApprovalDecision | Approvals recorded so far, oldest first. |
rejection | Rejection of the Approval Flow. null unless approvalState is REJECTED. |
availableActionsArray of ApprovalFlowAction | Actions that the current Associate can take on the Approval Flow. Empty unless the
flow is Can be PENDING, the Associate has the UPDATE_APPROVAL_FLOWS permission, and
they hold a role in currentTierPendingApproverRoles.APPROVE, or REJECT |
Approval Rule
idID | Unique identifier of the Approval Rule. |
keyString | User-defined identifier of the Approval Rule, unique within the Business Unit.
null if no key is set. |
nameString | Name of the Approval Rule. |
descriptionString | Description of the Approval Rule. |
approvalRuleState | State of the Approval Rule. Can beACTIVE, or INACTIVE |
conditionsArray of ApprovalCondition | Typed conditions of the Approval Rule. Complete only if conditionsFullyTyped is
true. |
predicateString | Stored Order
Predicate
of the Approval Rule, read-only. Read it when conditionsFullyTyped is false.
To change the conditions, set conditions in the input instead. |
conditionsFullyTypedBoolean | Whether
conditions represents the whole predicate.If false, the Approval Rule contains clauses that this API can't express. Don't
present such a rule as unconditional, and don't replace its conditions. |
approverTiersArray of ApproverTier | Approver hierarchy of the Approval Rule, in tier order. |
requesterRolesArray of AssociateRole | Associate Roles whose Orders the Approval Rule applies to. |
Approval Condition
A typed condition of an Approval Rule. An Order must meet all conditions of an Approval Rule for the rule to match.
field | What the condition tests. Can beORDER_TOTAL, ORDER_CURRENCY, or SHIPPING_COUNTRY |
operator | How the condition compares the Order value. Can beGT, GTE, LT, LTE, or EQ |
threshold | Threshold amount, in the currency it was set in. Set only for ORDER_TOTAL. |
codeString | Currency code (ISO 4217) for ORDER_CURRENCY, or country code (ISO 3166-1
alpha-2) for SHIPPING_COUNTRY. null for ORDER_TOTAL. |
Approver Tier
A tier of the approver hierarchy of an Approval Rule. Tiers are approved in order. Within a tier, every group must be satisfied. For example, to require approval from both a finance role and a legal role, use two groups in one tier.
order.orderInt | Position of the tier in the hierarchy, starting at 1. |
groupsArray of ApproverGroup | Groups that must all be satisfied to approve the tier. |
Approver Group
A group of Associate Roles within an approver tier. An approval from an Associate who holds any one of these roles satisfies the group.
rolesArray of AssociateRole | Associate Roles in the group. |
Approval Decision
Approval Rejection
Approval Flow Connection
approvals.edgesArray of ApprovalFlowEdge | Approval Flows on this page, with their cursors. |
nodesArray of ApprovalFlow | Approval Flows on this page, in the same order as edges. |
pageInfo | Information for getting the next or previous page. |
totalCountInt | Total number of Approval Flows that match the query, across all pages. |
Approval Flow Edge
ApprovalFlowConnection.node | The Approval Flow. |
cursorString | Opaque cursor of this item. Pass it as after to get the items that follow it. |
Approval Rule Connection
approvalRules.edgesArray of ApprovalRuleEdge | Approval Rules on this page, with their cursors. |
nodesArray of ApprovalRule | Approval Rules on this page, in the same order as edges. |
pageInfo | Information for getting the next or previous page. |
totalCountInt | Total number of Approval Rules that match the query, across all pages. |
Approval Rule Edge
ApprovalRuleConnection.node | The Approval Rule. |
cursorString | Opaque cursor of this item. Pass it as after to get the items that follow it. |
Approval State
Decision state of an Approval Flow.
PENDING- The Approval Flow isn't fully approved or rejected yet.
APPROVED- All approvers required by the matched Approval Rules have approved.
REJECTED- An approver rejected the Approval Flow.
Approval Flow Action
ApprovalFlow.availableActions can offer.APPROVE- Approve the Order with `approveOrder`.
REJECT- Reject the Order with `rejectOrder`.
Approval Rule State
Whether an Approval Rule is in effect.
ACTIVE- The Approval Rule is matched against Orders.
INACTIVE- The Approval Rule isn't matched against Orders.
Approval Condition Field
Order value that a typed approval condition tests.
ORDER_TOTAL- Total of the Order, compared against a threshold in a given currency.
ORDER_CURRENCY- Currency of the Order.
SHIPPING_COUNTRY- Country of the Order. The condition tests the `country` field of the [Order](https://docs.commercetools.com/api/projects/orders#ctp:api:type:Order), which is used for price selection, not the country of the shipping address.
Approval Condition Operator
ApprovalConditionInput.GT- Greater than.
GTE- Greater than or equal to.
LT- Less than.
LTE- Less than or equal to.
EQ- Equal to.
Approval Flow Result
approveOrder and rejectOrder.approvalFlow | The Approval Flow after the mutation. null if the mutation failed. |
userErrorsArray of UserError | Errors that prevented the mutation. Empty on success. |
Approval Rule Result
createApprovalRule, updateApprovalRule, and
setApprovalRuleActive.approvalRule | The Approval Rule after the mutation. null if the mutation failed. |
userErrorsArray of UserError | Errors that prevented the mutation. Empty on success. |
Input types
Create Business Unit Input
New Division under an existing Business Unit.
ACTIVE.keyString | User-defined unique identifier of the new Business Unit. A key that is already in
use is refused with BUSINESS_UNIT_KEY_EXISTS. |
nameString | Name of the new Business Unit. |
parentUnitKeyString | Key of the parent Company or Division. The current Associate must hold a role there
that has the ADD_CHILD_UNITS permission. Otherwise, the mutation is refused with
NOT_AUTHORIZED. |
contactEmailString | Email address of the new Business Unit. |
Add Associate Input
New Associate of the active Business Unit.
emailString | Email address of the Customer to add. The Customer must already have an account in the Project. |
roleKeysArray of String | Keys of the Associate Roles to assign. An unknown key is refused with
ASSOCIATE_ROLE_NOT_FOUND. |
inheritance | Inheritance mode for every role assigned here. If omitted, each assignment gets the
platform default, Can be DISABLED. See
AssociateRoleAssignmentDraft.ENABLED, or DISABLED |
Update Associate Roles Input
New role assignment of an existing Associate.
associateIdID | ID of the Associate to update. The Business Unit is taken from this ID, so an Associate of a child unit is updated in that child unit. |
roleKeysArray of String | Keys of the Associate Roles that the Associate holds after the update. Replaces all
current roles. An unknown key is refused with ASSOCIATE_ROLE_NOT_FOUND. |
inheritance | Inheritance mode for every role assigned here. If omitted, a role the Associate
already holds keeps its current mode, and a newly assigned role gets the platform
default, Can be DISABLED.ENABLED, or DISABLED |
Quote Request Filter
quoteRequests. A Quote Request must match every field you set.queryString | Matches a Quote Request whose reference equals this value. The match is exact,
not a substring search. |
quoteRequestStateArray of QuoteRequestState | Matches Quote Requests in any of these states. Can be UNKNOWN matches nothing.SUBMITTED, UNDER_REVIEW, ACCEPTED, REJECTED, CANCELLED, CLOSED, or UNKNOWN |
Quote Filter
quotes. A Quote must match every field you set.queryString | Matches a Quote whose reference equals this value. The match is exact, not a
substring search. |
quoteStateArray of QuoteState | Matches Quotes in any of these states. Can be UNKNOWN matches nothing.PENDING, DECLINED_FOR_RENEGOTIATION, RENEGOTIATION_ADDRESSED, ACCEPTED, DECLINED, WITHDRAWN, or UNKNOWN |
Request Quote Input
Buyer details for a new Quote Request.
messageString | Message to the Seller. Stored as the comment of the Quote Request. |
purchaseOrderNumberString | Purchase order number of the Buyer for this request. It can't be changed after the request is created. |
Renegotiate Quote Input
Renegotiation request for a Quote.
quoteIdID | ID of the Quote to renegotiate. |
messageString | Message to the Seller that explains what to change. Stored as the buyerComment
of the Quote. |
Approval Flow Filter
approvals.approvalStateArray of ApprovalState | Matches Approval Flows in any of these states. Can bePENDING, APPROVED, or REJECTED |
Approval Rule Filter
approvalRules.approvalRuleStateArray of ApprovalRuleState | Matches Approval Rules in any of these states. Can beACTIVE, or INACTIVE |
Create Approval Rule Input
Definition of a new Approval Rule.
keyString | User-defined identifier of the Approval Rule, unique within the Business Unit. |
nameString | Name of the Approval Rule. |
descriptionString | Description of the Approval Rule. |
conditionsArray of ApprovalConditionInput | Conditions that an Order must meet for the Approval Rule to apply. An empty list is
refused with CONDITION_NOT_SUPPORTED. |
approverTiersArray of ApproverTierInput | Approver hierarchy, in tier order. An empty list is refused with
APPROVER_TIERS_REQUIRED. |
requesterRoleKeysArray of String | Keys of the Associate Roles whose Orders the Approval Rule applies to. An unknown
key is refused with ASSOCIATE_ROLE_NOT_FOUND. |
approvalRuleState | Initial state of the Approval Rule. Default: Can be ACTIVE.ACTIVE, or INACTIVE |
Update Approval Rule Input
null
fields keep their current value. To change the state, use setApprovalRuleActive.conditions replaces the whole predicate of the Approval Rule. For a rule
whose conditionsFullyTyped is false, this is refused with
CONDITION_NOT_SUPPORTED.idID | ID of the Approval Rule to update. |
keyString | New key of the Approval Rule. |
nameString | New name of the Approval Rule. |
descriptionString | New description of the Approval Rule. |
conditionsArray of ApprovalConditionInput | New conditions, which replace all current conditions. Validated the same way as in
CreateApprovalRuleInput. |
approverTiersArray of ApproverTierInput | New approver hierarchy, which replaces the current one. |
requesterRoleKeysArray of String | New requester role keys, which replace the current ones. |
Approval Condition Input
field requires:ORDER_TOTAL:amountInMinorUnitsandcurrency, with any operator.ORDER_CURRENCYorSHIPPING_COUNTRY:code, with theEQoperator.
CONDITION_NOT_SUPPORTED. The field of
the error points to the value that is wrong, except for an extra value on
ORDER_CURRENCY or SHIPPING_COUNTRY, where it points to the condition's
field.field | What the condition tests. Can beORDER_TOTAL, ORDER_CURRENCY, or SHIPPING_COUNTRY |
operator | How the condition compares the Order value. Can beGT, GTE, LT, LTE, or EQ |
amountInMinorUnitsInt | Threshold in the minor units of currency, for example 500000 for 5,000.00
GBP. Required for ORDER_TOTAL, and must be a non-negative whole number. Not
allowed for other fields. |
currencyString | Currency code (ISO 4217) of the threshold. Required for ORDER_TOTAL, and the
condition then matches only Orders in this currency. Not allowed for other fields. |
codeString | Currency code (ISO 4217) for ORDER_CURRENCY, or country code (ISO 3166-1
alpha-2) for SHIPPING_COUNTRY. Must contain letters only. Not allowed for
ORDER_TOTAL. |
Approver Tier Input
ApproverTier for when a tier is
satisfied. For a tier that any of several roles can approve, pass a single group.groupsArray of ApproverGroupInput | Groups of the tier. An empty list is refused with APPROVER_TIERS_REQUIRED. |
Approver Group Input
ApproverGroup for when a
group is satisfied.roleKeysArray of String | Keys of the Associate Roles in the group. An empty list is refused with
APPROVER_TIERS_REQUIRED, and an unknown key with ASSOCIATE_ROLE_NOT_FOUND. |