logo

NJP

DYK: Create your TMF payloads in simple steps.

Import · Sep 11, 2023 · article

DYK (Did You Know) is a series of articles that introduces simple and basic concepts of the working of ServiceNow TMT Applications.

Application: Order Management

Release: All applicable

Order Management application is Catalog driven. Typical set of steps followed at any implementation are:

[1] Design & Construct the Catalog model via Catalog Manager

[2] Design & Configure the Orchestration subflows via Flow Designer

[3] Configure the Subflow invocation conditions via Decision Tables

Once this is done, we are ready to test the configuration by submitting Orders.

Order Management accepts orders via TMF APIs (622 – Product Orders or 641 – Service Orders) or via Agent Workspace (UI driven).

The design-build-test is an iterative process, and we end up submitting a lot of orders.

The most efficient way of submitting an order is to submit this via an API, but often a challenge faced by folks is ‘how to construct the API payload’ or ‘it is cumbersome to create a TMF API payload’.

This article suggests a simple way of solving this problem, that hopefully saves time for you.

Step 1: Once the initial set up is done, create an order via the Agent workspace and submit it.

Optional: Go ahead and complete the fulfilment tasks to complete the Order – but for the purposes of this article it is not required.

Step 2: Get the Sys Id (sys_id) of the Order that was submitted.

ShashankInamdar_0-1694451364340.png

Step 3: Navigate to All > REST API Explorer

ShashankInamdar_1-1694451364349.png

Step 4: On the REST API Explorer, select:

Namespace = sn_ind_tmt_orm

API Name = Product Order Open API or Service Order Open API (subject to payload you need)

API version = latest

Select the API – ‘Get Product Order’ or ‘Get Service Order’

ShashankInamdar_2-1694451364352.png

This is the GET method supported for the TMF622/TMF641 API.

Notice the URL formed on the right, such as –

GET https://.service-now.com/api/sn_ind_tmt_orm/order/productOrder/{id}

Step 5: Under Prepare request, key in the Sys Id of the order that was fetched in Step 2 and hit the Send button at the bottom.

ShashankInamdar_3-1694451364358.png

For a valid Sys Id, the API returns a 200 OK response along with the response payload.

The response payload is a representation of the TMF622 (Product) or TMF641 (Service Order).

ShashankInamdar_4-1694451364375.png

Step 6: Copy the response body from Step 5, view it in your choice of json viewer/editor.

Edit the payload as necessary – such as for different characteristic values, Account/Contact/Location information etc.

Note: Ensure the Requested Start/Completion dates follow the business rules.

Step 7: To submit an order using this payload, either use a REST client such as Postman or from the REST API Explorer choose the API ‘Create Order (POST)’ and paste the payload under the Request Body under the Raw tab.

ShashankInamdar_5-1694451364383.png

Note: When using Create Order API, from the Utah release there is an option to set the value for the field ‘mode’.

When no value is set, the order is treated as a ‘sync’ order.

When the value is set as ‘sync’, the order is processed asynchronously.

(We will cover the Async mode in a separate article)

ShashankInamdar_6-1694451364386.png

On successful submission of the POST request, the API returns a 201 Created response.

The Response Body returns the Sys Id (id) of the newly created Order.

Check the Order from under Customer Orders.

Feel free to comment or provide feedback on this article.

Mark this as Helpful :thumbs_up:, if you found this of value and/or feel this will be useful for the wider community.

View original source

https://www.servicenow.com/community/telecomm-articles/dyk-create-your-tmf-payloads-in-simple-steps/ta-p/2668114