#maxman101
1 messages · Page 1 of 1 (latest)
Hi there!
Pasting your other messages here:
seems like that has changes
once used, they stay sticky at the customer
thats a breaking change?
I guess it depends what type of coupon you are using.
hey
its a once coupon
req_exnd0OEMaoLxe7
"id": "juZqVDZL",
"object": "coupon",
"amount_off": 5000,
"created": 1691053690,
"currency": "eur",
"dashboard_currency_options": {
"eur": {
"amount_off": 5000
}
},
"duration": "once",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {
},
"name": "FIXED-50",
"owning_merchant": "acct_1EQgCWCrrVPAjQHJ",
"owning_merchant_info": "acct_1EQgCWCrrVPAjQHJ",
"percent_off": null,
"redeem_by": null,
"times_redeemed": 1,
"valid": true
},
Then once the coupon is used the coupon shoud be removed.
but its not
check my test customer
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
did an invoice, but coupon still active on the customer
Thanks! Give me a few minutes to look into this.
"id": "juZqVDZL",
"object": "coupon",
"amount_off": 5000,
"created": 1691053690,
"currency": "eur",
"dashboard_currency_options": {
"eur": {
"amount_off": 5000
}
},
"duration": "once",
"duration_in_months": null,```
this used to work for me, but now we just noticed this changed behavior
any idea whats wrong?
we did not change any code on our side
hello?
Hey! Taking over for my colleague. Let me catch up.
sure
so why is my once coupon kinda sticky on the customer
even if used on an invoice with amount > 0
I'm seeing that this coupon was applied in these invoices in_1NaxWPCrrVPAjQHJCMNNyrpm, in_1NaxXQCrrVPAjQHJMHr8w3sP and in_1NaxYBCrrVPAjQHJepnPto2R (not paid yet)
yes
fynn is our test customer
especially in_1NaxYBCrrVPAjQHJepnPto2R. wich has 10 € amount due and coupon used
but why is the coupon still at the customer?
I'm suspecting that the coupon wasn't 100% applied, because the invoice total amout was < the coupon discount...
doing some tests...
but this used to work fine for months on our side
Double checking something...
Wait what you wont to achieve here ?
You wont the coupon be used only one time by the customer or be used one time for a subscription ?
only one time per customer
like: hey customer here you get a one time 50€ off
as is said, this used to work for months
invoice created, coupon used, coupon not ! on the customer anymore
but now it stays sticky
The duration applies for Subscription and not one time payment:
https://stripe.com/docs/api/coupons/object#coupon_object-duration
we dont use subscriptions
Do you have an example ?
we only create invoices by ourself
well i create a coupon
req_BXoST6nXPQqwCI
"id": "juZqVDZL",
"object": "coupon",
"amount_off": 5000,
"created": 1691053690,
"currency": "eur",
"dashboard_currency_options": {
"eur": {
"amount_off": 5000
}
},
"duration": "once",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {
},
"name": "FIXED-50",
"owning_merchant": "acct_1EQgCWCrrVPAjQHJ",
"owning_merchant_info": "acct_1EQgCWCrrVPAjQHJ",
"percent_off": null,
"redeem_by": null,
"times_redeemed": 0,
"valid": true
}
then i apply this coupon to the customer
Do you have a working example ?
sure
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
now that customer has the 50off once coupon
now i create an invoice
item amount is 30€
coupon is beeing used as seen
now i would expect on invoice finalization that the coupon on the customer is gone after usage
invoice finalized: in_1NayRXCrrVPAjQHJj3JEHK5R
but still the customer has the coupon on his account: cus_ONiv5EzEs4ieme
Thanks for the detailed explanation, I'll try to reproduce on my end
I meant could you provide a working example where the coupon on the customer is gone after usage, you said before it worked do you have an example of that ?
no, as this behavior suddenly changed
this is how it used to work
whats coupon=once then for?
I managed to reproduce the issue. Indeed that's odd, looking into this.
Do you have a customer ID example where the behavior was different?
hmm interestingly not
but could swear it was like this
how am i supposed to implement a one time coupon?
ah
here:
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
live data
Nov 9, 2022, 10:18 AM
then invoice used coupon: https://dashboard.stripe.com/invoices/in_1MA6lFCrrVPAjQHJ4DMyl7eA
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
and after that, coupon is gone
and after that, coupon is gone
what does that mean, where exactly (which API parameter) are you looking to see that?
note that it's normal for discount to be null on the Subscription if you use a one-time coupon on the first invoice, that's how it works(there is no ongoing discount on the Subscription).
i dont use subscriptions !
i only create invoice manually
and would like. customer.coupon to be applied once
how am i supposed to use the coupon once?
that isnt possible anymore?
or did that change with a stripe api version change?
it's definitely possible
we are looking at some lost money due to this change
sales team is not happy
what happend?
basically coupon->once does not mean ONCE anymore !
I'm afraid you're nor making sense. Can you you focus on the technical question?
sure
I'm looking at in_1MA6lFCrrVPAjQHJ4DMyl7eA. What is the problem with it, what do you see versus what you expected to see?
in_1MA6lFCrrVPAjQHJ4DMyl7eA is fine
coupon applied to customer, invoice created, coupon used, coupon gone on the customer
so how to use a once coupon correctly?
so its gone after usage
that is the behavior i am aiming for
lets replicate this on test data
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
has coupon: €50.00 off once
now i would expect the coupon to be gone ONCE used for an invoice
correct?
depends what you mean by "gone".
to be clear duration:once is a field specifically intended for subscriptions, it just means if you apply it to a customer, the next invoice for that customer is discounted, and not any repeat Invoices after that.
Applying to a one-off invoice works too
okay
i am creating one-off invoices
app(StripeClient::class)->invoices->create($payload)
the coupon is beeing applied
but its active for more than one invoice
like i can create 20 invoices with 50€ amount, and its always discounted by the coupon
for one customer
do you see my issue? recurring one-off invoices still get the once coupon applied !
AFAIK duration is for Subscriptions, it's tied to the concept of a Subscription , coupons were built for Subscriptions as a product. duration is used to control if repeart Invoices in a subscription get the coupon again or not.
Have you ever seen this act differently?
well then, whats the proper way to add discount to an one-off invoice?
I get that it's confusing but I believe it's just a quirk of the API that's always been that way, happy to look if you have an example of it working differently
the way you're doing it works. And then you can manually remove the coupon from the customer afterwards.
or you can use a negative InvoiceItem instead of a coupon.
and manage the coupon behavior on my side?
probably the way to go, as using stripe susbcriptions didnt work for us
i like to maintaing 100% behavior on my side
but: i could swear the coupon behavior has changed on stripe's side!
when i implemented it, like 1-2 years ago it worked like mentioned
if you have an example of it working differently we can definitely investigate!
man this is weird
but okay
then i will implement it myself completely
maybe this changed on stripes side?