Question about

Hemal Ruparelia's Avatar

Hemal Ruparelia

27 Jun, 2016 01:32 PM

Hi guys,

Been researching subscription management apps for the last week to move out of our in-house beast we have created and still looking to find something that fits in with our pricing model. http://support.cheddargetter.com/kb/pricing-plans/pricing-plan-basics#tracked-items - I have had a read of this and it seems we mayy have found a perfect fit.

I have one question:
When a tracked item is set to a hard amount (i.e. - Overage amount = 0), what happens if one of our users tries to trigger an event on our app for that tracked item?

Real-world example: We include X number of outgoing messages in our app. If you hit that limit and want to send more, you need to upgrade. So, if Jane Doe hits her limit, and then tries to send a message, what happens?

Our ideal scenario is: Jane Doe gets prompted to upgrade her plan on the spot.

Less ideal scenario would be: Message goes through while Cheddar Getter's API gets back to our servers to tell us that the limit has been hit already and any further messages can then be 'blocked' by us (but that would get very messy I think).

* * *

Would love to hear back. *Fingers crossed*

Thanks in advance!

  1. 1 Posted by Drew Songer on 27 Jun, 2016 03:21 PM

    Drew Songer's Avatar

    Hi Hemal,

    In this scenario you will receive an 400 Bad Request error message with text explaining why. You can use that error message to prompt the customer to upgrade inside your application.

    Best,
    Drew

  2. 2 Posted by Hemal Ruparelia on 27 Jun, 2016 03:22 PM

    Hemal Ruparelia's Avatar

    Perfect!

    Consider us sold. I'll get setting this up.

    Ps - Feel free to make this /public' if helpful for your support base.

    Thanks again

  3. 3 Posted by Hemal Ruparelia on 30 Jun, 2016 05:05 AM

    Hemal Ruparelia's Avatar

    Follow up question:

    Are you able to point me to the documentation which outlines the response sent when the API call is made for a tracked item? I am trying to figure out:

    1. The exact 'text explaining why' that you mentioned. What words are used so that we can distinguish with other 400 errors (if they happen).
    2. If there is a response that indicates the 'number' of the current counter and/or (even better), how many 'credits' are left - so that we can pre-empt a user about to hit their limit by warning them. I.e. - You have 5 credits left for this month, please upgrade/be prepared to upgrade..

    Thanks in advance! I'll update this if I am able to hunt down the documentation.

  4. 4 Posted by Drew Songer on 30 Jun, 2016 02:10 PM

    Drew Songer's Avatar

    Hi Hemal,

    It's not specifically documented but it's fairly simple. Here's an example of trying to set a quantity too high on a hard limit item:

    <?xml version="1.0" encoding="UTF-8"?>
    <error id="85" code="412" auxCode="quantity:notLessThanOrEqual">
        '401' is not less than or equal to '400'
    </error>
    

    ... and too low:

    <?xml version="1.0" encoding="UTF-8"?>
    <error id="97" code="412" auxCode="quantity:notGreaterThanOrEqual">
        '-1' is not greater than or equal to '0'
    </error>
    

    So, it's just like any other 412 Precondition Failed( looks like I misspoke when I said it was a 400 error) validation error (e.g., an invalid format for email address) which is documented here:

    http://support.cheddargetter.com/kb/api-8/error-handling#412

    The response should contain both the quantity included and the current quantity. Although the response does not show quantity remaining, there is a convenience mechanism for getting this data. Here is an example in our PHP wrapper documentation: http://marc.guyer.me/cheddargetter-client-php/classes/CheddarGetter...

    Let us know if you have any other questions.

    Best,
    Drew

  5. Meghan Turner closed this discussion on 10 Aug, 2016 08:35 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