# Elastic Path GraphQL Schema # Source: https://github.com/elasticpath/elasticpath-graphql-server/tree/main/src/types # This schema is composed from the open-source elasticpath-graphql-server repository. # The GraphQL server acts as a gateway over the Elastic Path Commerce Cloud REST APIs. # ─── General / Shared ──────────────────────────────────────────────────────── type TimeStamps { created_at: String updated_at: String } type DataObj { data: DataVal } type DataArr { data: [DataVal] } type DataVal { type: String id: ID } type Links { current: String first: String last: String prev: String next: String self: String } type Meta { page: Page results: MetaResults } type Page { limit: Int offset: Int current: Int total: Int } type MetaResults { total: Int } input ListInput { page_offset: Int page_limit: Int sort: String filter: String } # ─── Authentication ─────────────────────────────────────────────────────────── type ImplicitToken { expires_in: Int! expires: Int! access_token: String! token_type: String! identifier: String! } type TokenPayload { type: String! id: ID! customer_id: String! token: String! expires: Int! } # ─── Account Tokens ─────────────────────────────────────────────────────────── enum AccountTokenType { account_management_authentication_token } enum AuthenticationMechanism { oidc account_management_authentication_token } type AccountToken { account_name: String! account_id: String! token: String! type: AccountTokenType! expires: String! } input AccountTokenInput { authentication_mechanism: AuthenticationMechanism! oauth_authorization_code: String oauth_redirect_uri: String oauth_code_verifier: String } type AccountAuthenticationSetting { id: String type: String } # ─── Customer ──────────────────────────────────────────────────────────────── enum AuthGrantType { client_credentials implicit refresh_token } type AuthenticatePayload { expires: Int! identifier: String! expires_in: Int! access_token: String! token_type: String! } type Customer { id: ID! type: String name: String email: String } type CustomerAddress { id: ID! type: String! first_name: String! last_name: String! name: String phone_number: String instructions: String company_name: String line_1: String line_2: String city: String county: String postcode: String country: String } input CustomerInput { id: ID name: String email: String password: String } input CustomerAddressInput { id: ID type: String! first_name: String! last_name: String! name: String phone_number: String instructions: String company_name: String line_1: String! line_2: String city: String county: String! postcode: String! country: String! } # ─── Cart ───────────────────────────────────────────────────────────────────── type Amount { amount: Int currency: String formatted: String } type Value { amount: Int currency: String includes_tax: Boolean } type CartItem { id: ID! type: String! name: String! description: String quantity: Int! sku: String! value: Value! unit_price: Value! } input CustomItemInput { name: String! sku: String description: String quantity: Int! price: CustomPrice! } input CustomPrice { amount: Int! includes_tax: Boolean } type Cart { id: ID! name: String description: String priceWithTax: Amount priceWithoutTax: Amount tax: Amount items: [CartItem] } input CustomerInputForCheckout { name: String email: String id: ID } input ContactInputForCheckout { name: String! email: String! } input BillingAddressInput { first_name: String! last_name: String! company_name: String line_1: String! line_2: String city: String postcode: String! county: String! country: String } input ShippingAddressInput { first_name: String! last_name: String! phone_number: String company_name: String line_1: String! line_2: String city: String postcode: String! county: String! country: String instructions: String } type CheckoutCartOrderResult { id: ID! items: [OrderItem] status: String! payment: String! shipping: String! } type OrderItem { id: ID! name: String! product_id: ID! quantity: Int! } type Checkout { id: ID! } # ─── Orders ─────────────────────────────────────────────────────────────────── type Orders { data: [Order] meta: Meta links: Links } type Order { id: ID! type: String status: String payment: String shipping: String customer: OrderCustomer shipping_address: ShippingAddress billing_address: BillingAddress meta: OrderMeta relationships: OrderRelationships } type OrderCustomer { name: String email: String } type OrderRelationships { customer: DataObj items: DataArr } type ItemsData { data: OrderItems } type OrderItems { type: String id: ID items: [CartItem] } type DisplayPrice { without_tax: WithoutTax with_tax: WithTax } type WithTax { amount: String currency: String formatted: String } type WithoutTax { amount: String currency: String formatted: String } type OrderMeta { display_price: DisplayPrice timestamps: TimeStamps } type ShippingAddress { first_name: String last_name: String phone_number: String company_name: String line_1: String line_2: String city: String postcode: String county: String country: String instructions: String } type BillingAddress { first_name: String last_name: String company_name: String line_1: String line_2: String city: String postcode: String county: String country: String } # ─── PCM (Product Content Management) ──────────────────────────────────────── type PCMProducts { data: [PCMProduct] meta: Meta links: Links } type PCMProductAttributes { name: String! commodity_type: String! sku: String! slug: String description: String mpn: String status: String upc_ean: String } type PCMProduct { id: ID! type: String! attributes: PCMProductAttributes! } type NodeAttributes { name: String! slug: String description: String } type Node { id: ID! type: String! attributes: NodeAttributes! children: [Node] products: [PCMProduct] } type HierarchyAttributes { name: String! slug: String description: String } type Hierarchy { id: ID! type: String! attributes: HierarchyAttributes! } # ─── Legacy Catalog (deprecated) ───────────────────────────────────────────── enum ActiveStatus { draft live } type Product { id: ID! name: String! slug: String! description: String! status: ActiveStatus! price: [ProductPrice] brands: [Brand] main_image: MainImage } type ProductPrice { amount: Int! currency: String includes_tax: Boolean! } type MainImage { file_name: String href: String } type Brand { id: ID! type: String! name: String! slug: String! description: String status: ActiveStatus! products: [Product] } type Collection { id: ID! type: String! status: ActiveStatus name: String slug: String description: String } type Category { id: ID! type: String! status: ActiveStatus name: String slug: String description: String } # ─── Query Root ─────────────────────────────────────────────────────────────── type Query { accountAuthenticationSetting: AccountAuthenticationSetting pcmProducts(listInput: ListInput = {}): PCMProducts pcmProduct(id: ID!): PCMProduct hierarchies: [Hierarchy] hierarchy(id: ID!): Hierarchy nodes: [Node] node(id: ID!): Node cart(id: ID!): Cart order(id: ID!): Order orders(listInput: ListInput = {}): Orders customer(id: ID!): Customer customerAddresses(customerId: String!): [CustomerAddress] customerAddress(customerId: String!, addressId: String!): CustomerAddress products: [Product] @deprecated(reason: "Use pcmProducts instead") product(id: ID!): Product @deprecated(reason: "Use pcmProduct instead") brands: [Brand] @deprecated(reason: "Use hierarchies and nodes instead") brand(id: ID!): Brand @deprecated(reason: "Use hierarchies and nodes instead") collections: [Collection] @deprecated(reason: "Use hierarchies and nodes instead") collection(id: ID!): Collection @deprecated(reason: "Use hierarchies and nodes instead") categories: [Category] @deprecated(reason: "Use hierarchies and nodes instead") category(id: ID!): Category @deprecated(reason: "Use hierarchies and nodes instead") } # ─── Mutation Root ──────────────────────────────────────────────────────────── type Mutation { authenticate(client_id: String!): ImplicitToken authenticateAsCustomerViaPassword(email: String!, password: String!): TokenPayload generateAccountTokens(accountTokenInput: AccountTokenInput!): [AccountToken] addToCart(cartId: ID!, productId: ID!, quantity: Int!): [CartItem] updateProductQtyInCart(cartId: ID!, productId: ID!, quantity: Int!): CartItem addPromotion(cartId: ID!, promotionCode: String!): [CartItem] addCustomItemToCart(cartId: ID!, customItem: CustomItemInput!): [CartItem] checkoutCart( cartId: ID! customer: CustomerInputForCheckout! billing: BillingAddressInput! shipping: ShippingAddressInput ): CheckoutCartOrderResult checkoutCartForAccount( cartId: ID! contact: ContactInputForCheckout! billing: BillingAddressInput! shipping: ShippingAddressInput ): CheckoutCartOrderResult payForOrder(orderId: ID!, gateway: String!, method: String!, payment: String, options: String): Order! addCustomer(customerInput: CustomerInput): Customer deleteCustomer(customerId: ID!): Boolean addCustomerAddress(customerId: ID!, address: CustomerAddressInput): CustomerAddress updateCustomerAddress(customerId: ID!, addressId: ID!, address: CustomerAddressInput): CustomerAddress deleteCustomerAddress(customerId: ID!, addressId: ID!): Boolean }