#nstripe0_api

1 messages ¡ Page 1 of 1 (latest)

wooden lichenBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1333605872869445758

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

white moon
#

I'm looking at the API docs for updating an invoice here: https://docs.stripe.com/api/invoices/update

My prior conversation with another Stripe dev suggested to specify an empty array for the coupons to remove the coupons no longer applicable to the invoice.

This does not seem to work, or our understanding of how to do this was incorrect. Is it even possible? If so, how can this action (removing coupon from invoice) be done?

uneven oxide
#

Could you try to pass an empty string to the discounts parameter?

white moon
#

Wouldn't that remove all discounts?

#

If there are two coupons, and I need to remove one of them, how can I specify that?

#

The docs here seem to imply this may be for adding discounts, but not modifying existing ones or removing them (perhaps besides removing all).

uneven oxide
#

Ah I see, 1 min

#

Well then you can remove the coupon you want, inside the discounts array. That array contains a list of applying "discount", which represent coupon

white moon
#

So using the discounts.discount to specify the ones the invoice should have.

  • If there is A and B and I just want to keep B, specify that discount ID there.
  • If there is A and B and I don't want any, perhaps then specify the empty string.
uneven oxide
#

Yeah

white moon
#

Will give that a try...

white moon
#

FYI, passing empty string to disounts.discount results in "Invalid array" error (req_QS6xeDfay4lnbQ)

uneven oxide
#

You want to pass direct to discounts

white moon
#

Ah, ok