#mytras-formo_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1304436515459301460
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! sure, you can use https://docs.stripe.com/api/invoiceitems/create?lang=node#create_invoiceitem-price_data when creating the InvoiceItem if you don't already have a Price object created.
so in the API step by step I will:
- Create an empty invoice
- Create the items for the invoice
When I look at documentation link that you sent me, I can see this
price_data.product string Required
The ID of the product that this price will belong to.
I need to create a 1 use product i will not have an id for the product
yes you need to have a Product object already created
alternatively you can use unit_amount on the InvoiceItem directly https://docs.stripe.com/api/invoiceitems/create?lang=node#create_invoiceitem-unit_amount but we don't generally recommend that but it's possible if you really want to
So I will need to have an existing product with no price and add the price when creating the line items for the invoice, correct?
OK, Hold on please
yes, or use unit_amount directly if you don't want Products
that was confusing
ok
there is the way to use stripe without 3ds right?
mate what is happening?
sorry. Just someone posting who shouldn't be.
o
ok
But if I use unit_amount directly no item will show up on the invoice for the customer, just the amount to pay?
no, there's always line items when using an invoice
it's just that the line item will not be associated with a specific Price/Product
looks good. how can I clarify/help?
more less
this is an example of the step after, create line items
I use an integration with a third party
so I will need to replace the parameter "price" with "unit_amount_decimal" so I will use a price instead of a price id, did I get you right?
@junior citrus yep, I'd try that.
But why?
like you have a Price, why don't you just use that?
because we have multiple customer with the same product but prices tailored for them
so that brings us to have hudreds of the same product names with different prices
trust me I wish it was that simple to just use the price id, i tried that for the past year
then yes you can use price_data to create the ad-hoc Prices(but they do appear in your accounts as objects yes), or you can use unit_amount directly , but then you have no link/reporting that the payments are for that Product(which is why we don't recommend using unit_amount and encourage using Prices/Products)
so to recap.
I create an empty invoice as i showed you above, (and that is all good)
than from the step to add line items, I will remove the parameter price and use the parameters
price_data.currency (with the nation currency)
price_data.product (with the id of the product without a price)
price_data.unit_amount_decimal (with the decimal prices that I need to charge that specific customer)
Correct?
if your goal is to create ad-hoc Prices , yep
what you describe should work, you can try it out in test mode and see
thank you so much
should be careful to make sure that random people cant join conversation that was annoying
it's impossible to avoid but yes it's something we're aware of
regardless you been of great help