POST /storefront/purchase
Executes a purchase.
A purchase can be completed both with and without authentication. Purchases that use a pre-created payment instrument must use authentication.
To preview the purchase before completing it, use the Purchase preview operation.
Servers
- https://api-sandbox.rebilly.com/organizations/{organizationId}
- https://api.rebilly.com/organizations/{organizationId}
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
deliveryAddress |
Object | No |
Delivery address details. |
paymentInstruction |
Object | Yes |
Payment instruction for the purchase. |
couponIds[] |
Array | No |
List of coupons that are applied to the order. |
items[] |
Array | Yes | |
items[].planId |
String | Yes |
ID of the plan. |
items[].quantity |
Integer | No |
Number of product units in the specified plan. |
poNumber |
String | No |
Purchase order number that is displayed on the invoice. |
shippingRateId |
String | No |
ID of the shipping rate. If this value is not set, the cheapest applicable shipping rate is chosen. |
billingAddress |
Object | No |
Billing address details. |
websiteId |
Object | Yes | |
orderId |
String | No |
ID of the shipping rate. If this value is not set, the cheapest applicable shipping rate is chosen. |
transaction |
Object | No |
Initial transaction. |
customFields |
Object | No |
Custom fields copied to resources. |
customFields.transactions |
Object | No |
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields. |
customFields.customers |
Object | No |
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields. |
customFields.subscriptions |
Object | No |
Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields. |
invoice |
Object | No |
Initial invoice. |
token |
String | No |
Session token that is used for authentication. This token can be used to view the created order, invoice, and transaction. |
redirectUrl |
String | No |
URL to redirect the end-user when an offsite transaction is completed.
If
This field defaults to the configured website URL.
You may use |
password |
String | No |
Customer account password. If this value is set, it is used to create a customer account. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.