All Release Notes
Orders available in the GraphQL schema
2 January 2019
Enhancement
GraphQLOrders
You can now access orders and related information using the GraphQL schema.
- [GraphQL API] Added the following types to the GraphQL schema:
CustomLineItemReturnItem
,LineItemReturnItem
,Order
,OrderQueryResult
,OrderState
,PaymentState
,ReturnInfo
,ReturnItem
,ReturnPaymentState
,ReturnShipmentState
,ShipmentState
,SyncInfo
. - [GraphQL API] Changed the
Me
type:- Added the
orders
field to theMe
type - Added the
order
field to theMe
type
- Added the
- [GraphQL API] Changed the
Query
type:- Added the
orders
field to theQuery
type - Added the
order
field to theQuery
type
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type Me {order("Queries with specified ID"id: String, orderNumber: String): Orderorders(where: String, sort: [String!], limit: Int, offset: Int): OrderQueryResult!}extend type Query {order("Queries with specified ID"id: String, orderNumber: String): Orderorders(where: String, sort: [String!], limit: Int, offset: Int): OrderQueryResult!}type CustomLineItemReturnItem implements ReturnItem {type: String!customLineItemId: String!id: String!quantity: Long!comment: StringshipmentState: ReturnShipmentState!paymentState: ReturnPaymentState!lastModifiedAt: DateTime!createdAt: DateTime!}type LineItemReturnItem implements ReturnItem {type: String!lineItemId: String!id: String!quantity: Long!comment: StringshipmentState: ReturnShipmentState!paymentState: ReturnPaymentState!lastModifiedAt: DateTime!createdAt: DateTime!}"""An order can be created from a cart, usually after a checkout process has been completed.[documentation](/http-api-projects-orders.html)"""type Order implements Versioned {customerId: Stringcustomer: CustomercustomerEmail: StringanonymousId: StringlineItems: [LineItem!]!customLineItems: [CustomLineItem!]!totalPrice: Money!taxedPrice: TaxedPriceshippingAddress: AddressbillingAddress: AddressinventoryMode: InventoryMode!taxMode: TaxMode!taxRoundingMode: RoundingMode!taxCalculationMode: TaxCalculationMode!customerGroup: CustomerGroupcustomerGroupRef: Referencecountry: CountryshippingInfo: ShippingInfodiscountCodes: [DiscountCodeInfo!]!refusedGifts: [CartDiscount!]!refusedGiftsRefs: [Reference!]!paymentInfo: PaymentInfolocale: LocaleshippingRateInput: ShippingRateInputorigin: CartOrigin!storeRef: KeyReference @deprecated(reason: "beta feature")store: Store @deprecated(reason: "beta feature")itemShippingAddresses: [Address!]!completedAt: DateTimeorderNumber: StringorderState: OrderState!stateRef: Referencestate: StateshipmentState: ShipmentStatepaymentState: PaymentStatesyncInfo: [SyncInfo!]!returnInfo: [ReturnInfo!]!lastMessageSequenceNumber: Long!cartRef: Referencecart: Cart"This field contains non-typed data. Consider using `customFields` as a typed alternative."customFieldsRaw("""The names of the custom fields to include.If neither `includeNames` nor `excludeNames` are provided, then all custom fields are returned."""includeNames: [String!],"""The names of the custom fields to exclude.If neither `includeNames` nor `excludeNames` are provided, then all custom fields are returned."""excludeNames: [String!]): [RawCustomField!]"This field would contain type data"customFields: Typeid: String!version: Long!createdAt: DateTime!lastModifiedAt: DateTime!createdBy: InitiatorlastModifiedBy: Initiator}type OrderQueryResult {offset: Int!count: Int!total: Long!results: [Order!]!}enum OrderState {ConfirmedCancelledCompleteOpen}enum PaymentState {PaidCreditOwedPendingFailedBalanceDue}"Stores information about returns connected to this order."type ReturnInfo {items: [ReturnItem!]!returnTrackingId: StringreturnDate: DateTime}interface ReturnItem {type: String!id: String!quantity: Long!comment: StringshipmentState: ReturnShipmentState!paymentState: ReturnPaymentState!lastModifiedAt: DateTime!createdAt: DateTime!}enum ReturnPaymentState {NotRefundedRefundedInitialNonRefundable}enum ReturnShipmentState {UnusableBackInStockReturnedAdvised}enum ShipmentState {DelayedBackorderPartialPendingReadyShipped}"Stores information about order synchronization activities (like export or import)."type SyncInfo {channelRef: Reference!channel: Channel!externalId: StringsyncedAt: DateTime!}