Skip to content
gist.link ↗

setProductOptions

Mutation Shop API — POST https://shop.api.gist.link/graphql

Replace a product’s options (and their values) wholesale. ADMIN.

shop:mutation:setProductOptions

The calling IAM key must hold this permission (or a wildcard that covers it: shop:mutation:* or shop:*) and the access token must have been minted with audience=shop. See Permissions.

type Mutation {
setProductOptions(id: String!, options: [ProductOptionInput!]!): Product!
}
Argument Type Required Description
id String! Yes —
options [ProductOptionInput!]! Yes —

Product! — see the Shop types reference.

Terminal window
curl https://shop.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation SetProductOptions($id: String!, $options: [ProductOptionInput!]!) { setProductOptions(id: $id, options: $options) { id uuid title status created_at updated_at } }",
"variables": {
"id": "example",
"options": [
{
"name": "Example",
"values": [
"example"
]
}
]
}
}
JSON