#AT

1 messages ยท Page 1 of 1 (latest)

cerulean graniteBOT
outer lynx
slate vapor
#

If I am taking payment online, via API/SDK., here is my flow :

#
  1. create pay method
#
  1. create customer + associate w/ payment method from step 1
#
  1. create invoice item + associate with product id
#
  1. create invoice item
#
  1. create & confirm payment intent
#

is my workflow accurate?

#

I want to be able to see if I can get reports after sale, on my account and get intended insight for sales by product - one way or the other

outer lynx
#

the workflow looks correct. if I understand your question correctly, you're looking to check the sales by Product on the Stripe Dashboard right? Support will be able to better answer your question about where you can check that via the Dashboard. Those of us on this channel don't interact with the Dashboard much. There's no way to get the sales by product via API. You'll have to calculate yourself if you want it

slate vapor
#

Ok. Thanks. Follow up question.

#

How do I create invoice line item object instead invoice item?

#

As an alternate, could I create checkout session?

outer lynx
#

Did you mean how do you create an Invoice Line Item?

You can't create an Invoice Line Item, Invoice Items represent the component lines of an invoice. An invoice item is added to an invoice by creating or updating it with an invoice field, at which point it will be included as an invoice line item within invoice.lines.

#

yes, you can create a Checkout Session instead

cerulean graniteBOT
slate vapor
#

I tried checkout session. It does not seem to serve my needs.

#

Let me create an invoice item and add it to an inoiuce

#
  • invoice
livid smelt
#

๐Ÿ‘‹ taking over here

#

You can simply create an Invoice for that Customer. It will pick up the created Invoice Item

slate vapor
#

Hello! Thanks for joining. ๐Ÿ‘‹

slate vapor
#
  "error": {
    "code": "invoice_no_customer_line_items",
    "doc_url": "https://stripe.com/docs/error-codes/invoice-no-customer-line-items",
    "message": "Nothing to invoice for customer",
    "param": "customer",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_CxxXscSaubN89W?t=1679285303",
    "type": "invalid_request_error"
  }
}```
livid smelt
#

Can you share the request that created the Invoice Item? req_xxx

slate vapor
#

I do not see it in the response. How do I find it?

#

I do have invoice item id though. I am in test mode, for what it's worth.

livid smelt
slate vapor
#

ii_1MnZ2qDI89yB3EcwGoW4Me3B

slate vapor
livid smelt
#

gime a few mins. brb

#

You created this Invoice Item for cus_NYfkliaWFaXcBz

#

while the error is on the request req_CxxXscSaubN89W which targets cus_MyMpHamO5EXstT

slate vapor
#

I am also having trouble finalizing an invoice. https://dashboard.stripe.com/test/logs/req_hnPZlpIedhdHEB?t=1679286578

livid smelt
#

Could you see its error message? It says that Customer has no card to be charged

slate vapor
#

That is bizarre. I have 2 credit cards and one default card to the customer.

livid smelt
#

You would want to have one setup as invoice_settings.default_payment_method to be automatically used