Get Next Invoice Date

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. 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