adminAppBlocks
Requires at least one of the permissions apps:app:read, payments:collection:create, payments:invoice:create, products:product:read, purchase:purchase_order:create, purchase:purchase_order:update, sales:credit_note:create, sales:quote:create, sales:quote:update, sales:sales_invoice:create, sales:sales_order:create, sales:sales_order:deliver, sales:sales_order:read, sales:sales_order:ship or sales:sales_order:update.
The blocks installed apps draw on a page of the admin console: admin.order.details.block (an order), admin.product.details.block (a product) or admin.app.home (the app's own page). 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 AdminAppBlocks($target: String!) {
adminAppBlocks(target: $target) {
title
appName
appHandle
handle
installationId
components {
currencyCode
type
amount
display
formKey
label
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query AdminAppBlocks($target: String!) {\n adminAppBlocks(target: $target) {\n title\n appName\n appHandle\n handle\n installationId\n components {\n currencyCode\n type\n amount\n display\n formKey\n label\n }\n }\n}",
"variables": {
"target": "string"
}
}
EOF
Variables:
{
"target": "string"
}
Response:
{
"data": {
"adminAppBlocks": [
{
"title": "string",
"appName": "string",
"appHandle": "string",
"handle": "string",
"installationId": "id",
"components": [
{
"currencyCode": "string",
"type": "string",
"amount": "string",
"display": "string",
"formKey": "string",
"label": "string"
}
]
}
]
}
}
adminAppBlocks(
contextId: ID
target: String!
): [AppBlockView!]!
Arguments
adminAppBlocks.contextId ● ID scalar
The order id for admin.order.details.block or the product id for admin.product.details.block. Leave it out for admin.app.home.
adminAppBlocks.target ● String! non-null scalar
The place: admin.order.details.block, admin.product.details.block or admin.app.home.
Type
AppBlockView object
One installed app's block for a place in the app. A block that failed is left out, never sent empty.