---
schema_version: "1"
id: 10850e4ecdbdfba178590befc350d3074eeed6c6dc9f1ebbb642b125e394630a
title: "SDK Example: Create and Submit the Order (Winter '20)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-examplecreate-and-submit-the-orderwinter20-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-examplecreate-and-submit-the-orderwinter20-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fe17de085bb1146f3f399a97c77bbd48afff7c11c5f7a58899cc18f9dbca47b1
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Create and Submit the Order (Winter '20)

Use the example SDK code in this topic to create and submit the order as the final step in the checkout process.

```nolang
// Instantiate the input object for submitOrder to specify parameters
const input = digitalCommerce.createSubmitOrderInput();
input.email = "YOUR EMAIL ID";
input.catalogCode = "CATALOG CODE";
input.cartContextKey = "CART CONTEXT KEY";
input.orderId = "ORDER ID"; // optional parameter

// Invoke submitOrder API
digitalCommerce
  .submitOrder(input)
  .then(response => {
    Logger.info(
      "Vlocity digital commerce submitOrder: " + JSON.stringify(response)
    );
  })
  .catch(error => {
    Logger.info("submitOrder apexrest call failed" + error);
  });
```

Possible error conditions:

"SubmitOrderInput::getRequestPayload() must have email."

"SubmitOrderInput::getRequestPayload() must have catalogCode."

"SubmitOrderInput::getRequestPayload() must have cartContextKey."
