Service Catalog API - POST /sn_sc/servicecatalog/items/{sys_id}/checkout_guide

This method retrieves an array of contents requested for checkout.

URL format

Versioned URL: /api/sn_sc/v1/servicecatalog/items/{sys_id}/checkout_guide

Default URL: /api/sn_sc/servicecatalog/items/{sys_id}/checkout_guide

Supported request parameters

Table 1. Parameters
Parameter 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 2. 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 response codes .

Table 3. Status codes
Status code Description
200 Indicates that the request has completed successfully.
  • Is not two-step: Items are added to cart and cart contents are returned.
  • Is two-step: Returns the request number and request sys_id after checkout.
400 Indicates that the request is invalid. Could be due to one of the following reasons:
  • One or more items sent do not exist.
  • User does not have access to one or more of the items.
  • Mandatory variables of one or more items have not been answered. (Only variables defined as mandatory are honored.)
  • Quantity value is sent and is not a positive integer.
500 Service error. Internal error during checkout.

Request body

Table 4. Values required in the request body
Parameter Description
Items Array of items requested for checkout. Each item is a JSON object with the following parameters:
  • sys_id: ID of the item, which is a required parameter.
  • variables: JSON object of variable name value pairs.
  • sysparam_quantity: Quantity of item. If not specified, the default value is 1.

Sample cURL request

curl "https://instance.service-now.com/api/sn_sc/v1/servicecatalog/items/6690750f4f7b4200086eeed18110c761/checkout_guide" \
--request POST \
--header "Accept:application/json"\
--header "Content-Type:application/json" \
--data "{\"items\":[{
  \"sys_id\":\"04b7e94b4f7b4200086eeed18110c7fd\",
  \"variables\":{
    \"acrobat\":\"true\",
    \"Additional_software_requirements\":\"MS Office 2007\"
  },
  \"sysparm_quantity\":\"3\"
},
{
  \"sys_id\":\"e1be6dcb4f7b4200086eeed18110c74c\"
},
{
  \"sys_id\":\"186d917a6fab7980575967ddbb3ee4f2\",
  \"variables\":{
    \"new_email\":\"abel.tuter@example.com\"
  }
},
{
  \"sys_id\":\"8b3ae7fedc1be1004ece5c08239e522b\"
},
{
  \"sys_id\":\"962967674ff38200086eeed18110c7e7\",
  \"variables\":{
    \"ergonomic_office\":\"Office chair should have lumbar support\"
  }
}]}" \
--user 'admin':'admin'
<!--Case-1: if two-step is false:-->
{
  "result": {
    "cart_id": "0d8c7a32c3211200d68d3b0ac3d3aeba",
    "subtotal_price": "$3,350.00",
    "subtotal_recurring_frequency": "",
    "subtotal_recurring_price": "$300.00",
    "total_title": "Total",
    "monthly": {
      "subtotal_price": "$50.00",
      "subtotal_recurring_frequency": "Monthly",
      "subtotal_recurring_price": "$0.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "90af095bcd38798071a208d710d1b64f",
          "variables": {},
          "quantity": "1",
          "localized_price": "$50.00",
          "price": "$50.00",
          "recurring_frequency": "Monthly",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Belkin iPad Mini Case",
          "cart_item_id": "cb6e485fc3211200d68d3b0ac3d3ae35",
          "delivery_time": "2 Days"
        }
      ],
      "show_subtotal_price": "true",
      "subtotal_title": "Subtotal"
    },
    "none": {
      "subtotal_price": "-",
      "subtotal_recurring_frequency": "",
      "subtotal_recurring_price": "$0.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "186d917a6fab7980575967ddbb3ee4f2",
          "variables": {
            "Preferred Email address": "abel.tuter@example.com"
          },
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "New Email Account",
          "cart_item_id": "17c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "global.Workflow"
        },
        {
          "catalog_item_id": "8b3ae7fedc1be1004ece5c08239e522b",
          "variables": {},
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Corp VPN",
          "cart_item_id": "97c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "2 Days"
        },
        {
          "catalog_item_id": "e1be6dcb4f7b4200086eeed18110c74c",
          "variables": {},
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "External Monitor",
          "cart_item_id": "d3c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "2 Days"
        },
        {
          "catalog_item_id": "962967674ff38200086eeed18110c7e7",
          "variables": {
            "Please describe any ergonomic requirements\n\t\t": "Office chair should have lumbar support"
          },
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Desk Set Up",
          "cart_item_id": "d7c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "5 Days"
        }
      ],
      "show_subtotal_price": "false",
      "subtotal_title": "Subtotal"
    },
    "yearly": {
      "subtotal_price": "$3,300.00",
      "subtotal_recurring_frequency": "Annually",
      "subtotal_recurring_price": "$300.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "04b7e94b4f7b4200086eeed18110c7fd",
          "variables": {
            "Adobe Photoshop": "",
            "Adobe Acrobat": "true",
            "Optional Software": "",
            "Additional software requirements": "MS Office 2007"
          },
          "quantity": "3",
          "localized_price": "$1,100.00",
          "price": "$1,100.00",
          "recurring_frequency": "Annually",
          "localized_recurring_price": "$100.00",
          "recurring_price": "$100.00",
          "item_name": "Standard Laptop",
          "cart_item_id": "9fc5241fc3211200d68d3b0ac3d3ae7e",
          "delivery_time": "5 Days"
        }
      ],
      "show_subtotal_price": "true",
      "subtotal_title": "Subtotal"
    },
    "show_subtotal_price": "true",
    "subtotal_title": "Subtotal"
  }
}

Case-2: if two-step is true:
{
  "result": {
    "request_number": "REQ0010001",
    "request_id": "82a7e89fc3211200d68d3b0ac3d3ae0a"
  }
}

Sample Python request

#Need to install requests package for python
#easy_install requests
import requests

# Set the request parameters
url = 'https://instance.service-now.com/api/sn_sc/v1/servicecatalog/items/6690750f4f7b4200086eeed18110c761/checkout_guide'

# Eg. User name="admin", Password="admin" for this code sample.
user = 'admin'
pwd = 'admin'

# Set proper headers
headers = {"Content-Type":"application/json","Accept":"application/json"}

# Do the HTTP request
response = requests.post(url, auth=(user, pwd), headers=headers ,data="{\"items\":[{
  \"sys_id\":\"04b7e94b4f7b4200086eeed18110c7fd\",
  \"variables\":{
    \"acrobat\":\"true\",
    \"Additional_software_requirements\":\"MS Office 2007\"
  },
  \"sysparm_quantity\":\"3\"
},
{
  \"sys_id\":\"e1be6dcb4f7b4200086eeed18110c74c\"
},
{
  \"sys_id\":\"186d917a6fab7980575967ddbb3ee4f2\",
  \"variables\":{
    \"new_email\":\"abel.tuter@example.com\"
  }
},
{
  \"sys_id\":\"8b3ae7fedc1be1004ece5c08239e522b\"
},
{
  \"sys_id\":\"962967674ff38200086eeed18110c7e7\",
  \"variables\":{
    \"ergonomic_office\":\"Office chair should have lumbar support\"
  }
}]}")

# Check for HTTP codes other than 200
if response.status_code != 200:
    print('Status:', response.status_code, 'Headers:', response.headers, 'Error Response:',response.json())
    exit()

# Decode the JSON response into a dictionary and use the data
data = response.json()
print(data)
Case-1: if two-step is false:
{
  "result": {
    "cart_id": "0d8c7a32c3211200d68d3b0ac3d3aeba",
    "subtotal_price": "$3,350.00",
    "subtotal_recurring_frequency": "",
    "subtotal_recurring_price": "$300.00",
    "total_title": "Total",
    "monthly": {
      "subtotal_price": "$50.00",
      "subtotal_recurring_frequency": "Monthly",
      "subtotal_recurring_price": "$0.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "90af095bcd38798071a208d710d1b64f",
          "variables": {},
          "quantity": "1",
          "localized_price": "$50.00",
          "price": "$50.00",
          "recurring_frequency": "Monthly",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Belkin iPad Mini Case",
          "cart_item_id": "cb6e485fc3211200d68d3b0ac3d3ae35",
          "delivery_time": "2 Days"
        }
      ],
      "show_subtotal_price": "true",
      "subtotal_title": "Subtotal"
    },
    "none": {
      "subtotal_price": "-",
      "subtotal_recurring_frequency": "",
      "subtotal_recurring_price": "$0.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "186d917a6fab7980575967ddbb3ee4f2",
          "variables": {
            "Preferred Email address": "abel.tuter@example.com"
          },
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "New Email Account",
          "cart_item_id": "17c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "global.Workflow"
        },
        {
          "catalog_item_id": "8b3ae7fedc1be1004ece5c08239e522b",
          "variables": {},
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Corp VPN",
          "cart_item_id": "97c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "2 Days"
        },
        {
          "catalog_item_id": "e1be6dcb4f7b4200086eeed18110c74c",
          "variables": {},
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "External Monitor",
          "cart_item_id": "d3c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "2 Days"
        },
        {
          "catalog_item_id": "962967674ff38200086eeed18110c7e7",
          "variables": {
            "Please describe any ergonomic requirements\n\t\t": "Office chair should have lumbar support"
          },
          "quantity": "1",
          "localized_price": "$0.00",
          "price": "$0.00",
          "recurring_frequency": "",
          "localized_recurring_price": "$0.00",
          "recurring_price": "$0.00",
          "item_name": "Desk Set Up",
          "cart_item_id": "d7c5241fc3211200d68d3b0ac3d3ae7f",
          "delivery_time": "5 Days"
        }
      ],
      "show_subtotal_price": "false",
      "subtotal_title": "Subtotal"
    },
    "yearly": {
      "subtotal_price": "$3,300.00",
      "subtotal_recurring_frequency": "Annually",
      "subtotal_recurring_price": "$300.00",
      "total_title": "Total",
      "items": [
        {
          "catalog_item_id": "04b7e94b4f7b4200086eeed18110c7fd",
          "variables": {
            "Adobe Photoshop": "",
            "Adobe Acrobat": "true",
            "Optional Software": "",
            "Additional software requirements": "MS Office 2007"
          },
          "quantity": "3",
          "localized_price": "$1,100.00",
          "price": "$1,100.00",
          "recurring_frequency": "Annually",
          "localized_recurring_price": "$100.00",
          "recurring_price": "$100.00",
          "item_name": "Standard Laptop",
          "cart_item_id": "9fc5241fc3211200d68d3b0ac3d3ae7e",
          "delivery_time": "5 Days"
        }
      ],
      "show_subtotal_price": "true",
      "subtotal_title": "Subtotal"
    },
    "show_subtotal_price": "true",
    "subtotal_title": "Subtotal"
  }
}

Case-2: if two-step is true:
{
  "result": {
    "request_number": "REQ0010001",
    "request_id": "82a7e89fc3211200d68d3b0ac3d3ae0a"
  }
}