Error: "Invalid Quantity value" when ordering a catalog item using REST API Explorer

Sreekar ML
Tera Contributor

Hi Community,

I'm trying to order a catalog item using the REST API Explorer in ServiceNow, but I'm encountering the following error:

 

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

 

  • Namespace: sn_sc

  • API Name: ServiceCatalogAPI

  • API Version: v1

  • Method: Buy Item

  • Endpoint:

 

POST https://<instance>.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now

 

I’ve replaced {sys_id} with the actual sys_id of the catalog item I’m trying to order.

 

Need help - 

Am I using the correct approach to order a catalog item via REST API?

What could be causing the "Invalid Quantity value" error?

 

 

2 REPLIES 2

debendudas
Mega Sage
Mega Sage

Hi @Sreekar ML ,

Please follow this HI Article: How to submit a catalog item using REST API - Support and Troubleshooting

or this Community post: Solved: How to order Catalog Items from REST API Explorer? - ServiceNow Community

 

If this solution helps you then, mark it as accepted solution ‌‌✔️ and give thumbs up 👍

Rafał Rataj
Tera Contributor

the message may indicate you are missing the quantity, in that case you can try to add it in the payload

{  
  "quantity": 1,
  "variables": {..... 
 
on other hand you can try the submit_producer method

also it may indicate user is missing permission to submit the item 

you can also try to add to your integration user the rest_api_explorer role
and try to execute the API on that user, im the REST API Explorer, if it works then it should work also in Postman or on the integration 
 
 
the error comes from script include CatalogSaveUtility