Skip to content
gist.link ↗

quoteInvoiceShipping

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

Quote live shipping rates for an invoice from the shipping service (persisted there, so every rate has a uuid). Stores the address + quote on the invoice and drops any current shipping line. Only rates in the invoice currency are returned. Fails with UPSTREAM_UNAVAILABLE when shipping is unreachable — never free shipping. Draft/open, unpaid invoices only. ROLE_ADMIN or ROLE_PAY_MANAGER.

pay:mutation:quoteInvoiceShipping

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 {
quoteInvoiceShipping(invoiceId: String!, input: QuoteInvoiceShippingInput!): InvoiceShippingQuote!
}
Argument Type Required Description
invoiceId String! Yes —
input QuoteInvoiceShippingInput! Yes —

InvoiceShippingQuote! — 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 QuoteInvoiceShipping($invoiceId: String!, $input: QuoteInvoiceShippingInput!) { quoteInvoiceShipping(invoiceId: $invoiceId, input: $input) { shipment_uuid messages } }",
"variables": {
"invoiceId": "example",
"input": {
"address": {
"line1": "example",
"city": "example",
"country": "example"
}
}
}
}
JSON