The Service Order Open API provides endpoint that enable a standardized mechanism for placing service orders.

This API is a ServiceNow® implementation of the Open API TMForum TMF641 Service Ordering Management API specification.

TMF conformance logo

To access this API, the Order Management for Telecommunications (sn_ind_tmt_orm) plugin must be activated. For more information, see Install Order Management . For information about Order Management tables, entities, and relationships, see Order Management data model.

This API is provided within the sn_tmf_api namespace.

The calling user must have the sn_ind_tmt_orm.order_integrator role.

This API can be extended to make customizations around required parameters, request body validation, additional REST operations, and field mappings. For more information, see the Service Order Open API Developer Guide.

Service Order Open API – GET /sn_tmf_api/order/serviceOrder

Retrieves all service orders.

This API retrieves service order information from the following related tables:
  • Order [sn_ind_tmt_orm_order]
  • Order Characteristic Value [sn_ind_tmt_orm_order_characteristic_value]
  • Order Line Item [sn_ind_tmt_orm_order_line_item]
  • Order Line Item Contact [sn_ind_tmt_orm_order_line_item_contact]
  • Order Line Related Items [sn_ind_tmt_orm_order_line_related_items]

URL format

/api/sn_tmf_api/order/serviceOrder

Supported request parameters

Table 1. Path parameters
Name Description
None
Table 3. Request body parameters (JSON)
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 4. Request headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters (JSON)

Example: cURL request

This example retrieves all service orders.

curl --location --request GET 'http://instance.service-now.com/api/sn_tmf_api/order/serviceOrder' \
--user 'username':'password'

Response body.

[
    {
        "id": "bd30366ec3a83010abc8b5183c40dd92",
        "ponr": "true",
        "href": "/api/sn_tmf_api/order/serviceOrder/bd30366ec3a83010abc8b5183c40dd92",
        "completionDate": "2021-06-07T21:52:12.000Z",
        "expectedCompletionDate": "2018-01-14T20:07:40.000Z",
        "orderDate": "2021-06-08T05:34:59.000Z",
        "requestedCompletionDate": "2018-01-14T20:07:40.000Z",
        "requestedStartDate": "2018-01-14T20:07:40.000Z",
        "serviceOrderItem": [
            {
                "id": "100",
                "ponr": "true",
                "quantity": 1,
                "action": "add",
                "service": {
                    "@type": "Service",
                    "id": "4b5072aec3a83010abc8b5183c40dd42",
                    "state": "active",
                    "serviceType": "cfs",
                    "serviceCharacteristic": [
                        {
                            "name": "Firewall coverage",
                            "valueType": "choice",
                            "value": "Premium(Up to 50 sites)\n\t\t",
                            "previousValue": ""
                        },
                        {
                            "name": "Firewall Security",
                            "valueType": "choice",
                            "value": "Premium",
                            "previousValue": ""
                        },
                        {
                            "name": "CPE Type",
                            "valueType": "choice",
                            "value": "Physical",
                            "previousValue": ""
                        },
                        {
                            "name": "Administration Support",
                            "valueType": "choice",
                            "value": "Basic( Customer Managed)\n\t\t",
                            "previousValue": ""
                        }
                    ],
                    "serviceSpecification": {
                        "id": "f99546ff07266010a7955b7e0ad300a8",
                        "name": "Managed Firewall Service",
                        "version": "",
                        "internalVersion": "1",
                        "internalId": "f99546ff07266010a7955b7e0ad300a8",
                        "@type": "ServiceSpecificationRef"
                    }
                },
                "place": {
                    "id": "920cf6ac73d423002728660c4cf6a799",
                    "@type": "Place"
                },
                "state": "completed",
                "version": "2",
                "@type": "ServiceOrderItem"
            }
        ],
        "relatedParty": [
            {
                "id": "ffc68911c35420105252716b7d40dd55",
                "name": "Funco Intl",
                "@type": "RelatedParty",
                "@referredType": "Customer"
            },
            {
                "id": "eaf68911c35420105252716b7d40ddde",
                "name": "Sally Thomas",
                "@type": "RelatedParty",
                "@referredType": "CustomerContact"
            }
        ],
        "state": "completed",
        "version": "2",
        "@type": "ServiceOrder"
    }
]

Service Order Open API – GET /sn_tmf_api/order/serviceOrder/{id}

Retrieves a specified service order.

This API retrieves service order information from the following related tables:
  • Order [sn_ind_tmt_orm_order]
  • Order Line Item [sn_ind_tmt_orm_order_line_item]
  • Order Characteristic Value [sn_ind_tmt_orm_order_characteristic_value]
  • Order Line Item Contact [sn_ind_tmt_orm_order_line_item_contact]
  • Order Line Related Items [sn_ind_tmt_orm_order_line_related_items]

URL format

/api/sn_tmf_api/order/serviceOrder/{id}

Supported request parameters

Table 7. Path parameters
Name Description
id Sys_id of the service order to retrieve.

Data type: String

Table: Order [sn_ind_tmt_orm_order]

Table 8. Query parameters
Name Description
None
Table 9. Request body parameters (JSON)
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 10. Request headers
Header Description
None
Table 11. Response headers
Header Description
Content-Type Data format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 12. Status codes
Status code Description
200 Request successfully processed. Full resource returned in response (no pagination).
The response returns successful with an error message if the selected order has processing issues.
  • A 200 OK response happens if the order is in the Inbound Queue [sn_tmt_core_inbound_queue] table waiting for the scheduler to pick the record to be processed. The error message field includes details for the record. For example:
    {
     "code": 102,
     "reason": "Request in queue",
     "message": "Request in queue",
     "details": [
      {
       "message": "This Order is still in the inbound queue table waiting to be processed.",
       "datapath": ""
      }
     ]
    }
  • A 200 OK response happens if an order creation fails and the record in the Inbound Queue [sn_tmt_core_inbound_queue] table is in an error state. The error message field includes details in for the inbound queue table record. For example:
    {
      "code": 23,
      "reason": "Missing body field",
      "message": "Missing body field",
      "details": [
        {
          "message": "Invalid payload: orderCurrency is missing",
          "datapath": "/"
        }
      ]
    }
400 Bad request. Possible reasons:
  • Missing query parameter
  • Invalid URI
404 Not found. The requested item wasn't found.

Response body parameters (JSON)

Example: cURL request

The following example retrieves a specified service order.

curl "https://instance.service-now.com/api/sn_tmf_api/order/serviceOrder/4f2af65ac3a030106e2473ce3640ddcf" \
--request GET \
--user 'username':'password'

Response body.

{
   "id": "4f2af65ac3a030106e2473ce3640ddcf",
   "ponr": "false",
   "expectedCompletionDate": "2018-01-15T09:37:40.000Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.000Z",
   "requestedStartDate": "2018-01-15T09:37:40.000Z",
   "note": [
      {
         "author": "System Administrator",
         "date": "2021-06-07T14:53:04.000Z",
         "text": "This is a TMF service order illustration no 2"
      },
      {
         "author": "System Administrator",
         "date": "2021-06-07T14:53:03.000Z",
         "text": "This is a TMF service order illustration"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "ponr": "false",
         "action": "add",
         "actionReason": "adding service package OLI",
         "quantity": 1,
         "service": {
            "@type": "Service",
            "state": "",
            "serviceType": "cfs",
            "serviceCharacteristic": [
               {
                  "name": "Firewall coverage",
                  "valueType": "choice",
                  "value": "Premium (Up to 50 sites)",
                  "previousValue": ""
               },
               {
                  "name": "Firewall Security",
                  "valueType": "choice",
                  "value": "Standard",
                  "previousValue": ""
               },
               {
                  "name": "Administration Support",
                  "valueType": "choice",
                  "value": "Basic (Customer Managed)",
                  "previousValue": ""
               }
            ],
            "serviceRelationship": [
               {
                  "id": "326d13f45b5620102dff5e92dc81c785",
                  "relationshipType": "Requires"
               }
            ],
            "serviceSpecification": {
               "id": "f99546ff07266010a7955b7e0ad300a8",
               "name": "Managed Firewall Service",
               "version": "v2",
               "internalVersion": "2",
               "internalId": "f99546ff07266010a7955b7e0ad300a8",
               "@type": "ServiceSpecificationRef"
            }
         },
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         },
         "relatedParty": [
            {
               "id": "972af65ac3a030106e2473ce3640ddda",
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "state": "new",
         "version": "1",
         "@type": "ServiceOrderItem"
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ],
   "state": "new",
   "version": "1",
   "@type": "ServiceOrder"
   "href": "/api/sn_tmf_api/order/serviceOrder/4f2af65ac3a030106e2473ce3640ddcfç",
   "orderDate": "2021-06-08T05:34:59.000Z",
}

Service Order Open API - PATCH /sn_tmf_api/order/serviceOrder/{id}

Updates the specified service order.

URL format

Default URL: /api/sn_tmf_api/order/serviceOrder/{id}

Supported request parameters

Table 13. Path parameters
Name Description
id Sys_id of the customer order to update.

Data type: String

Table: Customer Order [sn_ind_tmt_orm_order]

Table 14. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 16. Request headers
Header Description
Accept Data format of the response body. Only supports application/json.
Content-Type Data format of the request body. Only supports application/json.
Table 17. Response headers
Header Description
Content-Type Data format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Response body parameters (JSON)

Example: cURL request

This example shows how to update a service order.

curl -X PATCH 'https://instance.service-now.com/api/sn_tmf_api/order/serviceOrder/a831e56e77602110c8b3a4d54b5a9954' \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-u "username":"password" \
-d '{
  "externalId": "BSS748",
  "priority": "1",
  "description": "Managed Security",
  "category": "TMF resource illustration",
  "requestedStartDate": "2018-01-15T09:37:40.508Z",
  "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
  "@type": "ServiceOrder",
  "note": [
    {
      "id": "1",
      "author": "Jean Pontus",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration"
    },
    {
      "id": "2",
      "author": "Jean Pontus1",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration no 2"
    }
  ],
  "serviceOrderItem": [
    {
      "id": "100",
      "action": "add",
      "actionReason":"adding service package OLI",
      "quantity": 1,
      "@type": "ServiceOrderItem",
      "service": {
        "serviceState": "active",
        "@type": "CFS",
        "serviceCharacteristic": [
          {
            "name": "CPE Type",
            "valueType": "string",
            "value": "Virtual"
          },
          {
            "name": "Administration Support",
            "valueType": "string",
            "value": "Basic( Customer Managed)"
          },
          {
            "name": "Firewall coverage",
            "valueType": "string",
            "value": "Standard(Up to 20 sites)"
          },
          {
            "name": "Firewall Security",
            "valueType": "string",
            "value": "Basic"
          }
        ],
        "serviceSpecification": {
          "id": "f99546ff07266010a7955b7e0ad300a8",
          "name": "Managed Firewall Service",
          "internalVersion": "1",
          "@type": "Managed Firewall Service"
        },
        "serviceRelationship": [
          {
            "id": "326d13f45b5620102dff5e92dc81c785",
            "relationshipType": "Requires"
          }
        ]
      },
      "place": {
        "id": "5671dd2ec3a53010188473ce3640dd81",
        "@type": "Place"
      }
    }
  ],
  "relatedParty":[
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ]
}'

Response body.

{
  "externalId": "BSS748",
  "priority": "1",
  "description": "Managed Security",
  "category": "TMF resource illustration",
  "requestedStartDate": "2018-01-15T09:37:40.508Z",
  "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
  "@type": "ServiceOrder",
  "note": [
    {
      "id": "1",
      "author": "Jean Pontus",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration"
    },
    {
      "id": "2",
      "author": "Jean Pontus1",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration no 2"
    }
  ],
  "serviceOrderItem": [
    {
      "id": "100",
      "action": "add",
      v"actionReason": "adding service package OLI",
      "quantity": 1,
      "@type": "ServiceOrderItem",
      "service": {
        "serviceState": "active",
        "@type": "CFS",
        "serviceCharacteristic": [
          {
            "name": "CPE Type",
            "valueType": "string",
            "value": "Virtual"
          },
          {
            "name": "Administration Support",
            "valueType": "string",
            "value": "Basic(Customer Managed)"
          },
          {
            "name": "Firewall coverage",
            "valueType": "string",
            "value": "Standard(Up to 20 sites)"
          },
          {
            "name": "Firewall Security",
            "valueType": "string",
            "value": "Basic"
          }
        ],
        "serviceSpecification": {
          "id": "f99546ff07266010a7955b7e0ad300a8",
          "name": "Managed Firewall Service",
          "internalVersion": "1",
          "@type": "Managed Firewall Service",
          "sys_id": "f99546ff07266010a7955b7e0ad300a8",
          "version": "",
          "status": "published",
          "internalId": "f99546ff07266010a7955b7e0ad300a8"
        },
        "serviceRelationship": [
          {
            "id": "326d13f45b5620102dff5e92dc81c785",
            "relationshipType": "Requires"
          }
        ]
      },
      "place": {
        "id": "5671dd2ec3a53010188473ce3640dd81",
        "@type": "Place"
      }
    }
  ],
  "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ],
  "orderType": "add",
  "state": "revision_received",
  "href": "/api/sn_tmf_api/order/serviceOrder/a831e56e77602110c8b3a4d54b5a9954"
}

Service Order Open API - POST /sn_tmf_api/order/serviceOrder/cancelserviceorder

Cancels the specified service order.

Note: This endpoint can't be used on orders for which the point of no return has been reached. An order line item can't be canceled while fulfillment is in progress.

URL format

Default URL: /api/sn_tmf_api/order/serviceOrder/cancelserviceorder

Supported request parameters

Table 19. Path parameters
Name Description
None
Table 20. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 22. Request headers
Header Description
Accept Data format of the response body. Only supports application/json.
Content-Type Data format of the request body. Only supports application/json.
Table 23. Response headers
Header Description
Content-Type Data format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 24. Status codes
Status code Description
200 Successful. The request was successfully processed.
400 Bad Request. Could be any of the following reasons:
  • Empty payload.
  • Invalid payload. Mandatory field missing: <field name>.
  • Invalid order ID.
  • Invalid order ID: This order is yet to be created in customer order table. The cancel request was made for an order that has not been created yet. The order is in the Inbound Queue [sn_tmt_core_inbound_queue] table waiting for the scheduler to pick up the record.

Response body parameters (JSON)

Example: cURL request

The following code example cancels a customer order.

curl -X POST "https://instance.servicenow.com/api/sn_tmf_api/cancelserviceorder" \
-H "Content-Type: application/json" \
-u "username":"password" \
-d {
  "cancellationReason": "Duplicate order",
  "requestedCancellationDate": "2023-01-24T11:56:21.931Z",
  "serviceOrder": {
    "id": "5f4f5e5377a311101fa5a4d54b5a99fd",
    "@referredType": "ServiceOrder"
  },
  "@type": "CancelServiceOrder"
}
{
  "id": "5f4f5e5377a311101fa5a4d54b5a99fd",
  "cancellationReason": "Duplicate order",
  "requestedCancellationDate": "2023-01-24T11:56:21.931Z",
  "@type": "CancelServiceOrder",
  "serviceOrder": {
    "id": "5f4f5e5377a311101fa5a4d54b5a99fd",
    "@referredType": "ServiceOrder"
  },
  "state": "done"
}

Service Order Open API – POST /sn_tmf_api/order/serviceOrder

Creates, updates, or deletes a service order or line item.

When an add action is received and accepted, a new record is created in the following tables:
  • Order [sn_ind_tmt_orm_order]
  • Order Characteristic Value [sn_ind_tmt_orm_order_characteristic_value]
  • Order Line Item [sn_ind_tmt_orm_order_line_item]
  • Order Line Item Contact [sn_ind_tmt_orm_order_line_item_contact]
  • Order Line Related Items [sn_ind_tmt_orm_order_line_related_items]

URL format

/api/sn_tmf_api/order/serviceOrder

Supported request parameters

Table 25. Path parameters
Name Description
None
Table 26. Query parameters
Name Description
mode Enables asynchronous order processing.​ That is, the order is added to the Inbound Queue [sn_tmt_core_inbound_queue] table to be created. If not included, the order is processed synchronously.

Valid value: async

Data type: String

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 28. Request headers
Header Description
Accept Data format of the response body. Only supports application/json.
Table 29. Response headers
Header Description
Content-Type Data format of the response body. Only supports application/json.

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 30. Status codes
Status codeDescription
200 Successful. The request was successfully processed.
201 Successful.
If there are any issues with the characteristics or characteristics option information, the endpoint stores the following comments in the work notes fields of the associated Customer Order Line Item record:
  • The following Order Item characteristics does not exist: Review specification <specification.name> and correct the characteristic and characteristic option in the order line item prior to approving the order.
  • Order Item characteristic: <characteristic.name> with characteristic value: <characteristic.value> is invalid. Correct the characteristic values before approving the order.
202 Accepted. Successful request for an order in asynchronous mode. That is, the request was made with the mode parameter set to async and the record is scheduled to be processed in the Inbound Queue [sn_tmt_core_inbound_queue] table.
400 Bad Request. Could be any of the following reasons:
  • Invalid payload: Request body missing. - Payload was not passed in the request body.
  • Invalid payload: serviceOrderItem missing. - Service order line item object or JSON is missing.
  • Invalid payload: serviceOrderItem ID is missing. – The ID is missing from the service order line item.
  • Invalid payload: serviceOrderItem action is missing. – The service object or JSON is missing from the payload.
  • Invalid payload: serviceOrderItem service is missing. – The service property is missing from the service order line item.
  • Invalid payload: serviceSpecification is missing. - The service specification object or JSON in the service order line item is missing from the payload.
  • Invalid payload: serviceSpecification ID is missing. - The id parameter in the service order line item of the service specification object is missing from the payload.
  • Invalid payload: Service specification does not exist. - The service specification in the service order line item is not valid.
  • Invalid payload: Product Inventory does not exist. - In a change or delete order (i.e., action = change or delete), the sold service sent is not present in the system.
  • Invalid payload: Product inventory ID is missing. – In a change or delete order, the Sold Product ID is missing from the payload.
  • Invalid payload: Customer Account or Consumer is missing - The related party customer or consumer object is missing from the payload.
  • Invalid payload: Sold Product is inactive. – In a change or delete order, the Sold Product sent in the payload is not in active state.
  • Invalid payload: Consumer does not exist - The specified related party consumer does not exist in the instance.
  • Invalid payload: Customer Account does not exist. – The related party customer provided in payload is not present in the system.
  • Invalid payload: Order creation failed. - Not able to create the requested order.
404 Not found. The requested item wasn't found.

Response body parameters (JSON)

Example: Processing asynchronously

This example shows how to use the mode query parameter to create an order asynchronously. The order is added to the Inbound Queue [sn_tmt_core_inbound_queue] table on a schedule to be created.

curl -X POST 'https://instance.service-now.com/api/sn_tmf_api/serviceorder?mode=async' \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-u "username":"password" \
-d '{
  "externalId": "BSS748",
  "priority": "1",
  "description": "Managed Security",
  "category": "TMF resource illustration",
  "requestedStartDate": "2018-01-15T09:37:40.508Z",
  "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
  "@type": "ServiceOrder",
  "note": [
    {
      "id": "1",
      "author": "Jean Pontus",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration"
    },
    {
      "id": "2",
      "author": "Jean Pontus1",
      "date": "2019-04-30T08:13:59.509Z",
      "text": "This is a TMF product order illustration no 2"
    }
  ],
  "serviceOrderItem": [
    {
      "id": "100",
      "action": "add",
      "actionReason":"adding service package OLI",
      "quantity": 1,
      "@type": "ServiceOrderItem",
      "service": {
        "serviceState": "active",
        "@type": "CFS",
        "serviceCharacteristic": [
          {
            "name": "CPE Type",
            "valueType": "string",
            "value": "Virtual"
          },
          {
            "name": "Administration Support",
            "valueType": "string",
            "value": "Basic( Customer Managed)"
          },
          {
            "name": "Firewall coverage",
            "valueType": "string",
            "value": "Standard(Up to 20 sites)"
          },
          {
            "name": "Firewall Security",
            "valueType": "string",
            "value": "Basic"
          }
        ],
        "serviceSpecification": {
          "id": "f99546ff07266010a7955b7e0ad300a8",
          "name": "Managed Firewall Service",
          "internalVersion": "1",
          "@type": "Managed Firewall Service"
        },
        "serviceRelationship": [
          {
            "id": "326d13f45b5620102dff5e92dc81c785",
            "relationshipType": "Requires"
          }
        ]
      },
      "place": {
        "id": "5671dd2ec3a53010188473ce3640dd81",
        "@type": "Place"
      }
    }
  ],
  "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ]
}'

Response body.

{
  "orderId": "304e877ac3ab5110856d73ce3640dde5"
}

Example: Processing synchronously (default)

The following example shows how to create a service order by setting the serviceOrderItem.action property to add.

curl "https://instance.service-now.com/api/sn_tmf_api/serviceorder" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "add",
         "actionReason":"adding service package OLI",
         "quantity": 1,
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Standard"
               },
               {
                  "name": "Firewall coverage",
                  "value": "Premium (Up to 50 sites)"
               },
               {
                  "name": "Administration Support",
                  "value": "Basic (Customer Managed)"
               }
            ],
            "serviceRelationship": [
               {
                  "id": "326d13f45b5620102dff5e92dc81c785",
                  "relationshipType": "Requires"
               }
            ],
            "serviceSpecification": {
               "id": "f99546ff07266010a7955b7e0ad300a8",
               "name": "Managed Firewall Service",
               "@type": "Managed Firewall Service"
            }
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         }
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ]
}" \
--user 'username':'password'

Response body:

{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "add",
         "actionReason":"adding service package OLI",
         "quantity": 1,
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Standard"
               },
               {
                  "name": "Firewall coverage",
                  "value": "Premium (Up to 50 sites)"
               },
               {
                  "name": "Administration Support",
                  "value": "Basic (Customer Managed)"
               }
            ],
            "serviceRelationship": [
               {
                  "id": "326d13f45b5620102dff5e92dc81c785",
                  "relationshipType": "Requires"
               }
            ],
            "serviceSpecification": {
               "id": "f99546ff07266010a7955b7e0ad300a8",
               "name": "Managed Firewall Service",
               "@type": "Managed Firewall Service",
               "internalVersion": "2",
               "version": "v2",
               "internalId": "f99546ff07266010a7955b7e0ad300a8"
            }
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         },
         "state": "new"
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ],
   "id": "4f2af65ac3a030106e2473ce3640ddcf",
   "href": "/api/sn_tmf_api/order/serviceOrder/4f2af65ac3a030106e2473ce3640ddcf",
   "orderDate": "2024-06-20T10:38:55.000Z",
   "state": "new"
}

Example: cURL request

The following example updates a service order by setting the serviceOrderItem.action property to change.

curl "https://instance.service-now.com/api/sn_tmf_api/serviceorder" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "change",
         "actionReason":"change service package OLI",
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Premium",
                  "previousValue": "Standard"
               }
            ],
            "id": "4b5072aec3a83010abc8b5183c40dd42"
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         }
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ]
}" \
--user 'username':'password'

Response body.

{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "change",
         "actionReason":"change service package OLI",
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Premium",
                  "previousValue": "Standard"
               }
            ],
            "id": "4b5072aec3a83010abc8b5183c40dd42"
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         },
         "state": "new"
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ],
   "id": "4f2af65ac3a030106e2473ce3640ddcf",
   "href": "/api/sn_tmf_api/order/serviceOrder/4f2af65ac3a030106e2473ce3640ddcf",
   "orderDate": "2024-06-20T10:38:55.000Z",
   "state": "new"
}

Example: cURL request

The following example deletes a service order line item by setting the serviceOrderItem.action property to delete.

curl "https://instance.service-now.com/api/sn_tmf_api/serviceorder" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "delete",
         "actionReason":"delete service package OLI",
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Premium",
                  "previousValue": "Standard"
               }
            ],
            "id": "4b5072aec3a83010abc8b5183c40dd42"
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         }
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ]
}" \
--user 'username':'password'

Response body.

{
   "externalId": "BSS748",
   "requestedStartDate": "2018-01-15T09:37:40.508Z",
   "requestedCompletionDate": "2018-01-15T09:37:40.508Z",
   "@type": "ServiceOrder",
   "note": [
      {
         "text": "This is a TMF service order illustration"
      },
      {
         "text": "This is a TMF service order illustration no 2"
      }
   ],
   "serviceOrderItem": [
      {
         "id": "100",
         "action": "delete",
         "actionReason":"delete service package OLI",
         "@type": "ServiceOrderItem",
         "service": {
            "@type": "CFS",
            "serviceCharacteristic": [
               {
                  "name": "Firewall Security",
                  "value": "Premium",
                  "previousValue": "Standard"
               }
            ],
            "id": "4b5072aec3a83010abc8b5183c40dd42"
         },
         "relatedParty": [
            {
               "firstName": "Mike",
               "lastName": "Hudson",
               "email": "mike@example.com",
               "phone": "1234567890",
               "@type": "RelatedParty",
               "@referredType": "OrderLineItemContact"
            }
         ],
         "place": {
            "id": "920cf6ac73d423002728660c4cf6a799",
            "@type": "Place"
         },
         "state": "new"
      }
   ],
   "relatedParty": [
        {
            "id": "eaf68911c35420105252716b7d40ddde",
            "name": "Sally Thomas",
            "@type": "RelatedParty",
            "@referredType": "CustomerContact"
        },
        {
            "id": "ffc68911c35420105252716b7d40dd55",
            "name": "Funco Intl",
            "@type": "RelatedParty",
            "@referredType": "Customer"
        },
        {
            "id": "59f16de1c3b67110ff00ed23a140dd9e",
            "name": "Funco External",
            "@type": "RelatedParty",
            "@referredType": "Consumer"
        }
    ],
   "id": "4f2af65ac3a030106e2473ce3640ddcf",
   "href": "/api/sn_tmf_api/order/serviceOrder/4f2af65ac3a030106e2473ce3640ddcf",
   "orderDate": "2024-06-20T10:38:55.000Z",
   "state": "new"
}

Service Order Open API – POST /sn_tmf_api/order/serviceOrder/outboundresponse

Updates the fulfillment state for the specified domain order records in the Outbound Request [sn_tmt_core_outbound_request] table.

To use this method, the Outbound Request table must contain the specified domain order record. Also, the method validation throws an error if the records or states specified in the request body are not located in the existing outbound record.

Note: You can't create new records in this table using this endpoint.
For additional information on domain orders, see Order Management data model.

URL format

/api/sn_tmf_api/order/serviceOrder/outboundresponse

Supported request parameters

Table 31. Path parameters
Name Description
None
Table 32. Query parameters
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Table 34. Request headers
Header Description
Accept Data format of the response body. Only supports application/json.
Content-Type Data format of the request body. Only supports application/json.
Table 35. Response headers
Header Description
None

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Table 36. Status codes
Status code Description
201 Successful. The request was successfully processed.
400 Bad Request. Could be any of the following reasons:
  • Invalid payload: externalId is missing: Indicates that the external ID (externalId) was not passed.
  • Invalid payload: serviceOrderItem state is missing: Indicates that the external fulfillment state (ServiceOrderItem.state) was not passed in one or more domain orders.
  • Invalid external id. Please pass the correct external id: Indicates that the passed external ID (externalId) is not present in system.
  • Invalid domain order id. Please pass the correct domain order id: Indicates that the passed domain order ID (ServiceOrderItem.id) is not present in the system.
  • Domain order id passed is not associated with external id: Indicates that the external ID (externalId) is not associated with any domain orders. The system only updates domain orders that are associated with an external ID passed in the payload.
  • Invalid fulfilment state: Please provide correct fulfilment state: Indicates that the passed fulfilment state (ServiceOrderItem.state) for one or more domain orders is not valid.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

NameDescription
externalId Outbound request identifier of the domain orders record sent for fulfillment.

Data type: String

Table: In the request_id field in the Outbound Request [sn_tmt_core_outbound_request] table.

href Relative link to the resource record.

Data type: String

Default: Blank string

orderDate Date and timestamp of the order.

Format: YYYY-MM-DD HH:MM:SS

Data type: String

Default: Blank string

ServiceOrderItem List of domain orders whose external fulfillment state needs to be updated.

Data type: Array of Objects

"ServiceOrderItem": [
  {
    "id": "String",
    "state": "String"
  }
]
ServiceOrderItem.id Sys_id of a domain order record for which to update the external fulfillment state.

Data type: String

Table: Domain Order [sn_ind_tmt_orm_domain_order]

ServiceOrderItem.state External fulfillment state of the domain order.
Possible values:
  • error
  • fulfilled
  • pending

Data type: String

Example: cURL request

The following code example shows how to call this endpoint.

curl "http://instance.servicenow.com/api/sn_tmf_api/serviceorder/outboundresponse" \ 
--request POST \
--header "Accept:application/json" \
--data "{ 
  "externalId": "607017d243322110461f99612bb8f25c",
  "serviceOrderItem": [
    {
      "id": "19913c3577b301108e191e599a5a9988",
      "state": "error"
    }
  ]
}"
--user 'username':'password'

Response:

{
  "externalId": "607017d243322110461f99612bb8f25c",
  "serviceOrderItem": [
    {
      "id": "19913c3577b301108e191e599a5a9988",
      "state": "error"
    }
  ]
}