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:

Billing address details.

Contact's information.

deliveryAddressContactObject (object) or null
One of:

Delivery address details.

Contact's information.

couponIdsarray of stringswrite-only

List of coupons that are applied to the order.

shippingobject(Shipping)write-only

Shipping settings.

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,
        "plan": {
          "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
        },
        "quantity": 0
      }
    ],
    "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"
    ],
    "shipping": {
      "amount": 0.1,
      "calculator": "manual"
    }
  }'

Responses

Order preview retrieved.

Headers
Rate-Limit-Limitinteger

Maximum number of requests available at one time for this rate limit. For more information, see Rate limits.

Example:500
Rate-Limit-Remaininginteger

Number of requests still available for this rate limit. For more information, see Rate limits.

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

Billing address details.

Contact's information.

deliveryAddressContactObject (object) or null
One of:

Delivery address details.

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 } }