You've successfully subscribed to Alpaca Learn | Developer-First API for Crypto and Stocks
Great! Next, complete checkout for full access to Alpaca Learn | Developer-First API for Crypto and Stocks
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.
Broker API

Get Started with Local Currency Trading API for App Localization

George A J Sanders


In this article, we cover the features and behaviors of Local Currency Trading for Alpaca Broker API.

What is Local Currency Trading API?

With Local Currency Trading (LCT), you can buy, sell, and view US stocks in your local currency with real-time currency conversion. API responses are displayed in your local currency, with all calculations handled by Alpaca.

For more information, read our FAQs and Blog.

Note: Local Currency Trading API for Crypto will be available in the near future.

Set Up Your LCT Environment

To get started, please reach out to your customer success manager or our broker support team, who will arrange an API Key and Secret Key configured for your respective currency. They will walk you through what model type may be most suited for your business.

Create Your LCT Account

In this section, see how to create a JPY denominated fully disclosed account.

Example: Creating a JPY Fully Disclosed Account

Here’s an example of a fully disclosed account created with JPY.

{  
"currency": "JPY"
{
  "contact": {
    "email_address": "cool_alpaca_test@example.com",
    "phone_number": "555-666-7788",
    "street_address": ["20 N San Mateo Dr"],
    "city": "San Mateo",
    "state": "CA",
    "postal_code": "94401",
    "country": "USA"
  },
  "identity": {
    "given_name": "John",
    "family_name": "Doe",
    "date_of_birth": "1990-01-01",
    "tax_id": "666-55-4321",
    "tax_id_type": "USA_SSN",
    "country_of_citizenship": "USA",
    "country_of_birth": "USA",
    "country_of_tax_residence": "USA",
    "funding_source": ["employment_income"],
    "annual_income_min": "30000",
    "annual_income_max": "50000",
    "liquid_net_worth_min": "100000",
    "liquid_net_worth_max": "150000"
  },
  "disclosures": {
    "is_control_person": false,
    "is_affiliated_exchange_or_finra": false,
    "is_politically_exposed": false,
    "immediate_family_exposed": false
  },
  "agreements": [
   {
      "agreement": "customer_agreement",
      "signed_at": "2020-09-11T18:13:44Z",
      "ip_address": "185.13.21.99",
      "revision": "19.2022.02"
   },
   {
      "agreement": "crypto_agreement",
      "signed_at": "2020-09-11T18:13:44Z",
      "ip_address": "185.13.21.99",
      "revision": "04.2021.10"
    }
  ],
  "documents": [
    {
      "document_type": "identity_verification",
      "document_sub_type": "passport",
      "content": "/9j/Cg==",
      "mime_type": "image/jpeg"
    }
  ],
  "trusted_contact": {
    "given_name": "Jane",
    "family_name": "Doe",
    "email_address": "jane.doe@example.com"
  },

}
A fully disclosed account created with JPY

Response: LCT Account Creation
Below is the response that should be displayed upon the success of this account creation.

{
    "id": "5b452428-2a53-44f6-9dd7-48e37d7f955a",
    "account_number": "790047543",
    "status": "SUBMITTED",
    "crypto_status": "SUBMITTED",
    "currency": "JPY",
    "last_equity": "0",
    "usd": {
        "last_equity": "0"
    },
    "created_at": "2022-07-29T19:39:42.631013Z",
    "contact": {
        "email_address": "cool_alpaca_test@example.com",
        "phone_number": "555-666-7788",
        "street_address": [
            "20 N San Mateo Dr"
        ],
        "city": "San Mateo",
        "state": "CA",
        "postal_code": "94401"
    },
    "identity": {
        "given_name": "John",
        "family_name": "Doe",
        "date_of_birth": "1990-01-01",
        "tax_id_type": "USA_SSN",
        "country_of_citizenship": "USA",
        "country_of_birth": "USA",
        "country_of_tax_residence": "USA",
        "funding_source": [
            "employment_income"
        ],
        "annual_income_min": "30000",
        "annual_income_max": "50000",
        "liquid_net_worth_min": "100000",
        "liquid_net_worth_max": "150000",
        "visa_type": null,
        "visa_expiration_date": null,
        "date_of_departure_from_usa": null,
        "permanent_resident": null
    },
    "disclosures": {
        "is_control_person": false,
        "is_affiliated_exchange_or_finra": false,
        "is_politically_exposed": false,
        "immediate_family_exposed": false,
        "is_discretionary": false
    },
    "agreements": [
        {
            "agreement": "customer_agreement",
            "signed_at": "2020-09-11T18:13:44Z",
            "ip_address": "185.13.21.99",
            "revision": "19.2022.02"
        },
        {
            "agreement": "crypto_agreement",
            "signed_at": "2020-09-11T18:13:44Z",
            "ip_address": "185.13.21.99",
            "revision": "04.2021.10"
        }
    ],
    "trusted_contact": {
        "given_name": "Jane",
        "family_name": "Doe",
        "email_address": "jane.doe@example.com"
    },
    "account_type": "trading",
    "trading_configurations": null,
    "enabled_assets": [
        "us_equity",
        "crypto"
    ]
}
Example response displayed after account creation.

Running GET Accounts Endpoint
Lastly, let’s run GET /v1/trading/accounts/{account_id}/account

The response will be as follows:

{
    "id": "5b452428-2a53-44f6-9dd7-48e37d7f955a",
    "account_number": "790047543",
    "status": "ACTIVE",
    "crypto_status": "ACTIVE",
    "currency": "JPY",
    "usd": {
        "buying_power": "0",
        "regt_buying_power": "0",
        "daytrading_buying_power": "0",
        "cash": "0",
        "portfolio_value": "0",
        "equity": "0",
        "long_market_value": "0",
        "short_market_value": "0",
        "initial_margin": "0",
        "maintenance_margin": "0",
        "last_maintenance_margin": "0",
        "sma": "0",
        "last_equity": "0"
    },
    "buying_power": "0",
    "regt_buying_power": "0",
    "daytrading_buying_power": "0",
    "non_marginable_buying_power": "0",
    "cash": "0",
    "cash_withdrawable": "0",
    "cash_transferable": "0",
    "accrued_fees": "0",
    "pending_transfer_out": "0",
    "pending_transfer_in": "0",
    "portfolio_value": "0",
    "pattern_day_trader": false,
    "trading_blocked": false,
    "transfers_blocked": false,
    "account_blocked": false,
    "created_at": "2022-07-29T19:39:42.631013Z",
    "trade_suspended_by_user": false,
    "multiplier": "1",
    "shorting_enabled": false,
    "equity": "0",
    "last_equity": "0",
    "long_market_value": "0",
    "short_market_value": "0",
    "initial_margin": "0",
    "maintenance_margin": "0",
    "last_maintenance_margin": "0",
    "sma": "0",
    "daytrade_count": 0,
    "previous_close": "2022-07-28T20:00:00-04:00",
    "last_long_market_value": "0",
    "last_short_market_value": "0",
    "last_cash": "0",
    "last_initial_margin": "0",
    "last_regt_buying_power": "0",
    "last_daytrading_buying_power": "0",
    "last_buying_power": "0",
    "last_daytrade_count": 0,
    "clearing_broker": "VELOX"
}
Get Accounts Endpoint

How to Fund your LCT Account

Your account can be funded for Local Currency Trading API via:

  • Bank Wire
  • Just-in-Time Cash
  • Just-In-Time

Placing an Order

Now let's see what a Local Currency Trading transaction looks like. In this case, we will be looking at the Turkish Lira. We will submit the following request, which is a notional order to buy XLK in Turkish Lira. We will also be adding a markup to the transaction, or swap fee, which is made in basis points or bps for short. For example, a trade with 100 bps is equivalent to 1%.

We are adding a 100 bps fee to this order. It should be noted that there are two swap fees; the first is Alpaca’s swap fee, which will be set and charged by Alpaca (this is 0 in this example), and the second is the correspondent fee and can increase or decrease on a per order level. Alpaca’s swap fee is not configurable and applies regardless of the markup applied to the order.

{
  "symbol": "XLK",
  "side": "buy",
  "type": "market",
  "time_in_force": "day",
  "notional": "200",
  "swap_fee_bps": 100
}
Placing an Order

Response of Order in Local Currency
The response will look as follows. All the monetary amounts denoted are in the local currency. Note the notional amount of TRY200, swap_rate, and swap_fee of 100bps. Lastly, we can see a second order JSON for USD, which shows us the notional value of the trade in USD.

{
    "id": "3108d472-1be8-43a7-8f5c-6f0b18af2561",
    "client_order_id": "543feb21-8681-48fd-8657-7d2786cc5827",
    "created_at": "2022-08-11T14:06:27.519963342Z",
    "updated_at": "2022-08-11T14:06:27.520012232Z",
    "submitted_at": "2022-08-11T14:06:27.513014153Z",
    "filled_at": null,
    "expired_at": null,
    "canceled_at": null,
    "failed_at": null,
    "replaced_at": null,
    "replaced_by": null,
    "replaces": null,
    "asset_id": "d704f4fd-c735-44f8-a7fa-7a50fef08fe4",
    "symbol": "XLK",
    "asset_class": "us_equity",
    "notional": "200",
    "qty": null,
    "filled_qty": "0",
    "filled_avg_price": null,
    "order_class": "",
    "order_type": "market",
    "type": "market",
    "side": "buy",
    "time_in_force": "day",
    "limit_price": null,
    "stop_price": null,
    "status": "pending_new",
    "extended_hours": false,
    "legs": null,
    "trail_percent": null,
    "trail_price": null,
    "hwm": null,
    "commission": "0",
    "swap_rate": "17.962525",
    "swap_fee_bps": "100",
    "subtag": null,
    "source": null,
    "usd": {
        "notional": "11.0229",
        "filled_avg_price": null
    }
}
Order Response

Server-Sent Events Response

What does LCT trade look like in Server-Sent Events (SSE)?

This is what the SSE for a Local Currency Trade will be. As we mentioned earlier, all monetary amounts referenced above in the USD field at the bottom are in local currency. We can see the notional order is for TRY 200 with a swap_fee_bps of 100bps, which equates to TRY17.93 in Fees. The second order JSON for USD shows the notional value in USD and the average price.

data: {
    "account_id": "ece23fa8-0319-4ee5-9d54-f0d55841084c",
    "at": "2022-08-10T14:00:21.042878Z",
    "event": "new",
    "event_id": 5795265,
    "execution_id": "059753dd-61f8-43cd-b026-2cb78347bb29",
    "order": {
        "asset_class": "us_equity",
        "asset_id": "d704f4fd-c735-44f8-a7fa-7a50fef08fe4",
        "cancel_requested_at": null,
        "canceled_at": null,
        "client_order_id": "b903cd3f-9ddf-4d5a-8725-85392a1374d9",
        "commission": "0",
        "created_at": "2022-08-10T10:00:21.0195151-04:00",
        "expired_at": null,
        "extended_hours": false,
        "failed_at": null,
        "filled_at": null,
        "filled_avg_price": null,
        "filled_qty": "0",
        "hwm": null,
        "id": "9e597977-535a-49b6-bfd9-a3bac57b009b",
        "legs": null,
        "limit_price": null,
        "notional": "200",
        "order_class": "",
        "order_type": "market",
        "qty": null,
        "replaced_at": null,
        "replaced_by": null,
        "replaces": null,
        "side": "buy",
        "status": "new",
        "stop_price": null,
        "submitted_at": "2022-08-10T10:00:21.016631341-04:00",
        "swap_fee_bps": "100",
        "swap_rate": "17.929645",
        "symbol": "XLK",
        "time_in_force": "day",
        "trail_percent": null,
        "trail_price": null,
        "type": "market",
        "updated_at": "2022-08-10T10:00:21.033590949-04:00",
        "usd": {
            "filled_avg_price": null,
            "notional": "11.1547105366559126"
        }
    },
    "timestamp": "2022-08-10T14:00:21.031568271Z"
}
SSE Response

What’s Next?

To learn more about what Local Currency Trading API can do for your business, reach out to sales@alpaca.markets. If you are an existing Broker API partner, please get in touch with your representative support team.

Happy Coding!

Local Currency Trading
Build stock brokerage in over 15+ local currencies

The content is for general information only and is believed to be accurate as of posting date but may be subject to change. All examples and images are for illustrative purposes only.  Alpaca Securities LLC does not recommend any specific investments or investment strategies. Alpaca Securities LLC does not provide investment, tax, or legal advice.

Securities brokerage services are provided by Alpaca Securities LLC ("Alpaca Securities"), member FINRA/SIPC, a wholly-owned subsidiary of AlpacaDB, Inc. Technology and services are offered by AlpacaDB, Inc.

This is not an offer, solicitation of an offer, or advice to buy or sell securities, or open a brokerage account in any jurisdiction where Alpaca Securities LLC is not registered or licensed, as applicable.

Broker API

George A J Sanders

Principal Product Manager at Alpaca.