APIs & Integrations

johannes-m
Contributor

Unable to update line item discount

SOLVE

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.
 
--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
0 Upvotes
1 Accepted solution
johannes-m
Solution
Contributor

Unable to update line item discount

SOLVE
0 Upvotes
2 Replies 2
PamCotton
Community Manager
Community Manager

Unable to update line item discount

SOLVE

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

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




johannes-m
Solution
Contributor

Unable to update line item discount

SOLVE

Thank you!

0 Upvotes