#ninjaparade - Quotes

1 messages ยท Page 1 of 1 (latest)

muted ginkgo
#

Instead of an empty array, can you try passing an empty string for the line items array? I can look further in a minute, but I am pretty sure that empty string is the way to unset the entire array in our API

full dove
#

I will try your suggestion

#
You passed an empty string for 'line_items'. We assume empty values are an attempt to unset a parameter; however 'line_items' cannot be unset. You should remove 'line_items' from your request or supply a non-empty value.``` I get this when I try a string, which is what I would have expected
#

looks like the only way to remove this is to actally return the line items that are on the quote with a quantity of 0

muted ginkgo
#

Apologies for the bad info. I thought there was a good way to unset arrays in our API. I am checking into this further and will get back to you

full dove
#

โค๏ธ

muted ginkgo
#

Hey apologies for the delay. As far as I can tell we don't support updating a Quote to have 0 line items, you will need to include at least one. When you are making this call do you have line items that you want to put on the quote after?

#

Like is the goal to remove all line items here or is this an intermediate step before adding more?

full dove
#

yes

#

in this case, it's removing all line items, passing an array with the line items we want works, but when the line items are there and we send an empty array the quote doesn't respect it and the line items don't get removed

crude bough
#

looking, give me a bit

full dove
#

OK let me give you this

#

this is the quote

#

the request with no line items

#

this one is with a quanity of 0 which works for us, but it stays on the quote, sending an empty array of line items as line_items => [] and line_items => [ [ ] ] all don't work

crude bough
#

looking one sec

full dove
#

no sweat just wanted to give you all the things I've done to help this is def a bug ๐Ÿ˜„

#

I need to head out, I know in the past you just archive threads, is it possible to keep this open for like an hour until i get back?

crude bough
#

yeah I can leave it open

crude bough
#

just to double check, you're saying that you can create a Quote with no line items fine, but when you add line items, you can't unset them (i.e. set back to 0 line items), right?

full dove
#

no soryy

crude bough
#

ah ok can you clarify? I think I misunderstood

full dove
#

I create a quote and add line items, but if I want to clear the quote and send an empty array of line items, the line items do not get removed

#

the quote I linked above, I can not get the quote to have no line items anymore

#

if you look a this last request, I sent an empty array for line items, the SDK seems to array filter the null array out

#

how about this

#

since I am obvioulsy confusing things

#

show me how I can make an API request to the quote update endpoint that will accept an empty array of line items and have the quote start over with no items once there are any items on a quote. if you can do that I'd be in the clear.

#

@crude bough should I start over?

crude bough
#

no I understood, thanks for the detail you provided

repro'ing a few things

full dove
#

oh okay ๐Ÿ˜„

crude bough
#

I am seeing what you're seeing, i.e.

I can not get the quote to have no line items anymore

I don't know if it is by design or not, though I ~kinda agree on the use-case for why you would want to remove all line items

#

yeah I can file this as feedback to the team but for now, this isn't supporeted

full dove
#

I want to remove the line items to start fresh, my only option right now so that I don't show a UI bug (cause the items won't clear) i

#

the app we're building uses quotes to generate the invoice, so if they need to nuke it, your recommendation is to delete the quote and start over?

#

all other objects behave this way, invoices can accept an empty array and remove all invoice items, why can't a quote? ๐Ÿค”

crude bough
#

your recommendation is to delete the quote and start over?

for now, yes. I'm filing feedback on this to the team to consider this

full dove
#

OK thanks, this def feels like a huge oversight on my end, just based on having to start over, feels like quotes just don't fit the model everything else does.
Curious how/where one can follow up on this sort of feedback?

Appreciate your support ๐Ÿ‘