#nishant_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1252225079400730664
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Do you have an example?
Yes, ok sharing with you screen short
The ID is fine
I have created Inovice item with parameters Cutomer ID, Invoice ID, Description, unit_amount_decimal, currency
{
"id": "ii_1PSdsjHPfDAOjLTFdTnLTCcU",
"object": "invoiceitem",
"amount": 13,
"currency": "usd",
"customer": "cus_QJEylz6efmBTas",
"date": 1718624273,
"description": "Test",
"discountable": true,
"discounts": [],
"invoice": "in_1PSdrmHPfDAOjLTFZPVziLln",
"livemode": false,
"metadata": {},
"period": {
"end": 1718624273,
"start": 1718624273
},
"plan": null,
"price": {
"id": "price_1PSbCPHPfDAOjLTFGHihbUvs",
"object": "price",
"active": false,
"billing_scheme": "per_unit",
"created": 1718613961,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_QJANcQF7Wnoko6",
"recurring": null,
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "one_time",
"unit_amount": null,
"unit_amount_decimal": "12.5"
},
"proration": false,
"quantity": 1,
"subscription": null,
"tax_rates": [],
"test_clock": null,
"unit_amount": null,
"unit_amount_decimal": "12.5"
}
To confirm, what are you trying to actually do here? Create an invoice for $12.50 USD?
In stripe
OK, that all seems expected to me. But clearly it's unexpected to you, so I'm trying to understand what it is you want to do?
I have done integration between stripe and business central. For create successfully invoice in stripe I have create
- Invoice.
- Invoice Item.
- Pay an Invoice.
If i add two zero after value of unit_amount_decimal fields like this -125000
then in stripe invoice will create against 1250
OK, but what does the customer see? An invoice for how much and in what currency?
$12.50 USD?
I suspect you don't actually need to use unit_amount_decimal and actually just need to use unit_amount: 1250
But not 100% sure as I'm not sure what the required amount for the invoice needs to be
Again, please clarify what is actually your expectation here?
ok
Trying to create invoice item for value 0.01.
Is it this?
Then just use unit_amount: 1. That field is in the lowest currency denominator which for USD is cents
unit_amount: 1 === $0.01 USD
I can't fill manual values, if Business central have created invoice for Value 0.01 then this will pass in stripe then how to I can do
hi! I'm taking over this thread.
and if i have value in decimal then i can't use field unit_amount because its for integer not for decimal
you are creating the Invoice using the API? then it's up to you to decide which value you set for unit_amount.
for example if your receive 0.01, you can multiply this number by 100 to get 1, and use this for unit_amount.
ok it means I can't fill value same I have to multiply every value with 100
yes you have to multiply by 100.