Preview a purchase

Purchase can be accomplished both with and without Authentication. Purchase via pre-created Payment Instrument is only available with Authentication. Use purchase preview before making an actual purchase.

Warning: The shipping part of this API will change to support multiple shipping methods.

SecurityCustomerJWT or PublishableApiKey
Request
Request Body schema: application/json
websiteId
required
string <= 50 characters

The website identifier string.

required
Array of objects non-empty
Array (non-empty)
planId
required
string <= 50 characters

The plan identifier string.

quantity
integer

Number of units of the product on the given plan.

object or null

The billing address.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

The contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies whether the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies whether the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

The contact's job title.

object or null

The delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

The contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies whether the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies whether the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

The contact's job title.

couponIds
Array of strings

The list of coupons applied to the order.

shippingRateId
string <= 50 characters

The shipping rate ID. If unset the cheapest applicable shipping rate is chosen.

Responses
200

Purchase preview was retrieved.

Response Schema: application/json
currency
string = 3 characters

Currency code in ISO 4217 format.

Array of objects

Purchase items array.

Array
type
string

Type of the item.

Enum: "debit" "credit"
description
string

Description of the item.

unitPrice
number <double>

Unit price of the item.

quantity
number <integer>

The item total quantity.

price
number <double>

The item total amount.

planId
string <= 50 characters

The item plan identifier string.

productId
string <= 50 characters

The item product identifier string.

Array of objects (ShippingOption)

Available shipping rates.

Array
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string = 3 characters

Currency code in ISO 4217 format.

id
string <= 50 characters

The shipping rate identifier string.

descriptions
string

The shipping rate description.

Array of objects

Taxes applied to this purchase.

Array
amount
number <double>

Tax amount.

description
string

Tax description.

Array of objects

Discounts applied to this purchase.

Array
couponId
string <= 50 characters

The coupon identifier string.

amount
number

Total amount that was discounted by this coupon.

description
string

The discount description.

subtotalAmount
number <double>

The purchase's subtotal amount.

taxAmount
number <double>

The purchase's taxes amount.

shippingAmount
number <double>

The purchase's shipping amount. This property will likely change to support multiple shipping methods.

discountsAmount
number <double>

The purchase's discounts amount.

total
number <double>

The purchase's total amount.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data was sent.

post/preview-purchase
Request samples
application/json
{
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "items": [
    ],
  • "billingAddress": {
    },
  • "deliveryAddress": {
    },
  • "couponIds": [
    ],
  • "shippingRateId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}
Response samples
application/json
{
  • "currency": "USD",
  • "lineItems": [
    ],
  • "shippingRates": [
    ],
  • "taxes": [
    ],
  • "discounts": [
    ],
  • "subtotalAmount": 0,
  • "taxAmount": 0,
  • "shippingAmount": 0,
  • "discountsAmount": 0,
  • "total": 0
}