Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Buy Item (order_now) POST API only returns cart_id instead of request_id as per documentation

TanyapongS
Tera Contributor

Hi everyone,

 

I’m currently exploring the ServiceNow REST APIs for a project where we need to submit a catalog item in a single API call. Specifically, I am testing the following endpoint:

POST /api/sn_sc/servicecatalog/items/{sys_id}/order_now

According to the ServiceNow documentation, this endpoint should immediately place the order and return a JSON response containing fields such as:
{
"result": {
"sys_id": "...",
"number": "REQ0012345",
"request_number": "REQ0012345",
"request_id": "..."
}
}

However, in my instance, the response is consistently:
{
"result": {
"cart_id": "2bbb8bb1836b5690f8e358472daad336"
}
}

Question:

Is this behavior expected in certain versions or configurations of ServiceNow?

Does order_now sometimes behave as “add to cart” and require a separate call to cart/submit_order?

 

If so, is there a way to configure the instance to make order_now return the full request object directly (as shown in the documentation), or is the two-step process the only supported pattern in this scenario?

 

Any insight or clarification would be greatly appreciated!

 

Thank you.

1 ACCEPTED SOLUTION

Omkar Kumbhar
Mega Sage

Hello @TanyapongS ,

Yes, this is expected because your instance might be configured for 2 step checkout. Here in your case the order_now API  behaves like 'Add to cart'. and hence the request does not create.

 /api/sn_sc/servicecatalog/cart/submit_order  USe this submit_order API to submit the request

 

There are 2 system properties 

  • glide.sc.sp.twostep (for Service Portal)
  • glide.sc.checkout.twostep (for native UI)

If either is set to true, the two-step process is enforced

 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

View solution in original post

1 REPLY 1

Omkar Kumbhar
Mega Sage

Hello @TanyapongS ,

Yes, this is expected because your instance might be configured for 2 step checkout. Here in your case the order_now API  behaves like 'Add to cart'. and hence the request does not create.

 /api/sn_sc/servicecatalog/cart/submit_order  USe this submit_order API to submit the request

 

There are 2 system properties 

  • glide.sc.sp.twostep (for Service Portal)
  • glide.sc.checkout.twostep (for native UI)

If either is set to true, the two-step process is enforced

 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.