#iandk-laravel-invoice

1 messages · Page 1 of 1 (latest)

sharp ice
#

hello, let's start here, mind sharing the full output you get from that API call?
and also the request ID for the GET request being made for the upcoming Invoice on your Dashboard Logs

honest parrot
#

Sure, this is the output for invoicesIncludingPending without any filter applied.
As expected it returns a Collection of all the invoices.

Illuminate\Support\Collection {#3238 ▼
  #items: array:24 [▼
    0 => Laravel\Cashier\Invoice {#1352 ▶}
    1 => Laravel\Cashier\Invoice {#1346 ▶}
    2 => Laravel\Cashier\Invoice {#1345 ▶}
    3 => Laravel\Cashier\Invoice {#3147 ▶}
    4 => Laravel\Cashier\Invoice {#3215 ▶}
    5 => Laravel\Cashier\Invoice {#3219 ▶}
    6 => Laravel\Cashier\Invoice {#3220 ▶}
    7 => Laravel\Cashier\Invoice {#3221 ▶}
    8 => Laravel\Cashier\Invoice {#3222 ▶}
    9 => Laravel\Cashier\Invoice {#3223 ▶}
    10 => Laravel\Cashier\Invoice {#3224 ▶}
    11 => Laravel\Cashier\Invoice {#3225 ▶}
    12 => Laravel\Cashier\Invoice {#3226 ▶}
    13 => Laravel\Cashier\Invoice {#3227 ▶}
    14 => Laravel\Cashier\Invoice {#3228 ▶}
    15 => Laravel\Cashier\Invoice {#3229 ▶}
    16 => Laravel\Cashier\Invoice {#3230 ▶}
    17 => Laravel\Cashier\Invoice {#3231 ▶}
    18 => Laravel\Cashier\Invoice {#3232 ▶}
    19 => Laravel\Cashier\Invoice {#3233 ▶}
    20 => Laravel\Cashier\Invoice {#3234 ▶}
    21 => Laravel\Cashier\Invoice {#3235 ▶}
    22 => Laravel\Cashier\Invoice {#3236 ▶}
    23 => Laravel\Cashier\Invoice {#3237 ▶}
  ]
  #escapeWhenCastingToString: false
}
#

However when filtering for open invoices it returns an empty array, even tho the customer has a unpaid invoice

  #items: []
  #escapeWhenCastingToString: false
}
#

req_pzxrKhsYRTfyqX

sharp ice
#

looking

honest parrot
#

Thank you!

sharp ice
#

ok so that request ID req_pzxrKhsYRTfyqX - was that for no filter or with filter? (no filter right?)

honest parrot
#

that was without filter, however the filter is only serverside, so it probably fetches all invoices anyway

sharp ice
#

can you share the request ID of the one with the filter?

honest parrot
#

sure, one second

#

req_Whzssq5DpGuBH5

sharp ice
#

ah

#

thanks

#

looking

#

wait

#

that is a diff request, that is just fetching a Customer no?

honest parrot
#

my bad, copied the wrong id, sorry
req_drtEdWAiMzQ7Qx

sharp ice
#

same, wrong req

#

you can look up the request path on Dashboard Logs page

#

what you want is /v1/invoices

#

this is /v1/customers/cus_123

honest parrot
#

Those are the only get requests performed when viewing the invoices for a specific client

#

at least according to your logs

#

maybe I'm missing something here?

sharp ice
#

otherwise I can't trace anything if a request isn't being made! I assume there is, if it gives you the Laravel formatted "Invoices" list

honest parrot
#

I just tried it again, but still, only requests to /v1/invoices

#

That's my request

dd(auth()->user()->invoicesIncludingPending()->where('status', 'open'));
#

Using the Stripe Cashier Client

sharp ice
#

to clarify, a request to /v1/invoices is what we wanna see

your earlier requests were not that

#

the last two were /v1/customers/cus_123

honest parrot
#

At least one of those IDs should have been for a request to /v1/invoices 🙂

sharp ice
#

yeah the first one, which was without a status: open filter

honest parrot
#

ohh I see

sharp ice
#

so didn't see an /v1/invoices with the filter

#

which is what I am looking for