Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Stripe FX: Getting the converted amount from the BalanceTransaction

Creating a USD charge on a GBP account:

$ curl \
    -u REDACTED: \
    -d amount=400 \
    -d currency=usd \
    -d card[number]=4242424242424242 \
    -d card[exp_month]=04 \
    -d card[exp_year]=16 \
    -d card[cvv]=390 \
    -d description="USD charge on a GBP account"

Charge creation response:

  "id": "ch_2OEK6e5bc72wce",
  "object": "charge",
  "created": 1376577420,
  "livemode": false,
  "paid": true,
  "amount": 400,
  "currency": "usd",
  "refunded": false,
  "card": {
    "id": "card_2OEKpoYfZYhGSW",
    "object": "card",
    "last4": "4242",
    "type": "Visa",
    "exp_month": 4,
    "exp_year": 2016,
    "fingerprint": "rpUHa9dMscdvhsqc",
    "customer": null,
    "country": "US",
    "name": null,
    "address_line1": null,
    "address_line2": null,
    "address_city": null,
    "address_state": null,
    "address_zip": null,
    "address_country": null,
    "cvc_check": null,
    "address_line1_check": null,
    "address_zip_check": null
  "captured": true,
  "refunds": [],
  "balance_transaction": "txn_2OEKdVhXOvMZQ5",
  "failure_message": null,
  "failure_code": null,
  "amount_refunded": 0,
  "customer": null,
  "invoice": null,
  "description": "USD charge on a GBP account",
  "dispute": null

The BalanceTransaction from the Charge creation response:

$ curl \
>    -u REDACTED:

BalanceTransaction response:

  "id": "txn_2OEKdVhXOvMZQ5",
  "object": "balance_transaction",
  "source": "ch_2OEK6e5bc72wce",
  "amount": 258,                    # <-- The converted amount.
  "currency": "gbp",
  "net": 220,
  "type": "charge",
  "created": 1376577420,
  "available_on": 1377129600,
  "status": "pending",
  "fee": 38,
  "fee_details": [
      "amount": 5,
      "currency": "gbp",
      "type": "stripe_fee",
      "description": "Stripe currency conversion fee",
      "application": null
      "amount": 7,
      "currency": "gbp",
      "type": "tax",
      "description": "VAT",
      "application": null
      "amount": 26,
      "currency": "gbp",
      "type": "stripe_fee",
      "description": "Stripe processing fees",
      "application": null
  "description": "USD charge on a GBP account"

This comment has been minimized.

Copy link

@wesbos wesbos commented Nov 4, 2014

thank you - this is really helpful


This comment has been minimized.

Copy link

@zot24 zot24 commented Dec 3, 2014

Do we have access to the exchange rate?


This comment has been minimized.

Copy link

@sebastiansulinski sebastiansulinski commented Jul 13, 2016

You can also obtain converted values by expanding objects - it will give you similar result as above

curl \
   -u sk_test_1k5krhYfNScp2SoDk3PPUgrE: \
   -d expand[]=customer

This comment has been minimized.

Copy link

@bassu bassu commented Jun 1, 2017

Stripe doesn't list FX charges into fees anymore! It is now done prior to charging any fees.
So you'll have to calculate this manually.
Their markup is 2% now on top of the mid-market rate.


This comment has been minimized.

Copy link

@emkman emkman commented Sep 12, 2017

@bassu do you have any source for their 2% markup. I cannot find it mentioned anywhere in their docs, however I am seeing very poor conversion rates indicating you are correct. specifically states "When Stripe performs a currency conversion, funds are usually converted at the daily mid-market rate." and they go on to only mention their standard processing fees, no mention of conversion fees or mid-market markups. Very disingenuous if true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.