#Jonas Reif

1 messages · Page 1 of 1 (latest)

lavish shoalBOT
stuck veldt
#

Hi! Let me help you with this.

#

Why do you need the /v1/charges endpoint?

lucid crag
#

Hi Vanya,

At least I have the charge_id (ch_ / py_). Which endpoint is better therefore?

What I need based on the charge_id is:

  • the total payed amount
  • the vat/tax amount
  • the transaction fee amount
stuck veldt
#

Oh, you mean you want to retrieve the tax amount paid?
Could you please share the Charge ID?

lucid crag
#

Yes.
So for example for py_3NNWb3AHqm7DWpwQ2vUItOON
We need to get via API:

  • amount: €96.00
  • vat/tax amount: €15.33
  • transaction fee: €3.51

Another example for py_3NN4RpAHqm7DWpwQ2IYUZS2c

  • amount: €117.81
  • vat/tax amount: €18.81
  • transaction fee: €4.16
stuck veldt
#

Are you sure you're using Stripe Tax?
It seems like this was automatically generated by a Subscription.

lucid crag
#

Yes we are using stripe tax.
That both examples are payments of a subscription yes. Both made a trial and this is the first payment

stuck veldt
#

You can find it on the Invoice object: in_1NNWb2AHqm7DWpwQGshn2pBv

lucid crag
stuck veldt
#

Every billing period (e.g. month) you will receive an invoice.paid webhook event, that will contain the new Invoice. And on the Invoice object you will be able to find all tax-related amounts.

lucid crag
#

ok thanks, let me check 🙂

#

Alright, I see the vat/tax on the invoice. Thanks!

Where could I see the transaction fee?

stuck veldt
#

That's on the charge.balance_transaction.fee/fee_details

lucid crag
#

ok thanks.
So to summarize I could do sth similar to:

 curl https://api.stripe.com/v1/charges/py_3NNWb3AHqm7DWpwQ2vUItOON\
  -u sk_test***  \
  -d "expand[]"="invoice"  \
  
  -d "expand[]"="balance_transaction"

and use

  • amount
  • balance_transaction.fee
  • invoice.tax
stuck veldt
#

Yes

lavish shoalBOT