Queries#
Queries are read-only operations used to fetch data from the API. All queries are sent as POST requests to https://afosto.app/graphql.
account) require a user token obtained via logInCustomer. Most other queries work with a standard API key.account#
Fetch the currently authenticated account. Requires a user token.
No arguments.
Returns: Account
| Name | Type | Required | Description |
|---|---|---|---|
email | String! | Required | Email address |
given_name | String! | Required | First name |
additional_name | String! | Required | Middle name |
family_name | String! | Required | Last name |
Example#
address#
Fetch an address by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the address |
Returns: Address
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
address_line_1 | String! | Required | Street address line 1 |
address_line_2 | String | Optional | Street address line 2 |
locality | String! | Required | City / locality |
Example#
business#
Fetch a physical store location by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the business |
Returns: Business
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
type | String! | Required | Business type |
name | String! | Required | Name |
email | String | Optional | Email address |
Example#
See also: businesses
businesses#
Fetch a paginated list of business locations.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
before | String | Optional | Cursor for backward pagination |
type | String | Optional | Filter by business type |
sort | BusinessesSortInput▾ | Optional | Sort order |
Returns: Business
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
type | String! | Required | Business type |
name | String! | Required | Name |
email | String | Optional | Email address |
Example#
See also: business
cart#
Fetch a cart by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the cart |
intent | TrackingEvent▾ | Optional | Optional tracking event |
Returns: Cart
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID of the cart |
number | String! | Required | Cart number |
total | Money!▾ | Required | Total value |
subtotal | Money!▾ | Required | Total before discounts |
Example#
channel#
Fetch a channel (storefront) by ID. If no ID is provided, the default channel is returned.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Optional | The ID of the channel (optional — omit for default) |
Returns: Channel
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
name | String! | Required | Channel name |
type | String! | Required | Channel type |
locale | String! | Required | Locale (e.g. nl_NL) |
Example#
contact#
Fetch a contact by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the contact |
version | String | Optional | Optional version string for cache busting |
Returns: Contact
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
email | String! | Required | Email address |
given_name | String! | Required | First name |
family_name | String | Optional | Last name |
Example#
invoice#
Fetch an invoice by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the invoice |
Returns: Invoice
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Invoice number |
total | Money!▾ | Required | Total value |
currency | Currency!▾ | Required | Currency code |
Example#
item#
Fetch a single collection item (physical inventory item) by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the item |
Returns: CollectionItem
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
sku | String! | Required | SKU |
label | String! | Required | Display name |
product | Product!▾ | Required | The associated product |
Example#
See also: items
items#
Fetch a paginated list of collection items (inventory items) with filtering.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
before | String | Optional | Cursor for backward pagination |
filters | CollectionItemFilterInput!▾ | Required | Filter criteria |
Returns: CollectionItem
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
sku | String! | Required | SKU |
label | String! | Required | Display name |
product | Product!▾ | Required | The associated product |
Example#
See also: item
order#
Fetch an order by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the order |
options | OrderOptionsInput▾ | Optional | Options to control included pricing data |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money!▾ | Required | Total value |
currency | Currency!▾ | Required | Currency code |
Example#
See also: orders
orders#
Fetch a paginated list of orders with filtering.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
before | String | Optional | Cursor for backward pagination |
id | IdFilter▾ | Optional | Filter by order ID(s) |
progress | OrderProgressFilter▾ | Optional | Filter by progress |
created_at | InequalityFilter▾ | Optional | Filter by creation date |
number | NumberFilter▾ | Optional | Filter by order number |
email | String | Optional | Filter by customer email |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money!▾ | Required | Total value |
currency | Currency!▾ | Required | Currency code |
Example#
See also: order
organisation#
Fetch an organisation by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the organisation |
version | String | Optional | Optional version string |
Returns: Organisation
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
name | String | Optional | Organisation name |
type | OrganisationType!▾ | Required | Type of organisation |
number | String | Optional | Organisation number |
Example#
parcel#
Fetch a parcel (shipment) by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the parcel |
Returns: Parcel
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Parcel number |
status | ParcelStatus!▾ | Required | Current status |
track_trace | TrackTrace!▾ | Required | Track & trace details |
Example#
See also: parcels
parcels#
Fetch a paginated list of parcels with filtering.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
id | IdFilter▾ | Optional | Filter by parcel ID(s) |
delivery_id | IdFilter▾ | Optional | Filter by delivery ID |
track_trace_number | String | Optional | Filter by track & trace number |
Returns: Parcel
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Parcel number |
status | ParcelStatus!▾ | Required | Current status |
track_trace | TrackTrace!▾ | Required | Track & trace details |
Example#
See also: parcel
paymentMethod#
Fetch a payment method by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the payment method |
Returns: PaymentMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
code | String! | Required | Payment method code |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
Example#
See also: paymentMethods
paymentMethods#
Fetch a paginated list of available payment methods.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
before | String | Optional | Cursor for backward pagination |
codes | [String!] | Optional | Filter by payment method codes |
is_manual | Boolean | Optional | Filter by manual payment methods |
sort | PaymentMethodsOrderByInput▾ | Optional | Sort order |
Returns: PaymentMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
code | String! | Required | Payment method code |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
Example#
See also: paymentMethod
phoneNumber#
Fetch a phone number by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the phone number |
Returns: PhoneNumber
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
country_code | String! | Required | Country calling code |
national | String! | Required | National number |
number | String! | Required | Full international number |
Example#
price#
Fetch a price from a price list by item ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the price entry |
Returns: Price
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
sku | String! | Required | SKU this price applies to |
amount | Money!▾ | Required | The price amount |
original_amount | Money!▾ | Required | Original undiscounted amount |
Example#
product#
Fetch a product by SKU.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
sku | String! | Required | The SKU of the product |
Returns: Product
| Name | Type | Required | Description |
|---|---|---|---|
sku | String! | Required | SKU |
label | String! | Required | Display name |
slug | String! | Required | URL slug |
brand | String! | Required | Brand name |
Example#
See also: products
products#
Fetch products by a list of SKUs.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
skus | [String!]! | Required | List of SKUs to fetch |
Returns: Product
| Name | Type | Required | Description |
|---|---|---|---|
sku | String! | Required | SKU |
label | String! | Required | Display name |
slug | String! | Required | URL slug |
brand | String! | Required | Brand name |
Example#
See also: product
productViewingHistory#
Fetch a product viewing history list by token.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
token | String! | Required | The token of the viewing history |
Returns: ProductViewingHistory
| Name | Type | Required | Description |
|---|---|---|---|
label | String! | Required | Label |
token | String! | Required | Token identifier |
items | [ViewingHistoryItem!]!▾ | Required | Viewed items |
expires_at | DateTime!▾ | Required | Expiration date |
Example#
wishlist#
Fetch a wishlist by token.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
token | String! | Required | The token of the wishlist |
Returns: Wishlist
| Name | Type | Required | Description |
|---|---|---|---|
label | String! | Required | Label |
token | String! | Required | Token identifier |
items | [WishlistItem!]!▾ | Required | Items on the wishlist |
expires_at | DateTime!▾ | Required | Expiration date |
Example#
returnMethod#
Fetch a return method by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the return method |
Returns: ReturnMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
carrier | String | Optional | Carrier name |
Example#
See also: returnMethods
returnMethods#
Fetch a paginated list of return methods.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
query | QueryFilter | Optional | Search filter string |
Returns: ReturnMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
carrier | String | Optional | Carrier name |
Example#
See also: returnMethod
shippingMethod#
Fetch a shipping method by ID.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID of the shipping method |
Returns: ShippingMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
carrier | String | Optional | Carrier name |
Example#
See also: shippingMethods
shippingMethods#
Fetch a paginated list of shipping methods.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
first | Int | Optional | Number of items to returnDefault: 10 |
after | String | Optional | Cursor for forward pagination |
before | String | Optional | Cursor for backward pagination |
sort | ShippingMethodsOrderByInput▾ | Optional | Sort order |
Returns: ShippingMethod
| Name | Type | Required | Description |
|---|---|---|---|
id | String! | Required | The ID |
name | String! | Required | Display name |
is_enabled | Boolean! | Required | Whether enabled |
carrier | String | Optional | Carrier name |
Example#
See also: shippingMethod