Contracts API

Hello! I write a lot of scripts for our team to create automations for repetitive workflows in Service Desk. Looking over the doc at, I'm trying to UPDATE an item on a contract. Evidently I need the item ID, which is not to be found via API when creating a new one, retreiving the current contract information, or anywhere online. Am I missing something?

Parents Reply Children
  • I appreciate your time!

    So creating the Contract works, and creating new Items on the contract works. However I cannot get the ID of current Items so I can update them, and creating a new Item does NOT give me the ID of the Item. I have to, evidently, have the ID of the item except it's never revealed.

    I use powershell, so bear with me if you don't. The following codeblock returns the Contract as exptected, but Items have no ID listed.

    $URL = '{CONTRACTID}.xml'
    $Response = Invoke-RestMethod $URL -Method 'GET' -Headers $SAMHeaders

    The following code creates an item on the same contract, as expected, but does NOT return an ID.

    $CreateURL = "{CONTRACTID}/items"
    $CreateBody = '{
        "item": {
        "name": "Test Item Name",
        "version": "1",
        "qty": "1"
    $CreateResponse = Invoke-RestMethod $CreateURL -Method 'POST' -Headers $SAMHeaders -Body $CreateBody

    With no way to retrieve the ID of the Items, I can't use the following command to update them.

    $UpdateURL = "{CONTRACTID}/items/{ITEMID}"
    $UpdateBody = '{
        "item": {
          "version": "1.5",
          "qty": "10"
    $UpdateResponse = Invoke-RestMethod $UpdateURL -Method 'PUT' -Headers $SAMHeaders -Body $UpdateBody

  • FYI, they finally got back to me with this response:

    Hi there, as I have checked with our level two team there was a mistake from the API documentation as there has never been the ability to update contract items as they really do not have an ID.

    That sucks, but it is what it is. It must be something down the pipeline they haven't fully implemented yet.