Skip to content
gist.link ↗

createDiscount

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

Create a discount code. ADMIN.

shop:mutation:createDiscount

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 {
createDiscount(input: DiscountInput!): Discount!
}
Argument Type Required Description
input DiscountInput! Yes —

Discount! — 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 CreateDiscount($input: DiscountInput!) { createDiscount(input: $input) { id uuid type currency created_at updated_at } }",
"variables": {
"input": {
"code": "example",
"type": "example",
"value": 10
}
}
}
JSON