#nishant_api

1 messages ¡ Page 1 of 1 (latest)

steep coralBOT
#

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

dense totem
#

Do you have an example?

undone hull
#

Yes, ok sharing with you screen short

dense totem
#

The ID is fine

undone hull
#

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"
}

dense totem
#

To confirm, what are you trying to actually do here? Create an invoice for $12.50 USD?

undone hull
#

In stripe

dense totem
#

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?

undone hull
#

I have done integration between stripe and business central. For create successfully invoice in stripe I have create

  1. Invoice.
  2. Invoice Item.
  3. 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

dense totem
#

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

undone hull
#

I tried for same

dense totem
#

Again, please clarify what is actually your expectation here?

undone hull
#

ok

dense totem
#

Trying to create invoice item for value 0.01.
Is it this?

undone hull
#

Yes

#

for field unit_amount_decimal

dense totem
#

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

undone hull
#

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

vernal oxide
#

hi! I'm taking over this thread.

undone hull
#

and if i have value in decimal then i can't use field unit_amount because its for integer not for decimal

vernal oxide
#

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.

undone hull
#

ok it means I can't fill value same I have to multiply every value with 100

vernal oxide
#

yes you have to multiply by 100.