Skip to content
gist.link ↗

createPurchaseOrder

Mutation Pay API — POST https://pay.api.gist.link/graphql

Create a DRAFT purchase order for shop catalog variants. Every line’s variant must exist in shop (title + SKU are snapshotted). currency defaults to the supplier’s currency. ROLE_ADMIN or ROLE_PAY_MANAGER.

pay:mutation:createPurchaseOrder

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

type Mutation {
createPurchaseOrder(input: PurchaseOrderInput!): PurchaseOrder!
}
Argument Type Required Description
input PurchaseOrderInput! Yes —

PurchaseOrder! — see the Pay types reference.

Terminal window
curl https://pay.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "mutation CreatePurchaseOrder($input: PurchaseOrderInput!) { createPurchaseOrder(input: $input) { id uuid status currency total created_at updated_at } }",
"variables": {
"input": {
"supplier_id": "example",
"currency": "example",
"shop_location_uuid": "example"
}
}
}
JSON