---
sourceDocument: Australia Asset Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/it-asset-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Asset Management

ft:clusterId :

    - itam

bundleId :

    - itam

workflow :

    - Technology


---

# Integration script include

# Creating an integration script include for third-party carrier applications {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

In order to integrate with a ServiceNow instance, a third-party carrier application must have a script include that extends the base class ITAMShipmentIntegration script on its ServiceNow instance to receive the shipment tracking number from the customer's ServiceNow instance and respond with the carrier-related details.  
Consider the following when you create the script include:

* Make sure that the script include is accessible from the Asset Management Common application scope by adjusting the following settings on the application resource record:
  * Set the Accessible from field to All application scopes.
  * Set the Caller Access field to None to make sure the caller access isn't restricted.
  {#creating-integration-script-include-ham__ul_tsn_41w_dyb}
* The code for communicating with the customer's ServiceNow instance based on the tracking number must be included within the fetchShipmentInfo function.
* When the API is invoked in the test mode for validating the connection with the customer's ServiceNow instance, the return response from the fetchShipmentInfo method should be a JSON object with the HTTP response code and response message, as follows:

      {
      httpResponseCode: 200, httpResponseMessage: 'SUCCESS'
      }

* When not in the test mode, query the shipments and invoke the processResponse method with the following response format:

      [
      {
      trackingNumber: '',
      deliveryDate: '',
      pickupDate: '',
      packageStatus: ''.
      statusDetail: '',
      trackingURL: '',
      parcelWeight: '',
      deliveryServicesCost: '',
      currency: ''
      }
      	]

{#creating-integration-script-include-ham__ul_gnm_lzf_cyb}

## ITAMShipmentIntegration script include sample codes {#creating-integration-script-include-ham__section_jnr_nfq_zxb}

Figure 1. Sample ITAMShipmentIntegration script include with the default processResponse function provided by the IT Asset Management application Figure 2. Sample ITAMShipmentIntegration script include with custom processResponse function

## fetchShipmentInfo function {#creating-integration-script-include-ham__section_v1t_qfq_zxb}

The fetchShipmentInfo function receives the tracking numbers from the ServiceNow instance of the customer and invokes the carrier API to fetch the shipment details for all the tracking numbers. Within this function, you must define the business logic that enables your customers
to communicate with your carrier APIs based on the tracking numbers. This function processes the response that is received from the carrier API and invokes the post-processing function.

## processResponse function {#creating-integration-script-include-ham__section_yqv_dgq_zxb}

The processResponse function receives the response from the carrier API and updates the shipment records with the following carrier-related details:

* Carrier link
* Carrier status
* Carrier status detail
* Carrier pick-up date
* Carrier delivered date
* Currency
* Delivery services cost
* Parcel weight
{#creating-integration-script-include-ham__ul_bnd_sqb_qxb}

You can either use the default processResponse function or define a custom logic to update the shipment records.
**Related concepts**   

* [Stale shipments](https://servicenow-prod.fluidtopics.net/UUCq3QIkuDK7i0GecJZh6A "Shipments that are delayed due to various reasons such as an incorrect tracking number, the loss of a shipment package during transit, and invalid connection details are considered stale shipments.")  
**Related tasks**   

* [Connect your ServiceNow instance with a shipping carrier application](https://servicenow-prod.fluidtopics.net/6nmdAOqY5EPCeshfdXv9lQ "Associate a shipping carrier with an integration profile to connect your ServiceNow instance to the carrier application.")
* [Remove a shipping carrier from an integration profile](https://servicenow-prod.fluidtopics.net/Ok3L9hVMEYq_9~l7~Dpe7g "Remove a shipping carrier that you no longer want to associate with an integration profile.")
* [Create a carrier integration profile](https://servicenow-prod.fluidtopics.net/lTuHyKUdwQ1gIvFArQ0alw "Create a carrier integration profile for your carrier by specifying the API and connection details that are used to connect your ServiceNow instance to the third-party shipping carrier application.")
* [View the carrier integration profile details](https://servicenow-prod.fluidtopics.net/xLcaF01vLkywRqwwNsmJKg "View the details of the carrier API used to connect your ServiceNow instance to the third-party shipping carrier application.")
* [Test the integration with the carrier API](https://servicenow-prod.fluidtopics.net/u~h4nkCdH8fQ7t_Qpu2wWg "Check the connection with the carrier API to handle any connection issues such as invalid credentials, incorrect tracking details, and issues with the integration script include.")
* [Create a shipping carrier record](https://servicenow-prod.fluidtopics.net/IgIBdPKIH9jV4iQdlv3juQ "Create a shipping carrier record used to associate the carrier with an integration profile.")
* [View hardware asset shipment details](https://servicenow-prod.fluidtopics.net/cKjUMFc9Slw6Xej0RzBAdQ "View all hardware asset shipment details in a single place in the Hardware Asset Workspace.")
* [Track a hardware asset shipment](https://servicenow-prod.fluidtopics.net/8jwNNIvtbzIU73Jxx_OlFw "Track the progress of your hardware asset shipment that isn't delivered and that has a carrier associated with an active integration profile.")

