REST API Issue for service-now catalog

adityamadhira
Kilo Contributor

Hi I am planning to use REST API for service   catalog in C# and facing below issue while testing. Please help me to fix this issue -

To test I navigated to "REST API Explorer"   in service now. While testing Add Item To Cart   (POST) call fails. Please refer attached screen short.

Error -

{
  "error": {
  "detail": "",
  "message": "Invalid Quantity value"
  },
  "status": "failure"
}

Please help me what the issue is?

21 REPLIES 21

karthik73
Mega Guru

Hi Aditya,



The parameter for quantity is sysparm_quantity, Service Catalog API - POST /sn_sc/servicecatalog/cart/{cart_item_id} . And i am able to update the quantity on the cart item by setting sysparm_quantity


I am seeing below error , after adding syspam_quantity



{
  "error": {
  "detail": "",
  "message": "Security constraints prevent ordering of Item"
  },
  "status": "failure"
}


@adityamadhira  did you managed to get this error: Security constraints prevent ordering of Item  fixed ? 

Once Items has been added to cart, how we can do checkout with Postman? i tried to take the result of the POST (add to cart) but i couldn't able to checkout with the data. I am getting an error message as below:

{
"error": {
"message": "Cannot checkout an empty Cart",
"detail": ""
},
"status": "failure"
}

 

How can i checkout with the data which i added in cart?

karthik73
Mega Guru

Hi Aditya, Which sys_id are you providing in the request?



You   have to provide the sys id of the catalog item