salesAppBlocks
Requires at least one of the permissions customers:customer:list, customers:customer:read, payments:collection:create, payments:invoice:create, sales:credit_note:create, sales:quote:create, sales:sales_order:create, sales:sales_order:deliver, sales:sales_order:read or sales:sales_order:ship.
The blocks installed apps show on a sales record: sales.order.block (an order) or sales.customer.block (a customer). The record must be one you can see; a block that failed is left out.
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
query SalesAppBlocks($target: String!) {
salesAppBlocks(target: $target) {
title
appName
appHandle
handle
installationId
components {
currencyCode
type
amount
display
label
max
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query SalesAppBlocks($target: String!) {\n salesAppBlocks(target: $target) {\n title\n appName\n appHandle\n handle\n installationId\n components {\n currencyCode\n type\n amount\n display\n label\n max\n }\n }\n}",
"variables": {
"target": "string"
}
}
EOF
Variables:
{
"target": "string"
}
Response:
{
"data": {
"salesAppBlocks": [
{
"title": "string",
"appName": "string",
"appHandle": "string",
"handle": "string",
"installationId": "id",
"components": [
{
"currencyCode": "string",
"type": "string",
"amount": "string",
"display": "string",
"label": "string",
"max": 0
}
]
}
]
}
}
salesAppBlocks(
contextId: ID
target: String!
): [AppBlockView!]!
Arguments
salesAppBlocks.contextId ● ID scalar
The order id or the customer id the screen shows.
salesAppBlocks.target ● String! non-null scalar
The place: sales.order.block or sales.customer.block.
Type
AppBlockView object
One installed app's block for a place in the app. A block that failed is left out, never sent empty.