Newer Version Available

This content describes an older version of this product. View Latest

Commerce Webstore Checkout

Get, delete, or update a Commerce store checkout.

If a store is segmented into markets, this API looks at the language parameter appended to the URL to determine the shopper’s locale and returns the appropriate values.

Resource
1/commerce/webstores/webstoreId/checkouts/activeOrCheckoutId
Values for activeOrCheckoutId are:
  • checkoutId—ID of the checkout.
  • active—Active checkout.
Available version
55.0
If you want to use this resource with a WebStore of type B2CE, open a case with Salesforce Support and provide this information:
  • Salesforce organization ID
  • Tenant ID (You can find this ID on the Manage Cloud-to-Cloud Connections page in Setup)
  • B2C Commerce Business Manager login URL
  • B2C Commerce site IDs
HTTP methods
DELETE, GET, PATCH

To ensure that asynchronous checkout processes, such as calculating shipping, taxes, and promotions, finish, you must make a GET request to /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId or /commerce/webstores/webstoreId/checkouts/checkoutId at least one time after making a PATCH request to /commerce/webstores/webstoreId/checkouts/activeOrCheckoutId. While the asynchronous checkout processes, GET requests return a 202 status. When checkout processing is complete, requests return a 200 status with up-to-date data.

Note

To resolve a 409 error returned on a PATCH or DELETE request, retry your request until it returns a 2xx status with updated data. To avoid returning a 409 error on PATCH or DELETE requests, make sure that you don’t have any custom code that modifies the cart or a checkout session while calling PATCH or DELETE.

Response for DELETE
204: Successful Delete
Request body for PATCH
Root XML tag
<checkout>
JSON example
1{
2  "deliveryAddress": {
3    "name": "Alan Johnson",
4    "firstName": "Alan",
5    "lastName": "Johnson",
6    "region": "CA",
7    "country": "US",
8    "city": "San Francisco",
9    "street": "415 Mission St",
10    "postalCode": "94105"
11  },
12  "desiredDeliveryDate": "2021-05-28T16:41:41.090Z",
13  "shippingInstructions": "type code 1234 on gate keypad",
14  "customFields": [
15    {
16      "attributes": {
17        "type": "WebCart"
18      },
19      "Id": "0a6xx0000000000",
20      "MyCustomTextField__c": "Foo",
21      "MyCustomNumberField__c": 12.34,
22      "MyCustomPercentField__c": 0.2345,
23      "MyCustomGeolocationField__c": {
24        "latitude": 33.345,
25        "longitude": 45.567
26      }
27    },
28    {
29      "attributes": {
30        "type": "CartDeliveryGroup"
31      },
32      "Id": "0a7SB000000oBujYAE",
33      "MyCustomTextField__c": "Bar",
34      "MyCustomNumberField__c": 4.55,
35      "MyCustomPhoneField__c": "4145551212",
36      "MyCustomAddressField__c": {
37        "street": "100 Folsom Street",
38        "city": "San Francisco",
39        "state": "California", //This field isn't currently supported in customFields.
40        "stateCode": "US_CA",
41        "postalCode": "93555",
42        "country": "United States", //This field isn't currently supported in customFields.
43        "countryCode": "US",
44        "geocodeAccuracy": "City",
45        "latitude": 34,
46        "longitude": 85.9
47      }
48    }
49  ]
50}
Properties
Name Type Description Required or Optional Available Version
contactInfo Contact Information Input Contact information for the checkout. Optional 55.0
customFields sObject Attributes Input[]

Array of sObjects with respective custom fields. Currently, custom fields are supported on WebCart and CartDeliveryGroup entities. You can specify up to 21 sObjects in the array: one WebCart and multiple CartDeliveryGroups.

Field-level security rules from the shopper profile are applied to the custom fields. The rules are applied for registered shoppers and for the guest shopper profile.

You can specify this property only if you specify at least one other property. For example, you can set custom fields in PATCH checkouts when you specify the guest contact information or a delivery method (in addition to setting the delivery address).

The custom fields can be of type Checkbox, Currency, Date, Email, LongTextArea, Number, Percent, Phone, Text, TextArea, Url, Address, or Location. We currently don’t support updating the country and state fields through customFields as part of the address update using request. Instead, specify the countryCode and stateCode.

Use the yyyy-MM-dd format to specify date fields.

Use the yyyy-MM-ddTHH:mm:ss.SSS+/-HH:mm or yyyy-MM-ddTHH:mm:ss.SSSZ formats to specify dateTime fields. When a timezone is added to a UTC dateTime, the result is the date and time in that timezone.

Use the HH:mm.ss.SSS or HH:mm.ss.SSSZ formats to specify time fields. When a timezone is added to a UTC time, the result is the time in that timezone.

The customFields property isn't supported in stores built on an Aura template.

Optional 60.0
delivery​Address Checkout Address Input Shipping address for the checkout. Optional 55.0
delivery​MethodId String Delivery method ID for the checkout.

When Shipping is disabled for your web store, updation of delivery method isn’t supported.

Optional 55.0
desired​Delivery​Date String Desired delivery date for the checkout. Optional 55.0
shipping​Instructions String Special shipping instructions for the checkout. Optional 55.0
Response body for GET and PATCH
Checkout