adeltahir
adeltahir

Reputation: 1097

Get invoices from Stripe

I'm trying to get list of invoices for specific customer from Stripe using PHP.

Following is the code I'm using.

 \Stripe\Stripe::setApiKey('STRIPE_SECRET_KEY');
 $response = \Stripe\Invoice::all(array('customer' => 'CUSTOMER_TOKEN'));

But this returns empty array.

Instead, CURL command returns result

 curl https://api.stripe.com/v1/invoices?customer=CUSTOMER_TOKEN  -u STRIPE_SECRET_KEY

Any idea?

I'm using Stripe PHP library available from Github.

https://github.com/stripe/stripe-php

Upvotes: 3

Views: 2764

Answers (1)

Mukesh Kumar
Mukesh Kumar

Reputation: 33

$response = \Stripe\Invoice::all(array('customer' => 'cus_id'));

You need to add customer id for specific customer.

Upvotes: 2

Related Questions