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

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 website.url is https://example.com, then the redirectUrl can be set to one the following:

  • https://example.com

  • https://example.com/some/path

  • https://example.com/some/path?and=query

  • https://example.com/some/path?and=query#and-fragment

This field defaults to the configured website URL. You may use {id} or {result} as placeholders in the URL. These placeholders are replaced with the transaction ID and result.

password String No

Customer account password. If this value is set, it is used to create a customer account.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. 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.
  3. Click Test request to test run your request to the API and see the API's response.