#obo_api

1 messages ¡ Page 1 of 1 (latest)

burnt shaleBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1259943554889945230

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

slim cypress
#

They are the exact same data-wise, the one difference is when they trigger: invoice.paid will trigger both for payments and when you mark an invoice as paid out of band. invoice.payment_succeeded only triggers for actual payments, it ignores paid out of band

#

We generally reccommend using invoice.paid as that covers more scenarios

shy gyro
#

Gotcha, thanks!

#

On a somewhat related note. Is there a webhook event you would recommend for a subscription period starting fresh? For example, the subscription period ended, and the next month of that susbcription period starts

#

For context, we're putting together a system that lets customers lock their accounts from accrueing new usage if a certain dollar amount is hit. Then we want to let the system automatically unlock their account again at the start of a new pay period.

#

invoice.paid seems like a solid option, but understandably there could be some issues with that if billing hiccups occur (or if they're on an net 30 delay such as enterprise billing)

slim cypress
#

customer.subscription.updated is the one that will be specifically locked to subscription cycling. You can listen to that and then check the event's previous_attributes for current_period_start and current_period_end to make sure that the update was the subscription cycling

shy gyro
#

to clarify, you're saying that customer.subscription.updated fires off at the exact second a billing period end is hit and a new cycle starts?

#

(even if no changes to the subscription occurred)

slim cypress
#

Correct, the update in that case is an automatic update to the billing cycle of the subscription. So at a minimum you will see that the cycle start and end changed