Updating Pricing_Details on PriceBook using API not working

Updating Pricing_Details on PriceBook using API not working

Hi there,

Im encountering a problem updating pricebooks through the API.

(for the sake of the length of this post i removed the `$approval`, `$review_process`, `Owner`, `Modified_By` and `Created_By` keys from the data as they are not relevant)

Here is my postdata:

{
    "data": [
        {
            "Description""Basisprijslijst (excl BTW)",
            "Price_Book_Name""Test003",
            "Pricing_Model""differential",
            "Pricing_Details": [
                {
                    "from_range"1,
                    "to_range"10,
                    "discount"10
                }
            ]
        }
    ]
}

And eventhough im getting this response:

{
    "data": [
        {
            "code""SUCCESS",
            "details": {
                "Modified_Time""2022-02-22T10:34:24+01:00",
                "Created_Time""2022-01-17T17:08:39+01:00",
                "id""380272000000665002",
            },
            "message""record updated",
            "status""success"
        }
    ]
}

When i retrieve the pricebook again it looks like this:

{
    "data": [
        {
            "Modified_Time""2022-02-22T11:23:32+01:00",
            "Pricing_Details": [],
            "Description""Basisprijslijst (excl BTW)",
            "$currency_symbol""€",
            "$field_states"null,
            "Created_Time""2022-01-17T17:08:39+01:00",
            "$editable"true,
            "$orchestration"false,
            "Active"true,
            "$review"null,
            "Pricing_Model""differential",
            "$state""save",
            "$process_flow"false,
            "$in_merge"false,
            "Price_Book_Name""Test003",
            "id""380272000000665002",
            "Tag": [],
            "$approval_state""approved",
            "$approved"true
        }
    ]
}

As you can see the key `Pricing_Details` turns out to be empty. It doesnt matter if PATCH or PUT is used its always empty after the update.

If I alter the postdata a little so it looks like this:

{
    "data": [
        {
            "Description""Test PriceBook for testing pricing Pricing_Details",
            "Price_Book_Name""TestDetails",
            "Pricing_Model""differential",
            "Pricing_Details": [
                {
                    "from_range"1,
                    "to_range"10,
                    "discount"10
                }
            ]
        }
    ]
}

and use it to create a pricebook im getting this response:

{
    "data": [
        {
            "code""SUCCESS",
            "details": {
                "Modified_Time""2022-02-22T11:54:55+01:00",
                "Created_Time""2022-02-22T11:54:55+01:00",
                "id""380272000000759004",
            },
            "message""record added",
            "status""success"
        }
    ]
}

And after looking up the newly created pricebook by the Id this is the result:

{
    "data": [
        {
            "Modified_Time""2022-02-22T11:54:55+01:00",
            "Pricing_Details": [],
            "Description""Test PriceBook for testing pricing Pricing_Details",
            "$currency_symbol""€",
            "$field_states"null,
            "Created_Time""2022-02-22T11:54:55+01:00",
            "$editable"true,
            "$orchestration"false,
            "Active"true,
            "$review"null,
            "Pricing_Model""differential",
            "$state""save",
            "$process_flow"false,
            "$in_merge"false,
            "Price_Book_Name""TestDetails",
            "id""380272000000759004",
            "Tag": [],
            "$approval_state""approved",
            "$approved"true
        }
    ]
}

Also showing empty Pricing_Details.

I followed all the information in the documentation (for as far as I know) and would really like to know what is going on here and why this is not working as this is currently a huge problem for a few customers.

Thanks in advance for your reply.