---
schema_version: "1"
id: c65ad592edb97f5e929b308680b29c0832f022b0b276acf97462559eb55631ed
title: Create Cart (assetToOrder)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/standard_cart/std_comms-create-cart__assettoorder-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/std_comms-create-cart__assettoorder-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d9869e64a406f50c238514525c0668d73d8f36c46d18ed20d920996e9317a0ed
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Create Cart (assetToOrder)

Create orders from existing assets by performing move, add, change, and delete (MACD) actions. Use assetToOrder only for Future Dated Orders.

**note:** - 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`

- Standard Cart APIs parse these ISO date and date-time formats and do not use the running user's Salesforce locale. Classic Cart APIs parse date fields with locale-based `Date.parse()`, so values such as `dd/mm/yyyy` can succeed for day-first locales. Send ISO values (`yyyy-MM-dd` or `yyyy-MM-dd'T'HH:mm:ss'Z'`) so the same payload works when Standard Cart APIs are enabled or disabled.

```nolang
POST /v2/carts
```


## Remote Method

```nolang
assetToOrder
```

## REST Handler

```nolang
APICreateCartsCpqV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```


## Apex Remote Input Map

```nolang
{
"methodName":"assetToOrder",
"id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0",
"accountId":"801360000008eNU",
"requestDateTime":"2021-10-07"
}
```

## Apex Sample

```nolang
  String methodName = 'assetToOrder';
  String assetId = '02iS80000040exdIAA';
  String accountId = '001du000002PciXAAS';
  String requestDateTime = '2025-06-06T07:19:14.174Z';
  Map<String, Object> inputMap = new Map<String, Object>();
  Map<String, Object> outputMap = new Map<String, Object>();
  Map<String, Object> optionsMap = new Map<String, Object>();
  inputMap.put('subaction', methodName);
  inputMap.put('id', assetId);
  inputMap.put('accountId', accountId);
  inputMap.put('requestDateTime',requestDateTime);
  vlocity_cmt.CpqAppHandler cpqAppHandlerService = new vlocity_cmt.CpqAppHandler();
  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

```nolang
{
    "subaction": "assetToOrder",
    "id": "02ixx0000004HROAA2",
    "inputFields": [ { "RecordTypeId": "012xx0000005pgzAAA" } ],
    "accountId": "001xx000003GfGdAAK",
    "requestDateTime": "2024-09-30 19:24:04"
}
```

To raise a Change Order on the current time and date:

```nolang
{
"subaction":"assetToOrder",
"id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0",
"accountId":"801360000008eNU",
"requestDateTime":"2021-10-07"
}
```

## Example Response

```nolang
{
"messages":[],
"records":[
  {
  "messages":[],
  "cartId":"801xx000003GfgxAAC",
  "displaySequence":-1
  }
  ],
  "totalSize":0
}
```
