Experimental Preview a purchase

Previews a purchase.

Use this operation to preview a purchase before completing it.

A purchase can be completed both with and without authentication. Purchases that use a pre-created payment instrument must use authentication.

Warning: The shipping aspect of this API is experimental and may change to support multiple shipping methods.

SecurityHTTP: CustomerJWT or API Key: PublishableApiKey
Request
Request Body schema: application/json
websiteId
required
string <= 50 characters
required
Array of objects non-empty

Items details.

ContactObject (object) or null

Billing address details.

ContactObject (object) or null

Delivery address details.

couponIds
Array of strings

List of coupons that are applied to the order.

shippingRateId
string (ResourceId) <= 50 characters

Unique resource ID.

billingPortalId
any

ID of the billing portal to validate items against.

post
/storefront/preview-purchase
Request samples
application/json
{ "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "items": [ ], "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "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", "dob": "1980-04-01", "jobTitle": "CEO" }, "couponIds": [ "string" ], "currency": "USD", "shippingRateId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21", "billingPortalId": null }
Responses

200

Purchase preview retrieved.

Response Schema: application/json
currency
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

Array of objects

List of purchase items.

Array of objects (ShippingOption)

Available shipping rates.

Array of objects

Taxes applied to the purchase.

Array of objects

Discounts applied to the purchase.

subtotalAmount
number <double>

Subtotal amount of the purchase.

taxAmount
number <double>

Tax amount of the purchase.

shippingAmount
number <double>

Shipping amount of the purchase.

discountsAmount
number <double>

Total discount amount of the purchase.

total
number <double>

Total amount of the purchase.

billingPortalId
any

ID of the billing portal to validate items against.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

Response samples
application/json
{ "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "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", "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, "shippingRateId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21", "billingPortalId": null }