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.
websiteId required | string <= 50 characters ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID. | ||||||||||||||||||||||||||||||
required | Array of objects non-empty Items details. | ||||||||||||||||||||||||||||||
object or null Billing address details. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
object or null Delivery address details. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
couponIds | Array of strings List of coupons that are applied to the order. | ||||||||||||||||||||||||||||||
shippingRateId | string <= 50 characters ID of the shipping rate. If unset the cheapest applicable shipping rate is chosen. |
Purchase preview retrieved.
Unauthorized access. Invalid credentials used.
Access forbidden.
Invalid data sent.
{- "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
- "items": [
- {
- "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
- "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": "512-710-1640",
- "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": "512-710-1640",
- "primary": true
}
], - "emails": [
- {
- "label": "main",
- "value": "rebilly@example.com",
- "primary": true
}
], - "dob": "1980-04-01",
- "jobTitle": "CEO"
}, - "couponIds": [
- "string"
], - "shippingRateId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21"
}
{- "currency": "USD",
- "lineItems": [
- {
- "type": "debit",
- "description": "string",
- "unitPrice": 49.95,
- "quantity": 0,
- "price": 0,
- "planId": "plan_0YV7DENSVGDBW9S71XZNNYYQ0X",
- "productId": "prod_0YV7DES3WPC5J8JD8QTVNZBZNZ"
}
], - "shippingRates": [
- {
- "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "name": "string",
- "descriptions": "string",
- "price": 0,
- "currency": "USD"
}
], - "taxes": [
- {
- "amount": 0,
- "description": "string"
}
], - "discounts": [
- {
- "couponId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
- "amount": 0,
- "description": "string"
}
], - "subtotalAmount": 0,
- "taxAmount": 0,
- "shippingAmount": 0,
- "discountsAmount": 0,
- "total": 0
}