How to place an order from REST Api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 04:57 AM
Dear all,
I have a need to place an order from REST Api through an external application in ServiceNow
For that I have seen we need to use the service catalog Api and undertand that we need to :
- collect items from a given category
- place item in a cart using dedicated api
All those steps are ok and clear.
Now at some point there is the need to validate the order based on given cart items collection.
For that I have seen there are different API where I am confused on which to use :
- Check out Cart
- Submit Order
Which one to use in order that ServiceNOw generate in background the ServiceCatalog Task and Request Item ?
How to handle order if it is need to go through a Record Producer instead of getting individual items ?
Thanks for help
regards
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 05:09 AM
Hi
Submission of the cart via the REST API depends on the two step checkout parameter.
Please refer to the documentation on API and two step checkout.
https://developer.servicenow.com/app.do#!/rest_api_doc?v=kingston&id=r_SCatAPISubmitOrderPOST
https://docs.servicenow.com/bundle/jakarta-it-service-management/page/product/service-catalog-management/concept/c_EnableATwoStepCheckout.html?title=Enabling_a_Two-Step_Checkout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 05:52 AM
Thanks for your reply
By the way if I am using one step checkout to be simple, when I am submitting my cart, how do I know that
I am submitting the correct cart as I can have different ongoing cart ?
Thanks for your reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 08:13 AM
By default, logged in user's cart is used to submit the order. All the items added to the default cart are going to be submitted.
In case, if you have a requirement to submit the cart of multiple users. You may retrieve the default cart of the user with Gliderecord on sc_cart table and submit the order of each user cart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 11:13 PM
Thanks for your reply.
SO if I need to place an order on servicenow from an external application through rest API, how cqn I specify to which user the order will belongs ?
Will I neeed in a way to to pass user credential in HTTP header or stuff like this ?