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:

NameTypeRequiredDescription
DateTime
Scalar
OptionalDate and time as Unix milliseconds (e.g. 1705312200000)
Money
Scalar
OptionalMonetary value without currency symbol or code — pair with Currency
Currency
Scalar
OptionalISO 4217 currency code (e.g. EUR, USD)
Int64
Scalar
Optional64-bit integer (used for timestamps, prices, and large numeric values)
PremiseNumber
Scalar
OptionalHouse/apartment number — can be a string or integer
QueryFilter
Scalar
OptionalQuery string for filtering list endpoints
JsonObject
Scalar
OptionalArbitrary JSON object
Any
Scalar
OptionalAny value
RuleWhenClause
Scalar
OptionalRule condition clause for rule sets
Upload
Scalar
OptionalMultipart file upload

Common object types#

Address#

Represents a physical address.

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the address
country_code
String
OptionalISO 3166-1 alpha-2 country code
administrative_area
String
OptionalAdministrative area (state, province)
locality
String
OptionalLocality (city)
dependent_locality
String
OptionalDependent locality (district, suburb)
postal_code
String
OptionalPostal/ZIP code
sorting_code
String
OptionalSorting code
address_line_1
String
OptionalAddress line 1
address_line_2
String
OptionalAddress line 2
thoroughfare
String
OptionalStreet, road, or avenue
premise_number
PremiseNumber
OptionalHouse/apartment number
premise_number_suffix
String
OptionalPremise number suffix (e.g. A, B)
organisation
String
OptionalOrganisation name at this address
given_name
String
OptionalFirst name of the contact person
additional_name
String
OptionalMiddle name of the contact person
family_name
String
OptionalLast name of the contact person
geo_location
Geolocation
OptionalGeolocation details
created_at
DateTime!
RequiredCreation date (unix millis)
is_valid
Boolean!
RequiredWhether the address is valid
errors
[String!]!
RequiredValidation errors (if any)

PhoneNumber#

Represents a phone number.

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the phone number
country_code
String!
RequiredCountry code (e.g. NL, US)
number
String!
RequiredFormatted phone number
national
String!
RequiredNational formatting of the phone number
type
String!
RequiredType of phone number (e.g. MOBILE, FIXED_LINE)
created_at
DateTime!
RequiredCreation date (unix millis)

PageInfo#

Pagination metadata returned with every connection.

NameTypeRequiredDescription
hasPreviousPage
Boolean!
RequiredWhether there are more items before this page
hasNextPage
Boolean!
RequiredWhether there are more items after this page
startCursor
String!
RequiredCursor of the first item in this page
endCursor
String!
RequiredCursor 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.

NameTypeRequiredDescription
PENDING
enum
OptionalOrder has been created but not yet opened
OPEN
enum
OptionalOrder is open and being processed
CONFIRMED
enum
OptionalOrder has been confirmed

OrderItemProgress#

The progress of an individual order item.

NameTypeRequiredDescription
CONCEPT
enum
OptionalItem is in concept/draft state
ACCEPTED
enum
OptionalItem has been accepted
CONFIRMED
enum
OptionalItem has been confirmed
CANCELLED
enum
OptionalItem has been cancelled
FINISHED
enum
OptionalItem processing is finished
MISSING
enum
OptionalItem is missing from inventory
RETURN
enum
OptionalItem is being returned

PaymentStatus#

The status of a payment.

NameTypeRequiredDescription
PENDING
enum
OptionalPayment is pending
PAID
enum
OptionalPayment has been completed
CANCELLED
enum
OptionalPayment has been cancelled
EXPIRED
enum
OptionalPayment has expired

ParcelStatus#

The status of a parcel.

NameTypeRequiredDescription
OPEN
enum
OptionalParcel is open (being prepared)
ANNOUNCED
enum
OptionalParcel has been announced to the carrier
IN_TRANSIT
enum
OptionalParcel is in transit
DELIVERED
enum
OptionalParcel has been delivered
READY_TO_COLLECT
enum
OptionalParcel is ready for collection at a pick-up point

RmaStatus#

The status of a return merchandise authorisation.

NameTypeRequiredDescription
CONCEPT
enum
OptionalRMA is in concept/draft state
OPEN
enum
OptionalRMA is open and being processed
CLOSED
enum
OptionalRMA has been closed

PicklistState#

The state of a picklist.

NameTypeRequiredDescription
PENDING
enum
OptionalPicklist is pending
PROCESSING
enum
OptionalPicklist is being processed
FINISHED
enum
OptionalPicklist has been completed

OrganisationType#

NameTypeRequiredDescription
DEFAULT
enum
OptionalNormal organisation
SHARED
enum
OptionalOrganisation that contacts can sign in for

TrackingEvent#

NameTypeRequiredDescription
VIEW_CART
enum
OptionalTrack the view cart event
BEGIN_CHECKOUT
enum
OptionalTrack the begin checkout event

ItemType#

NameTypeRequiredDescription
OFFER
enum
OptionalStandard offer item
CANCEL
enum
OptionalCancelled item
RETURN
enum
OptionalReturned item
BUNDLE
enum
OptionalBundle item
PART
enum
OptionalPart of a bundle
LOOSE_RETURN
enum
OptionalLoose return (not linked to original order)
PRICED_BUNDLE
enum
OptionalBundle with its own price
PRICED_PART
enum
OptionalBundle part with its own price

FulfilmentType#

NameTypeRequiredDescription
RETAILER
enum
OptionalFulfilled by the retailer
THIRD_PARTY
enum
OptionalFulfilled by a third party

Input types#

Input types are used to pass structured data to mutations.

AddressInput#

Address input for mutations.

NameTypeRequiredDescription
country_code
String
OptionalISO 3166-1 alpha-2 country code
administrative_area
String
OptionalAdministrative area (state, province)
locality
String
OptionalLocality (city)
dependent_locality
String
OptionalDependent locality (district, suburb)
postal_code
String
OptionalPostal/ZIP code
sorting_code
String
OptionalSorting code
address_line_1
String
OptionalAddress line 1
address_line_2
String
OptionalAddress line 2
thoroughfare
String
OptionalStreet, road, or avenue
premise_number
PremiseNumber
OptionalHouse/apartment number
premise_number_suffix
String
OptionalPremise number suffix
organisation
String
OptionalOrganisation name at this address
given_name
String
OptionalFirst name of the contact person
additional_name
String
OptionalMiddle name of the contact person
family_name
String
OptionalLast name of the contact person
override
Boolean
OptionalSet to true to disable address validation

CartInput#

Input for creating a new cart.

NameTypeRequiredDescription
id
String
OptionalOptional ID for the cart
customer
CustomerInput
OptionalCustomer to attach to the cart
coupons
[String!]
OptionalCoupon codes to apply
channel_id
String
OptionalChannel ID (required when not using a storefront token)
country_code
String
OptionalShipping country code
currency
Currency
OptionalCurrency for the cart
session_id
String
OptionalSession ID for tracking
success_return_url
String
OptionalURL after successful checkout
failure_return_url
String
OptionalURL after failed checkout

OrderItemInput#

Input for adding items to an order.

NameTypeRequiredDescription
sku
String!
RequiredSKU of the item
quantity
Int!
RequiredQuantity of the item
label
String
OptionalLabel/name/title of the item
brand
String
OptionalBrand of the item
image
String
OptionalImage URL of the item
url
String
OptionalURL of the item
price
Int64
OptionalPrice of the item
original_price
Int64
OptionalOriginal price (before discounts)
weight
Int64
OptionalWeight in milligrams
hs_code
String
OptionalHarmonised System code
country_of_origin
String
OptionalCountry of origin
batch_number
String
OptionalBatch number
serial_number
String
OptionalSerial number
meta_data
JsonObject
OptionalArbitrary metadata
children
[OrderItemInput!]
OptionalChild items (bundles)

Connections (pagination)#

List fields follow the Relay Connection spec. Every paginated list returns a connection type with pageInfo and edges:

NameTypeRequiredDescription
pageInfo
PageInfo!
RequiredPagination metadata
edges
[Edge!]!
RequiredList of edges, each containing a cursor and node
query {
  orders(first: 10, after: "cursor123") {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      cursor
      node {
        id
        number
      }
    }
  }
}
Query Runnerhttps://afosto.app/graphql

No query loaded

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