Unable to update line item discount

Hi there,

I want to update the discount of a line item(using `crm/v3/objects/line_items/batch/update`). But I’m getting the below error.

{

“status”: “error”,

“message”: “Cannot set discount without clearing discountPercentage”,

“correlationId”: “4c838f3a-7b5c-4f42-8111-c8d129105505”,

“category”: “VALIDATION_ERROR”

}

So I tried to clear discountPercentage like below but It doesn’t update as `null`. It will keep the same value.

curl --location ‘https://api.hubapi.com/crm/v3/objects/line_items/batch/update’ \

--header ‘Content-Type: application/json’ \

--header 'Authorization: Bearer \

--data '{

“inputs”: [

{

“id”: 123,

“properties”: {

“hs_discount_percentage”: null,

“discount”: 20

}

}

]

}’

Any suggestions to resolve this issue?

Thanks

Hello @johannes-m , thank you for posting in our Community!

Checking more details on this error, looks like we need to leave hs_discount_percentage blank so it would look like either this -

{ “properties”: { “discount”: 50 , “hs_discount_percentage”: } } or { “properties”: { “discount”: 50 , “hs_discount_percentage”: " " } }.

Essentially to “clear” the property, we need to set it to nothing.

I hope this information helps.

Pam

Thank you!