All Release Notes
Added OrderImport GraphQL mutation
13 July 2022
Enhancement
OrdersGraphQL
You can now create an Order by import using the GraphQL API.
Changes:
- [GraphQL API] Added the following types to the GraphQL schema:
CustomLineItemImportDraft
,DeliveryDraft
,DiscountedLineItemPriceDraft
,ImportOrderDraft
,LineItemImportDraft
,ParcelDraft
,ProductVariantImportDraft
,ShippingInfoImportDraft
,TaxRateInput
,TaxedPriceDraft
. - [GraphQL API] Changed the
Mutation
type:- Added the
importOrder
field to theMutation
type.
- Added the
The following changes were introduced in terms of GraphQL SDL:
extend type Mutation {importOrder(draft: ImportOrderDraft!): Order}input CustomLineItemImportDraft {name: [LocalizedStringItemInputType!]!quantity: Long!money: BaseMoneyInput!slug: String!state: [ItemStateDraftType!]taxRate: TaxRateInputtaxCategory: ResourceIdentifierInputcustom: CustomFieldsDraftshippingDetails: ItemShippingDetailsDraft}input DeliveryDraft {id: String!createdAt: DateTime!items: [DeliveryItemDraftType!]!parcels: [ParcelDraft!]!address: AddressInputcustom: CustomFieldsDraft}input DiscountedLineItemPortionDraft {discount: ReferenceInput!discountedAmount: BaseMoneyInput!}input DiscountedLineItemPriceDraft {value: BaseMoneyInput!includedDiscounts: [DiscountedLineItemPortionDraft!] = []}input ImportOrderDraft {orderNumber: StringcustomerId: StringcustomerEmail: Stringstore: ReferenceInputlineItems: [LineItemImportDraft!]! = []customLineItems: [CustomLineItemImportDraft!]! = []totalPrice: MoneyInput!taxedPrice: TaxedPriceDraftshippingAddress: AddressInputbillingAddress: AddressInputcustomerGroup: ReferenceInputcountry: CountryorderState: OrderStateshipmentState: ShipmentStatepaymentState: PaymentStateshippingInfo: ShippingInfoImportDraftcompletedAt: DateTimecustom: CustomFieldsDraftinventoryMode: InventoryMode = NoneshippingDetails: ItemShippingDetailsDrafttaxCalculationMode: TaxCalculationMode = LineItemLevelorigin: CartOrigin = CustomeritemShippingAddresses: [AddressInput!] = []state: ReferenceInputpaymentInfo: ReferenceInput}input LineItemImportDraft {productId: Stringname: [LocalizedStringItemInputType!]!price: ProductPriceDataInput!quantity: Long!supplyChannel: ResourceIdentifierInputdistributionChannel: ResourceIdentifierInputtaxRate: TaxRateInputvariant: ProductVariantImportDraft!state: [ItemStateDraftType!]custom: CustomFieldsDraftshippingDetails: ItemShippingDetailsDraft}input ParcelDraft {id: String!createdAt: DateTime!measurements: ParcelMeasurementsDraftTypetrackingData: TrackingDataDraftTypeitems: [DeliveryItemDraftType!] = []custom: CustomFieldsDraft}input ProductVariantImportDraft {id: Intsku: Stringprices: [ProductPriceDataInput!] = []images: [ImageInput!] = []attributes: [ProductAttributeInput!] = []}input ShippingInfoImportDraft {shippingMethodName: String!price: MoneyInput!shippingRate: ShippingRateDraft!taxRate: TaxRateInputtaxCategory: ResourceIdentifierInputdeliveries: [DeliveryDraft!]! = []shippingMethod: ResourceIdentifierInputdiscountedPrice: DiscountedLineItemPriceDraftshippingMethodState: ShippingMethodState! = MatchesCart}input TaxRateInput {name: String!amount: Float!includedInPrice: Boolean!country: Country!state: Stringid: StringsubRates: [SubRateDraft!] = []}input TaxedPriceDraft {totalNet: BaseMoneyInput!totalGross: BaseMoneyInput!taxPortions: [TaxPortionDraft!]!totalTax: BaseMoneyInput}