#lifeofnitz

1 messages · Page 1 of 1 (latest)

sonic talonBOT
rain plover
#

I’m creating a tax calculation which is returning the following response.

——

{
"id": "taxcalc_1O8PTjGD6SohSNE6pBOSeFKJ",
"object": "tax.calculation",
"amount_total": 108,
"currency": "usd",
"customer": null,
"customer_details": {
"address": {
"city": null,
"country": "US",
"line1": null,
"line2": null,
"postal_code": "78610",
"state": null
},
"address_source": "billing",
"ip_address": null,
"taxability_override": "none"
},
"expires_at": 1699198811,
"livemode": false,
"shipping_cost": null,
"tax_amount_exclusive": 8,
"tax_amount_inclusive": 0,
"tax_breakdown": [
{
"amount": 8,
"inclusive": false,
"tax_rate_details": {
"country": "US",
"percentage_decimal": "8.25",
"state": "TX",
"tax_type": "sales_tax"
},
"taxability_reason": "standard_rated",
"taxable_amount": 100
}
],
"tax_date": 1699026011
}

——

Then I go to create a Payment intent and when I try to create the tax transaction from the calculation passing the Payment Intent ID and the Tax Calc ID it returns me a response with no monetary data.

——

{
"id": "tax_1O8Ov5GD6SohSNE6RYhZQXLp",
"object": "tax.transaction",
"created": 1699023892,
"currency": "usd",
"customer": null,
"customer_details": {
"address": {
"city": null,
"country": "US",
"line1": null,
"line2": null,
"postal_code": "78610",
"state": null
},
"address_source": "billing",
"ip_address": null,
"taxability_override": "none"
},
"livemode": false,
"reference": "pi_3O8EGoGD6SohSNE61gSgZL5u",
"reversal": null,
"shipping_cost": null,
"tax_date": 1699023863,
"type": "transaction"
}

——

Any ideas what could be causing this?

swift veldt
#

hi 👋

#

it would be easier for me to read if you just provided the IDs for each object instead of the full body

#

I can look those up

rain plover
#

Oh my bad!

taxcalc_1O8PTjGD6SohSNE6pBOSeFKJ
pi_3O8PPzGD6SohSNE60JDU508P
tax_1O8Ov5GD6SohSNE6RYhZQXLp

swift veldt
#

No problem, Iit's just easier to read this way

#

Did you expand the line_items property when you created the tax transaction?

rain plover
#

Hi! I forget that I need to multiply the values by 100 when making the calls... That must be the issue.

#

What is the line_item expansion? I couldn't find a description of that in the docs.

swift veldt
#

If you look at the code snippet for the api doc I shared, you will see the expand parameter passed to the API. This will return the line_items parameter complete with monetary details

rain plover
#

Gotcha! Thank you very much! I'm going to give it a try.

#

I just don't understand why that parameter has quotes. When I try to pass it I get an error.

#

Never mind sorry. It works now.

swift veldt
#

Great

rain plover
#

Thank you so much!