When I try to use the OOB: Add Item To Cart(POST) & Submit Order(POST) it says: "Mandatory...

nikhil kamlekar
Tera Contributor

Hi Team,

We have a requirement to provide users to create REQ, RITM for a catalog item, When I'm trying to provide them the POST link by using the OOB: Add Item To Cart(POST) & Submit Order(POST) it says:

400 Bad Request

In Response body:

{
  "error": {
    "message": "Mandatory Variables are required",
    "detail": ""
  },
  "status": "failure"
}

Eventhough, i filled the required all the variables. One of the variables is 'Read only, some of them are mandatory variables.


Thanks,
Nikhil Kumar

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhil kamlekar 

it should work ideally as you passed the mandatory variables

OR

you can use a Scripted REST API which gives you full control on what API request and response will look like

I shared solution here few years ago, check that and enhance

Scripted rest api 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader