# Preview an order

Previews an order.
Use this operation to preview a draft order before making an order.

Endpoint: POST /previews/orders
Version: latest
Security: SecretApiKey, JWT

## Request fields (application/json):

  - `websiteId` (string, required)
    ID of the website.
A website is where an organization obtains a customer.
For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
    Example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG

  - `items` (array, required)
    Items details.

  - `items.planId` (any)

  - `items.plan` (any)

  - `billingAddress` (any)
    Billing address details.

  - `billingAddress.firstName` (string | null)
    Contact's first name.
    Example: Benjamin

  - `billingAddress.lastName` (string | null)
    Contact's last name.
    Example: Franklin

  - `billingAddress.organization` (string | null)
    Contact's organization.
    Example: Rebilly

  - `billingAddress.address` (string | null)
    First line of the contact's street address.
    Example: 36 Craven St

  - `billingAddress.address2` (string | null)
    Second line of the contact's street address.

  - `billingAddress.city` (string | null)
    Contact's city of residence.
    Example: Austin

  - `billingAddress.region` (string | null)
    Contact's region of residence.
    Example: Texas

  - `billingAddress.country` (string | null)
    Contact's country of residence in ISO 3166 alpha-2 country code.
For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/).
    Example: GB

  - `billingAddress.postalCode` (string | null)
    Contact's postal code.
    Example: WC2N 5NF

  - `billingAddress.phoneNumbers` (array)
    List of phone numbers associated with the contact.

  - `billingAddress.phoneNumbers.label` (string, required)
    Phone number label or name.
    Example: main

  - `billingAddress.phoneNumbers.value` (string, required)
    Phone number value.
    Example: 1-512-777-0269

  - `billingAddress.phoneNumbers.primary` (boolean)
    Specifies if the phone number is the contact's primary phone number.
    Example: true

  - `billingAddress.emails` (array)
    List of email addresses associated with the contact.

  - `billingAddress.emails.label` (string, required)
    Email label or name.
    Example: main

  - `billingAddress.emails.value` (string, required)
    Email address value.
    Example: rebilly@example.com

  - `billingAddress.emails.primary` (boolean)
    Specifies if the email address is the contact's primary email address.
    Example: true

  - `billingAddress.dob` (string | null)
    Contact's date of birth in ISO-8601 `YYYY-MM-DD` format.
    Example: 1980-04-01

  - `billingAddress.jobTitle` (string | null)
    Contact's job title.
    Example: CEO

  - `deliveryAddress` (any)
    Delivery address details.

  - `couponIds` (array)
    List of coupons that are applied to the order.

  - `currency` (string)
    Currency code in ISO 4217 format.
    Example: USD

  - `shipping` (object)
    Shipping settings.

  - `shipping.amount` (number, required)
    Shipping amount.

  - `shipping.calculator` (string, required)
    Shipping calculator.
    Enum: "manual"

  - `shipping.rateId` (string | null)
    ID of the shipping rate.
If this value is not set,
the cheapest applicable shipping rate is used.
    Example: shipping-123-456

## Response 200 fields (application/json):

  - `websiteId` (string, required)
    ID of the website.
A website is where an organization obtains a customer.
For more information, see [Obtain an organization ID and website ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
    Example: web_0YV7DE4Z26DQSA1AC92FBJ7SEG

  - `billingAddress` (any)
    Billing address details.

  - `billingAddress.firstName` (string | null)
    Contact's first name.
    Example: Benjamin

  - `billingAddress.lastName` (string | null)
    Contact's last name.
    Example: Franklin

  - `billingAddress.organization` (string | null)
    Contact's organization.
    Example: Rebilly

  - `billingAddress.address` (string | null)
    First line of the contact's street address.
    Example: 36 Craven St

  - `billingAddress.address2` (string | null)
    Second line of the contact's street address.

  - `billingAddress.city` (string | null)
    Contact's city of residence.
    Example: Austin

  - `billingAddress.region` (string | null)
    Contact's region of residence.
    Example: Texas

  - `billingAddress.country` (string | null)
    Contact's country of residence in ISO 3166 alpha-2 country code.
For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/).
    Example: GB

  - `billingAddress.postalCode` (string | null)
    Contact's postal code.
    Example: WC2N 5NF

  - `billingAddress.phoneNumbers` (array)
    List of phone numbers associated with the contact.

  - `billingAddress.phoneNumbers.label` (string, required)
    Phone number label or name.
    Example: main

  - `billingAddress.phoneNumbers.value` (string, required)
    Phone number value.
    Example: 1-512-777-0269

  - `billingAddress.phoneNumbers.primary` (boolean)
    Specifies if the phone number is the contact's primary phone number.
    Example: true

  - `billingAddress.emails` (array)
    List of email addresses associated with the contact.

  - `billingAddress.emails.label` (string, required)
    Email label or name.
    Example: main

  - `billingAddress.emails.value` (string, required)
    Email address value.
    Example: rebilly@example.com

  - `billingAddress.emails.primary` (boolean)
    Specifies if the email address is the contact's primary email address.
    Example: true

  - `billingAddress.dob` (string | null)
    Contact's date of birth in ISO-8601 `YYYY-MM-DD` format.
    Example: 1980-04-01

  - `billingAddress.jobTitle` (string | null)
    Contact's job title.
    Example: CEO

  - `billingAddress.hash` (string)
    Hash value for the contact.
Use this value to compare contacts for identical attribute values.
    Example: 056ae6d97c788b9e98b049ebafd7b229bf852221

  - `deliveryAddress` (any)
    Delivery address details.

  - `currency` (string)
    Currency code in ISO 4217 format.
    Example: USD

  - `lineItems` (array)
    List of purchase items.

  - `lineItems.type` (string)
    Type of transaction.
    Enum: "debit", "credit"

  - `lineItems.description` (string)
    Description of the purchase item.

  - `lineItems.unitPrice` (number)
    Unit price of the purchase item.
    Example: 49.95

  - `lineItems.quantity` (number)
    Total quantity of the purchase item.

  - `lineItems.price` (number)
    Total cost of the purchase item.

  - `lineItems.planId` (string)
    ID of the related plan.
    Example: plan_0YV7DENSVGDBW9S71XZNNYYQ0X

  - `lineItems.productId` (string)
    ID of the related product.
    Example: prod_0YV7DES3WPC5J8JD8QTVNZBZNZ

  - `shippingRates` (array)
    Available shipping rates.

  - `shippingRates.id` (string)
    ID of the shipping rate.
    Example: ship_rate_0YVDN408G4DQE9G1RV1QCFHJ3P

  - `shippingRates.name` (string, required)
    Name of the shipping rate.

  - `shippingRates.description` (string | null)
    Description of the shipping rate.

  - `shippingRates.price` (number, required)
    Price of the shipping rate.
If `price` is `0`, shipping is free.

  - `taxes` (array)
    Taxes applied to the purchase.

  - `taxes.amount` (number)
    Amount of tax that is due.

  - `taxes.description` (string)
    Description of the tax.

  - `discounts` (array)
    Discounts applied to the purchase.

  - `discounts.couponId` (string)
    ID of a coupon that is associated with the purchase.
    Example: cpn_0YVCNKF81GD778N4YNVGDJK558

  - `discounts.amount` (number)
    Total amount of discount from the coupon.

  - `discounts.description` (string)
    Description of the discount.

  - `subtotalAmount` (number)
    Subtotal amount of the purchase.

  - `taxAmount` (number)
    Tax amount of the purchase.

  - `shippingAmount` (number)
    Shipping amount of the purchase.

  - `discountsAmount` (number)
    Total discount amount of the purchase.

  - `total` (number)
    Total amount of the purchase.

  - `initialAmounts` (object)
    Total amounts of the initial invoice.
This displays the amount the customer pays initially.

  - `initialAmounts.amount` (number)
    Total amount of the initial invoice.

  - `initialAmounts.subtotalAmount` (number)
    Subtotal amount of the initial invoice.

  - `initialAmounts.discountAmount` (number)
    Discount amount applied to the initial invoice.

  - `initialAmounts.shippingAmount` (number)
    Shipping amount applied to the initial invoice.

  - `initialAmounts.taxAmount` (number)
    Tax amount applied to the initial invoice.

  - `recurringAmounts` (object | null)
    Total amounts of the recurring invoice.
This includes recurring items only.
If the order does not have recurring items, the value of this field is `null`.

  - `recurringAmounts.amount` (number)
    Total amount of the recurring invoice.

  - `recurringAmounts.subtotalAmount` (number)
    Subtotal amount of the recurring invoice.

  - `recurringAmounts.discountAmount` (number)
    Discount amount applied to the recurring invoice.

  - `recurringAmounts.shippingAmount` (number)
    Shipping amount applied to the recurring invoice.

  - `recurringAmounts.taxAmount` (number)
    Tax amount applied to the recurring invoice.

  - `shipping` (object)
    Shipping settings.

  - `shipping.amount` (number, required)
    Shipping amount.

  - `shipping.calculator` (string, required)
    Shipping calculator.
    Enum: "manual"

  - `shipping.rateId` (string | null)
    ID of the shipping rate.
If this value is not set,
the cheapest applicable shipping rate is used.
    Example: shipping-123-456

  - `shipping.amount` (number)
    Shipping amount which is calculated from [Shipping rates](https://www.rebilly.com/catalog/all/shipping-rates).

## Response 401 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 403 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

## Response 422 fields (application/json):

  - `status` (integer)
    HTTP status code.

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

  - `invalidFields` (array)
    Invalid field details.
    Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}]

  - `invalidFields.field` (string)
    Name of the field.
Dot notation is used for nested object field names.

  - `invalidFields.message` (string)
    Message field.

## Response 429 fields (application/json):

  - `type` (string)
    Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
It should provide human-readable documentation for the problem type.
When this member is not present, its value is assumed to be "about:blank".
    Example: about:blank

  - `title` (string)
    Short, human-readable summary of the problem type.
Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
    Example: Rate Limit Exceeded

  - `status` (integer)
    HTTP status code.

  - `detail` (string)
    Human-readable explanation that is specific to this occurrence of the problem.
    Example: A request cannot be executed because the user has sent too many requests within a certain period of time

  - `instance` (string)
    URI reference that identifies the specific occurrence of the problem.
It may or may not yield further information if dereferenced.

