# 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` (string, required) ID of the plan. Example: "plan_0YV7DENSVGDBW9S71XZNNYYQ0X" - `items.quantity` (integer) Number of product units in the specified plan. - `billingAddress` (any) Billing address details. - `deliveryAddress` (any) Delivery address details. - `couponIds` (array) List of coupons that are applied to the order. - `shipping` (any) ## Response 200 fields (application/json): - `currency` (string) Currency code in ISO 4217 format. - `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 is , 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. - `shipping` (any) ## 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.