Skip to content

rail API Specification (1.1.2)

Welcome to the rail Developer Guide!

Download OpenAPI description
Languages
Servers
Mock server

https://docs.rail.io/_mock/api-docs/openapi/rail-spec/

Sandbox - Stable API Instance

https://sandbox.layer2financial.com/api/

Production - Stable API Instance

https://platform.layer2financial.com/api/

Applications

Applications represent the onboarding journey for your customers. They are used to collect KYC information and documents required to open accounts on the platform. Visit our guides for a detailed understanding on how to use these APIs.

Operations

Accounts

Accounts are used to hold funds on the platform. Once a customer is onboarded via the application process, you can create accounts for them in various currencies.

Operations

Counterparties

Counterparties represent external entities that you may wish to send or receive funds from. All counterparties are verified to ensure compliance with regulatory requirements prior to being available for use for withdrawals.

Operations

Customers

Customers can only be created via the application process. Once created, customers can have multiple accounts associated with them.

Operations

Deposits

Deposits are used to request instructions for funding platform managed accounts from external sources. A given account may have many deposits associated with it depending on the supported rails and configurations.

Operations

Documents

Document uploading and management functions.

Operations

Exchanges

Exchanges are used to convert funds from one currency to another. This is achieved by moving money between 2 platform accounts that are denominated in different currencies. We have eliminated the complexity of traditional currency trading.

Operations

Payments

Payments are used to orchestrate end to end payment flows from external parties or from within the platform.

Operations

Request

Create a payment request for a platform account in order to receive funds from an external third party.

Security
OAuth2Flow
Headers
Authorizationstring

OAuth bearer token (see authentication flows)

x-l2f-request-idstring

Optional Unique ID per request, useful for fault resolution/diagnosis and audit.

x-l2f-idempotency-idstring

Unique ID used to safely retry an operation. See idempotency section for more details.

Bodyapplication/jsonrequired
payment_sourcePaymentSourceCounterparty (object)(PaymentSource)required
PaymentSourceCounterparty (object)(PaymentSource)
payment_destinationPaymentDestinationAccount (object)(PaymentDestination)required
PaymentDestinationAccount (object)(PaymentDestination)
payment_infoobject(PaymentInfo)required

Payment information

payment_info.​descriptionstringrequired

Description of the payment

payment_info.​amountstringrequired

Amount of the payment

curl -i -X POST \
  https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/payments \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-l2f-idempotency-id: string' \
  -H 'x-l2f-request-id: string' \
  -d '{
    "payment_source": {
      "source_counterparty_id": "string",
      "asset_type": [
        "string"
      ]
    },
    "payment_destination": {
      "account_id": "string"
    },
    "payment_info": {
      "description": "string",
      "amount": "string"
    }
  }'

Responses

Success

Bodyapplication/json
dataobject(PaymentBase)required
data.​idstringread-onlyrequired

Unique ID of the payment, to be used to lookup payment details and status

data.​statusstringread-only

Status of the payment

  • REQUESTED - Payment request is created and has passed validation. It must be accepted before it can be used
  • ACCEPTED - Payment request has been accepted and is waiting execution. At this point it cannot be cancelled.
  • INPROGRESS - Payment is in progress.
  • EXECUTED - Payment Processing have been completed.
  • FAILURE - There is a problem or failure with the payment. View payment details for more information.
Value"ACCEPTED"
Response
application/json
{ "data": { "id": "string", "status": "ACCEPTED" } }

Request

Accept a Payment. On acceptance, payment instructions will be returned (if source = counterparty) or funds will begin processing (if source = account).

Security
OAuth2Flow
Path
idstringrequired

Payment ID

Headers
Authorizationstring

OAuth bearer token (see authentication flows)

x-l2f-request-idstring

Optional Unique ID per request, useful for fault resolution/diagnosis and audit.

x-l2f-idempotency-idstring

Unique ID used to safely retry an operation. See idempotency section for more details.

curl -i -X POST \
  'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/payments/{payment_id}/accept' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'x-l2f-idempotency-id: string' \
  -H 'x-l2f-request-id: string'

Responses

Success

Bodyapplication/json
dataobject(PaymentBase)required
data.​idstringread-onlyrequired

Unique ID of the payment, to be used to lookup payment details and status

data.​statusstringread-only

Status of the payment

  • REQUESTED - Payment request is created and has passed validation. It must be accepted before it can be used
  • ACCEPTED - Payment request has been accepted and is waiting execution. At this point it cannot be cancelled.
  • INPROGRESS - Payment is in progress.
  • EXECUTED - Payment Processing have been completed.
  • FAILURE - There is a problem or failure with the payment. View payment details for more information.
Value"ACCEPTED"
Response
application/json
{ "data": { "id": "string", "status": "ACCEPTED" } }

Request

Retrieves details of a previously requested payment

Security
OAuth2Flow
Path
idstringrequired

Payment ID

Headers
Authorizationstring

OAuth bearer token (see authentication flows)

x-l2f-request-idstring

Optional Unique ID per request, useful for fault resolution/diagnosis and audit.

curl -i -X GET \
  'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/payments/{payment_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'x-l2f-request-id: string'

Responses

Success

Bodyapplication/json
dataobject(Payment)required
data.​idstringread-onlyrequired

Unique ID of the payment, to be used to lookup payment details and status

data.​statusstringread-only

Status of the payment

  • REQUESTED - Payment request is created and has passed validation. It must be accepted before it can be used
  • ACCEPTED - Payment request has been accepted and is waiting execution. At this point it cannot be cancelled.
  • INPROGRESS - Payment is in progress.
  • EXECUTED - Payment Processing have been completed.
  • FAILURE - There is a problem or failure with the payment. View payment details for more information.
Value"ACCEPTED"
data.​payment_sourcePaymentSourceCounterparty (object)(PaymentSource)required
PaymentSourceCounterparty (object)(PaymentSource)
data.​payment_destinationPaymentDestinationAccount (object)(PaymentDestination)required
PaymentDestinationAccount (object)(PaymentDestination)
data.​payment_infoobject(PaymentInfo)required

Payment information

data.​payment_info.​descriptionstringrequired

Description of the payment

data.​payment_info.​amountstringrequired

Amount of the payment

Response
application/json
{ "data": { "id": "string", "status": "ACCEPTED", "payment_source": {}, "payment_destination": {}, "payment_info": {} } }

Request

Retrieves status of a previously created payment. Provides insight into any actions or RFIs that require attention.

Security
OAuth2Flow
Path
payment_idstringrequired

Payment ID

Headers
Authorizationstring

OAuth bearer token (see authentication flows)

x-l2f-request-idstring

Optional Unique ID per request, useful for fault resolution/diagnosis and audit.

curl -i -X GET \
  'https://docs.rail.io/_mock/api-docs/openapi/rail-spec/v1/payments/{payment_id}/status' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'x-l2f-request-id: string'

Responses

Success

Bodyapplication/json
dataobject(PaymentStatusData)required
data.​idstringrequired

Unique ID of the payment

Example: "550e8400-e29b-41d4-a716-446655440000"
data.​statusstringrequired

Current status of the payment

Example: "REQUESTED"
data.​document_errorsArray of objects(DocumentError)

List of document errors that require attention

Response
application/json
{ "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "status": "REQUESTED", "document_errors": [] } }

Transactions

Transactions are created to record the movement of funds between accounts. The transactions endpoint allows the bulk retrieval of transaction data for reconciliation and reporting purposes.

Operations

Transfers

Transfer are used to move funds between two platform managed accounts that are denominated in the same currency.

Operations

Withdrawals

Move funds from a platform managed account to an external counterparty via supported rails.

Operations

Settlements

Settlement services for funds confirmation and reconciliation. Settlements are a deprecated concept and will be removed in future versions of the API. Please use Payments for all new integrations.

Operations

Subscriptions (Webhooks)

Manage your callback (webhook) subscriptions. Subscriptions allow you to receive real-time notifications of events that occur within your platform instance. Visit the guides for a full breakdown of all available events.

Operations