Skip to content
gist.link ↗

cartLinesAdd

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

Add a variant (by uuid) to a cart. PUBLIC.

shop:mutation:cartLinesAdd

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 {
cartLinesAdd(token: String!, variantId: String!, quantity: Int): Cart!
}
Argument Type Required Description
token String! Yes —
variantId String! Yes —
quantity Int No —

Cart! — 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 CartLinesAdd($token: String!, $variantId: String!, $quantity: Int) { cartLinesAdd(token: $token, variantId: $variantId, quantity: $quantity) { id uuid currency created_at updated_at } }",
"variables": {
"token": "example",
"variantId": "example",
"quantity": 10
}
}
JSON