#itsed-invoice-shipping
1 messages · Page 1 of 1 (latest)
yes, exactly
And you're either charging these automatically or using the hosted invoice page for customers to pay them?
in that case I would expect that you'd want to add another invoice item to account for the shipping charges
ok, that's easy enough, but then my next issue is with taxes for one off invoices created through the api. is automatic tax calculation just not supported for invoices created through the api?
i guess that may be a separate question -- would it be better to ask it in #dev-help instead of this thread?
no that's fine to keep here, all closely related 🙂
Ok - great
So the only thing I can see is the ability to assign a tax rate to a line item
But I’m hoping that there’s a way to instead assign a tax code and take advantage of the automatic tax calculation
Also a a more general question, how granular is the automatic tax calculation? I know in Florida we have a 6% general sales tax, but there is a supplemental sales tax that is calculated based on the city where goods are delivered
Does stripe keep track on the city/county level?
Yea, if you're in a supported region you can use automatic taxes with invoices: https://stripe.com/docs/tax/invoicing#enable
and yes you'd need to set up registration, tax behaviour etc as you mentioned
all of those things are handled based on customer locations:
https://stripe.com/docs/tax/customer-locations
The issue seems to be that a tax code can’t be set for a one-off line item through the api
Yes, that’s from the docs
can you point me to the docs that show how to add a product to an invoice via the API?
i dont see anything here: https://stripe.com/docs/api/invoices
or anything about creating a line item for a product here: https://stripe.com/docs/api/invoiceitems
You'd supply the price: https://stripe.com/docs/api/invoiceitems/object#invoiceitem_object-price
price has the amount & currency & product reference
you dont using products directly because products don't contain any pricing information
ok - great
so for a one off item, i would just need to use the api to:
- create a product
- create a price for the product
- add the invoice item using the price id
is there a limit to how many products stripe will let me create?
nope, go wild
great - thanks a lot
👍
Archiving this thread 🗄️ -- if you have further questions, please feel free to ask in the main channel!
📂
is it possible to have more than 1 draft invoices for a customer? i have 2 services that bill the same customer independently, and each service needs to create its own invoice for the customer. it seems i cant create an empty draft invoice and then add items to it...
so i can't seem to find a way to have 2 independent invoices for the same customer
You can't create empty drafts, no, but you can create multiple drafting from pending items
so create the item, then create the invoice
then to add more items you can specify the invoice parameter on the invoice item creation to attach it to an existing draft
im trying to avoid a race condition where 2 services might both create an item at the same time, and then one of the services will create a draft invoice using both of those items
i guess i could always create a $0 dummy item as the first item, and then just remove it after the draft invoice is created...
are line items guaranteed to always be returned in the order they were added?
you can check if there are pending invoice items and have the service wait
until those go away
(because the other one pulls them into an invoice)
i know it would be super rare, but it still seems possible that i could query that before the second service adds a pending item, and then the second service could add an item before the first service creates the invoice
then you can confirm the items in the invoice are what you expect after creating it, if you need to
are line items guaranteed to always be returned in the order they were added?
i would be ok with only ever adding a "dummy" item without specifying an invoice. that way i wouldn't care if one invoice consumed 2 of the pending items
and then i guess once i have a draft invoice i can just go through and remove any line items that match the "dummy" item
I see no reason you couldnt do that
the only problem then would be that i could never actually use the "pending item" feature as intended
is there a way to use tax calculation with payment intents/charges?
then i wouldnt need to use invoices at all
No, automatic taxes are not currently supported on payment intents unless you're using Checkout payment mode
ok - thanks. i just did some testing with the dummy items. it seems like stripe has no issue with me creating a pending item, then a draft invoice, then removing the pending item
so empty invoices dont seem to be an issue. it would definitely be nice to be able to create one without the 2 extra steps
in_1JcXc6AbO50Vvg08k67jmsYE is the invoice i just tried that with
i expected an error when i removed the only item it had, but this should work