Prerequisites
Before getting started with Layer’s API, you will need:- A Layer account. Reach out to your Layer contact or contact our team.
- Client credentials (
client_idandclient_secret) provided by Layer.
Environments
Layer provides two environments for development and production use:| Environment | Base URL | OAuth Scope |
|---|---|---|
| Sandbox | https://sandbox.layerfi.com | https://sandbox.layerfi.com/sandbox |
| Production | https://api.layerfi.com | https://api.layerfi.com/production |
1
Obtain your client credentials
Layer uses OAuth2’s client credentials flow to authenticate API clients. To start your development, we will give you a set of
client_id and client_secret tokens.To obtain a set of client credentials, reach out to your Layer contact or contact our team here.
2
Get a bearer token
Calls to the Layer API require a bearer access token. To receive an access token and make calls to other API endpoints, provide your The authorization server will respond with your granted access token:Extract the
client_id and client_secret in the body of a POST request to Layer’s authorization server.access_token value from the response. You’ll use this in the Authorization header for all API requests.3
Make a test API call
Use the access token to make a request to the API by including it as a Bearer token in the authorization header.The API will respond with your client name and client id:
Access tokens expire after 1 hour. To refresh your access token, make another call to Layer’s authorization endpoint with your
client_id and client_secret. We recommend refreshing tokens for new sets of requests rather than persisting access tokens.Next Steps
Now that you’re authenticated, you can:- Onboard a business - Create your first business in Layer
- Import financial data - Start passing transaction data
- Explore the API reference - Learn about available endpoints
- Set up embedded components - Add Layer’s pre-built UI components to your platform