#hamidm-preview-tax

1 messages ยท Page 1 of 1 (latest)

merry gazelle
#

Hello ๐Ÿ‘‹
Moving the questions in this thread for full context

How can I preview tax amount for a given subscription before incrementing the quantity (purchase new seats logic) with Stripe Api and the next question is how to preview the tax amount before user subscribes (no customer yet), basically on checkout where the customer has selected the price and has the quantity for the subscription also with Stripe Api? Thank you

merry gazelle
nova falcon
#

Hi, yes we are already using upcoming invoice endpoint to get the prorated amount based on subscription quantity, but the problem is that don't know how to preview the tax for that prorated amount

#

So far this is the payload that we are using to preview the tax before the customer subscribes - no customer created to Stripe yet:

$payload = [
'automatic_tax' => ['enabled' => true],
'customer_details' => [
'address' => [
'city' => $city,
'state' => $state,
'country' => 'US',
'postal_code' => $zip,
'line1' => $address
],
],
'expand' => [
'total_tax_amounts.tax_rate'
],
'subscription_items' => [
['price' => $price, 'quantity' => $quantity]
]
];

    $upcomingInvoice = Invoice::upcoming($payload);
inland delta
#

HI ๐Ÿ‘‹

#

Apologies for leaving you hanging