Welcome to the rail Developer Guide!
rail API Specification (1.1.2)
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/
https://sandbox.layer2financial.com/api/
https://platform.layer2financial.com/api/
CLIENT- Accounts at the Client level for managing client treasury operationsDEPOSIT- Accounts at the Customer level account for managing customer funds on platformVIRTUAL- Accounts at the Customer level account for tracking externally managed customer funds
see account concepts for more details.
OPEN- Account is open and available for use in line with its product configurationCLOSED- Account is permanently closed, no further actions can be performed on the account.PENDING- Account is under additional review prior to moving to the OPEN or CLOSED state. No actions can be performed on the account.FROZEN- Account has been temporarily locked for all actions (deposits, transfers, exchanges and withdrawals).EDD- Account (and/or customer) requires enhanced due diligence to be performed. The accounts will operate as if frozen.DORMANT- No activity has been seen in the last 12 months. The account is available for use.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits?page=0&page_size=0&customer_id=string&product_type=CLIENT&status=OPEN' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'Success
Account List
Unique Identifier for the account - defined by the Client during account open
Account Status - will determine servicing options on the account.
OPEN- Account is open and available for use in line with its product configurationCLOSED- Account is permanently closed, no further actions can be performed on the account.PENDING- Account is under additional review prior to moving to the OPEN or CLOSED state. No actions can be performed on the account.FROZEN- Account has been temporarily locked for all actions (deposits, transfers, exchanges and withdrawals).EDD- Account (and/or customer) requires enhanced due diligence to be performed. The accounts will operate as if frozen.DORMANT- No activity has been seen in the last 12 months. The account is available for use.
Asset type IDs follow a simple structure as follows: {$BLOCKCHAIN}_{$NETWORK}_{$CURRENCY_CODE} Simple asset type to test with include
ETHEREUM_SEPOLIA_ETHETHEREUM_SEPOLIA_USDCSOLANA_DEVNET_SOLBITCOIN_TESTNET_BTCFIAT_TESTNET_USDFIAT_TESTNET_USDFIAT_MAINNET_USDFIAT_TESTNET_EUR
CLIENT- Accounts at the Client level for managing client treasury operationsDEPOSIT- Accounts at the Customer level account for managing customer funds on platformVIRTUAL- Accounts at the Customer level account for tracking externally managed customer funds
See account concepts for additional details on these product types
Client Product configuration this account respects. These are configured in the management portal. Default products include BASIC_DEPOSIT
See the pagination section for additional details on the generic pagination approach.
{ "data": { "accounts": [ … ] }, "links": { "self": "string", "first": "string", "prev": "string", "next": "string", "last": "string" } }
Optional Unique ID per request, useful for fault resolution/diagnosis and audit.
Unique ID used to safely retry an operation. See idempotency section for more details.
Customer ID of the customer for whom the account is being opened (see /customers)
Details of the account to open for the customer
The identifier you wish to use to uniquely identify this account. The account id follows the External Identifier pattern.
Select the type of account being opened. You can customise and/or create new product offerings by visiting the Management Interface
Pre configured products that are available for use are
DEPOSIT_BASIC
Select the asset type of the account being opened. Asset type selection is not open ended, it must be configured per product via the Management Interface.
Asset type IDs follow a simple structure as follows: {$BLOCKCHAIN}_{$NETWORK}_{$CURRENCY_CODE} Simple asset type to test with include
ETHEREUM_SEPOLIA_ETHETHEREUM_SEPOLIA_USDCSOLANA_DEVNET_SOLBITCOIN_TESTNET_BTCFIAT_TESTNET_USDFIAT_TESTNET_USDFIAT_MAINNET_USDFIAT_TESTNET_EUR
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string' \
-d '{
"customer_id": "string",
"account_to_open": {
"account_id": "string",
"product_id": "string",
"asset_type_id": "string"
}
}'{ "data": { "id": "string" } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'Success
Account Status - will determine servicing options on the account.
OPEN- Account is open and available for use in line with its product configurationCLOSED- Account is permanently closed, no further actions can be performed on the account.PENDING- Account is under additional review prior to moving to the OPEN or CLOSED state. No actions can be performed on the account.FROZEN- Account has been temporarily locked for all actions (deposits, transfers, exchanges and withdrawals).EDD- Account (and/or customer) requires enhanced due diligence to be performed. The accounts will operate as if frozen.DORMANT- No activity has been seen in the last 12 months. The account is available for use.
Asset type IDs follow a simple structure as follows: {$BLOCKCHAIN}_{$NETWORK}_{$CURRENCY_CODE} Simple asset type to test with include
ETHEREUM_SEPOLIA_ETHETHEREUM_SEPOLIA_USDCSOLANA_DEVNET_SOLBITCOIN_TESTNET_BTCFIAT_TESTNET_USDFIAT_TESTNET_USDFIAT_MAINNET_USDFIAT_TESTNET_EUR
CLIENT- Accounts at the Client level for managing client treasury operationsDEPOSIT- Accounts at the Customer level account for managing customer funds on platformVIRTUAL- Accounts at the Customer level account for tracking externally managed customer funds
See account concepts for additional details on these product types
Client Product configuration this account respects. These are configured in the management portal. Default products include BASIC_DEPOSIT
{ "data": { "id": "string", "status": "OPEN", "asset_type_id": "string", "product_type": "CLIENT", "product_id": "string", "customer_id": "string", "current_balance": 0, "available_balance": 0 } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-request-id: string' \
-d '{
"updates": [
{
"field": "string",
"value": "string"
}
],
"updated_by": "string",
"reason": "string"
}'{ "data": { "id": "string" } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/transactions
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{id}/transactions
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{id}/transactions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/transactions?page=0&page_size=0&order=ASC&start_date=2019-08-24&end_date=2019-08-24' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'Success
Transaction List
Value of the transaction in the underlying account currency
Date time the transaction was performed
Status of transaction
AUTHORIZED- Treat as a temporary hold. This transaction impacts the account available balance but does not impact the current balance. Can and should be cancelled and replaced by a pending/posted pair.PENDING- Transaction waiting final confirmation. This transaction impacts the account available balance but does not impact the current balance. Cannot be cancelled as the underlying transaction is in flight.POSTED- Transaction is final. Both the available balance and current balance are impacted. Cannot be reversed.CANCELLED- Transaction is no longer valid. Reverse any impacts to available balance and current balance.
Transaction type
TRANSFER_IN- External deposit of crypto funds into an account.TRANSFER_OUT- Withdrawal of crypto funds from an account to an external location .FIAT_TRANSFER_IN- External deposit of FIAT funds into an account.FIAT_TRANSFER_OUT- Withdrawal of FIAT funds from an account to an external location .FIAT_TRANSFER_IN_RETURN- Clawback of a FIAT deposit (e.g. due to bankiing error).FIAT_TRANSFER_OUT_RETURN- Return of a FIAT withdrawal (e.g. due to the destination account being closed)DEBIT_CORRECTION- Debit account adjustment.CREDIT_CORRECTION- Credit account adjustment.TRADE- Currency exchange transaction (applies to both the debit on the source account or credit on the destination account).FEE- Fee deduction.INTERNAL_TRANSFER- Book (internal) movement of funds between account.
If this transaction related to a core platform feature
DEPOSIT- When this transaction was a result of a deposit.EXCHANGE- When this transaction was a result of an exchange.TRANSFER- When this transaction was a result of a transfer.WITHDRAWAL- When this transaction was a result of a withdrawal.
Where the category_type is present, this identifier allows you to lookup the category details using the standard APIs. For example, where a category_type is TRANSFER and the category_id is abc-123, you can lookup the original transfer that this transaction relates to using GET /transfers/abc-123
Where the type of transaction is TRANSFER_IN, the available details of the originator of the transaction
See the pagination section for additional details on the generic pagination approach.
{ "data": { "transactions": [ … ] }, "links": { "self": "string", "first": "string", "prev": "string", "next": "string", "last": "string" } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/transactions/{id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{id}/transactions/{id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{id}/transactions/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/transactions/{id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'Success
Status of transaction
AUTHORIZED- Treat as a temporary hold. This transaction impacts the account available balance but does not impact the current balance. Can and should be cancelled and replaced by a pending/posted pair.PENDING- Transaction waiting final confirmation. This transaction impacts the account available balance but does not impact the current balance. Cannot be cancelled as the underlying transaction is in flight.POSTED- Transaction is final. Both the available balance and current balance are impacted. Cannot be reversed.CANCELLED- Transaction is no longer valid. Reverse any impacts to available balance and current balance.
Transaction type
TRANSFER_IN- External deposit of crypto funds into an account.TRANSFER_OUT- Withdrawal of crypto funds from an account to an external location .FIAT_TRANSFER_IN- External deposit of FIAT funds into an account.FIAT_TRANSFER_OUT- Withdrawal of FIAT funds from an account to an external location .FIAT_TRANSFER_IN_RETURN- Clawback of a FIAT deposit (e.g. due to bankiing error).FIAT_TRANSFER_OUT_RETURN- Return of a FIAT withdrawal (e.g. due to the destination account being closed)DEBIT_CORRECTION- Debit account adjustment.CREDIT_CORRECTION- Credit account adjustment.TRADE- Currency exchange transaction (applies to both the debit on the source account or credit on the destination account).FEE- Fee deduction.INTERNAL_TRANSFER- Book (internal) movement of funds between account.
If this transaction related to a core platform feature
DEPOSIT- When this transaction was a result of a deposit.EXCHANGE- When this transaction was a result of an exchange.TRANSFER- When this transaction was a result of a transfer.WITHDRAWAL- When this transaction was a result of a withdrawal.
Where the category_type is present, this identifier allows you to lookup the category details using the standard APIs. For example, where a category_type is TRANSFER and the category_id is abc-123, you can lookup the original transfer that this transaction relates to using GET /transfers/abc-123
Where the type of transaction is TRANSFER_IN, the available details of the originator of the transaction
{ "data": { "id": "string", "value": 0, "transaction_date": "2019-08-24T14:15:22Z", "transaction_posted_date": "2019-08-24T14:15:22Z", "transaction_status": "AUTHORIZED", "transaction_type": "TRANSFER_IN", "category_type": "ADJUSTMENT", "category_id": "string", "description": "string", "originator": { … }, "rail_information": { … } } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/statements
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{id}/statements
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{id}/statements
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{id}/statements?page=0&page_size=0' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'Success
See the pagination section for additional details on the generic pagination approach.
{ "data": { "statements": [ … ] }, "links": { "self": "string", "first": "string", "prev": "string", "next": "string", "last": "string" } }
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{account_id}/statements/{statement_id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/accounts/deposits/{account_id}/statements/{statement_id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/accounts/deposits/{account_id}/statements/{statement_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/accounts/deposits/{account_id}/statements/{statement_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-request-id: string'{ "data": { "account_id": "string", "asset_type_id": "string", "statement_period": "string", "opening_balance": 0, "closing_balance": 0, "customer": { … }, "transactions": [ … ] } }