Skip to content
gist.link ↗

createVariant

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

Add a variant to a product. ADMIN.

shop:mutation:createVariant

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 {
createVariant(productId: String!, input: VariantInput!): Product!
}
Argument Type Required Description
productId String! Yes —
input VariantInput! 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 CreateVariant($productId: String!, $input: VariantInput!) { createVariant(productId: $productId, input: $input) { id uuid title status created_at updated_at } }",
"variables": {
"productId": "example",
"input": {
"title": "Example",
"price": 10,
"currency": "example"
}
}
}
JSON