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.
Security
CustomerJWT or PublishableApiKey
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"
- Mock serverhttps://www.rebilly.com/_mock/catalog/all/storefront/preview-purchase
- Sandbox serverhttps://api-sandbox.rebilly.com/organizations/{organizationId}/storefront/preview-purchase
- Live serverhttps://api.rebilly.com/organizations/{organizationId}/storefront/preview-purchase
curl -i -X POST \
https://www.rebilly.com/_mock/catalog/all/storefront/preview-purchase \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"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": "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",
"shippingRateId": "ship_rate_0YVDN408G4DQE9G1RV1QCFHJ3P"
}'Purchase preview retrieved.
Headers
Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.
Example:3600
Total amounts of the initial invoice. This displays the amount the customer pays initially.
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 } }