Implementing subscriptionBillable

API prod's Avatar

API prod

01 Sep, 2017 12:56 PM

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

  1. Support Staff 1 Posted by Meghan Turner on 01 Sep, 2017 02:51 PM

    Meghan Turner's Avatar

    Hey there 360Learning team,

    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?

    Good catch! The activityType description on our Web Hooks Knowledge Base article should include subscriptionBillable as one of the possible event types. I'll fix that. In the payload of the subscription billable hook, the activityType will be subscriptionBillable.

    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)?

    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 specific billingDateTime of the invoice to be updated. All you need to do is use the set tracked items API call with an invoicePeriod of outstanding and the desired quantity 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. 2 Posted by API prod on 01 Sep, 2017 04:52 PM

    API prod's Avatar

    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

  3. Meghan Turner closed this discussion on 08 Sep, 2017 06:57 PM.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM