Types & Scalars#
The Afosto GraphQL schema uses standard GraphQL types plus several custom scalars, enums, and structured input/object types.
Custom scalars#
Beyond the standard GraphQL scalars (String, Int, Float, Boolean, ID), the API defines these custom scalars:
| Name | Type | Required | Description |
|---|---|---|---|
DateTime | Scalar | Optional | Date and time as Unix milliseconds (e.g. 1705312200000) |
Money | Scalar | Optional | Monetary value without currency symbol or code — pair with Currency |
Currency | Scalar | Optional | ISO 4217 currency code (e.g. EUR, USD) |
Int64 | Scalar | Optional | 64-bit integer (used for timestamps, prices, and large numeric values) |
PremiseNumber | Scalar | Optional | House/apartment number — can be a string or integer |
QueryFilter | Scalar | Optional | Query string for filtering list endpoints |
JsonObject | Scalar | Optional | Arbitrary JSON object |
Any | Scalar | Optional | Any value |
RuleWhenClause | Scalar | Optional | Rule condition clause for rule sets |
Upload | Scalar | Optional | Multipart file upload |
Common object types#
Address#
Represents a physical address.
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID of the address |
country_code | String | Optional | ISO 3166-1 alpha-2 country code |
administrative_area | String | Optional | Administrative area (state, province) |
locality | String | Optional | Locality (city) |
dependent_locality | String | Optional | Dependent locality (district, suburb) |
postal_code | String | Optional | Postal/ZIP code |
sorting_code | String | Optional | Sorting code |
address_line_1 | String | Optional | Address line 1 |
address_line_2 | String | Optional | Address line 2 |
thoroughfare | String | Optional | Street, road, or avenue |
premise_number | PremiseNumber | Optional | House/apartment number |
premise_number_suffix | String | Optional | Premise number suffix (e.g. A, B) |
organisation | String | Optional | Organisation name at this address |
given_name | String | Optional | First name of the contact person |
additional_name | String | Optional | Middle name of the contact person |
family_name | String | Optional | Last name of the contact person |
geo_location | Geolocation | Optional | Geolocation details |
created_at | DateTime! | Required | Creation date (unix millis) |
is_valid | Boolean! | Required | Whether the address is valid |
errors | [String!]! | Required | Validation errors (if any) |
PhoneNumber#
Represents a phone number.
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID of the phone number |
country_code | String! | Required | Country code (e.g. NL, US) |
number | String! | Required | Formatted phone number |
national | String! | Required | National formatting of the phone number |
type | String! | Required | Type of phone number (e.g. MOBILE, FIXED_LINE) |
created_at | DateTime! | Required | Creation date (unix millis) |
PageInfo#
Pagination metadata returned with every connection.
| Name | Type | Required | Description |
|---|---|---|---|
hasPreviousPage | Boolean! | Required | Whether there are more items before this page |
hasNextPage | Boolean! | Required | Whether there are more items after this page |
startCursor | String! | Required | Cursor of the first item in this page |
endCursor | String! | Required | Cursor of the last item in this page |
Enums#
Enums are predefined sets of allowed values used throughout the API.
OrderProgress#
The progress of an order.
| Name | Type | Required | Description |
|---|---|---|---|
PENDING | enum | Optional | Order has been created but not yet opened |
OPEN | enum | Optional | Order is open and being processed |
CONFIRMED | enum | Optional | Order has been confirmed |
OrderItemProgress#
The progress of an individual order item.
| Name | Type | Required | Description |
|---|---|---|---|
CONCEPT | enum | Optional | Item is in concept/draft state |
ACCEPTED | enum | Optional | Item has been accepted |
CONFIRMED | enum | Optional | Item has been confirmed |
CANCELLED | enum | Optional | Item has been cancelled |
FINISHED | enum | Optional | Item processing is finished |
MISSING | enum | Optional | Item is missing from inventory |
RETURN | enum | Optional | Item is being returned |
PaymentStatus#
The status of a payment.
| Name | Type | Required | Description |
|---|---|---|---|
PENDING | enum | Optional | Payment is pending |
PAID | enum | Optional | Payment has been completed |
CANCELLED | enum | Optional | Payment has been cancelled |
EXPIRED | enum | Optional | Payment has expired |
ParcelStatus#
The status of a parcel.
| Name | Type | Required | Description |
|---|---|---|---|
OPEN | enum | Optional | Parcel is open (being prepared) |
ANNOUNCED | enum | Optional | Parcel has been announced to the carrier |
IN_TRANSIT | enum | Optional | Parcel is in transit |
DELIVERED | enum | Optional | Parcel has been delivered |
READY_TO_COLLECT | enum | Optional | Parcel is ready for collection at a pick-up point |
RmaStatus#
The status of a return merchandise authorisation.
| Name | Type | Required | Description |
|---|---|---|---|
CONCEPT | enum | Optional | RMA is in concept/draft state |
OPEN | enum | Optional | RMA is open and being processed |
CLOSED | enum | Optional | RMA has been closed |
PicklistState#
The state of a picklist.
| Name | Type | Required | Description |
|---|---|---|---|
PENDING | enum | Optional | Picklist is pending |
PROCESSING | enum | Optional | Picklist is being processed |
FINISHED | enum | Optional | Picklist has been completed |
OrganisationType#
| Name | Type | Required | Description |
|---|---|---|---|
DEFAULT | enum | Optional | Normal organisation |
SHARED | enum | Optional | Organisation that contacts can sign in for |
TrackingEvent#
| Name | Type | Required | Description |
|---|---|---|---|
VIEW_CART | enum | Optional | Track the view cart event |
BEGIN_CHECKOUT | enum | Optional | Track the begin checkout event |
ItemType#
| Name | Type | Required | Description |
|---|---|---|---|
OFFER | enum | Optional | Standard offer item |
CANCEL | enum | Optional | Cancelled item |
RETURN | enum | Optional | Returned item |
BUNDLE | enum | Optional | Bundle item |
PART | enum | Optional | Part of a bundle |
LOOSE_RETURN | enum | Optional | Loose return (not linked to original order) |
PRICED_BUNDLE | enum | Optional | Bundle with its own price |
PRICED_PART | enum | Optional | Bundle part with its own price |
FulfilmentType#
| Name | Type | Required | Description |
|---|---|---|---|
RETAILER | enum | Optional | Fulfilled by the retailer |
THIRD_PARTY | enum | Optional | Fulfilled by a third party |
Input types#
Input types are used to pass structured data to mutations.
AddressInput#
Address input for mutations.
| Name | Type | Required | Description |
|---|---|---|---|
country_code | String | Optional | ISO 3166-1 alpha-2 country code |
administrative_area | String | Optional | Administrative area (state, province) |
locality | String | Optional | Locality (city) |
dependent_locality | String | Optional | Dependent locality (district, suburb) |
postal_code | String | Optional | Postal/ZIP code |
sorting_code | String | Optional | Sorting code |
address_line_1 | String | Optional | Address line 1 |
address_line_2 | String | Optional | Address line 2 |
thoroughfare | String | Optional | Street, road, or avenue |
premise_number | PremiseNumber | Optional | House/apartment number |
premise_number_suffix | String | Optional | Premise number suffix |
organisation | String | Optional | Organisation name at this address |
given_name | String | Optional | First name of the contact person |
additional_name | String | Optional | Middle name of the contact person |
family_name | String | Optional | Last name of the contact person |
override | Boolean | Optional | Set to true to disable address validation |
CartInput#
Input for creating a new cart.
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Optional | Optional ID for the cart |
customer | CustomerInput | Optional | Customer to attach to the cart |
coupons | [String!] | Optional | Coupon codes to apply |
channel_id | String | Optional | Channel ID (required when not using a storefront token) |
country_code | String | Optional | Shipping country code |
currency | Currency | Optional | Currency for the cart |
session_id | String | Optional | Session ID for tracking |
success_return_url | String | Optional | URL after successful checkout |
failure_return_url | String | Optional | URL after failed checkout |
OrderItemInput#
Input for adding items to an order.
| Name | Type | Required | Description |
|---|---|---|---|
sku | String! | Required | SKU of the item |
quantity | Int! | Required | Quantity of the item |
label | String | Optional | Label/name/title of the item |
brand | String | Optional | Brand of the item |
image | String | Optional | Image URL of the item |
url | String | Optional | URL of the item |
price | Int64 | Optional | Price of the item |
original_price | Int64 | Optional | Original price (before discounts) |
weight | Int64 | Optional | Weight in milligrams |
hs_code | String | Optional | Harmonised System code |
country_of_origin | String | Optional | Country of origin |
batch_number | String | Optional | Batch number |
serial_number | String | Optional | Serial number |
meta_data | JsonObject | Optional | Arbitrary metadata |
children | [OrderItemInput!] | Optional | Child items (bundles) |
Connections (pagination)#
List fields follow the Relay Connection spec. Every paginated list returns a connection type with pageInfo and edges:
| Name | Type | Required | Description |
|---|---|---|---|
pageInfo | PageInfo!▾ | Required | Pagination metadata |
edges | [Edge!]!▾ | Required | List of edges, each containing a cursor and node |