Skip to content
gist.link ↗

Pay API

Invoice your customers: products, invoices, payments, refunds, and checkout.

Endpoint POST https://pay.api.gist.link/graphql
Token audience audience=pay
Permission prefix pay:

Mint an access token for this API with your IAM key and audience=pay — see Authentication.

Operation Required permission Description
billPayment pay:query:billPayment A single bill payment by uuid. Any org member.
billPayments pay:query:billPayments Cursor-paginated outbound bill payments (wire/EFT). Any org member.
checkoutSessions pay:query:checkoutSessions Checkout sessions for an invoice (newest first). Any org member.
crmCompanies pay:query:crmCompanies Search the CRM customer book’s companies for the invoice customer picker. Any org member.
crmContacts pay:query:crmContacts Search CRM contacts, optionally scoped to one company. Any org member.
crmSegments pay:query:crmSegments Static CRM segments for the new-customer segment picker (proxied from CRM). Any org member.
customer pay:query:customer A single customer by uuid. Any org member.
customers pay:query:customers Cursor-paginated customers (billing profiles). Any org member.
customerStats pay:query:customerStats Invoice stats per customer email (campaigns audience enrichment). One entry per requested email that exists as a customer in the org; unknown emails are omitted. Max 500 emails. Counts issued invoices only (open, paid, uncollectible — drafts and voids excluded). Money is summed only in the customer’s dominant currency (most invoices). ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE.
invoice pay:query:invoice A single invoice by uuid. Any org member.
invoices pay:query:invoices Cursor-paginated invoices for the caller’s organization. Any org member.
invoiceShippingSuggestion pay:query:invoiceShippingSuggestion Suggested ship-to for an invoice: its stored shipping address, else the customer’s CRM contact default shipping address, else its CRM company’s (CRM is the suite’s only address book). Best-effort; null when nothing usable. Any org member.
payment pay:query:payment A single payment by uuid. Any org member.
paymentMethods pay:query:paymentMethods Vaulted payment methods for one customer (newest first). ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE.
paymentProviderCatalog pay:query:paymentProviderCatalog Supported payment processors and their required connection fields. Any org member.
paymentProviderConnections pay:query:paymentProviderConnections The caller organization’s connected payment processors. Credentials are never returned.
payments pay:query:payments Cursor-paginated payments for the caller’s organization. Any org member.
purchaseOrder pay:query:purchaseOrder A single purchase order by uuid. Any org member.
purchaseOrders pay:query:purchaseOrders Cursor-paginated purchase orders (sort fields: created_at, number, total, expected_at, status). Any org member.
refunds pay:query:refunds Cursor-paginated refunds, optionally scoped to one payment. Any org member.
shopLocations pay:query:shopLocations Active shop stock locations (purchase-order receiving picker). ROLE_ADMIN or ROLE_PAY_MANAGER.
shopProducts pay:query:shopProducts Search the shop catalog (the suite’s single product catalog) for invoice lines and purchase orders. Proxied from shop with a service token; archived products are excluded. Fails with UPSTREAM_UNAVAILABLE when shop is unreachable. ROLE_ADMIN or ROLE_PAY_MANAGER.
supplier pay:query:supplier A single supplier by uuid (masked bank data only). Any org member.
suppliers pay:query:suppliers Cursor-paginated supplier (payee) profiles — masked bank data only. Any org member.
taxRate pay:query:taxRate A single tax rate by uuid (managed in the settings app). Any org member.
taxRates pay:query:taxRates Cursor-paginated configurable tax rates (managed in the settings app, proxied here). Any org member.
Operation Required permission Description
cancelBillPayment pay:mutation:cancelBillPayment Cancel a still-pending bill payment. ROLE_ADMIN or ROLE_PAY_MANAGER.
cancelPurchaseOrder pay:mutation:cancelPurchaseOrder draft | ordered -> cancelled. ROLE_ADMIN or ROLE_PAY_MANAGER.
chargeSavedPaymentMethod pay:mutation:chargeSavedPaymentMethod Charge a vaulted payment method off-session (no payer present). Declines come back as a Payment with status failed — never an error. Idempotent on input.idempotency_key (scoped per customer). ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE.
completePaymentMethodSetup pay:mutation:completePaymentMethodSetup Finish vaulting after the browser confirms the setup intent: verifies it succeeded at the PSP and persists the method as a PaymentMethodToken. Idempotent on the resulting PSP payment-method ref. ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE.
connectPaymentProvider pay:mutation:connectPaymentProvider Connect or replace credentials for an organization-owned payment processor account.
createBillPayment pay:mutation:createBillPayment Record an outbound wire/EFT payment to a supplier (status pending — no money moves yet). Idempotent via idempotencyKey. ROLE_ADMIN or ROLE_PAY_MANAGER.
createCheckoutSession pay:mutation:createCheckoutSession Prepare a public payment link for a draft or open invoice. Drafts become open/payable, but no email is sent. Returns the session whose url (${CHECKOUT_BASE_URL}/checkout/<token>) can be shared by the admin — the page requires no login. ROLE_ADMIN or ROLE_PAY_MANAGER.
createCrmCustomer pay:mutation:createCrmCustomer Create a CRM company (optional) + contact on the fly for a new billing customer, directly from the invoice builder. A company is created from a business email domain automatically, or explicitly when companyName is set. ROLE_ADMIN or ROLE_PAY_MANAGER.
createCustomer pay:mutation:createCustomer Create a billing customer. ROLE_ADMIN or ROLE_PAY_MANAGER.
createInvoice pay:mutation:createInvoice Create a draft invoice with its line items. ROLE_ADMIN or ROLE_PAY_MANAGER.
createPaymentMethodSetup pay:mutation:createPaymentMethodSetup Start vaulting a reusable card for a customer: creates the PSP customer if needed and a setup intent, returning the client_secret + publishable key for an embedded payment element in the CALLER’s own frontend (never a PSP-hosted page). ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE — the charge-rail surface sibling GistLink services consume.
createPurchaseOrder pay:mutation:createPurchaseOrder 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.
createSupplier pay:mutation:createSupplier Create a supplier profile. bank_details are ENCRYPTED AT REST (libsodium secretbox) and never returned by the API — only bank_name, bank_country and account_last4 are readable afterwards. ROLE_ADMIN or ROLE_PAY_MANAGER.
disconnectPaymentProvider pay:mutation:disconnectPaymentProvider Permanently remove a processor connection and its encrypted credentials.
markInvoiceUncollectible pay:mutation:markInvoiceUncollectible Mark an open invoice uncollectible (dunning exhausted). ROLE_ADMIN or ROLE_PAY_MANAGER.
markPurchaseOrderOrdered pay:mutation:markPurchaseOrderOrdered draft -> ordered. ROLE_ADMIN or ROLE_PAY_MANAGER.
quoteInvoiceShipping pay:mutation:quoteInvoiceShipping 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.
receivePurchaseOrder pay:mutation:receivePurchaseOrder ordered -> received. Sets inventory_status = pending and asynchronously adds every line’s quantity to shop inventory (receiveInventory, reference “pay:po:<uuid>”, idempotent; retried on failure). ROLE_ADMIN or ROLE_PAY_MANAGER.
refundPayment pay:mutation:refundPayment Refund a succeeded payment (fully when amount is omitted). Idempotent: pass the same idempotencyKey to retry safely. ROLE_ADMIN or ROLE_PAY_MANAGER.
removeInvoiceShipping pay:mutation:removeInvoiceShipping Remove the invoice’s shipping line. ROLE_ADMIN or ROLE_PAY_MANAGER.
removePaymentMethod pay:mutation:removePaymentMethod Detach a vaulted method at the PSP (best-effort) and delete the local token. ROLE_ADMIN, ROLE_PAY_MANAGER or ROLE_SERVICE.
retryPurchaseOrderInventorySync pay:mutation:retryPurchaseOrderInventorySync Re-queue the shop inventory update for a received PO whose inventory_status is failed. ROLE_ADMIN or ROLE_PAY_MANAGER.
sendInvoice pay:mutation:sendInvoice Email a draft or open invoice to the customer. Opens drafts, dispatches the email via Messenger, and guarantees an open checkout session whose public URL is returned on the invoice (checkout_url). ROLE_ADMIN or ROLE_PAY_MANAGER.
setInvoiceShipping pay:mutation:setInvoiceShipping Add/replace the invoice’s single shipping line from a rate of its latest quote and recalculate totals. Shipping is untaxed unless taxRateBps is passed (or PAY_SHIPPING_TAXABLE=1 applies the automatic rate). ROLE_ADMIN or ROLE_PAY_MANAGER.
submitBillPayment pay:mutation:submitBillPayment Submit a pending bill payment to the payout rail: flips it to processing and queues the transfer via Messenger (bank details are decrypted only inside the async handler). ROLE_ADMIN or ROLE_PAY_MANAGER.
updateCustomer pay:mutation:updateCustomer Update a billing customer. ROLE_ADMIN or ROLE_PAY_MANAGER.
updateInvoice pay:mutation:updateInvoice Update a DRAFT invoice (line items are replaced wholesale). ROLE_ADMIN or ROLE_PAY_MANAGER.
updatePaymentProviderConnection pay:mutation:updatePaymentProviderConnection Update a connection without exposing its stored credentials.
updatePurchaseOrder pay:mutation:updatePurchaseOrder Update a DRAFT purchase order; lines, when present, REPLACES every line. ROLE_ADMIN or ROLE_PAY_MANAGER.
updateSupplier pay:mutation:updateSupplier Update a supplier. Passing bank_details REPLACES the sealed blob wholesale. ROLE_ADMIN or ROLE_PAY_MANAGER.
voidInvoice pay:mutation:voidInvoice Void an open/draft invoice. ROLE_ADMIN or ROLE_PAY_MANAGER.