> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Direct Bank Transactions

If your platform provides an embedded bank account or credit card to your customers, Layer can ingest data from these accounts. There are two ways to pass embedded banking activity to Layer:

* **API** - Pass bank and credit card transactions to Layer's API directly.
* **Layer integrations** - Layer has direct connections with top embedded banking platforms. You can grant Layer access to pull your customers' data from these platforms on your behalf. Layer currently supports: [Unit](https://www.unit.co/) and [Stripe Treasury](https://stripe.com/treasury).

## Importing transactions via API

To import bank transactions to Layer, first call the [Create Custom Account](/api-reference/v1/create-custom-account) endpoint. This endpoint creates the record for this embedded account in Layer's systems.

```bash Request theme={null}
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "external_id": "ww9wwLgkrbU3jkg3J4J7ckBR3zKQV6sLPQevK",
  "mask": "4321",
  "account_name": "My custom account",
  "institution_name": "My custom account institution",
  "account_type": "DEPOSITORY",
  "account_subtype": "checking"
}'
```

The API will respond with the created Custom Account.

Next, pass the transactions that have occured in your embedded account to Layer by calling the [Import Transactions](/api-reference/v1/import-transactions) endpoint. When making this call, be sure to populate the `customAccountId` parameter in the URL with the `id` of the Custom Account you just created.

```bash Request theme={null}
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/custom-accounts/{customAccountId}/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "transactions": [
    {
      "external_id": "custom-transaction-id-1234",
      "amount": 123,
      "direction": "CREDIT",
      "date": "2023-11-07T05:31:56Z",
      "merchant_name": "My example merchant",
      "merchant_category_code": "4072",
      "description": "Original description",
      "display_description": "Current description to display with details",
      "currency_code": "USD",
      "balance": 123
    }
  ]
}'
```

The API will respond with a `200` if transactions were successfully imported.

Your embedded bank account and its associated transactions will now be accessible in all of [Layer's accounting workflows](/guides/offering-accounting-overview).

## Using Layer's integrations

To leverage Layer's embedded banking integrations with [Unit](https://www.unit.co/) and [Stripe Treasury](https://stripe.com/treasury), reach out to your Layer contact.
