Get Next Invoice Date

ryan robinson's Avatar

ryan robinson

05 Oct, 2011 01:36 AM

I have the following php code:

$response = $client->getCustomer($user);
$plan = $response->getCustomerPlan();
$nextBilling = $plan["nextInvoiceBillingDatetime"];

$nextBilling always returns exactly 30 days from the moment the script is executed. Is this normal? I am trying to get the next date the client will be billed. I can get what I want from getCustomerInvoice(), but the above seemed like a more direct path. So, I mostly wanted to report a potential bug if what I described is not the expected behavior.

  1. Support Staff 1 Posted by Marc Guyer on 05 Oct, 2011 03:11 PM

    Marc Guyer's Avatar

    Hi Ryan. That can be confusing. The $plan["nextInvoiceBillingDatetime"] doesn't have anything to do with the current subscription. That value is simply a convenience to determine when a subscriber's next bill would be if they signed up today. For those already subscribed, you'll want to use the billingDatetime of the first invoice:

    $response = $client->getCustomer($user);
    $invoice = $response->getCustomerInvoice();
    $nextBilling = $invoice["billingDatetime"];
    
  2. Dean closed this discussion on 16 Jan, 2013 09:44 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