Return a summary of the cart status including pricing, account, multi-site, and additional action information.
-
Pricing information, such as total one-time charges and total recurring charges
-
Account information associated with the cart
-
If the cart includes a multi-site order and available sites
-
Links to further actions, such as checkout
GET /v2/cpq/carts/{cart_ID}/items/checkout
This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the UserSecurity class with this API. See Guest User Technical Details.
For additional information, see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.
Remote Method
getCarts
REST Handler
CpqCreateCartActionV2
Apex Remote Service
Class: vlocity_cmt.CpqAppHandler
method: global Object invokeMethod(String methodName, Map<String,Object> inputs, Map<String,Object> output, Map<String,Object> options)
Apex Remote Input Map
String methodName: checkout
Map<String,Object>
inputs: SAME AS SAMPLE REQUEST Body
API Parameters and Response Format
For API parameter names and descriptions, see Cart-Based API Swagger Reference.
Resource Information
| Response Format | JSON |
|---|---|
| Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout |
Example Request Body
The checkOrderStatus parameter indicates whether a set of status fields should be checked prior to allowing an order to be checked out. If checkOrderStatus is set to true (the default):
{
"methodName": "checkout",
"cartId": "8012800000004GFAAY",
"ContextId": "8012800000004GFAAY",
"objectTypeToIdsToClone": "OrderItem:8021N000008NG5t",
"validateSubmittedXLI": false,
"checkOrderStatus": true,
"provisioningStatus": "Active"
}
-
Any order that is active cannot be submitted.
-
If any of the following is true, the order is determined to be active:
-
Status has a value of Activated
-
OrderStatus_c has any of the following values:
-
In Progress
-
Cancelled
-
Cancel Requested
-
Complete
-
-
SupersededOrderId_c is not null
-
If checkOrderStatus is set to false, the order can be processed even if the order is active.
The validateSubmittedXLI parameter controls the pre-submit validation for the checkout API. If true, it will validate whether the user has submitted complete bundles and if all the line items have the field FulfilmentStatus__c value set to Activated. If either or both of those conditions are not met, the transaction will fail.
Example Responses
The following example shows a response to a successful submit.
{
"totalSize": 1,
"messages": [
{
"code": "SUBMIT-1008",
"severity": "INFO",
"message": "Order 8012M000007mAQIQA2 was successfully assetized and activated"
}
],
"records": [
{
"messages": [
],
"displaySequence": -1,
"id": "0012M00002GchG1QAJ",
"objectType": "Account",
"clonedObjectIds": [
"02i2M00000Q8FZNQA3",
"02i2M00000Q8FZOQA3"
]
}
]
}
The following example shows a response to a failed submit if validate is true and some or all the line items are not activated.
{
"totalSize": 0,
"messages": [
{
"code": "214",
"severity": "ERROR",
"message": "The following line items are not activated: 8021N00000BS6TFQA1,8021N00000BS6VPQA1,8021N00000BS6VQQA1,8021N00000BS6TGQA1,8021N00000BS6THQA1,8021N00000BS6TKQA1,8021N00000BS6TLQA1,8021N00000BS6TMQA1,8021N00000BS6TNQA1"
}
]
}
The following example shows a response to a failed submit if validate is true, some bundles are incomplete, and some or all line items are not activated.
{
"totalSize": 0,
"messages": [
{
"code": "214",
"severity": "ERROR",
"message": "The following line items are not activated 8021N00000BS6VQQA1 | Please submit the full bundle for the following line item(s) 8021N00000BS6VQQA1"
}
]
}
Message Codes
| Code | Description |
|---|---|
| SUBMIT-1001 | Order submission is accepted by OM. |
| SUBMIT-1002 | Order submission is provisionally accepted. |
| SUBMIT-1003 | Order submission was rejected for PONR. |
| SUBMIT-1004 | Order submission was rejected because queue is full. |
| SUBMIT-1005 | Order submission is done without a required parameter. This will be used only during integration. |
| SUBMIT-1006 | Order Management responded with an unknown response code. |
| SUBMIT-1007 | Order Management responded with "rejected" and without a reason code. |
| SUBMIT-1008 | Auto-assetization is successful, which happens if OdinAPIAutoAssetizeHandler is configured for OdinAPIHandler. |
| SUBMIT-1009 | Order submission ran into an exception that may not be reproducible. |