Examples#

Practical step-by-step guides for common tasks with the Afosto GraphQL API.

Cart and checkout#

Orders#

  • Create an order — Create an order manually with a contact, organisation, or project as customer, optionally set an expiration date, then add products with custom prices or discounts.
  • List orders — Fetch a paginated list of orders, with optional filtering by email, order number, ID, progress, or creation date.
  • Change the billing address on an order — Update or replace the billing address attached to an existing order.
  • Cancel order items — Cancel items before shipment, approve the cancellation, optionally credit back fees and restock, then finish the process.
  • Return order items — Process a customer return after delivery: receive the items back, approve the settlement, optionally credit fees and restock, then finish.

Payments and invoicing#

Fulfilment and shipping#

  • Create a parcel and add track & trace — Group order items into a parcel for a delivery, attach a carrier tracking number, and expose it to the customer.
  • Ship order items — Ship items through a connected carrier, an existing parcel, or your own track & trace, generate shipping labels, and mark the parcel as shipped.
  • Set and read shipping dates and track & trace — Set the suggested ship date and expected delivery date on order items, read the actual shipping date once the delivery is processed, and retrieve the carrier tracking link.
Query Runnerhttps://afosto.app/graphql

No query loaded

Click play on any code block in the docs to load a query here.