Create draft order
OrderingMutation.createDraftOrder()
Input
The input is the same as the OrderingMutation.createOrder()
API.
input
OrderingCreateOrderInput
- The input to create a draft order.
Response
OrderingDraftOrder
OrderingDraftOrder
- The draft order that was created.
The OrderingDraftOrder
type is the same as the OrderingReviewOrderResponse
type, but with an additional id
field that can be used to retrieve the draft order and to place an order based on it.
id
string
- The ID of the draft order. This ID can be used to retrieve the draft order and to place an order based on it.
address
OrderingAddress
- The property address associated with the order. If the fulfillmentMethod is DELIVERY
, this is the address the order will be shipped to.
products
OrderingOrderProduct[]
- An array of order products.
contactInfo
OrderingCustomerContactInfo | undefined
- The contact information that was passed in. Has all the same properties as OrderingCustomerContactInfoInput
.
distributionCenter
OrderingDistributionCenter
- The distribution center where the order will be placed.
taxCents
number
- The total tax amount for the order, in cents.
subtotalCents
number
- The subtotal for the order, in cents.
totalPriceCents
number
- The total price for the order, in cents. This is the sum of the subtotal and tax.
poNumber
string | undefined
- The purchase order number that was passed in.
specialInstructions
string | undefined
- The special instructions that were passed in.
fulfillmentMethod
OrderingFulfillmentMethod
- One of DELIVERY
or PICKUP
. This is the fulfillment method that will be used for the order. Will always return a valid value for the order. If an invalid fulfillment method was passed to reviewOrder()
, the query will fail with an error.
requestedDeliveryDate
string
- The requested delivery date for the order. The value returned will be a valid delivery date for the product & distribution center. If an invalid delivery date was passed to revierOrder()
, the query will fail with an error.
availableDeliveryDates
string[]
- An array of available delivery dates for the order. The array will always contain at least one value. If there are no available delivery dates, the query will fail with an error.
paymentMethodId
string
- The ID of the payment method that will be used for the order. If no payment method was passed to reviewOrder()
, the API will pick a value from `availablePaymentMethods“ and return a sensible default.
availablePaymentMethods
OrderingPaymentMethod[]
- An array of available payment methods for the order. The array will always contain at least one value. If there are no available payment methods, the query will fail with an error.
OrderingAddress
Both line2 and country are optional. All other fields are required. reviewOrder
will only return a valid addresses for properties registered with SIBI. If an invalid address is passed to reviewOrder()
, the query will fail with an error.
OrderingDistributionCenter
name
string
- The name of the distribution center.
imageUrl
string | undefined
- The URL of the distribution center’s logo.
storeNumber
string
- The store number of the distribution center. May not actually be numeric.
address
OrderingAddress
- The address of the distribution center.
fulfillmentMethods
string[]
- An array of fulfillment methods that are available for the distribution center. Possible values are DELIVERY
and PICKUP
.
OrderingPaymentMethod
These are the two possible payment methods that can be returned by reviewOrder()
. The id
and description
fields are always returned. The last4
field is only returned for OrderingPaymentMethodStripe
.
id
string
- The ID of the payment method.
description
string
- A human-readable description of the payment method.
last4
string
- The last 4 digits of the credit card number. Only returned for OrderingPaymentMethodStripe
.