Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
When two-step checkout is enabled and when using scripted web services to order an item, all items in the DEFAULT cart is being ordered instead of the specified item in the request body. - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • When two-step checkout is enabled and when using scripted web services to order an item, all items in the DEFAULT cart is being ordered instead of the specified item in the request body.
KB0696054

When two-step checkout is enabled and when using scripted web services to order an item, all items in the DEFAULT cart is being ordered instead of the specified item in the request body.


2993 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


When two-step checkout is enabled and when we use scripted web services to order an item (by passing in the custom cart with the sys_id of the item as a parameter to n_sc.CartJS), all items in the DEFAULT cart is being ordered instead of the specified item in the request body. 

Release


Kingston

 

Cause


This is a bug in the platform and a PRB1297366 is created to fix the issue. 

 

Resolution


The dev team is working on a fix for this issue at the time of this writing (PRB1297366).
 
However, we have a workaround to resolve the issue.
 
WORKAROUND:
 
 we can make use of the OOB REST API named "Buy Item", which has this endpoint,
POST https://<instance-name>.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now
 
One modification is required to get over the issue and it is to add this parameter along with other parameters to the request body,
 
'get_portal_messages': 'true'
 
Now it will directly order the item specified in the request body rather than all the items in the DEFAULT/portal cart.
 
To test the endpoint, please navigate to "System Web services" -> "REST" -> "REST API EXPLORER"
2. Select theNamespace -> sn_sc
3. Click on the API named "Buy Item (POST)"
 
4. Give the sys_id of the item being ordered.
5. Please provide variable values, if any, for the item.
6. Add the quantity (sysparm_quantity) and the above mentioned parameter, 'get_portal_messages': 'true'.
 
Click send.
 
Now we can see from the response that it orders only the item being specified and not all the items in the DEFAULT cart.

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.