for the life of me I don't know how to set the pri...
# suitetalkapi
t
for the life of me I don't know how to set the pricelevel on a sales order the following is not working and defaulting to base prices "item": { "items": [ { "item": { "id": 30112 }, "quantity": 5, "rate": 17000 "price":{ "id":"-1" } } ] }
e
Is the price level assigned to the item?
The syntax seems correct, but the ID must exist and be previously assigned to the item.
t
I'm trying to set a custom price level
e
Same syntax works for me, tested on Postman
t
and you confirmed it set the custom price level?
e
t
I wonder if price level is a beta feature
we can't set the price level at all even using different valid ids
thanks for your help
e
If you create SO in the UI, can you select the Custom price level? And also, no errors or warning in the API response?
t
other than an inventory warning no errors
n
Maybe the order it's setting the values? When you set "price" after setting the quantity / rate, it's potentially wiping the rate and defaulting to the price from the item. I'm not sure if moving the price in your object further up affects the order values are set? If it does, try moving "price" further up before you set the rate.
Copy code
"item": {
        "items": [
            {
                "item": {
                    "id": 30112
                },
                "price":{
                        "id":"-1"
                 }
                "quantity": 5,
                "rate": 17000
            }
        ]
    }
t
thanks. I tried the following and it still didn't work. I'm going to log a ticket with NS and will post back the result "item": { "items": [ { "item": { "id": 30112 }, "price:": { "id": "12" } } ] }
12 is a valid price level for the item
e
Can you share the whole call?
i
is there a UE script that may be setting the price level, sending price level as -1 should set it to the custom price level
t
I turned off all scripts and workflows and set the form to standard
Still the same
{ "entity": { "id": 168498 }, "custbody_contact": 166552, "custbody_sale_type": "1", "custbody_hubspot_quote_nbr": "123", "shipaddress": "Looney HQ", "department": "41", "saleseffectivedate": "2024-04-28", "custbody_delivery": "2025-04-30", "prevRep": 152099, "salesRep": { "id": "152099" }, "custbody_sales_t_and_c": { "items": [ { "id": "4" } ] }, "subsidiary": "1", "custbody_contactemail": "praveenmech@yrst.com", "custbody_contactphone": "937777777", "memo": "Test", "item": { "items": [ { "item": { "id": 30112 }, "price:": { "id": "12" } }, { "item": { "id": 10970 }, "quantity": 4, "price:": "-1", "rate": 7000 } ] } }
e
Change
"price:": "-1",
For
"price" : {"id" : -1},
Your code works for me
t
sorry to cause confusion, it's the first element with the problem, the second item doesn't have a price level so it defaults to custom already. I changed the payload and it is the same issue
e
So just to be sure... The price level 12 exists AND is assigned to the item? The price level can exist, but if the item doesn't have an amount set for that price level, then it doesn't work
As an example, this item, in the tab
Sales / Pricing
is listing all my existing price levels, but it doesnt have any of them set with a price So I can pass the ID of that price level, and it will not work
t
it is a valid price level in the transaction i.e. I can set it manually on the line. I tried 12 instead of -1 just to see if another price level would go through in the api
e
And after you save the SO in the UI the price level is not changed?
t
correct even on save. as mentioned I turned off all scripts, work flows and reverted to the standard form. I opened a case with NetSuite and I'm curious for the result. I will post it here