### Setup Withdrawal API Source: https://docs.rail.io/guides/fiatofframp This endpoint is used to set up a fiat withdrawal to a previously created counterparty. You need to provide withdrawal details like amount, source account, and destination counterparty ID. ```APIDOC ## POST /api/v1/withdrawals ### Description Sets up a fiat withdrawal to an external account. Requires a pre-created counterparty. ### Method POST ### Endpoint /api/v1/withdrawals ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **withdrawal_rail** (string) - Required - The rail used for withdrawal (e.g., "ACH"). - **description** (string) - Required - A description for the withdrawal. - **source_account_id** (string) - Required - The ID of the source account from which funds will be withdrawn. - **amount** (string) - Required - The amount to withdraw. - **destination_counterparty_id** (string) - Required - The ID of the destination counterparty. - **memo** (string) - Optional - A memo for the withdrawal. ### Request Example ```json { "withdrawal_rail": "ACH", "description": "Withdraw usd", "source_account_id": "PK001_USD.001", "amount":"4.9", "destination_counterparty_id": "{COUNTERPARTY_ID}", "memo": "withdrawal" } ``` ### Response #### Success Response (200) - **data** (object) - Contains details of the initiated withdrawal. - **id** (string) - The unique identifier for the withdrawal. - **status** (string) - The current status of the withdrawal (e.g., "REQUESTED"). #### Response Example ```json { "data": { "id": "887804df-13c2-4019-835b-08c92ed77c72", "status": "REQUESTED" } } ``` ``` -------------------------------- ### Setup Crypto Withdrawal Source: https://docs.rail.io/guides/fiatonramp This endpoint is used to set up a withdrawal of crypto funds to a previously created counterparty. ```APIDOC ## POST /api/v1/withdrawals ### Description Sets up a cryptocurrency withdrawal to a specified destination counterparty. ### Method POST ### Endpoint https://sandbox.layer2financial.com/api/v1/withdrawals ### Parameters #### Request Body - **withdrawal_rail** (string) - Required - The rail for withdrawal, must be 'CRYPTO'. - **description** (string) - Required - A description for the withdrawal. - **source_account_id** (string) - Required - The ID of the source account from which funds will be withdrawn. - **amount** (string) - Required - The amount of cryptocurrency to withdraw. - **destination_counterparty_id** (string) - Required - The ID of the counterparty to which funds will be withdrawn. - **memo** (string) - Optional - A memo for the withdrawal. ### Request Example ```json { "withdrawal_rail": "CRYPTO", "description": "Withdraw crypto", "source_account_id": "DANIELLEE001_USDC.001", "amount":"3", "destination_counterparty_id": "{COUNTERPARTY_ID}", "memo": "withdrawal" } ``` ### Response #### Success Response (200) - **data** (object) - Contains details of the initiated withdrawal. - **id** (string) - The unique identifier for the withdrawal. - **status** (string) - The current status of the withdrawal (e.g., 'REQUESTED'). #### Response Example ```json { "data": { "id": "887804df-13c2-4019-835b-08c92ed77c72", "status": "REQUESTED" } } ``` ``` -------------------------------- ### Setup Crypto Withdrawal Source: https://docs.rail.io/guides/fiatonramp Sets up a cryptocurrency withdrawal to a previously created counterparty. Requires the counterparty ID, source account ID, amount, and withdrawal rail. Returns a withdrawal ID and status upon success. ```curl curl --location 'https://sandbox.layer2financial.com/api/v1/withdrawals' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "withdrawal_rail": "CRYPTO", "description": "Withdraw crypto", "source_account_id": "DANIELLEE001_USDC.001", "amount":"3", "destination_counterparty_id": "{COUNTERPARTY_ID}", "memo": "withdrawal" }' ``` -------------------------------- ### USDC Deposit Response Details (JSON) Source: https://docs.rail.io/guides/fiatonramp Example response after requesting a deposit address. It includes the deposit ID, status, creation timestamp, and detailed deposit instructions such as the crypto address, blockchain, network, and asset type. ```json { "data": { "id": "d9b4cd0e-c66e-4540-9abd-55fa79833791", "status": "REQUESTED", "created_timestamp": "2023-03-05T14:56:32.316773-05:00", "destination_details": { "destination_account_id": "DANIELLEE001_USDC.001", "asset_type_id": "ETHEREUM_GOERLI_USDC" }, "deposit_instructions": [ { "instruction_type": "CRYPTO", "address": "0x9ED9961A87ba49511Cf522059df52e2a94eF188b", "blockchain": "ethereum", "network": "goerli", "asset_type_id": "ETHEREUM_GOERLI_USDC" } ] } } ``` -------------------------------- ### Setup Fiat Withdrawal using cURL Source: https://docs.rail.io/guides/fiatofframp This cURL command sets up a fiat withdrawal to an external account. It requires the destination counterparty ID obtained from the previous step, source account ID, amount, and withdrawal rail (ACH). ```bash curl --location 'https://sandbox.layer2financial.com/api/v1/withdrawals' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "withdrawal_rail": "ACH", "description": "Withdraw usd", "source_account_id": "PK001_USD.001", "amount":"4.9", "destination_counterparty_id": "{COUNTERPARTY_ID}", "memo": "withdrawal" }' ``` -------------------------------- ### GET /accounts/deposits/{ACCOUNT_ID} - Get Account Deposits Source: https://docs.rail.io/guides/fiatonramp Retrieves deposit information for a specific account, including its status, asset type, and current balance. ```APIDOC ## GET /accounts/deposits/{ACCOUNT_ID} ### Description Retrieves deposit information for a specific account, including its status, asset type, and current balance. ### Method GET ### Endpoint /api/v1/accounts/deposits/{ACCOUNT_ID} ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The ID of the account to query. #### Query Parameters None ### Request Example ```bash curl --location --request GET 'https://sandbox.layer2financial.com/api/v1/accounts/deposits/DANIELLEE001_USDC.001' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Contains deposit information for the account. - **id** (string) - The account ID. - **status** (string) - The current status of the account (e.g., 'OPEN'). - **asset_type_id** (string) - The type of asset in the account. - **product_id** (string) - The product ID associated with the account. - **current_balance** (number) - The current balance of the account. - **available_balance** (number) - The available balance of the account (Note: may be 0 in sandbox until settlement). #### Response Example ```json { "data": { "id": "DANIELLEE001_USDC.001", "status": "OPEN", "asset_type_id": "ETHEREUM_GOERLI_USDC", "product_id": "DEPOSIT_BASIC", "current_balance": 1000.000000000000000000, "available_balance": 0 } } ``` ``` -------------------------------- ### POST /v1/applications Source: https://docs.rail.io/guides/customer_onboarding Creates a new corporate application. This is the first step in the onboarding process. ```APIDOC ## POST /v1/applications ### Description Creates a new corporate application. This endpoint is used to initiate the onboarding process for a corporation. ### Method POST ### Endpoint /v1/applications ### Parameters #### Request Body - **customer_id** (string) - Required - The unique identifier for the corporate customer. - **customer_type** (string) - Required - The type of customer, should be 'CORPORATION'. - **profile** (object) - Required - Contains profile information for the corporation. - **legal_name** (string) - Required - The legal name of the corporation. - **incorporation_date** (string) - Required - The date of incorporation (YYYY-MM-DD). - **tax_reference_number** (string) - Required - The tax reference number of the corporation. - **address** (object) - Required - The address of the corporation. - **address_line1** (string) - Required - The first line of the address. - **city** (string) - Required - The city. - **state** (string) - Required - The state or province. - **postal_code** (string) - Required - The postal code. - **country_code** (string) - Required - The two-letter country code (e.g., 'US'). - **business_type** (string) - Required - The type of business. - **website** (string) - Optional - The corporation's website URL. - **default_account** (object) - Required - Default account details for the application. - **product_id** (string) - Required - The ID of the product for the default account. - **asset_type_id** (string) - Required - The asset type ID for the default account. ### Request Example ```json { "customer_id": "CORPORATE_CUSTOMER_001", "customer_type": "CORPORATION", "profile": { "legal_name": "Example Tech Corp", "incorporation_date": "2020-01-01", "tax_reference_number": "12-3456789", "address": { "address_line1": "456 Business Blvd", "city": "San Francisco", "state": "CA", "postal_code": "94105", "country_code": "US" }, "business_type": "TECHNOLOGY", "website": "https://exampletech.com" }, "default_account": { "product_id": "DEPOSIT_BASIC", "asset_type_id": "FIAT_TESTNET_USD" } } ``` ### Response #### Success Response (200) - **data** (object) - Contains the application details. - **id** (string) - The unique identifier for the created application. - **status** (string) - The current status of the application. #### Response Example ```json { "data": { "id": "app_corp_987654", "status": "INCOMPLETE" } } ``` ``` -------------------------------- ### GET /api/v1/accounts/deposits Source: https://docs.rail.io/guides/buysellhold Retrieves data for all accounts across all customers. ```APIDOC ## GET /api/v1/accounts/deposits ### Description Retrieves information on all accounts associated with all customers. ### Method GET ### Endpoint /api/v1/accounts/deposits ### Response #### Success Response (200) - **data** (object) - **accounts** (array) - **id** (string) - The account ID. - **status** (string) - The status of the account. - **asset_type_id** (string) - The asset type of the account. - **product_type** (string) - The type of product associated with the account. - **product_id** (string) - The product ID. - **customer_id** (string) - The ID of the customer owning the account. - **current_balance** (number) - The current balance. - **available_balance** (number) - The available balance. #### Response Example ```json { "data": { "accounts": [ { "id": "QUORUM001.001", "status": "OPEN", "asset_type_id": "ETHEREUM_GOERLI_ETH", "product_type": "DEPOSIT", "product_id": "DEPOSIT_FORT_CRYPTO", "customer_id": "QUORUM001", "current_balance": 0, "available_balance": 0 } ] } } ``` ``` -------------------------------- ### POST /v1/applications Source: https://docs.rail.io/guides/customer_onboarding Create a new application for customer onboarding. This is the first step in the onboarding process and requires customer details. ```APIDOC ## POST /v1/applications ### Description Creates a new customer application. This endpoint is used to initiate the onboarding process for either individual or corporate customers by providing their initial profile information. ### Method POST ### Endpoint `https://sandbox.layer2financial.com/api/v1/applications` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **customer_id** (string) - Required - A unique identifier for the customer. - **customer_type** (string) - Required - Type of customer ('INDIVIDUAL' or 'CORPORATE'). - **profile** (object) - Required - Contains profile information for the customer. - **name** (object) - Required - Name of the customer. - **first_name** (string) - Required - Customer's first name. - **last_name** (string) - Required - Customer's last name. - **date_of_birth** (string) - Optional - Customer's date of birth (YYYY-MM-DD). - **tax_reference_number** (string) - Optional - Customer's tax identification number. - **address** (object) - Required - Customer's address. - **address_line1** (string) - Required - Street address. - **city** (string) - Required - City. - **state** (string) - Required - State or province. - **postal_code** (string) - Required - Postal code. - **country_code** (string) - Required - ISO 3166-1 alpha-2 country code. - **email** (string) - Required - Customer's email address. - **phone_number** (string) - Optional - Customer's phone number. - **default_account** (object) - Optional - Default account details for the customer. - **product_id** (string) - Required - The ID of the product for the default account. - **asset_type_id** (string) - Required - The ID of the asset type for the default account. ### Request Example ```json { "customer_id": "INDIVIDUAL_CUSTOMER_001", "customer_type": "INDIVIDUAL", "profile": { "name": { "first_name": "Jane", "last_name": "Doe" }, "date_of_birth": "1990-01-15", "tax_reference_number": "123-45-6789", "address": { "address_line1": "123 Main Street", "city": "Boston", "state": "MA", "postal_code": "02101", "country_code": "US" }, "email": "jane.doe@example.com", "phone_number": "+1234567890" }, "default_account": { "product_id": "DEPOSIT_BASIC", "asset_type_id": "FIAT_TESTNET_USD" } } ``` ### Response #### Success Response (200) - **data** (object) - Contains application details. - **id** (string) - The unique identifier for the created application. - **status** (string) - The current status of the application (e.g., 'INCOMPLETE'). #### Response Example ```json { "data": { "id": "app_123456789", "status": "INCOMPLETE" } } ``` ``` -------------------------------- ### GET /api/v1/accounts/deposits/{ACCOUNT_ID} Source: https://docs.rail.io/guides/buysellhold Retrieves details for a specific account. ```APIDOC ## GET /api/v1/accounts/deposits/{ACCOUNT_ID} ### Description Retrieves detailed information about a specific account, including its status, balance, and associated asset and product types. ### Method GET ### Endpoint /api/v1/accounts/deposits/{ACCOUNT_ID} ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The unique identifier of the account to retrieve. ### Response #### Success Response (200) - **data** (object) - **id** (string) - The account ID. - **status** (string) - The current status of the account (e.g., "OPEN"). - **asset_type_id** (string) - The asset type associated with the account. - **product_id** (string) - The product ID for the account. - **current_balance** (number) - The current balance of the account. - **available_balance** (number) - The available balance of the account. #### Response Example ```json { "data": { "id": "QUORUM001.001", "status": "OPEN", "asset_type_id": "ETHEREUM_GOERLI_ETH", "product_id": "DEPOSIT_FORT_CRYPTO", "current_balance": 0, "available_balance": 0 } } ``` ``` -------------------------------- ### Create Application Source: https://docs.rail.io/guides/applications Initiates a new customer application on the Rail Platform. You need to provide a `customer_id` and the details of the account to be opened. An `application_id` will be returned for subsequent steps. ```APIDOC ## POST /applications ### Description Create an application, provide the `customer_id` to designate to the customer record and the details of the account you wish to open. You will get an `application_id` in the response that will be needed in subsequent steps. ### Method POST ### Endpoint `/applications` ### Parameters #### Query Parameters - **customer_id** (string) - Required - The ID of the customer to associate with this application. #### Request Body - **account_details** (object) - Required - Details of the account to be opened. - **type** (string) - Required - The type of the account. - **currency** (string) - Required - The currency of the account. ### Request Example ```json { "customer_id": "cust_123abc", "account_details": { "type": "checking", "currency": "USD" } } ``` ### Response #### Success Response (201 Created) - **application_id** (string) - The unique identifier for the created application. #### Response Example ```json { "application_id": "app_456def" } ``` ``` -------------------------------- ### Get Payment Details (JSON Response Example) Source: https://docs.rail.io/api-docs/openapi/layer2/operation/getPayment Example JSON response for a successful retrieval of payment details. It includes payment status and detailed deposit instructions which can vary based on the asset type and payment method. ```json { "data": { "id": "string", "status": "ACCEPTED", "payment_source": { "source_counterparty_id": "string", "asset_type": [ "string" ], "deposit_instructions": { "property1": [ [ { "instruction_type": "CRYPTO", "address": "0x000121", "blockchain": "ETHEREUM", "network": "MAINNET", "asset_type_id": "ETHEREUM_MAINNET_ETH" }, { "instruction_type": "SWIFT", "account_holder_name": "string", "account_number": "string", "account_routing_number": "string", "swift_bic": "string", "account_holder_address": { "unit_number": "string", "address_line1": "string", "address_line2": "string", "address_line3": "string", "city": "string", "state": "string", "postal_code": "string", "country_code": "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" }, "asset_type_id": "string" }, { "instruction_type": "FEDWIRE", "account_holder_name": "string", "account_number": "string", "account_routing_number": "string", "account_holder_address": { "unit_number": "string", "address_line1": "string", "address_line2": "string", "address_line3": "string", "city": "string", "state": "string", "postal_code": "string", "country_code": "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" }, "memo": "string", "asset_type_id": "string" }, { "instruction_type": "ACH", "account_holder_name": "string", "account_number": "string", "account_routing_number": "string", "description": "string", "asset_type_id": "string" } ] ], "property2": [ [ { "instruction_type": "CRYPTO", "address": "0x000121", "blockchain": "ETHEREUM", "network": "MAINNET", "asset_type_id": "ETHEREUM_MAINNET_ETH" }, { "instruction_type": "SWIFT", "account_holder_name": "string", "account_number": "string", "account_routing_number": "string", "swift_bic": "string", "account_holder_address": { "unit_number": "string", "address_line1": "string", "address_line2": "string", "address_line3": "string", "city": "string", "state": "string", "postal_code": "string", "country_code": "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" }, "asset_type_id": "string" }, { "instruction_type": "FEDWIRE", "account_holder_name": "string", "account_number": "string", "account_routing_number": "string", "account_holder_address": { "unit_number": "string", "address_line1": "string", "address_line2": "string", "address_line3": "string", "city": "string", "state": "string", "postal_code": "string", "country_code": "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" }, "memo": "string", "asset_type_id": "string" } ] ] } } } } ``` -------------------------------- ### Create Application Source: https://docs.rail.io/guides/applications Initiates a new application for an individual customer. You need to provide a customer ID and details about the desired account. The response includes an application ID required for subsequent steps. ```APIDOC ## POST /applications ### Description Create an application for an individual customer. Provide the `customer_id` and the details of the account to be opened. The `application_id` returned in the response is crucial for subsequent operations. ### Method POST ### Endpoint /applications ### Parameters #### Query Parameters - **customer_id** (string) - Required - The ID of the customer to associate with this application. #### Request Body - **account_details** (object) - Required - Details of the default account to be opened. - **type** (string) - Required - The type of the account. - **currency** (string) - Required - The currency of the account. ### Request Example ```json { "account_details": { "type": "checking", "currency": "USD" } } ``` ### Response #### Success Response (200) - **application_id** (string) - The unique identifier for the created application. #### Response Example ```json { "application_id": "app_12345abcde" } ``` ``` -------------------------------- ### Retrieve Applications - HTTP Request Example Source: https://docs.rail.io/api-docs/openapi/layer2/operation/getApplications This example shows a basic HTTP GET request to retrieve applications. It includes common query parameters for filtering and sorting, as well as the necessary Authorization header for authentication. ```http GET /v1/applications?page=0&page_size=20&order_by=customer_id&order=ASC&status=INCOMPLETE&application_type=INDIVIDUAL&terms_and_conditions_accepted=true&information_attested=false&customer_id=string&customer_name=string&email_address=string HTTP/1.1 Host: api.rail.io Authorization: Bearer YOUR_OAUTH2_TOKEN X-L2f-Request-Id: optional-unique-id ``` -------------------------------- ### POST /v1/documents/{document_id} Source: https://docs.rail.io/guides/customer_onboarding Uploads a document for a corporate or individual application. ```APIDOC ## POST /v1/documents/{document_id} ### Description Uploads a specified document for either the corporation or an individual associated with an application. Use the `document_id` obtained from the application status endpoint. ### Method POST ### Endpoint /v1/documents/{document_id} ### Parameters #### Path Parameters - **document_id** (string) - Required - The ID of the document to be uploaded. #### Request Body - **file** (file) - Required - The document file to upload (e.g., PDF, image). ### Request Example ```bash # Upload corporate documents curl --location --request POST 'https://sandbox.layer2financial.com/api/v1/documents/doc_corp_001' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --form 'file=@"/path/to/articles_of_incorporation.pdf"' # Upload beneficial owner documents curl --location --request POST 'https://sandbox.layer2financial.com/api/v1/documents/doc_ind_001' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --form 'file=@"/path/to/owner_passport.pdf"' ``` ### Response #### Success Response (200) - The response for a successful document upload is typically a status confirmation or an empty response body, depending on the API's implementation. #### Response Example (Example response structure may vary. Typically, a 200 OK status indicates success.) ```json { "message": "Document uploaded successfully" } ``` ``` -------------------------------- ### GET /accounts/deposits/{account_id} Source: https://docs.rail.io/guides/buysellhold Retrieves the deposit information for a specific account, including current and available balances. ```APIDOC ## GET /accounts/deposits/{account_id} ### Description Retrieves the deposit information for a specific account, including current and available balances. ### Method GET ### Endpoint `/api/v1/accounts/deposits/{account_id}` ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://sandbox.layer2financial.com/api/v1/accounts/deposits/QUORUM001.001' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - **id** (string) - The account ID. - **status** (string) - The current status of the account (e.g., 'OPEN'). - **asset_type_id** (string) - The type of asset deposited (e.g., 'ETHEREUM_GOERLI_ETH'). - **product_id** (string) - The product associated with the deposit. - **current_balance** (number) - The total current balance in the account. - **available_balance** (number) - The balance available for use. #### Response Example ```json { "data": { "id": "QUORUM001.001", "status": "OPEN", "asset_type_id": "ETHEREUM_GOERLI_ETH", "product_id": "DEPOSIT_FORT_CRYPTO", "current_balance": 0.2, "available_balance": 0.2 } } ``` ``` -------------------------------- ### GET /api/v1/accounts/deposits/{ACCOUNT_ID} Source: https://docs.rail.io/guides/fiatonramp Retrieves the current and available balance for a specified account, reflecting recent deposits. ```APIDOC ## GET /api/v1/accounts/deposits/{ACCOUNT_ID} ### Description Retrieves the balance details for a given account. This endpoint is useful for verifying that a fiat deposit has been successfully credited and to check the current and available balances. ### Method GET ### Endpoint `/api/v1/accounts/deposits/{ACCOUNT_ID}` ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The ID of the account for which to retrieve balance information. ### Request Example ```bash curl --location --request GET 'https://sandbox.layer2financial.com/api/v1/accounts/deposits/DANIELLEE001_USD.001' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Contains account balance information. - **id** (string) - The ID of the account. - **status** (string) - The status of the account (e.g., "OPEN"). - **asset_type_id** (string) - The type of asset in the account (e.g., "FIAT_TESTNET_USD"). - **product_id** (string) - The product associated with the account (e.g., "DEPOSIT_BASIC"). - **current_balance** (number) - The total current balance in the account. - **available_balance** (number) - The balance available for use. #### Response Example ```json { "data": { "id": "DANIELLEE001_USD.001", "status": "OPEN", "asset_type_id": "FIAT_TESTNET_USD", "product_id": "DEPOSIT_BASIC", "current_balance": 1000, "available_balance": 1000 } } ``` ``` -------------------------------- ### Submit Application Source: https://docs.rail.io/guides/customer_onboarding Submits the application for processing once all required documents have been uploaded and the application status is 'READY_FOR_SUBMISSION'. ```APIDOC ## POST /v1/applications/{application_id}/submit ### Description Submits the application for processing. This action can only be performed when the application status is 'READY_FOR_SUBMISSION'. ### Method POST ### Endpoint `/v1/applications/{application_id}/submit` ### Parameters #### Path Parameters - **application_id** (string) - Required - The unique identifier for the application to submit. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request POST 'https://sandbox.layer2financial.com/api/v1/applications/app_123456789/submit' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - **id** (string) - The application ID. - **status** (string) - The updated status of the application (e.g., 'SUBMITTED'). #### Response Example ```json { "data": { "id": "app_123456789", "status": "SUBMITTED" } } ``` ``` -------------------------------- ### GET /accounts/deposits/{account_id}/transactions Source: https://docs.rail.io/guides/buysellhold Retrieves a list of transactions associated with a specific account deposit, including their status. ```APIDOC ## GET /accounts/deposits/{account_id}/transactions ### Description Retrieves a list of transactions associated with a specific account deposit, including their status. ### Method GET ### Endpoint `/api/v1/accounts/deposits/{account_id}/transactions` ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account. #### Query Parameters None #### Request Body None ### Request Example ```bash curl --location --request GET 'https://sandbox.layer2financial.com/api/v1/accounts/deposits/QUORUM001.001/transactions' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - **transactions** (array) - **id** (string) - The transaction ID. - **value** (number) - The value of the transaction. - **transaction_date** (string) - The date and time the transaction occurred. - **transaction_posted_date** (string) - The date and time the transaction was posted. - **transaction_status** (string) - The status of the transaction (e.g., 'PENDING', 'ACCEPTED', 'POSTED'). - **description** (string) - A description of the transaction (e.g., 'TRANSFER_IN'). - **transaction_type** (string) - The type of transaction (e.g., 'TRANSFER_IN'). #### Response Example ```json { "data": { "transactions": [ { "id": "d01c36a3-78ef-41f0-8209-455dd0b46680", "value": 0.2, "transaction_date": "2022-11-09T09:46:55.519763", "transaction_posted_date": "2022-11-09T09:46:55.519763", "transaction_status": "PENDING", "description": "TRANSFER_IN", "transaction_type": "TRANSFER_IN" } ] } } ``` ``` -------------------------------- ### Submit Application for Processing Source: https://docs.rail.io/guides/customer_onboarding Submits the application for final processing once it reaches the 'READY_FOR_SUBMISSION' status. This action initiates the review by banking partners. The response confirms that the application has been successfully submitted. ```curl curl --location --request POST 'https://sandbox.layer2financial.com/api/v1/applications/app_123456789/submit' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Authentication API Source: https://docs.rail.io/guides/customer_onboarding Obtain an AUTH_TOKEN by authenticating your account using your client ID and secret with OAuth2 Client Credentials Grant. ```APIDOC ## POST /oauth2/ausbdqlx69rH6OjWd696/v1/token ### Description Authenticates your account to obtain an access token for making API requests. Requires your `BASE_64_ENCODED_CLIENTID_AND_SECRET` and specified scopes. ### Method POST ### Endpoint `https://auth.layer2financial.com/oauth2/ausbdqlx69rH6OjWd696/v1/token` ### Parameters #### Query Parameters - **grant_type** (string) - Required - Must be `client_credentials`. - **scope** (string) - Required - Scopes required for the access token (e.g., `applications:read applications:write customers:read`). #### Request Body This endpoint does not have a request body. Authentication is done via headers. ### Headers - **Accept**: `application/json` - **Content-Type**: `application/x-www-form-urlencoded` - **Authorization**: `Basic {BASE_64_ENCODED_CLIENTID_AND_SECRET}` ### Request Example ```bash curl --location --request POST 'https://auth.layer2financial.com/oauth2/ausbdqlx69rH6OjWd696/v1/token?grant_type=client_credentials&scope=applications:read+applications:write+customers:read' \ --header 'Accept: application/json' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Cache-Control: no-cache' \ --header 'Authorization: Basic {BASE_64_ENCODED_CLIENTID_AND_SECRET}' ``` ### Response #### Success Response (200) - **token_type** (string) - Type of the token, typically `Bearer`. - **expires_in** (integer) - The time in seconds until the token expires. - **access_token** (string) - The obtained authentication token. - **scope** (string) - The scopes granted with this token. #### Response Example ```json { "token_type": "Bearer", "expires_in": 43200, "access_token": "{AUTH_TOKEN}", "scope": "applications:read applications:write customers:read" } ``` ``` -------------------------------- ### GET /api/v1/accounts/deposits/{account_id} Source: https://docs.rail.io/guides/buysellhold This endpoint allows you to query the balance of a specific account. It requires the account ID as a path parameter. ```APIDOC ## GET /api/v1/accounts/deposits/{account_id} ### Description Retrieves the current balance and details of a specific customer account. ### Method GET ### Endpoint /api/v1/accounts/deposits/{account_id} ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account to query. ### Request Example ```bash curl --location --request GET 'https://sandbox.layer2financial.com/api/v1/accounts/deposits/QUORUM001.003' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **data** (object) - Contains the account balance and related information. (Specific fields not detailed in source text, but typically includes balance, asset type, etc.). #### Response Example (Example response structure assumed based on context, actual response may vary) ```json { "data": { "account_id": "QUORUM001.003", "asset_type_id": "FIAT_TESTNET_USD", "current_balance": 125.43, "available_balance": 125.43 } } ``` ``` -------------------------------- ### Initiate Crypto Deposit Request (cURL) Source: https://docs.rail.io/guides/fiatofframp This snippet demonstrates how to initiate a crypto deposit by making a POST request to the /api/v1/deposits endpoint. It includes the necessary authorization and content type headers, along with the request body specifying the deposit type and destination account. The response provides instructions for the customer to complete the deposit. ```curl curl --location --request POST 'https://sandbox.layer2financial.com/api/v1/deposits' \ --header 'Authorization: Bearer {AUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --data-raw '{ "deposit_type": "PUSH", "deposit_destination": { "destination_account_id": "PK001_USDC.001" } }' ``` -------------------------------- ### GET /v1/applications/{application_id} Source: https://docs.rail.io/guides/customer_onboarding Retrieves the status of an application and associated document IDs. ```APIDOC ## GET /v1/applications/{application_id} ### Description Retrieves the status of a corporate application, including any missing or errored documents for both the corporation and its associated individuals. This endpoint is crucial for identifying document IDs required for uploads. ### Method GET ### Endpoint /v1/applications/{application_id} ### Parameters #### Path Parameters - **application_id** (string) - Required - The ID of the application to retrieve status for. ### Response #### Success Response (200) - **data** (object) - Contains the application details. - **id** (string) - The unique identifier for the application. - **status** (string) - The current status of the application. - **customer_id** (string) - The customer ID associated with the application. - **application_document_errors** (array) - A list of errors for corporate documents. - **document_id** (string) - The ID of the corporate document. - **document_type** (string) - The type of the corporate document. - **status** (string) - The status of the document (e.g., 'MISSING'). - **individual_errors** (array) - A list of errors for individual documents. - **individual_id** (string) - The ID of the individual. - **individual_type** (string) - The type of the individual. - **individual_document_errors** (array) - A list of errors for the individual's documents. - **document_id** (string) - The ID of the individual's document. - **document_type** (string) - The type of the individual's document. - **status** (string) - The status of the document (e.g., 'MISSING'). #### Response Example ```json { "data": { "id": "app_corp_987654", "status": "INCOMPLETE", "customer_id": "CORPORATE_CUSTOMER_001", "application_document_errors": [ { "document_id": "doc_corp_001", "document_type": "ARTICLES_OF_INCORPORATION", "status": "MISSING" }, { "document_id": "doc_corp_002", "document_type": "OWNERSHIP_STRUCTURE", "status": "MISSING" } ], "individual_errors": [ { "individual_id": "individual_001", "individual_type": "BENEFICIAL_OWNER", "individual_document_errors": [ { "document_id": "doc_ind_001", "document_type": "PASSPORT", "status": "MISSING" }, { "document_id": "doc_ind_002", "document_type": "PROOF_OF_ADDRESS", "status": "MISSING" } ] } ] } } ``` ``` -------------------------------- ### GET /api/v1/accounts/{ACCOUNT_ID} Source: https://docs.rail.io/guides/buysellhold Retrieves details of a specific account. This endpoint allows querying the current balance and other details of an account. ```APIDOC ## GET /api/v1/accounts/{ACCOUNT_ID} ### Description Retrieves details of a specific account. This endpoint allows querying the current balance and other details of an account. ### Method GET ### Endpoint /api/v1/accounts/{ACCOUNT_ID} ### Parameters #### Path Parameters - **ACCOUNT_ID** (string) - Required - The ID of the account to query. #### Query Parameters None #### Request Body None ### Request Example ```json (No request body needed for this endpoint) ``` ### Response #### Success Response (200) - **data** (object) - Contains account details: - **id** (string) - The account ID. - **status** (string) - The current status of the account (e.g., "OPEN"). - **asset_type_id** (string) - The ID of the asset type held in the account. - **product_id** (string) - The ID of the product associated with the account. - **current_balance** (number) - The current balance of the account. - **available_balance** (number) - The available balance of the account. #### Response Example ```json { "data": { "id": "QUORUM001.002", "status": "OPEN", "asset_type_id": "ETHEREUM_GOERLI_ETH", "product_id": "DEPOSIT_FORT_CRYPTO", "current_balance": 0.1, "available_balance": 0.1 } } ``` ```