Stripe Workflow Data

UPDATE:
Okay, setting up the API was easy enough:

Use HTTP Basic Auth
Username is your live secret key with a “:” added to the end (prevents the need for a password)

To get the Stripe fee for a credit card charge, you need to set up TWO calls

Retrieve Charge:
GET https://api.stripe.com/v1/charges/[charge_id]
charge_id is a variable that you set to NOT private so you can replace it using workflows.

Retrieve Balance Transaction:
GET https://api.stripe.com/v1/balance_transactions/[transaction_id]
transaction_id is a variable that you set to NOT private so you can replace it using workflows.

NOW, when you charge a credit card using the built in Stripe plugin, you can use “results of Step X” to get the charge ID. You can also get the payment intent ID which has all sorts of data, but for this use case the charge ID works.

You then call the Retrieve Charge API call using the charge ID from the workflow above, which will return a bunch of data about that charge. You will then use the “Balance Transaction” for that charge to call the Retrieve Balance Transaction API call. This call will have a data point called “fee” which is… the Stripe fee for that Balance Transaction. Don’t forget that this will be presented in CENTS, so if you need it in dollars, divide by 100 and round to 2.

I hope this helps someone!

2 Likes