Order Now API

Brian Lancaster
Tera Sage

I'm trying to test the catalog API Order Now using SOAP UI. According to the link I provided it should return to me the request number. However it is returning the sys_id of a shopping cart. What am I missing? Below is the json body I am sending. All fields in this request are single line text.

{
  sysparm_quantity: 1,
  variables: {
    first_name: 'John',
    middle_name: '',
    last_name: 'smith',
    employee_id: 'test',
    employee_type: 'test',
    employee_manager: 'test',
    department: 'test',
    start_date: 'test',
    end_date: 'test',
    managment_level: 'test',
    work_location: 'test',
    work_hours: 'test'
  }
}
1 ACCEPTED SOLUTION

Hi,

I believe two-step may cause some issues. You could try on PDI, for example, disabling it to see if that helps.

You can also review the code for it at:

1. Please change the current application scope to "Service Catalog REST API" (the same scope where the OOB order_now scripted API is present)
2. Type "Scripted REST APIs" in the filter navigator and select the "Scripted REST APIs" under the "System Web Services"
3. Open the record with the name "Service Catalog API"
4. Under the "Resources" section (at the bottom), Open the record with the name "Buy Item" in a separate tab for reference.
 
Do you see any edits or anything within that would cause this behavior?

Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

13 REPLIES 13

Hi,

Yeah, that's what I figured.

You could attempt to take the sys_id in response...and fire yet another curl using the check_out:

/sn_sc/servicecatalog/cart/checkout

You'd want to review that approach as that orders all items in checkout, maybe you can try and specify the item, etc. but essentially, the main point is, you'd have to punch the checkout through.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Yes that works, now lets just hope the developer for workday can figure out how to take the response and send another api.

Gave correct answer to early. The checkout api just return what was in the cart but never actually submitted the cart. I had to use /api/sn_sc/v1/servicecatalog/cart/submit_order instead.

Hi @Brian Lancaster 

Alright, heh.

Yeah, like I said above:

the main point is, you'd have to punch the checkout through. So I was just trying to help read the documentation as that's not something I've had to personally do, but glad you got the idea and looked into it.

I didn't mean that specific method, but was guiding the approach. I would believe the correct answer to your question (posted above) was why was it going to the cart...and that was because of 2-step?

Additional info, to help you, was the extra info I provided about approaching it with a second curl request.

Take care

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!