Orders Import
Orders can also be imported via the Import API endpoint so you don't have to create a cart before.
Representations
OrderImportDraft
An order import draft is a snapshot of an order at the time it was imported.
orderNumber
- String - Optional
String that unique identifies an order. It can be used to create more human-readable (in contrast to ID) identifier for the order. It should be unique within a project.customerId
- String - Optional
If given the customer with that ID must exist in the project.customerEmail
- String - Optional
The customer email can be used when no check against existing Customers is desired during order import.lineItems
- Array of LineItemImportDraft - Optional
If not givencustomLineItems
must not be empty.customLineItems
- Array of CustomLineItem - Optional
If not givenlineItems
must not be empty.totalPrice
- Money - RequiredtaxedPrice
- TaxedPrice - Optional
Order Import does not support calculation of taxes. When setting the draft the taxedPrice is to be provided.shippingAddress
- Address - OptionalbillingAddress
- Address - OptionalcustomerGroup
- Reference to a CustomerGroup - Optional
Set when the customer is set and the customer is a member of a customer group. Used for product variant price selection.country
- String - Optional
A two-digit country code as per ↗ ISO 3166-1 alpha-2 . Used for product variant price selection.orderState
- OrderState - Optional
If not given theOpen
state will be assigned by default.shipmentState
- ShipmentState - OptionalpaymentState
- PaymentState - OptionalshippingInfo
- ShippingInfo - Optional
Set if the ShippingMethod is set.completedAt
- DateTime - Optionalcustom
- CustomFieldsDraft - Optional
The custom fields.inventoryMode
- InventoryMode - Optional
If not given the modeNone
will be assigned by default.taxRoundingMode
- RoundingMode - Optional
If not given the tax rounding modeHalfEven
will be assigned by default.taxCalculationMode
- TaxCalculationMode - Optional
The default tax calculation mode isLineItemLevel
.origin
- CartOrigin - Optional
The default origin isCustomer
.itemShippingAddresses
- Array of Address - Optional
Contains addresses for orders with multiple shipping addresses.
LineItemImportDraft
A line item import draft is a snapshot of a product variant at the time it was imported with the order.
productId
- String - Optional
ID of the existing product. You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.name
- LocalizedString
The product name.variant
- ProductVariantImportDraftprice
- Pricequantity
- Numberstate
- Array of ItemState - OptionalsupplyChannel
- Reference to a Channel - Optional
Optional connection to particular supplier. By providing supply channel information, you can unique identify inventory entries that should be reserved. Provided channel should have role InventorySupply.taxRate
- TaxRate - Optionalcustom
- CustomFieldsDraft - Optional
The custom fields.shippingDetails
- ItemShippingDetailsDraft - Optional
ProductVariantImportDraft
id
- Number - Optional
The sequential ID of the variant within the product. The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, or alternatively you can just specify SKU of the product variant.sku
- String - Optional The SKU of the existing variant.prices
- Array of Price - Optional
The prices of the variant. The prices should not contain two prices for the same price scope (same currency, country and customer group). If this property is defined, then it will override theprices
property from the original product variant, otherwiseprices
property from the original product variant would be copied in the resulting order.attributes
- Array of Attribute - Optional
If this property is defined, then it will override theattributes
property from the original product variant, otherwiseattributes
property from the original product variant would be copied in the resulting order.images
- Array of Image - Optional
If this property is defined, then it will override theimages
property from the original product variant, otherwiseimages
property from the original product variant would be copied in the resulting order.
Create an Order by Import
Creates directly an Order by importing it instead of creating it from a Cart. Each LineItem is referencing some existing product variant. You have 3 ways to specify a product reference:
productId
+variant.id
- this field combination will unique identify the product. In this casevariant.sku
would be initialized automatically in the resulting order.variant.sku
- SKU can also unique identify the product.productId
andvariant.id
would be filled automatically.productId
+variant.id
+variant.sku
- you can also provide all 3 fields. In this case SKU would be validated.
Endpoint: /{projectKey}/orders/import
Method: POST
OAuth2 Scopes: manage_orders
:{projectKey}
Request Body Representation: OrderImportDraft
Response Representation: Order
Specific Error Codes:
Importing an order produces the OrderImported message.