Checkout Input

Input for a Commerce store checkout.
Root XML tag
<checkout>
JSON examples
Here’s an example of a request including contact information and Cart custom fields:

The PATCH request fails if it includes contact information with Cart Delivery Group custom fields or with both Cart and Cart Delivery Group custom fields.

Note

1{
2  "contactInfo": {
3    "firstName": "Alan",
4    "lastName": "Johnson",
5    "email": "al**@jo*****.com",
6    "phoneNumber": "******3944"
7  },
8  "customFields": [
9    {
10      "attributes": {
11        "type": "WebCart"
12      },
13      "Id": "0a6xx0000000000",
14      "MyCustomTextField__c": "Foo",
15      "MyCustomNumberField__c": 12.34,
16      "MyCustomPercentField__c": 0.2345,
17      "MyCustomGeolocationField__c": {
18        "latitude": 33.345,
19        "longitude": 45.567
20      }
21    }
22  ]
23}
Here’s an example of a request including delivery method and custom fields:

A PATCH request that includes deliveryMethodId clears all payment information for the checkout, including WebCart.BillingAddress.

Note

1{
2  "deliveryMethodId": "7cdLT000000EzA5YAK",
3  "customFields": [
4    {
5      "attributes": {
6        "type": "WebCart"
7      },
8      "Id": "0a6xx0000000000",
9      "MyCustomTextField__c": "Foo",
10      "MyCustomNumberField__c": 12.34,
11      "MyCustomPercentField__c": 0.2345,
12      "MyCustomGeolocationField__c": {
13        "latitude": 33.345,
14        "longitude": 45.567
15      }
16    },
17    {
18      "attributes": {
19        "type": "CartDeliveryGroup"
20      },
21      "Id": "0a7SB000000oBujYAE",
22      "MyCustomTextField__c": "Bar",
23      "MyCustomNumberField__c": 4.55,
24      "MyCustomPhoneField__c": "******1212",
25      "MyCustomAddressField__c": {
26        "street": "100 Folsom Street",
27        "city": "San Francisco",
28        "state": "California", //This field isn't currently supported in custom fields.
29        "stateCode": "US_CA",
30        "postalCode": "93555",
31        "country": "United States", //This field isn't currently supported in custom fields.
32        "countryCode": "US",
33        "geocodeAccuracy": "City",
34        "latitude": 34,
35        "longitude": 85.9
36      }
37    }
38  ]
39}
Here’s an example of a request including shipping information (deliveryAddress, desiredDeliveryDate, and shippingInstructions) and custom fields:

The PATCH request fails if it includes only shipping instructions along with custom fields for either Cart or Cart Delivery Group.

Note

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": "******1212",
36      "MyCustomAddressField__c": {
37        "street": "100 Folsom Street",
38        "city": "San Francisco",
39        "state": "California", //This field isn't currently supported in custom fields.
40        "stateCode": "US_CA",
41        "postalCode": "93555",
42        "country": "United States", //This field isn't currently supported in custom fields.
43        "countryCode": "US",
44        "geocodeAccuracy": "City",
45        "latitude": 34,
46        "longitude": 85.9
47      }
48    }
49  ]
50}
Here’s an example of a request including shipping information (deliveryAddress, desiredDeliveryDate, and shippingInstructions) without custom fields:

Any combination of these three sub-resources is valid if custom fields aren’t included in the request.

Note

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}
Here’s an example of a request for a guest user, including contact information and delivery address:
1{
2  "contactInfo": {
3    "firstName": "Alan",
4    "lastName": "Johnson",
5    "email": "al**@jo*****.com",
6    "phoneNumber": "******3944"
7  },
8  "deliveryAddress": {
9    "name": "Alan Johnson",
10    "firstName": "Alan",
11    "lastName": "Johnson",
12    "region": "CA",
13    "country": "US",
14    "city": "San Francisco",
15    "street": "415 Mission St",
16    "postalCode": "94105"
17  }
18}
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