#Aditya-invoicing

1 messages · Page 1 of 1 (latest)

coral ridge
#

Hi there, creating an invoice requires at least one invoice item, the item can be an existing or ad-hoc.

coral ridge
near wing
#

Yeah. I want to reverse it a little bit and create invoice(draft) without invoice items first. As it happens in the dashboard.

coral ridge
#

Sure, that's totally possible.

near wing
#

Can you help out with that, because I’m getting an error while creating a draft invoice which doesn’t have invoice items, “Nothing to invoice for customer”

coral ridge
#

Sure thing, can you give me invoice ID?

near wing
#

I can give you a customer id, because the invoice didn’t get created.

#

Customer id: cus_L1O8znGBXqukmi

coral ridge
#

OK, give me a sec, let me read the logs

near wing
#

Hey jack this seems to be some other invoice, because the customer is not the same as I shared.

coral ridge
#

Can you send me the request ID then?

near wing
#

I tried again, it gave me this error, although I’m not able to see it in the logs (Request req_XNGNHyu7LIXHSG) No upcoming invoices for customer: cus_L1OC0UKknM8WZc>>

coral ridge
#

Can you find the request to create an invoice object for customer cus_L1O8znGBXqukmi ?

near wing
#

I can’t seem to find it in the logs. I’m using stripe connect for each request.

#

The stripe account I’m using is - acct_1JzunAQ7Vcs0maxV

coral ridge
#

Hmm, if you don't have the log, where did you see the “Nothing to invoice for customer” error message?

near wing
#

The error comes in response to the failed invoice creation request.

coral ridge
#

Can you send me the request ID of that request?

near wing
#

Yeah sure, here you go - req_XNGNHyu7LIXHSG

coral ridge
#

Thanks, btw this request is to preview the upcoming invoice, not create a new invoice.

#

Btw, I'd like to make a correction. You need to have pending invoice items before creating an invoice. As per the doc mentions -> Returns the invoice object if there are pending invoice items to invoice. Returns an error if there are no pending invoice items or if the customer ID provided is invalid.

#

In another words, you need to use /v1/invoiceItems to create pending invoice items, and then use /v1/invoices to create a draft invoice, not the other way around.

near wing
#

Ah, okay. I was unsure if this happens that’s why this was the first thing I asked. No worries. Thanks for the help.

#

Is it possible that you help out with one more thing, I’m unable to view many of the recent stripe api requests in the logs.

#

req_XNGNHyu7LIXHSG like this one.

coral ridge
#

What's the problem with this request?

near wing
#

Unable to search for it in the logs for “req_XNGNHyu7LIXHSG”

coral ridge
#

You can find this request in the Connected account's log instead of your (Platform) logs

near wing
#

Okay. Thanks jack got it.