Create Cart (assetToOrder)

Create orders from existing assets by performing move, add, change, and delete (MACD) actions. Use assetToOrder only for Future Dated Orders.

  • The inputFields is not supported for AssetToOrder (subaction as assetToOrder).

  • This API supports following Date and DateTime formats.

    • yyyy-MM-dd
    • yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
    • yyyy-MM-dd'T'HH:mm:ss.SSSZ
    • yyyy-MM-dd'T'HH:mm:ss.SSSX
    • yyyy-MM-dd'T'HH:mm:ssXXX
    • yyyy-MM-dd'T'HH:mm:ss'Z'
    • yyyy-MM-dd HH:mm:ss
    • YYYY-MM-DDTHH:MM:SS.sss.000+0000

    Date format example:

    • 2025-06-01

    DateTime format examples:

    • 2026-01-24T11:13:33.000Z
    • 2026-01-24T11:13:33.000+0000
    • 2026-06-01T12:34:56.789Z
    • 2026-06-01T12:34:56+00:00
    • 2026-06-01T12:34:56Z
    • 2026-06-01 12:34:56

Note

1POST /v2/carts

Remote Method 

1assetToOrder

REST Handler 

1APICreateCartsCpqV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{
2"methodName":"assetToOrder",
3"id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0",
4"accountId":"801360000008eNU",
5"requestDateTime":"2021-10-07"
6}

Apex Sample 

1String methodName = 'assetToOrder';
2  String assetId = '02iS80000040exdIAA';
3  String accountId = '001du000002PciXAAS';
4  String requestDateTime = '2025-06-06T07:19:14.174Z';
5  Map<String, Object> inputMap = new Map<String, Object>();
6  Map<String, Object> outputMap = new Map<String, Object>();
7  Map<String, Object> optionsMap = new Map<String, Object>();
8  inputMap.put('subaction', methodName);
9  inputMap.put('id', assetId);
10  inputMap.put('accountId', accountId);
11  inputMap.put('requestDateTime',requestDateTime);
12  vlocity_cmt.CpqAppHandler cpqAppHandlerService = new vlocity_cmt.CpqAppHandler();
13  cpqAppHandlerService.invokeMethod(methodName, inputMap, outputMap, optionsMap);

Package 

Communication (vlocity__cmt)

Resource Information 

Resource URL: /services/apexrest/{namespace}/v2/carts Response Format: JSON

Example Request 

While performing AssetToOrder we can create Order of specific RecordType by RecordTypeId in the request payload

1{
2    "subaction": "assetToOrder",
3    "id": "02ixx0000004HROAA2",
4    "inputFields": [ { "RecordTypeId": "012xx0000005pgzAAA" } ],
5    "accountId": "001xx000003GfGdAAK",
6    "requestDateTime": "2024-09-30 19:24:04"
7}

To raise a Change Order on the current time and date:

1{
2"subaction":"assetToOrder",
3"id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0",
4"accountId":"801360000008eNU",
5"requestDateTime":"2021-10-07"
6}

Example Response 

1{
2"messages":[],
3"records":[
4  {
5  "messages":[],
6  "cartId":"801xx000003GfgxAAC",
7  "displaySequence":-1
8  }
9  ],
10  "totalSize":0
11}