#mytras-formo_api

1 messages ¡ Page 1 of 1 (latest)

glass copperBOT
#

👋 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.

sacred hinge
junior citrus
#

so in the API step by step I will:

  1. Create an empty invoice
  2. 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

sacred hinge
junior citrus
#

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?

tame tendon
#

OK, Hold on please

sacred hinge
#

yes, or use unit_amount directly if you don't want Products

tame tendon
#

Can I use strype without 3DS

#

there is correct?

sacred hinge
#

@tame tendon create your own thread in #help , don't post in other threads.

junior citrus
#

that was confusing

tame tendon
#

ok

sacred hinge
tame tendon
junior citrus
sacred hinge
#

sorry. Just someone posting who shouldn't be.

junior citrus
#

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?

sacred hinge
#

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

junior citrus
#

Sorry I dont get it

#

this is an example of the step create invoice

sacred hinge
#

looks good. how can I clarify/help?

tame tendon
#

more less

junior citrus
#

this is an example of the step after, create line items

tame tendon
#

I use an integration with a third party

junior citrus
#

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?

sacred hinge
#

@junior citrus yep, I'd try that.
But why?

#

like you have a Price, why don't you just use that?

junior citrus
#

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

sacred hinge
#

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)

junior citrus
#

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?

sacred hinge
#

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

junior citrus
#

thank you so much

#

should be careful to make sure that random people cant join conversation that was annoying

sacred hinge
#

it's impossible to avoid but yes it's something we're aware of

junior citrus
#

regardless you been of great help