#santosh2585
1 messages ยท Page 1 of 1 (latest)
I don't understand the question. Which parameters are you referencing?
Hello Ynnoj
I am creating invoice and adding the line items in the invoice. The products that I am adding in the invoice line items while fetching invoice from api the product id I am receiving is a different one ?
Can you sahre an example
Yeah sure
Wait a min please don't close this thread
Sure
Hello Ynnoj
Hi!
This is the invoice I had generated invoice id : in_1NPfDUSF9C1b0htOFuSpBUiO
Here I had attached two products namely
- Test Product Three and its id :: prod_O7KHa1h1KWLHJO
- Test Product Four (id) : prod_O7KIP0SLkLHkLZ
and the invoice that I get after fetching this invoice id from the api is this
if You will see the product details under the line items the product id is different from the actual product id of the products.
So how this product id is getting different value ?
That Invoice has 2 items:
price_1NPfDUSF9C1b0htOMfcIomO1which belongs toprod_O7w7sXOOInYRnnprice_1NPfDUSF9C1b0htOqVdfE0Fmwhich belongs toprod_O7w7geBzDnMGLT
Your code that is creating this items is not using the parameters/values you think it is
So if product x have two prices then it will have two different product id ?
The thing is I am taking product id from /product api and when I am taking the same product in the invoice as line items I don't know maybe because of different price on the same product the product id is getting different ?
No, the item will have the prod_xxx ID of the price_xxx parent. A Price can only belong to one Product
But in my product that test product four or three I have 2-3 prices so if I will check in my product list
One product is having multiple prices ??
How is this happening ?
I'm not sure what you're asking me
๐ taking over for my colleague. please try to elaborate your question
Hello Tarzan
Please check this once
See I have three products in the product list of stripe.
While creating invoice I am selecting the product to attach the invoice line items.
But since I am attaching a product from product list and it have a unique product id and once invoice is created and When I am fetching that invoice the product id that I am getting is of different product ?
Can you please tell me how the product id I am getting in the above invoice is different?
I think it's better if you start by reading this doc https://stripe.com/docs/products-prices/getting-started
which explains the relationship with products and prices
I got that a single product can have different prices,
Although see I have a product x and it has 3 prices, so when I will associate this product in invoice based on the price the product id will change ?
no