XOMSubmitOrder: Submit customer order to Vlocity order management - sashavmorozov/vlocity-utilities GitHub Wiki
Revision History
Version | Date | Changed By | Description | Reference |
---|---|---|---|---|
0.1 | Apr 19, 2019 | [email protected] | Initial draft |
Purpose
The interface can be used by a frontend application or an omniscript to submit a previously configured order to Vlocity order management for further fulfillment. The order submission can be done either in synchronous or asynchronous mode.
This interface can be consumed by:
- front-end application
- guided process (ordering, care, etc.)
Interface: REST (POST)
Engine: Vlocity Integration Procedure
Endpoint: /services/apexrest/vlocity_cmt/v1/integrationprocedure/Otter_XOMSubmitOrder
Input Parameters
Parameter | Mandatory | Type | Default | Description | Example |
---|---|---|---|---|---|
orderId | Yes |
String | Salesforce ID of the order to be submitted | 8014J000000PC2n | |
mode | Yes |
String | Operation mode (synchronous or asynchronous) | Async,Sync |
Business Logic
The procedure performs the following logic:
- Input data validation (according to the Input Parameters section)
- Order status validation (should be
Draft
) - Initiate XOM decomposition and orchestration processes
Response Messages
Code | Severity | Message |
---|---|---|
305 | INFO | Submission process for the order with Id {orderId} is completed |
305 | INFO | Submission process for the order with Id {orderId} is scheduled. Follow the progress (and possible errors) in Salesforce Job with Id {jobId} |
208 | ERROR | orderId parameter is mandatory |
208 | ERROR | Mode parameter is mandatory and should be one of the following values (Sync, Async) |
208 | ERROR | Id {orderId} is not of the Order type |
208 | ERROR | Order with Id {orderId} does not exist |
208 | ERROR | The order with Id {orderId} cannot be submitted because it is not in the Draft state |
Sample Request
POST /services/apexrest/vlocity_cmt/v1/integrationprocedure/Otter_XOMSubmitOrder
{
"mode": "Sync",
"orderId": "8014J000000PC2n"
}
Sample Response (Success)
{
"code": "305",
"message": "Submission process for the order with Id 8014J000000PC2nQAG is completed",
"severity": "INFO"
}
Sample Response (Error)
{
"code": "208",
"message": "The order with Id 8014J000000PC2nQAG cannot be submitted because it is not in the Draft state",
"severity": "ERROR"
}