POST Create Cart (Asset To Order)
POST /carts
Operation ID: AssetToOrder. Tags: Cart.
Create orders from existing assets and perform Move, Add, Change, and Delete (MACD) operations. The assetToOrder API is specifically intended for use with Future Dated Orders.
Rest Handler - APICreateCartsCpqV2 Method Invoked - createCarts
Request body (required)
While performing AssetToOrder we can create Order of specific RecordType by RecordTypeId in the request payload.
Request Example
{
"subaction": "assetToOrder",
"id": "02ixx0000004HROAA2",
"inputFields": [ { "RecordTypeId": "012xx0000005pgzAAA" } ],
"accountId": "001xx000003GfGdAAK",
"requestDateTime": "2024-09-30 19:24:04"
}
For assetToOrder, if future-dated order is not available, the requestDate should be greater than or equal to current date. If a future dated order(s) is/are available for that asset, the requestDate should be greater than or equal to current date and should be greater than or equal to the date on all the future dated orders of the asset.
For assetToOrder, the field id can be a list of all assets or just the root asset. The child assets will be retrived from the root asset.
Media type: application/json. Schema: AssetToOrderRequest.
Example: assetToOrderRequest Sample AssetToOrder Request Example
{
"subaction": "assetToOrder",
"accountId": "001xx000003H3cJAAS",
"orderId": "003xx000002fIKa",
"id": "02ixx0000004HrCAAU,02ixx0000004HrDABV",
"requestDateTime": "2025-05-16T00:00:00.000Z",
"validate": true
}
Responses
- 200
OK - API request processed. Look for messages in the response to determine if it succeeded or failed.
Media type:
application/json. Schema:AssetToOrderResponse. - 215
Example response for Invalid Request DateTime
[ { "message" : "Change To Order Failed. Request DateTime is less than now", "code" : "215", "severity" : "ERROR" } ] - 500
Look for below error code in response.
Example response for INVOKE-500
{ "errorCode" : "INVOKE-500", "error" : "An internal server error has occurred. Error ID: 672691857-12982 (1442400963)" }