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 and Stripe Treasury.

Importing transactions via API

To import bank transactions to Layer, first call the Create Custom Account endpoint. This endpoint creates the record for this embedded account in Layer’s systems.

Request
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 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.

Request
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.

Using Layer’s integrations

To leverage Layer’s embedded banking integrations with Unit and Stripe Treasury, reach out to your Layer contact.