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

Allen Andreas
Administrator
Administrator

Hello,

Is that all that you're sending and is your URL using the item sys_id?

Is the request actually created? Have you found it in your system?

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


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

Yes the URL has the sys_id of the item. If I impersonate the account I'm using to test with I find the request filled out in their cart. If I use Rest API explorer giving it the sys_id of the item and the same json body in the raw tab. I get the same results. The item is filled out and in my cart.

And just to ask, because I have to, haha, you're using order_now not 

/sn_sc/servicecatalog/items/{sys_id}/add_to_cart

Because it sounds like you're using the add_to_cart.

Thanks


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

Yes I'm doing /api/sn_sc/servicecatalog/items/{sys_id}/order_now

screenshot from Rest API explorer.

find_real_file.png