> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sibipro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get draft order

# `OrderingQuery.getDraftOrder()`

Retrieves a draft order by its ID. Can be used to retrieve updated pricing & availability information for the order.

```graphql theme={null}
type OrderingQuery {
  draftOrder(id: ID!): OrderingDraftOrder!
}
```

## Input

### `id`

`string` - The ID of the draft order to retrieve.

## Response

### `OrderingDraftOrder`

[`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.

```graphql theme={null}
type OrderingDraftOrder {
  id: ID!
  address: OrderingAddress!
  manufacturer: String!
  createdAt: String!
  orderId: String
  orderInSibiStoreUrl: String
  products: [OrderingOrderProduct!]!
  contactInfo: OrderingCustomerContactInfo
  distributionCenter: OrderingDistributionCenter!
  taxCents: Int!
  subtotalCents: Int!
  totalPriceCents: Int!
  fees: [OrderingFee!]!
  discounts: [OrderingDiscount!]!
  poNumber: String
  specialInstructions: String
  fulfillmentMethod: OrderingFulfillmentMethod!
  requestedDeliveryDate: String!
  paymentMethodId: String!
  availablePaymentMethods: [OrderingPaymentMethod!]!
  availableFulfillmentMethods: [OrderingFulfillmentMethod!]!
  subscribers: [OrderingOrderSubscriber!]!
}
```

***

### `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.

***

### `manufacturer`

`string` - The manufacturer associated with the draft order.

***

### `createdAt`

`string` - The timestamp when the draft order was created.

***

### `orderId`

`string | undefined` - The ID of the order that was created from this draft order, if one has been placed.

***

### `orderInSibiStoreUrl`

`string | undefined` - A URL to view the order in the SIBI store, if an order has been placed from this draft.

***

### `products`

[`OrderingOrderProduct[]`](/graphql/ordering/ordering-order-product) - An array of order products.

***

### `contactInfo`

`OrderingCustomerContactInfo | undefined` - The contact information that was passed in. Has all the same properties as [`OrderingCustomerContactInfoInput`](/graphql/ordering/ordering-customer-contact-info-input).

### `distributionCenter`

[`OrderingDistributionCenter`](#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.

***

### `fees`

[`OrderingFee[]`](/graphql/ordering/review-order#orderingfee) - An array of fees applied to the order.

***

### `discounts`

[`OrderingDiscount[]`](/graphql/ordering/review-order#orderingdiscount) - An array of discounts applied to the order.

***

### `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[]`](#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.

***

### `availableFulfillmentMethods`

[`OrderingFulfillmentMethod[]`](#orderingfulfillmentmethod) - An array of available fulfillment methods for the order.

***

### `subscribers`

`OrderingOrderSubscriber[]` - An array of subscribers that will receive updates about the order.

***

### `OrderingOrderSubscriber`

```graphql theme={null}
type OrderingOrderSubscriber {
  email: String!
}
```

***

## `OrderingAddress`

```graphql theme={null}
type OrderingAddress {
  line1: String!
  line2: String
  city: String!
  stateOrProvince: String!
  postalCode: String!
  country: String
}
```

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`

```graphql theme={null}
type OrderingDistributionCenter {
  id: ID!
  name: String!
  latitude: Float
  longitude: Float
  address: OrderingAddress!
  imageUrl: String
  storeNumber: String!
}
```

### `id`

`string` - The distribution center's unique identifier. Use this when placing orders at a specific DC.

***

### `name`

`string` - The name of the distribution center.

***

### `latitude`

`number | undefined` - The latitude of the distribution center's location.

***

### `longitude`

`number | undefined` - The longitude of the distribution center's location.

***

### `address`

[`OrderingAddress`](#orderingaddress) - The address 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.

***

### `fulfillmentMethods`

[`OrderingFulfillmentMethod[]`](#orderingfulfillmentmethod) - An array of fulfillment methods that are available for the distribution center.

***

## `OrderingFulfillmentMethod`

```graphql theme={null}
type OrderingFulfillmentMethod {
  id: String!
  title: String!
  description: String
  type: OrderingFulfillmentMethodType!
  dates: [String!]!
}

enum OrderingFulfillmentMethodType {
  DELIVERY
  PICKUP
}
```

### `id`

`string` - The unique identifier for the fulfillment method. Use this when placing orders with a specific fulfillment method.

***

### `title`

`string` - The human-readable title of the fulfillment method.

***

### `description`

`string | undefined` - An optional description providing additional details about the fulfillment method.

***

### `type`

`OrderingFulfillmentMethodType` - The type of fulfillment method. Either `DELIVERY` or `PICKUP`.

***

### `dates`

`string[]` - An array of available dates for this fulfillment method.

***

## `OrderingPaymentMethod`

```graphql theme={null}
union OrderingPaymentMethod = OrderingPaymentMethodManufacturerCredit | OrderingPaymentMethodStripe

type OrderingPaymentMethodManufacturerCredit {
  id: String!
  description: String!
}

type OrderingPaymentMethodStripe {
  id: String!
  description: String!
  last4: String!
}
```

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`.
