ServiceNow
How to place a Commerce Cloud order from a ServiceNow RITM or TASK, and write the response back to the ticket.
This scenario covers the end-to-end integration between ServiceNow and Commerce Cloud for automated IT procurement. The typical trigger is an approved RITM (Requested Item) or TASK, which your Flow or Business Rule converts into a Commerce Cloud order.
How it could work
The diagram below shows a high-level flow view from an approved ServiceNow request to receiving updates back in the ticket — using a Flow Designer flow with a REST step.
This is just an example to give you an idea of how you could design it in your ServiceNow instance.
Field mapping
The table below maps ServiceNow record fields to the Commerce Cloud order request.
| Commerce Cloud field | ServiceNow source | Notes |
|---|---|---|
externalDocumentNumber | sc_req_item.number | Returned on the invoice for reconciliation |
type | Static value | Set to "New" — For special needs, agree this with your account manager |
invoice.id | Provided by Danoffice IT | A pre-registered invoice ID eliminates address errors |
shipping.contact.email | sc_req_item.requested_for.email | Used for delivery notifications |
shipping.address* | End user's location record | Map from cmn_location or user profile |
orderLines[].itemNumber | Catalogue item variable | The Danoffice IT item number agreed per catalogue item |
orderLines[].quantity | sc_cart_item.quantity | |
orderLines[].customerReference | task.number | Ties each line back to the source request |
Example request
The following payload shows a typical ServiceNow-originated order where you include request number and task number(s).
{
"externalDocumentNumber": "SN-ORD-00981",
"type": "New",
"invoice": {
"id": "CUST1234",
"vatNumber": "US123456789",
"companyName": "Acme Corporation",
"attentionName": "ServiceNow Procurement",
"address1": "100 Main Street",
"address2": null,
"city": "San Jose",
"zipCode": "95101",
"stateName": "California",
"countryIso2": "US"
},
"consignee": null,
"sellTo": {
"id": null,
"companyName": "Acme Corporation",
"contact": {
"firstName": "Alice",
"lastName": "Smith",
"phoneNumber": "+14085550100",
"email": "alice.smith@acme.com"
},
"address1": "100 Main Street",
"address2": null,
"city": "San Jose",
"zipCode": "95101",
"stateName": "California",
"countryIso2": "US"
},
"shipping": {
"companyName": "Acme Corporation",
"contact": {
"firstName": "Bob",
"lastName": "Jones",
"phoneNumber": "+14085550199",
"email": "bob.jones@acme.com"
},
"address1": "200 Tech Park Drive",
"address2": null,
"city": "Santa Clara",
"zipCode": "95054",
"stateName": "California",
"countryIso2": "US"
},
"orderLines": [
{
"itemNumber": "SN-LAPTOP-001",
"quantity": 1.0,
"customerReference": "TASK-LINE-1",
"comments": null
},
{
"itemNumber": "SN-DOCK-002",
"quantity": 2.0,
"customerReference": "TASK-LINE-2",
"comments": null
}
]
}Writing the response back to ServiceNow
When the order is accepted, store the correlationId from the response on the ServiceNow record. This is your link between the ticket and every webhook event that follows.
A typical Business Rule or Flow Action would do something like:
// In a REST step's "Response" section
var correlationId = JSON.parse(response.body).data.correlationId;
current.u_cc_correlation_id = correlationId; // custom field on the RITM
current.update();This field becomes the key for matching incoming webhook events — when Danoffice IT sends a shipping update, you look up the RITM by u_cc_correlation_id and update the ticket automatically.
Integration checklist
Before going live
- Item numbers in your ServiceNow catalogue are agreed with your Danoffice IT account manager
- Invoice ID or full invoice address has been confirmed
- A custom field (e.g.
u_cc_correlation_id) exists on the RITM or TASK to store thecorrelationId - Your webhook endpoint is configured and tested (only needed if you require live order updates) — see Events
- Error responses (400, 401) are handled and surfaced in the ServiceNow ticket