# 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 only accepts dates in the format `YYYY-MM-DDTHH:MM:SS.sss.000+0000`.
  For example, `2023-01-24T11:13:33.000+0000`.
:::

```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-7"
}
```

## Package

Communication (vlocity_cmt)

## API Parameters and Response Format

For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).

## Resource Information

| Response Format | JSON                                      |
| --------------- | ----------------------------------------- |
| Resource URL    | `/services/apexrest/{namespace}/v2/carts` |

## Example Request

To raise a Change Order for a specific time and date:

```nolang
{
"subaction": "assetToOrder",
"id": "02i3O000006PrKSQA0",
"accountId": "0013O00000N6TEN",
"requestDateTime": "2021-11-10 10:24:04"
}
```

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

```nolang
{
"methodName":"assetToOrder",

"id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0",
"accountId":"801360000008eNU",
"requestDateTime":"2021-10-7"
}
```

## Example Response

```nolang
{
 "error": "OK",
 "errorCode": "INVOKE-200",
 "result": {
 "actions": "0x6be19049",
 "data": "0x7988afe5",
 "messages": "0x1c660bd",
 "records": "0x37796bf6",
 "totalSize": 0
 }
}
```
