#allan-egidio_api

1 messages · Page 1 of 1 (latest)

round daggerBOT
#

👋 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/1402354908820144211

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

umbral smelt
#

hello! just want to acknowledge your question, i'll be back to it ASAP

#

can you share an example customer you've been testing this with where it's not working as expected?

#

typically coupons are directly attached to a specific invoice and not to a customer, so i'm curious how you're trying to implement this currently

round daggerBOT
viral spoke
#

All right

#

Hello solanum

#

I'm doing the following steps:

#
  • Added a coupon/promotional code for a specific customer with ID: cus_RwVLKB9vjyxAMo
    The coupon id is EWEM2u3d and the promotional code is promo_1Rsoz9S5MCZY2pF9W45mAB5l
#

When I create the invoice, I can see in the docs:
The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice’s customer. Pass an empty string to avoid inheriting any discounts.

#

But when I'm creating the invoice, it is not inheriting the coupons/promotion codes

#

I'm creating the invoice for this same customer id cus_RwVLKB9vjyxAMo

north rose
#

Hello
Thank you for sharing more details. Let me take a look

#

do you have the invoice ID?

viral spoke
#

sure I created it right now in_1RspytS5MCZY2pF9txVpvZBq

north rose
viral spoke
#

But why we have this description? something is not making sense for me sorry:
The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice’s customer. Pass an empty string to avoid inheriting any discounts.

Why I have the option to send empty string If I want to avoid inheriting discount? How I can make it inheriting the discount from customer?

#

** If not specified, inherits the discount from the invoice’s customer.** How I can do it?

#

inherit discount from invoice customer?

north rose
#

I think there's a way you can "apply discounts" directly on the Customer obejct via the dashboard

#

Like this

#

There's "Apply Coupon" in the dashboard that let's you set a discount on the Customer

viral spoke
#

I will try using dashboard, but I really would need to do it by API 🙁

north rose
#

I don't think there's a way to apply coupon on a Customer via the API unfortunately.

viral spoke
#

It worked on this way, it applied automatically the coupon to the invoice now using apply coupon to the customer via Dashboard

north rose
#

but in the latest version (Basil), we've removed coupon from the customer

#

We expect folks to use discounts parameter for the objects that support it like Subscriptions, Invoices etc

viral spoke
#

I'm taking a look here and when I apply the coupon to the customer, the coupon enter as discount to the customer

#

I will try to update the customer via API passing the discount object, one moment

north rose
#

What API version are you currently on? If you're not on Basil, you can still use coupon parameter to apply it directly to the Customer.

The dashboard is likely using an older API version under the hood.

viral spoke
#

I'm using the v1 "/v1/customers/"

#

Unfortunately, in the doc, we don't have this parameter to be updated, showing there. My luck was you!

#

Thank you so much!

north rose
#

NP! 🙂 pure luck but glad you're unblocked

round daggerBOT