All Release Notes

Orders mutations available in the GraphQL schema

21 January 2019
Enhancement
GraphQLOrders

You can now update orders using the GraphQL schema.

  • [GraphQL API] Added the following types to the GraphQL schema: AddOrderDelivery, AddOrderItemShippingAddress, AddOrderParcelToDelivery, AddOrderPayment, AddOrderReturnInfo, ChangeOrderPaymentState, ChangeOrderShipmentState, ChangeOrderState, DeliveryItemDraftType, ImportOrderCustomLineItemState, ImportOrderLineItemState, ItemShippingDetailsDraftType, ItemStateDraftType, OrderCartCommand, OrderMyCartCommand, OrderUpdateAction, ParcelMeasurementsDraftType, RemoveOrderDelivery, RemoveOrderItemShippingAddress, RemoveOrderParcelFromDelivery, RemoveOrderPayment, ReturnItemDraftType, SetOrderBillingAddress, SetOrderCustomField, SetOrderCustomLineItemCustomField, SetOrderCustomLineItemCustomType, SetOrderCustomLineItemShippingDetails, SetOrderCustomType, SetOrderCustomerEmail, SetOrderCustomerId, SetOrderDeliveryAddress, SetOrderDeliveryItems, SetOrderLineItemCustomField, SetOrderLineItemCustomType, SetOrderLineItemShippingDetails, SetOrderLocale, SetOrderNumber, SetOrderParcelItems, SetOrderParcelMeasurements, SetOrderParcelTrackingData, SetOrderReturnPaymentState, SetOrderReturnShipmentState, SetOrderShippingAddress, ShippingTargetDraftType, TrackingDataDraftType, TransitionOrderCustomLineItemState, TransitionOrderLineItemState, TransitionOrderState, UpdateOrderItemShippingAddress, UpdateOrderSyncInfo.
  • [GraphQL API] Changed the Mutation type:
    • Added the updateOrder field to the Mutation type.
    • Added the createOrderFromCart field to the Mutation type.
    • Added the createMyOrderFromCart to the Mutation type.
    • Added the deleteOrder field to the Mutation type.

Introduced the following changes to the GraphQL schema (in SDL format):

extend type Mutation {
createMyOrderFromCart(draft: OrderMyCartCommand!): Order
createOrderFromCart(draft: OrderCartCommand!): Order
deleteOrder(version: Long!, personalDataErasure: Boolean = false,
"Queries with specified ID"
id: String, orderNumber: String): Order
updateOrder(version: Long!, actions: [OrderUpdateAction!]!,
"Queries with specified ID"
id: String, orderNumber: String): Order
}
input AddOrderDelivery {
items: [DeliveryItemDraftType!] = []
parcels: [DeliveryItemDraftType!] = []
address: AddressInput
}
input AddOrderItemShippingAddress {
address: AddressInput!
}
input AddOrderParcelToDelivery {
deliveryId: String!
measurements: ParcelMeasurementsDraftType
trackingData: TrackingDataDraftType
items: [DeliveryItemDraftType!] = []
}
input AddOrderPayment {
payment: ResourceIdentifierInput!
}
input AddOrderReturnInfo {
items: [ReturnItemDraftType!]!
returnDate: DateTime
returnTrackingId: String
}
input ChangeOrderPaymentState {
paymentState: PaymentState!
}
input ChangeOrderShipmentState {
shipmentState: ShipmentState!
}
input ChangeOrderState {
orderState: OrderState!
}
input DeliveryItemDraftType {
id: String!
quantity: Long!
}
input ImportOrderCustomLineItemState {
customLineItemId: String!
state: [ItemStateDraftType!]!
}
input ImportOrderLineItemState {
lineItemId: String!
state: [ItemStateDraftType!]!
}
input ItemShippingDetailsDraftType {
targets: [ShippingTargetDraftType!]!
}
input ItemStateDraftType {
quantity: Long!
state: ReferenceInput!
}
input OrderCartCommand {
id: String!
version: Long!
paymentState: PaymentState
orderState: OrderState
state: ReferenceInput
shipmentState: ShipmentState
orderNumber: String
}
input OrderMyCartCommand {
id: String!
version: Long!
}
input OrderUpdateAction {
addDelivery: AddOrderDelivery
addItemShippingAddress: AddOrderItemShippingAddress
addParcelToDelivery: AddOrderParcelToDelivery
addPayment: AddOrderPayment
addReturnInfo: AddOrderReturnInfo
changeOrderState: ChangeOrderState
changePaymentState: ChangeOrderPaymentState
changeShipmentState: ChangeOrderShipmentState
importCustomLineItemState: ImportOrderCustomLineItemState
importLineItemState: ImportOrderLineItemState
removeDelivery: RemoveOrderDelivery
removeItemShippingAddress: RemoveOrderItemShippingAddress
removeParcelFromDelivery: RemoveOrderParcelFromDelivery
removePayment: RemoveOrderPayment
setBillingAddress: SetOrderBillingAddress
setCustomField: SetOrderCustomField
setCustomLineItemCustomField: SetOrderCustomLineItemCustomField
setCustomLineItemCustomType: SetOrderCustomLineItemCustomType
setCustomLineItemShippingDetails: SetOrderCustomLineItemShippingDetails
setCustomType: SetOrderCustomType
setCustomerEmail: SetOrderCustomerEmail
setCustomerId: SetOrderCustomerId
setDeliveryAddress: SetOrderDeliveryAddress
setDeliveryItems: SetOrderDeliveryItems
setLineItemCustomField: SetOrderLineItemCustomField
setLineItemCustomType: SetOrderLineItemCustomType
setLineItemShippingDetails: SetOrderLineItemShippingDetails
setLocale: SetOrderLocale
setOrderNumber: SetOrderNumber
setParcelItems: SetOrderParcelItems
setParcelMeasurements: SetOrderParcelMeasurements
setParcelTrackingData: SetOrderParcelTrackingData
setReturnPaymentState: SetOrderReturnPaymentState
setReturnShipmentState: SetOrderReturnShipmentState
setShippingAddress: SetOrderShippingAddress
transitionCustomLineItemState: TransitionOrderCustomLineItemState
transitionLineItemState: TransitionOrderLineItemState
transitionState: TransitionOrderState
updateItemShippingAddress: UpdateOrderItemShippingAddress
updateSyncInfo: UpdateOrderSyncInfo
}
input ParcelMeasurementsDraftType {
heightInMillimeter: Int
lengthInMillimeter: Int
widthInMillimeter: Int
weightInGram: Int
}
input RemoveOrderDelivery {
deliveryId: String!
}
input RemoveOrderItemShippingAddress {
addressKey: String!
}
input RemoveOrderParcelFromDelivery {
parcelId: String!
}
input RemoveOrderPayment {
payment: ResourceIdentifierInput!
}
input ReturnItemDraftType {
quantity: Long!
lineItemId: String
customLineItemId: String
comment: String
shipmentState: ReturnShipmentState!
}
input SetOrderBillingAddress {
address: AddressInput
}
input SetOrderCustomField {
name: String!
value: String
}
input SetOrderCustomLineItemCustomField {
customLineItemId: String!
name: String!
value: String
}
input SetOrderCustomLineItemCustomType {
customLineItemId: String!
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetOrderCustomLineItemShippingDetails {
customLineItemId: String!
shippingDetails: ItemShippingDetailsDraftType
}
input SetOrderCustomType {
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetOrderCustomerEmail {
email: String
}
input SetOrderCustomerId {
customerId: String
}
input SetOrderDeliveryAddress {
deliveryId: String!
address: AddressInput
}
input SetOrderDeliveryItems {
deliveryId: String!
items: [DeliveryItemDraftType!]!
}
input SetOrderLineItemCustomField {
lineItemId: String!
name: String!
value: String
}
input SetOrderLineItemCustomType {
lineItemId: String!
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetOrderLineItemShippingDetails {
lineItemId: String!
shippingDetails: ItemShippingDetailsDraftType
}
input SetOrderLocale {
locale: Locale
}
input SetOrderNumber {
orderNumber: String
}
input SetOrderParcelItems {
parcelId: String!
items: [DeliveryItemDraftType!]!
}
input SetOrderParcelMeasurements {
parcelId: String!
measurements: ParcelMeasurementsDraftType
}
input SetOrderParcelTrackingData {
parcelId: String!
trackingData: TrackingDataDraftType
}
input SetOrderReturnPaymentState {
returnItemId: String!
paymentState: ReturnPaymentState!
}
input SetOrderReturnShipmentState {
returnItemId: String!
shipmentState: ReturnShipmentState!
}
input SetOrderShippingAddress {
address: AddressInput
}
input ShippingTargetDraftType {
addressKey: String!
quantity: Long!
}
input TrackingDataDraftType {
trackingId: String
carrier: String
provider: String
providerTransaction: String
isReturn: Boolean = false
}
input TransitionOrderCustomLineItemState {
customLineItemId: String!
quantity: Long!
fromState: ResourceIdentifierInput!
toState: ResourceIdentifierInput!
actualTransitionDate: DateTime
}
input TransitionOrderLineItemState {
lineItemId: String!
quantity: Long!
fromState: ResourceIdentifierInput!
toState: ResourceIdentifierInput!
actualTransitionDate: DateTime
}
input TransitionOrderState {
state: ResourceIdentifierInput!
force: Boolean = false
}
input UpdateOrderItemShippingAddress {
address: AddressInput!
}
input UpdateOrderSyncInfo {
channel: ResourceIdentifierInput!
syncedAt: DateTime
externalId: String
}
Developer Center
HTTP APIGraphQL APIBETAPlatform Release NotesCustom ApplicationsBETASDKs & Client LibrariesImport & ExportSUNRISE Starter FrontendsTutorialsFAQ
Sign upLog inTech BlogIntegrationsStatusSupportUser Research Program
Copyright © 2021 commercetools