Product Inventory Open API
The Product Inventory Open API provides endpoints to create and retrieve product inventories.
Use this API to manage product inventory information between external systems and the ServiceNow AI Platform.
This API is included in the Product Inventory Advanced application, which is available on the ServiceNow Store.
This API is provided within the sn_prd_invt namespace.
The calling user must have the sn_prd_invt.product_inventory_integrator role.
- Product Characteristics [sn_prd_invt_product_characteristics]
- Product Inventory [sn_prd_invt_product_inventory]
- Product Model [cmdb_model]
- Product Model Characteristic [sn_prd_pm_product_model_characteristic]
The Product Inventory Open API is a ServiceNow® implementation of the TM Forum Product Inventory Management API REST specification. This implementation is based on the TMF637 Product Inventory Management API User Guide v5.0.0, September 2024. The Product Inventory Open API is conformance certified by TM Forum.
Product Inventory Open API – DELETE /sn_prd_invt/order/product/{id}
Deletes a specified product inventory record.
URL format
Default URL: /api/sn_prd_invt/order/product/{id}
Supported request parameters
| Name | Description |
|---|---|
| id | Sys_id of the product inventory to delete. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| Name | Description |
|---|---|
| None |
| 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.
| Header | Description |
|---|---|
| Accept | Data format of the response body. Only supports application/json. |
| 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.
| Status code | Description |
|---|---|
| 204 | No Content. Record successfully deleted. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| None |
cURL request
This example deletes a product inventory record.
curl "https://instance.service-now.com/api/sn_prd_invt/product/01b2f9972b8c72d07a83f395f291bf53" \
--request DELETE \
--header "Accept:application/json" \
--user 'username':'password'
No response body is returned when a product inventory record is successfully deleted.
Product Inventory Open API - GET /sn_prd_invt/product
Retrieves a list of all product inventories.
URL format
Default URL: api/sn_prd_invt/product
Supported request parameters
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| customer | Filter product inventories by customer. Only product offerings with a customer sys_id or external ID matching the value of this parameter are returned in the response. Data type: String Default: Don't filter by customer. |
| fields | List of fields to return in the response. Invalid fields are ignored. Data type: String Default: Return all fields. |
| limit | Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval. Data type: Number Default: 20 Maximum: 100 |
| offset | Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable
chunks. Data type: Number Default: 0 |
| place | Filter product inventories by location. Data type: Object |
| place.id | Sys_id or external id of the location associated with the product inventory record. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| status | Filter product inventories by status. Only product inventories with a status matching the value of this parameter are returned in the response. Data type: String Default: Don't filter by status. |
| 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.
| Header | Description |
|---|---|
| None |
| Header | Description |
|---|---|
| Content-Range | Range of content returned in a paginated call. For example, if |
| Content-Type | Data format of the response body. Only supports application/json. |
| Link | Contains the following links to navigate through query results.
|
| X-Total-Count | For paginated queries, this header specifies the total number of records available on the server. |
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.
| Status code | Description |
|---|---|
| 200 | Request successfully processed. Full resource returned in response (no pagination). |
| 206 | Partial resource returned in response (with pagination). |
| 400 | Bad request. Possible reasons:
|
| 404 | Record not found. No records matching the query parameters are found in the table. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| href | Relative link to the product inventory record. Data type: String |
| id | Sys_id of the product inventory. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| name | Name of the product inventory. Data type: String |
| place | Location of the product. Data type: Array |
| place.id | Location sys_id or external id. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| place.name | Name of the location. Data type: String Table: Location [cmn_location] Field: name |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productId | Sys_id of the product model for the product inventory. Data type: String Table: Product Model [cmdb_model] |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Initial version or external ID of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: initial_version or external_id |
| productOffering.internalId | Internal version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: internal_version |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| productPrice | Returns an empty array. Data type: Array |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Initial version or external ID of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: internal_version or external_id |
| productSpecification.internalId | Initial version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: initial_version |
| productSpecification.internalVersion | Version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: version |
| productSpecification.version | External version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: external_version |
| realizingResource | Resource that realizes the product. The realizing resource is a child product inventory of this product inventory. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Valid value: child Data type: String |
| realizingService | Service that realizes the product. The realizing service is a child product inventory of this product inventory. Data type: Object |
| realizingService.id | Sys_id of the realizing service.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Valid value: child Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.@referredType | Type of customer. Possible values:
Data type: String |
| state | Current state of the product. Data type: String |
cURL request
This example retrieves all product inventories.
curl --location --request GET "https://instance.service-now.com/api/sn_prd_invt/product" \
--user 'username':'password'
Response body.
[
{
"id": "037fd87ec3603010abc8b5183c40ddf2",
"relatedParty": [
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Example Company",
"@type": "RelatedParty",
"@referredType": "Customer"
},
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
}
],
"name": "Routing and Configuration PI0000318",
"productSpecification": {
"id": "aec57e981bb420106ba59acf034bcb08",
"name": "Routing and Configuration",
"version": "",
"internalVersion": "1",
"internalId": "aec57e981bb420106ba59acf034bcb08"
},
"status": "Active",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering",
"version": "",
"internalVersion": "1",
"internalId": "69017a0f536520103b6bddeeff7b127d"
},
"productId": "ce0b52c7532520103b6bddeeff7b12f5",
"place": [
{
"id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
"name": "100 South Charles Street, Baltimore, MD"
}
],
"productCharacteristic": [],
"productRelationship": [],
"realizingService": [],
"realizingResource": [
{
"id": "9b2fa60b536520103b6bddeeff7b1233",
"name": "Route Target"
}
],
"productPrice": [],
"href": "/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2",
"billingAccount": "Not Specified."
}
]
Product Inventory Open API - GET /sn_prd_invt/product/{id}
Retrieves a specified product inventory record.
URL format
Default URL: /api/sn_prd_invt/product/{id}
Supported request parameters
| Name | Description |
|---|---|
| id | Sys_id of the product inventory to retrieve. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| Name | Description |
|---|---|
| customer | Filter product inventories by customer. Only product offerings with a customer sys_id or external ID matching the value of this parameter are returned in the response. Data type: String Default: Don't filer y customer. |
| fields | List of fields to return in the response. Invalid fields are ignored. Data type: String Default: All fields returned. |
| place | Filter product inventories by location. Data type: Object |
| place.id | Sys_id or external id of the location associated with the product inventory record. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| status | Filter product inventories by status. Only product inventories with a status matching the value of this parameter are returned in the response. Data type: String Default: Don't filter by status. |
| 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.
| Header | Description |
|---|---|
| None |
| 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.
| Status code | Description |
|---|---|
| 200 | Request successfully processed. |
| 400 |
Bad Request. Could be any of the following reasons:
|
| 404 | Record not found. Record associated with the ID is not found in the table. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| billingAccount | Billing account of the product inventory record. Data type: String |
| href | Relative link to the product inventory record. Data type: String |
| id | Sys_id of the product inventory Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| name | Name of the product inventory. Data type: String |
| place | Location of the product. Data type: Array |
| place.id | Location sys_id or external id. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| place.name | Name of the location. Data type: String Table: Location [cmn_location] Field: name |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productId | Sys_id of the product model for the product inventory. Data type: String Table: Product Model [cmdb_model] |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Initial version or external ID of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: initial_version or external_id |
| productOffering.internalId | Internal version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: internal_version |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| productPrice | Returns an empty array. Data type: Array |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Initial version or external ID of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: internal_version or external_id |
| productSpecification.internalId | Initial version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: initial_version |
| productSpecification.internalVersion | Version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: version |
| productSpecification.version | External version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: external_version |
| realizingResource | Resource that realizes the product. The realizing resource is a child product inventory of this product inventory. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Valid value: child Data type: String |
| realizingService | Service that realizes the product. The realizing service is a child product inventory of this product inventory. Data type: Object |
| realizingService.id | Sys_id of the realizing service.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Valid value: child Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.type | Type of related party. Value is always Related Party.Data type: String |
| relatedParty.@referredType | Type of customer, such as a customer or customer contact. Data type: String |
| status | Current state of the product. Data type: String |
cURL request
This example retrieves a specified product inventory.
curl -X GET 'https://instance.service-now.com/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2' \
--user 'username':'password'
Output:
{
"id": "037fd87ec3603010abc8b5183c40ddf2",
"relatedParty": [
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Example Company",
"@type": "RelatedParty",
"@referredType": "Customer"
},
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
}
],
"name": "Routing and Configuration PI0000318",
"productSpecification": {
"id": "aec57e981bb420106ba59acf034bcb08",
"name": "Routing and Configuration",
"version": "",
"internalVersion": "1",
"internalId": "aec57e981bb420106ba59acf034bcb08"
},
"status": "Active",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering",
"version": "",
"internalVersion": "1",
"internalId": "69017a0f536520103b6bddeeff7b127d"
},
"productId": "ce0b52c7532520103b6bddeeff7b12f5",
"place": [
{
"id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
"name": "100 South Charles Street, Baltimore, MD"
}
],
"productCharacteristic": [],
"productRelationship": [],
"realizingService": [],
"realizingResource": [
{
"id": "9b2fa60b536520103b6bddeeff7b1233",
"name": "Route Target"
}
],
"productPrice": [],
"href": "/api/sn_prd_invt/product/037fd87ec3603010abc8b5183c40ddf2",
"billingAccount": "Not Specified."
}
Product Inventory Open API - GET /sn_prd_invt/productinventory
Retrieves a list of all product inventories.
URL format
Default URL: api/sn_prd_invt/productinventory
Supported request parameters
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| customer | Filter product inventories by customer. Only product offerings with a customer sys_id or external ID matching the value of this parameter are returned in the response. Data type: String Default: Don't filter by customer. |
| fields | List of fields to return in the response. Invalid fields are ignored. Data type: String Default: All fields are returned. |
| limit | Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval. Data type: Number Default: 20 Maximum: 100 |
| offset | Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable
chunks. Data type: Number Default: 0 |
| place | Filter product inventories by location. Data type: Object |
| place.id | Sys_id or external id of the location associated with the product inventory record. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| status | Filter product inventories by status. Only product inventories with a status matching the value of this parameter are returned in the response. Data type: String Default: Don't filter by inventory status. |
| 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.
| Header | Description |
|---|---|
| None |
| Header | Description |
|---|---|
| Content-Range | Range of content returned in a paginated call. For example, if |
| Content-Type | Data format of the response body. Only supports application/json. |
| Link | Contains the following links to navigate through query results.
|
| X-Total-Count | For paginated queries, this header specifies the total number of records available on the server. |
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.
| Status code | Description |
|---|---|
| 200 | Request successfully processed. Full resource returned in response (no pagination). |
| 206 | Partial resource returned in response (with pagination). |
| 400 | Bad request. Possible reasons:
|
| 404 | Record not found. No records matching the query parameters are found in the table. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| id | Sys_id of the product inventory. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| name | Name of the product inventory. Data type: String |
| place | Place associated with the product. Data type: Object |
| place.id | Location sys_id or external_id of the product inventory. Table: Location [cmn_location] Data: String |
| place.name | Name of the location associated with the product inventory. Table: Location [cmn_location] Data: String |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Sys_id of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Sys_id of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] |
| realizingResource | Realizing resource. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Data type: String |
| realizingService | Realizing service. Data type: Object |
| realizingService.id | Sys_id of the realizing service. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact] or Consumer [csm_consumer] |
| relatedParty.@referredType | Type of related party. Value is always Related Party.Data type: String |
| relatedParty.type | Type of customer. Possible values:
Data type: String |
| status | Current state of the product. Data type: String |
cURL request
This example retrieves all product inventories.
curl "https://instance.servicenow.com/api/sn_prd_invt/productinventory" \
--request GET \
--user 'username':'password'
Response body.
[
{
"id": "075072aec3a83010abc8b5183c40dd44",
"relatedParty": [
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Funco Intl",
"@type": "RelatedParty",
"@referredType": "Customer"
},
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
}
],
"name": "Firewall Administration PI0000300",
"productSpecification": {
"id": "31c5caff07266010a7955b7e0ad3006b",
"name": "Firewall Administration"
},
"status": "Active",
"productOffering": {
"id": "",
"name": ""
},
"place": {
"id": "920cf6ac73d423002728660c4cf6a799",
"name": "200 South James street,Atlanta, GA"
},
"productCharacteristic": [
{
"name": "Firewall Administration CPE Type",
"valueType": "Choice",
"value": "Physical"
},
{
"name": "Configuration and Policy backup",
"valueType": "Choice",
"value": ""
},
{
"name": "Firewall Administration CPE ID",
"valueType": "Single Line Text",
"value": "CPE123456789"
},
{
"name": "Remote CLI troubleshoot support",
"valueType": "Choice",
"value": ""
},
{
"name": "Firewall Administration CPE Model",
"valueType": "Choice",
"value": "9300 series"
}
],
"productRelationship": [],
"realizingService": [],
"realizingResource": [
{
"id": "3546463307666010a7955b7e0ad3005d",
"name": "Cisco Firewall Management system"
}
]
},
{
"id": "0303a8ea74418510f877ca57242ff96d",
"relatedParty": [
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Funco Intl",
"@type": "RelatedParty",
"@referredType": "Customer"
},
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
}
],
"name": "SD-WAN Edge Device PI0001114",
"productSpecification": {
"id": "39b627aa53702010cd6dddeeff7b1202",
"name": "SD-WAN Edge Device"
},
"status": "Installation Pending",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering"
},
"place": "",
"productCharacteristic": [],
"productRelationship": [],
"realizingService": [
{
"id": "bf65eadc1b7420106ba59acf034bcb57",
"name": "SD-WAN Routing"
},
{
"id": "16d79ec3532520103b6bddeeff7b12a6",
"name": "SD WAN Optimization Service"
},
{
"id": "16d79ec3532520103b6bddeeff7b12a6",
"name": "SD WAN Optimization Service"
},
{
"id": "bf65eadc1b7420106ba59acf034bcb57",
"name": "SD-WAN Routing"
},
{
"id": "bf65eadc1b7420106ba59acf034bcb57",
"name": "SD-WAN Routing"
},
{
"id": "bf65eadc1b7420106ba59acf034bcb57",
"name": "SD-WAN Routing"
}
],
"realizingResource": [
{
"id": "493fa60b536520103b6bddeeff7b12b6",
"name": "Customer Premise SD-WAN Router"
}
]
}
]
Product Inventory Open API - GET /sn_prd_invt/productinventory/{inventoryId}
Retrieves a product inventory.
URL format
Default URL: /api/sn_prd_invt/productinventory/{inventoryId}
Supported request parameters
| Name | Description |
|---|---|
| inventoryId | Sys_id of the product inventory to retrieve. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| Name | Description |
|---|---|
| customer | Filter product inventories by customer. Only product offerings with a customer sys_id or external ID matching the value of this parameter are returned in the response. Data type: String |
| fields | List of fields to return in the response. Invalid fields are ignored. Data type: String Default: All fields returned. |
| place | Filter product inventories by location. Data type: Object |
| place.id | Sys_id or external id of the location associated with the product inventory record. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| status | Filter product inventories by status. Only product inventories with a status
matching the value of this parameter are returned in the response. Data type: String |
| 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.
| Header | Description |
|---|---|
| None |
| 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.
| Status code | Description |
|---|---|
| 200 | Request successfully processed. |
| 400 | Bad Request. Could be any of the following reasons:
|
| 404 | Record not found. Record associated with the ID is not found in the table. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| id | Sys_id of the product inventory Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| name | Name of the product inventory. Data type: String |
| place | Place associated with the product. Data type: Object |
| place.id | Location sys_id or external_id of the product inventory. Table: Location [cmn_location] Data: String |
| place.name | Name of the location associated with the product inventory. Table: Location [cmn_location] Data: String |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Sys_id of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Sys_id of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] |
| realizingResource | Realizing resource. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Data type: String |
| realizingService | Realizing service. Data type: Object |
| realizingService.id | Sys_id of the realizing service. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.@referredType | Type of related party. Value is always Related Party.Data type: String |
| relatedParty.type | Type of customer. Possible values:
Data type: String |
| status | Current state of the product. Data type: String |
cURL request
This example retrieves a product inventory for an SD-WAN service package.
curl --location --request GET 'https:// instance.servicenow.com/api/sn_prd_invt/productinventory/074450fc74918d10f877ca57242ff9e3' \
--user 'username':'password'
Output:
{
"id": "074450fc74918d10f877ca57242ff9e3",
"relatedParty": [
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Funco Intl",
"@type": "RelatedParty",
"@referredType": "Customer"
},
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
}
],
"name": "SD-WAN Service Package PI0001576",
"productSpecification": {
"id": "cfe5ef6a53702010cd6dddeeff7b12f6",
"name": "SD-WAN Service Package"
},
"status": "Installation Pending",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering"
},
"place": "",
"productCharacteristic": [],
"productRelationship": [
{
"id": "a74490fc74918d10f877ca57242ff942",
"name": "SD-WAN Edge Device PI0001582",
"relationshipType": "Bundles"
},
{
"id": "b85414fc74918d10f877ca57242ff90e",
"name": "SD-WAN Controller PI0001602",
"relationshipType": "Bundles"
},
{
"id": "d74490fc74918d10f877ca57242ff907",
"name": "SD-WAN Security PI0001577",
"relationshipType": "Bundles"
}
],
"realizingService": [],
"realizingResource": []
}
Product Inventory Open API – PATCH /sn_prd_invt/order/product/{id}
Updates a specified product inventory record.
URL format
Default URL: /api/sn_prd_invt/order/product/{id}
Supported request parameters
| Name | Description |
|---|---|
| id | Sys_id of the product inventory to update. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| bundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean |
| name | Name of the product inventory. Data type: String |
| place | Location of the product. Data type: Array |
| place.id | Location sys_id or external id. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| place.name | Name of the location. Data type: String Table: Location [cmn_location] Field: name |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.@referredType | This value is always ProductOffering.Data type: String |
| productOffering.id | Initial version or external ID of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: initial_version or external_id |
| productOffering.internalId | Internal version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: internal_version |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: name |
| productOffering.status | Status of the product offering. Possible values:
Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: status |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.@referredType | Type of related party. Possible values:
Data type: String |
| relatedParty.@type | This value is always RelatedParty.Data type: String |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.name | Name of the of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
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.
| 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. |
| 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.
| Status code | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 404 | Not found. The requested item wasn't found. |
Response body parameters (JSON)
| Name | Description |
|---|---|
| bundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean |
| name | Name of the product inventory. Data type: String |
| place | Location of the product. Data type: Array |
| place.id | Location sys_id or external id. Data type: String Table: Location [cmn_location] Field: sys_id or sn_tmt_core_external_id |
| place.name | Name of the location. Data type: String Table: Location [cmn_location] Field: name |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.@referredType | This value is always ProductOffering.Data type: String |
| productOffering.id | Initial version or external ID of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: initial_version or external_id |
| productOffering.internalId | Internal version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: internal_version |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: name |
| productOffering.status | Status of the product offering. Possible values:
Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: status |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.@referredType | Type of related party. Possible values:
Data type: String |
| relatedParty.@type | This value is always RelatedParty.Data type: String |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.name | Name of the of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
cURL request
This example updates a product inventory record.
curl "https://instance.service-now.com/api/sn_prd_invt/product/036e506510322250f8777d910acbd77f" \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{
\"name\": \"Internet Plan\",
\"productOffering\": {
\"@referredType\": \"ProductOffering\",
\"name\": \"Premium SD-WAN Offering\",
\"id\": \"0361dd9fd0a63110f8770dbf976be16f\"
},
\"relatedParty\": [
{
\"@referredType\": \"CustomerContact\",
\"@type\": \"RelatedParty\",
\"name\": \"Sally Thomas\",
\"id\": \"f3af54c413651200042ab3173244b053\"
},
{
\"@referredType\": \"Customer\",
\"@type\": \"RelatedParty\",
\"name\": \"Funco Intl\",
\"id\": \"ffc68911c35420105252716b7d40dd55\"
}
],
\"bundle\": false,
\"place\": [
{
\"id\": \"25ab9c4d0a0a0bb300f7dabdc0ca7c1c\",
\"name\": \"100 South Charles Street, Baltimore, MD\"
}
]
}" \
--user 'username':'password'
Response body.
{
"name": "Internet Plan",
"productOffering": {
"@referredType": "ProductOffering",
"name": "Premium SD-WAN Offering",
"id": "0361dd9fd0a63110f8770dbf976be16f",
"internalVersion": "1",
"version": "",
"status": "published",
"internalId": "0361dd9fd0a63110f8770dbf976be16f"
},
"relatedParty": [
{
"@referredType": "CustomerContact",
"@type": "RelatedParty",
"name": "Sally Thomas",
"id": "f3af54c413651200042ab3173244b053"
},
{
"@referredType": "Customer",
"@type": "RelatedParty",
"name": "Funco Intl",
"id": "ffc68911c35420105252716b7d40dd55"
}
],
"bundle": false,
"place": [
{
"id": "25ab9c4d0a0a0bb300f7dabdc0ca7c1c",
"name": "100 South Charles Street, Baltimore, MD"
}
],
"productPrice": [],
"id": "036e506510322250f8777d910acbd77f",
"href": "/api/sn_prd_invt/product/036e506510322250f8777d910acbd77f"
}
Product Inventory Open API - POST /sn_prd_invt/product
Creates a product inventory record.
URL format
Default URL: /api/sn_prd_invt/product
Supported request parameters
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| bundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean Default: false |
| isBundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean Default: false |
| name | Required. Name of the product inventory. Data type: String |
| pid | Unique identifier for the product inventory from the external system. Data type: String Default: Blank string |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String Default: Blank string |
| productCharacteristic.value | Value of the characteristic. Data type: String Default: Blank string |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productOffering | Required. Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Required. Initial_version or external_id of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Default: Blank string Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Required if using the productRelationship parameter. Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. The only valid value is child. Data type: String Default: Blank string |
| productSpecification | Required. Product specification for the product. Data type: Object |
| productSpecification.id | Required. Initial_version or external_id of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] |
| productSpecification.internalVersion | Version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: version |
| productSpecification.version | External version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: external_version |
| realizingResource | Resource that realizes the product. The realizing resource is a child product inventory of this product inventory. Data type: Object |
| realizingResource.id | Required if using the realizingResource parameter. Sys_id of the realizing resource.
Data type: String |
| realizingResource.type | Type of the realizing resource. Valid value: child Data type: String |
| realizingService | Service that realizes the product. The realizing service is a child product inventory of this product inventory. Data type: Object |
| realizingService.id | Required if using the realizingService parameter. Sys_id of the realizing service.
Data type: String |
| realizingService.type | Type of the realizing service. Valid value: child Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.@referredType | Type of customer. Possible values:
Data type: String Default: Blank string |
| relatedParty.id | Required if using the relatedParty parameter. Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| state | Current state of the product. Possible values:
Data type: String Default: installation_pending |
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.
| 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. |
| 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.
| Status code | Description |
|---|---|
| 201 | Request successfully processed. |
| 400 | Bad Request. Could be any of the following reasons:
|
Response body parameters (JSON)
| Name | Description |
|---|---|
| bundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean |
| href | Relative link to the product inventory record. Data type: String |
| id | Sys_id of the product inventory. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| isBundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean |
| name | Name of the product inventory. Data type: String |
| pid | Unique identifier for the product inventory from the external system. Data type: String |
| productCharacteristic | List of product characteristics. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Initial version or external ID of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: initial_version or external_id |
| productOffering.internalId | Internal version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: internal_version |
| productOffering.internalVersion | Version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: version |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.version | External version of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] Field: external_version |
| productPrice | Returns an empty array. Data type: Array |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Initial version or external ID of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: internal_version or external_id |
| productSpecification.internalId | Initial version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: initial_version |
| productSpecification.internalVersion | Version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: version |
| productSpecification.version | External version of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] Field: external_version |
| realizingResource | Resource that realizes the product. The realizing resource is a child product inventory of this product inventory. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Valid value: child Data type: String |
| realizingService | Service that realizes the product. The realizing service is a child product inventory of this product inventory. Data type: Object |
| realizingService.id | Sys_id of the realizing service.
Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Valid value: child Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.@referredType | Type of related party. Value is always Related Party.Data type: String |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table:Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.type | Type of customer. Possible values:
Data type: String |
| status | Current state of the product. Data type: String |
cURL request
This example creates a product inventory for a voice over IP solution for a user.
curl -X POST "https://instance.service-now.com/api/sn_prd_invt/product" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--user "username":"password" \
--data "[
{
"pid": "PO-456",
"description": "inventory description",
"isBundle": false,
"name": "Voice Over IP Basic instance for Jean",
"productOffering": {
"@referredType": "ProductOffering",
"name": "Premium SD-WAN Offering",
"id": "69017a0f536520103b6bddeeff7b127d"
},
"productCharacteristic": [],
"productRelationship": [
{
"productId": "fa6d13f45b5620102dff5e92dc81c77f",
"relationshipType": "child"
}
],
"realizingService": {
"id": "fe6d13f45b5620102dff5e92dc81c786",
"relationshipType": "child"
},
"realizingResource": {
"id": "326d13f45b5620102dff5e92dc81c78c",
"relationshipType": "child"
},
"relatedParty": [
{
"@referredType": "CustomerContact",
"@type": "RelatedParty",
"name": "Sally Thomas",
"id": "eaf68911c35420105252716b7d40ddde"
},
{
"@referredType": "Customer",
"@type": "RelatedParty",
"name": "Funco Intl",
"id": "ffc68911c35420105252716b7d40dd55"
}
],
"productSpecification": {
"@referredType": "ProductSpecification",
"@type": null,
"name": null,
"id": "3ee1fdb1c3331010d216b5183c40dd81",
"internalVersion": "1"
},
"bundle": false
}
]"
Response body.
{
"pid": "PO-456",
"description": "inventory description",
"isBundle": false,
"name": "Voice Over IP Basic instance for Jean",
"productOffering": {
"@referredType": "ProductOffering",
"name": "Premium SD-WAN Offering",
"id": "69017a0f536520103b6bddeeff7b127d",
"internalVersion": "1",
"version": null,
"status": "published",
"internalId": "69017a0f536520103b6bddeeff7b127d"
},
"productCharacteristic": [],
"productRelationship": [
{
"productId": "fa6d13f45b5620102dff5e92dc81c77f",
"relationshipType": "child"
}
],
"realizingService": {
"id": "fe6d13f45b5620102dff5e92dc81c786",
"relationshipType": "child"
},
"realizingResource": {
"id": "326d13f45b5620102dff5e92dc81c78c",
"relationshipType": "child"
},
"relatedParty": [
{
"@referredType": "CustomerContact",
"@type": "RelatedParty",
"name": "Sally Thomas",
"id": "eaf68911c35420105252716b7d40ddde"
},
{
"@referredType": "Customer",
"@type": "RelatedParty",
"name": "Example Company",
"id": "ffc68911c35420105252716b7d40dd55"
}
],
"productSpecification": {
"@referredType": "ProductSpecification",
"@type": null,
"name": null,
"id": "3ee1fdb1c3331010d216b5183c40dd81",
"internalVersion": "1",
"version": null,
"status": "published",
"internalId": "3ee1fdb1c3331010d216b5183c40dd81"
},
"bundle": false,
"productPrice": [],
"id": "25b07475471789108761b955d36d439d",
"href": "/api/sn_prd_invt/product/25b07475471789108761b955d36d439d"
}
Product Inventory Open API - POST /sn_prd_invt/productinventory
Creates a product inventory.
URL format
Default URL: /api/sn_prd_invt/productinventory
Supported request parameters
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| isBundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean Default: false |
| name | Required. Name of the product inventory. Data type: String |
| pid | Unique identifier for the product inventory from the external system. Data type: String Default: Blank string |
| productCharacteristic | List of product characteristics. For additional information on product characteristics, see Create a product offering category. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String Default: Blank string |
| productCharacteristic.value | Value of the characteristic. Data type: String Default: Blank string |
| productCharacteristic.valueType | Type of characteristic value. Accepted values:
Data type: String |
| productOffering | Required. Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Required. Sys_id of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.name | Name of the product offering. Data type: String Default: Blank string Table: Product Offering [sn_prd_pm_product_offering] |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Required if using the productRelationship parameter. Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. The only valid value is child. Data type: String Default: Blank string |
| productSpecification | Required. Product specification for the product. Data type: Object |
| productSpecification.id | Required. Sys_id of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] |
| realizingResource | Realizing resource. Data type: Object |
| realizingResource.id | Required if using the realizingResource parameter. Sys_id of the realizing resource. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. The only valid value is child. Data type: String Default: Blank string |
| realizingService | Realizing service. Data type: Object |
| realizingService.id | Required if using the realizingService parameter. Sys_id of the realizing service. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. The only valid value is child. Data type: String Default: Blank string |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.@referredType | Type of customer. Possible values:
Data type: String Default: Blank string |
| relatedParty.id | Required if using the relatedParty parameter. Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_Consumer] |
| state | Current state of the product. Possible values:
Data type: String Default: installation_pending |
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.
| 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. |
| 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.
| Status code | Description |
|---|---|
| 201 | Request successfully processed. |
| 400 | Bad Request. Could be any of the following reasons:
|
Response body parameters (JSON)
| Name | Description |
|---|---|
| id | Sys_id of the product inventory. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| isBundle | Flag that indicates whether the product inventory record is part of a bundled product. Valid values:
Data type: Boolean |
| name | Name of the product inventory. Data type: String |
| pid | Unique identifier for the product inventory from the external system. Data type: String |
| productCharacteristic | List of product characteristics. Data type: Array of Objects |
| productCharacteristic.name | Name of the characteristic. Data type: String |
| productCharacteristic.value | Value of the characteristic. Data type: String |
| productOffering | Product offering that the product inventory is associated with. Data type: Object |
| productOffering.id | Sys_id of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productOffering.name | Name of the product offering. Data type: String Table: Product Offering [sn_prd_pm_product_offering] |
| productRelationship | List of related products. Data type: Array of Objects |
| productRelationship.productId | Sys_id of the related product. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| productRelationship.relationshipType | Type of relationship. Data type: String |
| productSpecification | Product specification for the product. Data type: Object |
| productSpecification.id | Sys_id of the product specification. Data type: String Table: Product Specification [sn_prd_pm_product_specification] |
| realizingResource | Realizing resource. Data type: Object |
| realizingResource.id | Sys_id of the realizing resource Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingResource.type | Type of the realizing resource. Data type: String |
| realizingService | Realizing service. Data type: Object |
| realizingService.id | Sys_id of the realizing service. Data type: String Table: Product Inventory [sn_prd_invt_product_inventory] |
| realizingService.type | Type of the realizing service. Data type: String |
| relatedParty | List of parties associated with the ticket. Data type: Array of Objects |
| relatedParty.id | Sys_id of the account or customer contact associated with the ticket. Data type: String Table: Account [customer_account], Contact [customer_contact], or Consumer [csm_consumer] |
| relatedParty.@referredType | Type of customer. Possible values:
Data type: String |
| state | Current state of the product. Data type: String |
cURL request
This example creates a product inventory for a voice over IP solution for a user.
curl --location --request POST "https://instance.servicenow.com/api/sn_prd_invt/productinventory" \
--header "Content-Type: application/json" \
--data-raw '[
{
"pid": "demoInventory",
"description": "inventory description",
"isBundle": false,
"name": "Voice Over IP Basic instance for Jean",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering",
"@referredType": "ProductOffering"
},
"productCharacteristic": [
{
"name": "CPE Type",
"valueType": "choice",
"value": "Virtual"
},
{
"name":"Routing",
"valueType": "choice",
"value": "Premium"
}
],
"productRelationship": [
{
"productId": "7e6d13f45b5620102dff5e92dc81c787",
"relationshipType": "child"
}
],
"relatedParty": [
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"role": "User",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
},
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Funco Intl",
"@type": "RelatedParty",
"@referredType": "Customer"
}
],
"productSpecification": {
"id": "cfe5ef6a53702010cd6dddeeff7b12f6",
"@referredType": "ProductSpecification",
"version": "1"
}
}
]'
--user 'username':'password'
Response body.
{
"pid": "demoInventory",
"description": "inventory description",
"isBundle": false,
"name": "Voice Over IP Basic instance for Jean",
"productOffering": {
"id": "69017a0f536520103b6bddeeff7b127d",
"name": "Premium SD-WAN Offering",
"@referredType": "ProductOffering"
},
"productCharacteristic": [
{
"name": "CPE Type",
"valueType": "choice",
"value": "Virtual"
},
{
"name": "Routing",
"valueType": "choice",
"value": "Premium"
}
],
"productRelationship": [
{
"productId": "7e6d13f45b5620102dff5e92dc81c787",
"relationshipType": "child"
}
],
"relatedParty": [
{
"id": "eaf68911c35420105252716b7d40ddde",
"name": "Sally Thomas",
"role": "User",
"@type": "RelatedParty",
"@referredType": "CustomerContact"
},
{
"id": "ffc68911c35420105252716b7d40dd55",
"name": "Funco Intl",
"@type": "RelatedParty",
"@referredType": "Customer"
}
],
"productSpecification": {
"id": "cfe5ef6a53702010cd6dddeeff7b12f6",
"@referredType": "ProductSpecification",
"version": "1"
},
"id": "3ac715c6745d8150f877ca57242ff97a"
}