#bhaumik1665_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/1254725694806822953
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
๐ happy to help
so I have to first create tax and then use it while creating subscription correct?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes correct
no it's tax_rate not tax_id
sorry my bad
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
whats the difference between the two? (tax_id and tax_rate?)
which one would be correct for me?
tax rate is the correct one
tax id is for customer Tax IDs
or Account IDs (for connected Accounts)
it can also be your own tax ID
but this is mostly used for invoicing and displaying the Tax on Invoices
okay, I want to have 6.5% tax on Connecticut state, can I create a tax rate for the same like below?
$stripe->taxRates->create([
'display_name' => 'Connecticut Tax',
'description' => 'Connecticut Tax',
'percentage' => 6.5,
'jurisdiction' => 'DE',
'inclusive' => false,
]);
can you explain me jurisdiction and inclusive?
inclusive means that the price you'll apply this tax rate to already has tax, so for example 10$ inclusive price means that the 6.5$ tax is already included in the 10$
whereas when it's false this means that you add the 6.5$ to the price amount
jurisdiction = 'the taxation authority that imposes the tax'
so if inclusive is false and when I use it in subscription stripe will add some tax amount to the subscription payment (invoice), correct?
(e.g. Gold plan $100 then final invoice will be $100 + $6.5 = $106.5)
if inclusive is true then whatever price/plan amount is chosen for subscription it will stay same (e.g. Gold plan $100) then final invoice will be ($100) only.
correct?
correct
ok, can you tell me which jurisdiction should I set for Connecticut tax?
Connecticut in the US?
yes
then the US
okay, let me try it.
Thanks, its working fine!
I have created a subscription with tax like below
$allParams = [
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
'default_tax_rates' => ['txr_1PV9GKHpCCuanh4qRnkbSSX1']
'items' => [....]
];
$subscription = Subscription::create($allParams);
now If I want to apply multiple taxes to multiple items I can do that like this.
$allParams = [
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
'default_tax_rates' => ['txr_ccc']
'items' => [
['price' => 'price_aa', 'tax_rates' => 'tax_aaa'],
['price' => 'price_bb', 'tax_rates' => 'tax_bbb'],
['price' => 'price_cc'],
]
];
$subscription = Subscription::create($allParams);
so for the above code, tax applied like below
price_aa->tax_aaaprice_bb->tax_bbbprice_cc->tax_ccc-> Default tax from the main subscription applied because no tax mentioend for this price.
correct?
correct