Implementing subscriptionBillable
Hello,
I am trying to implement the solution you talk about on your subscriptionBillable page. I wait for the event to set the quantity of tracked items (users in our case) on my outstanding bill. I have multiple questions about this process:
-
on your webhook webpage there is no activityType subscriptionBilling is that not up to date or do i need to use another route or is it part of another event type with a specific field value?
-
is the subscription[invoice][billingDatetime] the billingDate of the outstanding invoice (the one billable that i want to set the tracked items of) or the current invoice (month that just begun) ?
If not then i need to use subscription[invoice][previousBillingDatetime] for the billingDate of the outstanding invoice, but then i cannot reliably determine the begining date of the outstanding invoice period due to your method of computing periods. For example if billing date is 1st of a month, the beginning of a month can either be 1st of the previous month or 31 of 2months ago.
Regards,
Lucas Kennedy
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Meghan Turner on 01 Sep, 2017 02:51 PM
Hey there 360Learning team,
Good catch! The
activityType
description on our Web Hooks Knowledge Base article should includesubscriptionBillable
as one of the possible event types. I'll fix that. In the payload of the subscription billable hook, theactivityType
will besubscriptionBillable
.Yes, the
subscription[invoice][billingDateTime]
of the subscription billable hook contains the bill date of the billable outstanding invoice which will be the one that you want to update. To update the tracked item for the customer's outstanding invoice in Cheddar, however, you don't need to give us the specificbillingDateTime
of the invoice to be updated. All you need to do is use the set tracked items API call with aninvoicePeriod
ofoutstanding
and the desiredquantity
of the item (more information on calls to update the current vs. outstanding invoice here).You may also find it useful to test your web hooks before implementing them. You can use a service like Request Bin to setup a temporary hook listener url that allows you to examine the data you'll receive in hook payloads. Just get your test url from Request Bin, configure it as your listener url in the service hooks section of the Cheddar dashboard, and wait for events (or cause events) to happen in Cheddar (more info on testing hooks can be found here).
Hope that helps, but please let me know if you have any other questions!
Meghan
2 Posted by API prod on 01 Sep, 2017 04:52 PM
Thanks for the return.
Nice tips for the testing i'll make sure to use it.
Noted for the activityType and nice for the dates.
For the record i wasn't asking for the dates to pass it to the url (i already have the good url with invoicePeriod=outstanding, this part is ok). I just needed the dates to be able to compute the number of tracked items to bill for the outstanding time period. But if i had only the endDate of the period i could not reliably compute the beginning date because of the way you compute periods aka 31st transforms in 1st on the next month (that was my main point). In the end it won't affect me so no problem.
Regards,
Lucas Kennedy
Meghan Turner closed this discussion on 08 Sep, 2017 06:57 PM.