Preview an order

Request

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

Security
SecretApiKey or JWT
Bodyapplication/json
websiteIdstring, <= 50 characters(WebsiteId)write-onlyrequired

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

Example:"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"
itemsArray of objects, non-emptywrite-onlyrequired

Items details.

billingAddressContactObject (object) or null
One of:

Contact's information.

deliveryAddressContactObject (object) or null
One of:

Contact's information.

couponIdsArray of stringswrite-only

List of coupons that are applied to the order.

shippingobject(Shipping)write-only
curl -i -X POST \
  https://www.rebilly.com/_mock/catalog/all/previews/orders \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
    "items": [
      {
        "planId": null
      }
    ],
    "billingAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "string",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "1-512-777-0269",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "deliveryAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "string",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "1-512-777-0269",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "couponIds": [
      "string"
    ],
    "currency": "USD",
    "shipping": {
      "amount": 0.1,
      "calculator": "manual"
    }
  }'

Responses

Order preview retrieved.

Headers
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
billingAddressContactObject (object) or null
One of:

Contact's information.

deliveryAddressContactObject (object) or null
One of:

Contact's information.

currencystring, = 3 characters(CurrencyCode)read-only

Currency code in ISO 4217 format.

Example:"USD"
lineItemsArray of objectsread-only

List of purchase items.

shippingRatesArray of objects(ShippingOption)read-only

Available shipping rates.

taxesArray of objectsread-only

Taxes applied to the purchase.

discountsArray of objectsread-only

Discounts applied to the purchase.

subtotalAmountnumber, (double)read-only

Subtotal amount of the purchase.

taxAmountnumber, (double)read-only

Tax amount of the purchase.

shippingAmountnumber, (double)read-only

Shipping amount of the purchase.

discountsAmountnumber, (double)read-only

Total discount amount of the purchase.

totalnumber, (double)read-only

Total amount of the purchase.

initialAmountsobjectread-only

Total amounts of the initial invoice. This displays the amount the customer pays initially.

recurringAmountsobject or nullread-only

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.

Response
{ "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "currency": "USD", "lineItems": [ {} ], "shippingRates": [ {} ], "taxes": [ {} ], "discounts": [ {} ], "subtotalAmount": 0.1, "taxAmount": 0.1, "shippingAmount": 0.1, "discountsAmount": 0.1, "total": 0.1, "initialAmounts": { "amount": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shippingAmount": 0.1, "taxAmount": 0.1 }, "recurringAmounts": { "amount": 0.1, "subtotalAmount": 0.1, "discountAmount": 0.1, "shippingAmount": 0.1, "taxAmount": 0.1 }, "shipping": { "amount": 0.1, "calculator": "manual" } }