OrderingMutation.createDraftOrder()
OrderingCreateDraftOrderInput
OrderingMutation.createOrder()
API except that the paymentMethodId
is optional and it does not take an idempotencyKey
.
manufacturer
string
- The manufacturer of the products in the order.
address
OrderingAddressInput
- The address should correspond to a valid property in the system. If there is no matching property and the address is valid, a new property will be created. If the address is not valid, the mutation will fail with an error.
products
OrderingOrderProductInput[]
- An array of order products. At least one product must be specified.
contactInfo
OrderingCustomerContactInfoInput
- Information about how to contact the customer. This information is what the delivery agent will use to contact the customer if there is an issue with the order.
fulfillmentMethodId
string
- The ID of the fulfillment method to use for the order. If not provided, defaults to standard delivery if available, else it will default to the first fulfillment method that the distributor has. Only specify fulfillmentMethodId or fulfillmentMethodType, not both.
fulfillmentMethodType
OrderingFulfillmentMethodType
- The type of fulfillment method to use for the order. If not provided, defaults to DELIVERY
if available. If the distributor only has pickup available, it will default to PICKUP
. Only specify fulfillmentMethodId or fulfillmentMethodType, not both.
shipToOfficePropertyId
string
- The property id of the office to ship the order to. Is only valid to be provied if the fulfillmentMethodId is ship-to-office
. If the id is provided when the fulfillmentMethodId is not ship-to-office
, the mutation will fail with an error. If the fulfillmentMethodId is ship-to-office
and this value is not provided, the mutation will fail with an error.
requestedDeliveryDate
string
- The date the customer wants the order delivered. If not provided, defaults to the earliest available. If the provided date is not available, the mutation will fail with an error.
poNumber
string
- The purchase order number for the order. Can be anything you want. It doesn’t even need to be a number.
specialInstructions
string
- The special instructions for fulfilling the order. E.g. “the lock code is 1234”.
distributionCenterId
string
- The ID of the distribution center to place the order in. If not provided, the order will be placed in the closest distribution center to the provided address that has the product available.
paymentMethodId
string
- The ID of the payment method to use for the order. If not provided, defaults to the default first payment method for the user. If multiple payment methods are available, it is recommended to request the paymentMethodId
in the response to the createDraftOrder mutation so that you can confirm the correct one was selected. If you need to see which payment methods are available, you can use the availablePaymentMethods
field on the OrderingDraftOrder
type. Note that you will need to create a new draft order to change the payment method.
subscribers
OrderingOrderSubscriberInput[]
- An optional list of subscribers to receive updates about the order in addition to the user account that placed the order. If the email is not formatted correctly, the mutation will fail with an error.
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.
subscribers
OrderingOrderSubscriber[]
- An array of subscribers that will receive updates about the order.
OrderingOrderSubscriber
OrderingAddress
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
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
.