Checkout endpoint 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 /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.

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

  • commercetools

  • Salesforce Commerce Cloud

  • SAP Commerce Cloud

POST

Post shipping methods

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.

Request URL

/.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

addressWrapper

required

The JSON param for the address object.

body

address

cartId

required

The ID for the checkout cart.

path

string

accessToken

required

The user’s access token.

header

string

PUT

Set a shipping method

Returns the payment method and total amounts for the cart.

Request URL

.rest/ecommerce/v2/carts/{cartId}/shippingmethod

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

shippingInformationWrapper

required

The shipping information wrapper.

body

shippingInformationWrapper

accessToken

required

The user’s access token.

header

string

POST

Post an order

Creates an order and returns an orderId.

Request URL

/.rest/ecommerce/v2/orders/carts/{cartId}

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

paymentInformation

required

The JSON param for the payment object.

body

paymentInformation

accessToken

required

The user’s access token.

header

string

PUT

Set an address

Sets an 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/carts/{cartId}/address

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

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

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

POST

Post shipping methods

Gets the shipping method for a cart by location and currency.

Request URL

/.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

addressWrapper

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

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

PUT

Set a shipping method

Sets the shipping method for a cart and returns the cart with the shipping method.

Request URL

.rest/ecommerce/v2/carts/{cartId}/shippingmethod

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

shippingInformationWrapper

required

The shipping information wrapper.

body

shippingInformationWrapper

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

POST

Post an order

Creates and returns an order.

Request URL

/.rest/ecommerce/v2/orders/carts/{cartId}

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

GET

Get a shipping method

Returns a shipping method.

Request URL /.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

Prerequisite token

In the case of Salesforce Commerce, you must prepare a token from Salesforce Commerce. A guest token is required for anonymous users. For logged in users, a token is also required.

Query example: https://magnolia1-tech-prtnr-eu02-dw.demandware.net/s/RefArchGlobal/dw/shop/v20_3/customers/auth?client_id=0a0dddf0-aaf0-0000-b000-000000c00a0e

In both cases, in the response header, you have an item named Authorization with a value such as Bearer xyzabc, xyzabc is your token (exclude Bearer).

PUT

Set an address

Set existing addressId of logged in user.

Request URL

/.rest/ecommerce/v2/carts/{cartId}/address

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

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

cartId

required

The ID for the checkout cart.

path

string

accessToken

required

The user’s access token.

header

string

POST

Post shipping methods

Creates a new shipping method.

Request URL

/.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

addressWrapper

required

The JSON param for the address object.

body

address

cartId

required

The ID for the checkout cart.

path

string

accessToken

required

The user’s access token.

header

string

PUT

Set a shipping method

Returns the payment method and total amounts for the cart.

Request URL

.rest/ecommerce/v2/carts/{cartId}/shippingmethod

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

shippingInformationWrapper

required

The shipping information wrapper.

body

shippingInformationWrapper

accessToken

required

The user’s access token.

header

string

POST

Post an order

Creates and returns an order.

Request URL

/.rest/ecommerce/v2/orders/carts/{cartId}

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

accessToken

required

The user’s access token.

header

string

GET

Get a shipping method

Returns a shipping method.

Request URL /.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

accessToken

required

The user’s access token.

header

string

Also see the User endpoint, which can be used to log in a user and retrieve their address and payment information from your SAP Commerce Cloud service.

PUT

Set an address

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/carts/{cartId}/address

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

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

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

POST

Post shipping methods

Creates a new shipping method.

Request URL

/.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

addressWrapper

required

The JSON param for the address object.

body

address

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

PUT

Set a shipping method

Returns the payment method and total amounts for the cart.

Request URL

.rest/ecommerce/v2/carts/{cartId}/shippingmethod

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

shippingInformationWrapper

required

The shipping information wrapper.

body

shippingInformationWrapper

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

POST

Post an order

Creates and returns an order.

Request URL

/.rest/ecommerce/v2/orders/carts/{cartId}

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

GET

Get a shipping method

Returns a shipping method.

Request URL /.rest/ecommerce/v2/carts/{cartId}/shippingmethods

Parameters

Parameter Description Type Data Type

definitionName

required

The definition name.

query

string

connectionName

required

The connection name.

query

string

cartId

required

The ID for the checkout cart.

path

string

userId

required

The userId must be Base64-encoded.

The unique ID of the user.

header

string

accessToken

required

The user’s access token.

header

string

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Ecommerce module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules