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/
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.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties
- 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/counterparties?page=0&page_size=0&customer_id=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string'Success
Counterparty List
The customer to which this counter party will be registered for use.
The type of counterparty will determine the available rails for sending or receiving funds. See the guides for more detailed explanation of counterparty types.
- FIAT_US
- FIAT_CN
- FIAT_HK
- FIAT_SG
- FIAT_JP
- FIAT_MY
- FIAT_PA
- FIAT_CA
- FIAT_BS
- FIAT_EU
- FIAT_GB
- FIAT_IN
- FIAT_US_LINKED
- CRYPTO
- BASIC
- FIAT_IBAN
- FIAT_ACCNO
Counterparty status determines options available for use on the counterparty.
ACTIVE- Counterparty is open and available for use for withdrawal or depositsCLOSED- Counterparty is permanently closed, no further actions can be performed on the Counterparty.PENDING- Counterparty is under additional review prior to moving to theOPENorCLOSEDstate. No actions can be performed on the Counterparty in this stateFROZEN- Counterparty has been temporarily locked for all actions.EDD- Counterparty requires enhanced due diligence to be performed. The counterparty will operate as if active but may transition toFROZENorCLOSEDpost due-diligence.DORMANT- No activity has been seen in the last 12 months. The counterparty is available for use.
The rails required for this counterparty. Rail selection will determine data requirements. See guides for full breakdowns.
Details of the counter party account holder. Required fields are determined by the combination of required rails. See the API Guides for a full documented breakdown of required fields.
The profile type of the counterparty sending/receiving these funds.
Name of the counterparty (individual or business name). Should match the name on the destination account if sending funds.
The email address of the counterparty who is sending/receiving these funds.
The Telephone Number in E.164 format of the counterparty who is sending/receiving these funds.
The tax reference number of the counterparty who is sending/receiving these funds. (Corporations - EIN, FEIN, TIN, etc. / Individuals = SSN, ITIN, SIN, National Insurance Number etc). For large value payments, providing this info can significantly streamline processing times.
RFC3339 (YYYY-MM-DD) Date of Birth of the counterparty if they are an individual.
Address of the counterparty (individual or business name)
State / Province (2 Digit subdivision component of the ISO 3166-2 code, which consists of the last two characters. https://en.wikipedia.org/wiki/ISO_3166-2
Line of Business of the counterparty (if they are a business)
Details of the counter party account and institution. Required fields are determined by the combination of required needed rails. See the API Guides for a full documented breakdown of required fields.
Destination asset type. 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
Counterparty account number
Counterparty account type.
Counterparty routing number
Institution Name (e.g. Bank of America)
See the pagination section for additional details on the generic pagination approach.
{ "data": { "counterparties": [ … ] }, "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.
The type of counterparty will determine the available rails for sending or receiving funds. See the guides for more detailed explanation of counterparty types.
- FIAT_US
- FIAT_CN
- FIAT_HK
- FIAT_SG
- FIAT_JP
- FIAT_MY
- FIAT_PA
- FIAT_CA
- FIAT_BS
- FIAT_EU
- FIAT_GB
- FIAT_IN
- FIAT_US_LINKED
- CRYPTO
- BASIC
- FIAT_IBAN
- FIAT_ACCNO
The rails required for this counterparty. Rail selection will determine data requirements. See guides for full breakdowns.
Details of the counter party account holder. Required fields are determined by the combination of required rails. See the API Guides for a full documented breakdown of required fields.
The profile type of the counterparty sending/receiving these funds.
Name of the counterparty (individual or business name). Should match the name on the destination account if sending funds.
The Telephone Number in E.164 format of the counterparty who is sending/receiving these funds.
The tax reference number of the counterparty who is sending/receiving these funds. (Corporations - EIN, FEIN, TIN, etc. / Individuals = SSN, ITIN, SIN, National Insurance Number etc). For large value payments, providing this info can significantly streamline processing times.
RFC3339 (YYYY-MM-DD) Date of Birth of the counterparty if they are an individual.
Address of the counterparty (individual or business name)
State / Province (2 Digit subdivision component of the ISO 3166-2 code, which consists of the last two characters. https://en.wikipedia.org/wiki/ISO_3166-2
Line of Business of the counterparty (if they are a business)
Details of the counter party account and institution. Required fields are determined by the combination of required needed rails. See the API Guides for a full documented breakdown of required fields.
Destination asset type. 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/counterparties
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties
- 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/counterparties \
-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",
"description": "string",
"counterparty_type": "FIAT_US",
"supported_rails": [
"ACH"
],
"profile": {
"profile_type": "INDIVIDUAL",
"name": "string",
"email": "string",
"telephone_number": "string",
"tax_reference_number": "string",
"date_of_birth": "2019-08-24",
"address": {
"unit_number": "string",
"address_line1": "string",
"address_line2": "string",
"address_line3": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country_code": "string"
},
"line_of_business": "ARTS_AND_ANTIQUES",
"relationship_to_customer": "SPOUSE"
},
"account_information": {
"asset_type_id": "string",
"account_number": "string",
"type": "CHECKING",
"routing_number": "string",
"swift_bic": "string",
"institution_name": "string",
"institution_address": {
"unit_number": "string",
"address_line1": "string",
"address_line2": "string",
"address_line3": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country_code": "string"
}
},
"intermediary_information": {
"intermediary_type": "FIAT_US",
"institution_name": "string",
"institution_address": {
"unit_number": "string",
"address_line1": "string",
"address_line2": "string",
"address_line3": "string",
"city": "string",
"state": "string",
"postal_code": "string",
"country_code": "string"
}
}
}'{ "data": { "id": "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.
The provider for which linking instructions are required.
Renders the widget in a mobile WebView. Executes URL updates in place of the JavaScript event postMessages.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties/{counterparty_id}/link/details
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/details
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/details
- 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/counterparties/{counterparty_id}/link/details' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string' \
-d '{
"linking_provider": "MX",
"is_mobile_webview": true,
"ui_message_webview_url_scheme": "string"
}'{ "linking_provider": "MX", "is_mobile_webview": true, "ui_message_webview_url_scheme": "string", "mx_widget_url": "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.
The provider for which linking instructions are required.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties/{counterparty_id}/link/connect
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/connect
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/connect
- 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/counterparties/{counterparty_id}/link/connect' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string' \
-d '{
"linking_provider": "MX",
"account_link_id": "string"
}'{ "data": { "id": "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.
Which provider was used when generating linking instructions
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties/{counterparty_id}/link/accounts
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/accounts
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties/{counterparty_id}/link/accounts
- 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/counterparties/{counterparty_id}/link/accounts' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string' \
-d '{
"linking_provider": "MX",
"member_guid": "string"
}'Success
Which provider was used when generating linking instructions
The member_guid from the mx/connect/memberConnected event generated in the UI by the mx widget
The list of accounts that are available for linking. Use the connect operation to connect the desired account from this list with the counterparty
{ "linking_provider": "MX", "member_guid": "string", "available_accounts": [ { … } ] }
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.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties/{counterparty_id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties/{counterparty_id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties/{counterparty_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/counterparties/{counterparty_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string'Success
The type of counterparty will determine the available rails for sending or receiving funds. See the guides for more detailed explanation of counterparty types.
- FIAT_US
- FIAT_CN
- FIAT_HK
- FIAT_SG
- FIAT_JP
- FIAT_MY
- FIAT_PA
- FIAT_CA
- FIAT_BS
- FIAT_EU
- FIAT_GB
- FIAT_IN
- FIAT_US_LINKED
- CRYPTO
- BASIC
- FIAT_IBAN
- FIAT_ACCNO
Counterparty status determines options available for use on the counterparty.
ACTIVE- Counterparty is open and available for use for withdrawal or depositsCLOSED- Counterparty is permanently closed, no further actions can be performed on the Counterparty.PENDING- Counterparty is under additional review prior to moving to theOPENorCLOSEDstate. No actions can be performed on the Counterparty in this stateFROZEN- Counterparty has been temporarily locked for all actions.EDD- Counterparty requires enhanced due diligence to be performed. The counterparty will operate as if active but may transition toFROZENorCLOSEDpost due-diligence.DORMANT- No activity has been seen in the last 12 months. The counterparty is available for use.
The rails required for this counterparty. Rail selection will determine data requirements. See guides for full breakdowns.
Details of the counter party account holder. Required fields are determined by the combination of required rails. See the API Guides for a full documented breakdown of required fields.
The profile type of the counterparty sending/receiving these funds.
Name of the counterparty (individual or business name). Should match the name on the destination account if sending funds.
The email address of the counterparty who is sending/receiving these funds.
The Telephone Number in E.164 format of the counterparty who is sending/receiving these funds.
The tax reference number of the counterparty who is sending/receiving these funds. (Corporations - EIN, FEIN, TIN, etc. / Individuals = SSN, ITIN, SIN, National Insurance Number etc). For large value payments, providing this info can significantly streamline processing times.
RFC3339 (YYYY-MM-DD) Date of Birth of the counterparty if they are an individual.
Address of the counterparty (individual or business name)
State / Province (2 Digit subdivision component of the ISO 3166-2 code, which consists of the last two characters. https://en.wikipedia.org/wiki/ISO_3166-2
Line of Business of the counterparty (if they are a business)
Details of the counter party account and institution. Required fields are determined by the combination of required needed rails. See the API Guides for a full documented breakdown of required fields.
Destination asset type. 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
{ "data": { "id": "string", "customer_id": "string", "description": "string", "counterparty_type": "FIAT_US", "status": "ACTIVE" } }
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.
- Mock server
https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/counterparties/{counterparty_id}
- Sandbox - Stable API Instance
https://sandbox.layer2financial.com/api/v1/counterparties/{counterparty_id}
- Production - Stable API Instance
https://platform.layer2financial.com/api/v1/counterparties/{counterparty_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/counterparties/{counterparty_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-l2f-idempotency-id: string' \
-H 'x-l2f-request-id: string' \
-d '{
"updates": [
{
"field": "string",
"value": "string"
}
],
"updated_by": "string",
"reason": "string"
}'{ "data": { "id": "string" } }