Checkout endpoint API v2

This page describes the checkout endpoint, which can be used to interact with your external e-commerce solution’s REST checkout service.

In v2, all the rest-call paths have been slightly changed to be more descriptive and intuitive. The v2 checkout endpoint sets the address of a cartId to ensure the correct resource is consistently identified. For example, the v1 /checkouts/address/{cartId} becomes in v2 /checkouts/carts/{cartId}/address.

In general, the checkout process involves four steps:

  1. Set an address.

  2. Get shipping methods.

  3. Set a shipping method.

  4. Create an order.

Note that in Adobe Commerce (formerly Magento), steps 1 and 2 are combined in step 2. Get shipping methods, where you must provide the address object as a required parameter. Skip step 1 if you are using Adobe Commerce as your external e-commerce solution.

Magento is now Adobe Commerce, powered by Magento. In the examples and configuration below, we refer to Adobe Commerce as Magento.

PUT address

Only relevant for commercetools.

Sets address. The shipping address is set by default and is required for a successful checkout process. The billing address is set when the address object contains the field addressType with a billing value. The billing address is optional.

Request URL

/.rest/ecommerce/v2/checkouts/cart/{cartId}/address

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

commercetools

connectionName

required

The connection name.

query

string

commercetools

address

required

The shipping address (does not require addressType field) or the billing address if the addressType field is set with the billing value.

body

address

commercetools

cartId

required

The ID for the checkout cart.

path

string

commercetools

POST shipping methods

For Magento, sets the address for checkout and gets a list of shipping methods for a cart (make sure the cart has at least one item, otherwise empty is returned).

For commercetools, gets the shipping method for a cart by location and currency.

Request URL

/.rest/ecommerce/v2/checkouts/cart/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

commercetools

Magento

connectionName

required

The connection name.

query

string

commercetools

Magento

address

required

The JSON param for the address object.

commercetools requires only the countryCode and currencyCode fields to be set in the address object.

body

address

commercetools

Magento

cartId

required

The ID for the checkout cart.

path

string

commercetools

Magento

PUT shipping method

Returns the payment method and total amounts for the cart.

For commercetools, sets the shipping method for a cart and returns the cart with the shipping method.

Request URL

.rest/ecommerce/v2/checkouts/cart/{cartId}/shippingmethod

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

commercetools

Magento

connectionName

required

The connection name.

query

string

commercetools

Magento

cartId

required

The ID for the checkout cart.

path

string

commercetools

Magento

addressInformation

required

The JSON param for the addressInformation object.

body

addressInformation

For commercetools, only the shippingMethodId field in the addressInformation JSON object is required

commercetools

Magento

POST an order

For Magento, creates an order and returns an orderId.

For commercetools, creates and returns an order.

Request URL

/.rest/ecommerce/v2/checkouts/cart/{cartId}/order

Parameters

Parameter Description Type Data Type Connector

definitionName

required

The definition name.

query

string

commercetools

Magento

connectionName

required

The connection name.

query

string

commercetools

Magento

cartId

required

The ID for the checkout cart.

path

string

commercetools

Magento

payment

required (Magento only)

The JSON param for the payment object.

body

payment

Magento

Feedback