### PUSH Deposit Instructions Response (JSON) Source: https://squarefi-baas-api.readme.io/docs/deposits Example JSON response after requesting PUSH deposit instructions. It includes the deposit ID, status, creation timestamp, and detailed deposit instructions for various financial rails, including account details and memo information. ```json { "data": { "id": "4d5f954c-1d54-4fa7-a93e-6c0843d5eb69", "status": "REQUESTED", "created_timestamp": "2025-11-04T15:45:35.004361-05:00", "deposit_type": "PUSH", "deposit_destination": { "destination_account_id": "kziG6fD8M57hri4uNKaTuEFnr61b4m", "asset_type_id": "FIAT_TESTNET_USD" }, "customer_name": "Jimmy Cimble", "deposit_source": { "deposit_instructions": [ { "instruction_type": "FEDWIRE", "asset_type_id": "FIAT_TESTNET_USD", "account_holder_name": "John Smith", "account_number": "506548758", "account_routing_number": "021214891", "memo": "SN69F7P", "institution_name": "Cross River Bank", "account_holder_address": { "address_line1": "Static street name", "city": "Los Angeles", "state": "CA", "postal_code": "90001", "country_code": "US" }, "institution_address": { "address_line1": "885 Teaneck Rd", "city": "Teaneck", "state": "NJ", "postal_code": "07666", "country_code": "US" } }, { "instruction_type": "ACH", "asset_type_id": "FIAT_TESTNET_USD", "account_holder_name": "John Smith", "account_number": "506548758", "account_routing_number": "021214891", "memo": "TDE5ZKB", "institution_name": "Cross River Bank" } ] } } } ``` -------------------------------- ### GET /deposits Source: https://squarefi-baas-api.readme.io/docs/depositing-funds Retrieve deposit instructions for PUSH deposits or initiate PULL deposits. ```APIDOC ## GET /deposits ### Description This endpoint can be used to either retrieve PUSH deposit instructions or initiate a PULL deposit. ### Method GET ### Endpoint /deposits ### Parameters #### Query Parameters - **deposit_type** (string) - Required - Specifies the type of deposit ('PUSH' or 'PULL'). - **deposit_destination.destination_account_id** (string) - Required for PUSH - The account ID where funds should be deposited. - **source_counterparty_id** (string) - Required for PULL - The ID of the counterparty from which to pull funds. - **amount** (string) - Required for PULL - The amount to pull. ### Request Example ```json { "deposit_type": "PUSH", "deposit_destination": { "destination_account_id": "acc_12345" } } ``` ```json { "deposit_type": "PULL", "source_counterparty_id": "cp_67890", "amount": "100.00" } ``` ### Response #### Success Response (200) - **instructions** (object) - Contains details for PUSH deposits (e.g., bank name, account number, routing number, memo). - **deposit_id** (string) - The ID of the initiated PULL deposit. #### Response Example ```json { "instructions": { "bank_name": "Example Bank", "account_number": "123456789", "routing_number": "012345678", "memo": "acc_12345" } } ``` ```json { "deposit_id": "dep_abcdef123" } ``` ``` -------------------------------- ### Transfers API - Setup Transfer Source: https://squarefi-baas-api.readme.io/docs/transfers Sets up a new transfer, returning a transfer ID for subsequent actions. ```APIDOC ## POST /transfers ### Description Sets up a new transfer. This operation returns a `transfer_id` which is required to accept/execute or retrieve details about the transfer. ### Method POST ### Endpoint /transfers ### Parameters #### Request Body - **source_account_id** (string) - Required - The ID of the account from which funds will be transferred. - **destination_account_id** (string) - Required - The ID of the account to which funds will be transferred. - **amount** (number) - Required - The amount of funds to transfer. - **currency** (string) - Required - The currency of the transfer (e.g., 'USD', 'EUR'). ### Request Example ```json { "source_account_id": "acc_12345", "destination_account_id": "acc_67890", "amount": 100.50, "currency": "USD" } ``` ### Response #### Success Response (201 Created) - **transfer_id** (string) - The unique identifier for the created transfer. - **status** (string) - The initial status of the transfer (e.g., 'PENDING'). #### Response Example ```json { "transfer_id": "tr_abcdef123456", "status": "PENDING" } ``` ``` -------------------------------- ### Get Exchange Quote Source: https://squarefi-baas-api.readme.io/docs/exchanges This endpoint is used to set up an exchange by getting a quote for the desired swap. It requires specifying the source and destination accounts, the amount, and the exchange action. ```APIDOC ## POST /exchanges/quote ### Description Gets a quote for an exchange between two assets. ### Method POST ### Endpoint /exchanges/quote ### Parameters #### Query Parameters - **source_account** (string) - Required - The account to debit funds from. - **destination_account** (string) - Required - The account to credit funds to. - **amount** (number) - Required - The amount of the source asset to exchange. - **action** (string) - Required - The type of exchange action. Supported values: `FIX_SOURCE`, `FIX_DESTINATION`. ### Request Body ```json { "source_account": "string", "destination_account": "string", "amount": 0.0, "action": "FIX_SOURCE" } ``` ### Response #### Success Response (200) - **quote_id** (string) - The ID of the generated quote. - **source_amount** (number) - The amount of the source asset to be debited. - **destination_amount** (number) - The estimated amount of the destination asset to be credited. - **fee** (number) - The fee for the exchange. #### Response Example ```json { "quote_id": "quote_abc123", "source_amount": 100.0, "destination_amount": 0.005, "fee": 0.1 } ``` ``` -------------------------------- ### Get Access Token using OAuth 2.0 Client Credentials Flow (PHP) Source: https://squarefi-baas-api.readme.io/reference This PHP example demonstrates how to request a JWT access token using the OAuth 2.0 client credentials grant. It utilizes your client ID and client secret for the request. ```php 'client_credentials', 'client_id' => $client_id, 'client_secret' => $client_secret ]); $options = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => $data ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); if ($result === FALSE) { die('Error fetching token'); } var_dump(json_decode($result, true)); ?> ``` -------------------------------- ### Create Application Source: https://squarefi-baas-api.readme.io/docs/applications Initiates a new customer application. Requires customer ID and account details, returning an application ID 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 #### Request Body - **customer_id** (string) - Required - The ID of the customer to associate with the application. - **account_details** (object) - Required - Details of the account to be opened. ### Request Example ```json { "customer_id": "cus_12345", "account_details": { "type": "checking", "currency": "USD" } } ``` ### Response #### Success Response (201) - **application_id** (string) - The unique identifier for the created application. #### Response Example ```json { "application_id": "app_abcde" } ``` ``` -------------------------------- ### Get Access Token using OAuth 2.0 Client Credentials Flow (Node.js) Source: https://squarefi-baas-api.readme.io/reference This Node.js example shows how to exchange client credentials for a JWT access token using the OAuth 2.0 client credentials flow. Ensure you have the necessary client ID and secret. ```javascript const fetch = require('node-fetch'); async function getAccessToken() { const response = await fetch('https://sandbox.baas.sqfi.rest/oauth/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ 'grant_type': 'client_credentials', 'client_id': 'your_client_id', 'client_secret': 'your_client_secret' }) }); const data = await response.json(); return data; } getAccessToken().then(tokenData => console.log(tokenData)); ``` -------------------------------- ### Create Application Source: https://squarefi-baas-api.readme.io/docs/applications Initiates a new corporate application. You must provide a customer ID and account details. The response includes an application ID crucial for subsequent operations. ```APIDOC ## POST /applications ### Description Creates a new corporate application, associating it with a customer and specifying account details. Returns an `application_id` for future reference. ### 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 account. - **currency** (string) - Required - The currency of the account. ### Request Example ```json { "account_details": { "type": "checking", "currency": "USD" } } ``` ### Response #### Success Response (201) - **application_id** (string) - The unique identifier for the created application. #### Response Example ```json { "application_id": "app_12345abcde" } ``` ``` -------------------------------- ### Get Subscriptions OpenAPI Definition Source: https://squarefi-baas-api.readme.io/reference/subscriptionscontroller_getsubscriptions This OpenAPI definition describes the 'Get Subscriptions' endpoint for the SquareFi BaaS API. It specifies the HTTP GET method, request parameters (including optional idempotency and request IDs), and possible responses (200, 400, 401, 404, 500). ```json { "openapi": "3.0.0", "paths": { "/v1/subscriptions": { "get": { "description": "Return all subscriptions", "operationId": "SubscriptionsController_getSubscriptions", "parameters": [ { "name": "x-l2f-request-id", "required": false, "in": "header", "description": "Optional Unique ID per request, useful for fault resolution/diagnosis and audit.", "schema": { "type": "string" } }, { "name": "x-l2f-idempotency-id", "required": false, "in": "header", "description": "Unique ID used to safely retry an operation. See idempotency section for more details.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success" }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Error" } }, "security": [ { "BearerAuth": [] } ], "summary": "Get Subscriptions", "tags": [ "Subscriptions (Webhooks)" ] } } }, "info": { "title": "SquareFi BaaS API", "description": "SquareFi Payment & Banking API - Multi-tenant financial services platform with access control and business logic. Comprehensive API for payments, deposits, withdrawals, accounts, and more. Visit us at squarefi.co", "version": "1.5.2", "contact": {} }, "servers": [ { "url": "https://sandbox.baas.sqfi.rest", "description": "Sandbox" } ], "components": { "securitySchemes": { "BearerAuth": { "scheme": "bearer", "bearerFormat": "API Key", "type": "http", "description": "Enter your tenant API key (Basic Auth)" } } } } ``` -------------------------------- ### POST /v1/applications Source: https://squarefi-baas-api.readme.io/reference/applicationscontroller_createapplication Initiates a new application for onboarding individuals or corporations. After creation, you can add and update details before submission. ```APIDOC ## POST /v1/applications ### Description Start a new application to onboard a person or corporation. Once the application is created, proceed to add individuals and update as needed, and then submit once the status allows for it. ### Method POST ### Endpoint /v1/applications ### Parameters #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. - **x-l2f-idempotency-id** (string) - Optional - Unique ID used to safely retry an operation. See idempotency section for more details. #### Request Body - **name** (string) - Required - The name of the application. ### Request Example ```json { "name": "New Business Application" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created application. - **name** (string) - The name of the application. - **status** (string) - The current status of the application. #### Response Example ```json { "id": "app_12345abcde", "name": "New Business Application", "status": "PENDING_REVIEW" } ``` #### Error Responses - **400** - Bad Request: The request was malformed or invalid. - **401** - Unauthorized: Authentication credentials were not provided or were invalid. - **404** - Not Found: The requested resource could not be found. - **500** - Internal Error: An unexpected error occurred on the server. ``` -------------------------------- ### GET /v1/subscriptions Source: https://squarefi-baas-api.readme.io/reference/subscriptionscontroller_getsubscriptions Retrieves a list of all subscriptions associated with the account. This endpoint is useful for managing and monitoring active subscriptions. ```APIDOC ## GET /v1/subscriptions ### Description Retrieves a list of all subscriptions. This endpoint is useful for managing and monitoring active subscriptions. ### Method GET ### Endpoint /v1/subscriptions ### Parameters #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. - **x-l2f-idempotency-id** (string) - Optional - Unique ID used to safely retry an operation. See idempotency section for more details. ### Request Example ```json { "message": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **Success** (object) - Description of the success response payload (details not provided in OpenAPI spec). #### Error Responses - **400** (object) - Bad Request - **401** (object) - Unauthorized - **404** (object) - Not Found - **500** (object) - Internal Error #### Response Example (Success) ```json { "message": "Subscription data retrieved successfully." } ``` #### Response Example (Error) ```json { "error": "Bad Request", "message": "Invalid parameters provided." } ``` ``` -------------------------------- ### Request PUSH Deposit Instructions (Bash) Source: https://squarefi-baas-api.readme.io/docs/deposits Initiates a PUSH deposit request to obtain instructions for sending funds into a SquareFi account. Requires `deposit_type` set to 'PUSH' and the `destination_account_id`. The response provides specific instructions for available rails like FEDWIRE and ACH. ```bash POST https://sandbox.baas.sqfi.rest/v1/deposits ``` -------------------------------- ### Create Customer Application Source: https://squarefi-baas-api.readme.io/docs/customers Initiates the creation of a new customer by submitting Know Your Business (KYB) and/or Know Your Customer (KYC) data. This process involves validation and approval by SquareFI and its partners. Upon successful validation, the customer and a default account are created. ```APIDOC ## POST /applications ### Description Creates a new customer application by submitting KYB/KYC data. Upon approval, a customer and a default account are created. ### Method POST ### Endpoint /applications ### Parameters #### Request Body - **customer_id** (string) - Required - Your unique reference for the customer. - **kyc_data** (object) - Required - Contains Know Your Customer data. - **kyb_data** (object) - Optional - Contains Know Your Business data. ``` -------------------------------- ### GET /v1/accounts/deposits/{account_id}/statements/{statement_id} Source: https://squarefi-baas-api.readme.io/reference/accountscontroller_getaccountstatement Retrieves a specific statement for a given account. ```APIDOC ## GET /v1/accounts/deposits/{account_id}/statements/{statement_id} ### Description Retrieves a specific statement for an account. ### Method GET ### Endpoint /v1/accounts/deposits/{account_id}/statements/{statement_id} ### Parameters #### Path Parameters - **account_id** (string) - Required - Account ID - **statement_id** (string) - Required - Statement ID #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **(No specific fields defined in OpenAPI for success response body)** - Description: Success #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found - **500** - Internal Error ``` -------------------------------- ### POST /v1/deposits/{deposit_id}/accept Source: https://squarefi-baas-api.readme.io/reference/depositscontroller_acceptdeposit Accept a Deposit. This is only needed for `PULL` deposits, `PUSH` deposits do not need to be accepted. On acceptance, this will initiate the funds pull from the source counterparty. It is not reversible. ```APIDOC ## POST /v1/deposits/{deposit_id}/accept ### Description Accept a Deposit. This is only needed for `PULL` deposits, `PUSH` deposits do not need to be accepted. On acceptance, this will initiate the funds pull from the source counterparty. It is not reversible. ### Method POST ### Endpoint /v1/deposits/{deposit_id}/accept ### Parameters #### Path Parameters - **deposit_id** (string) - Required - Deposit ID #### Query Parameters None #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. - **x-l2f-idempotency-id** (string) - Optional - Unique ID used to safely retry an operation. See idempotency section for more details. - **x-signature** (string) - Optional - Client signature to validate the provence of the API request. See signing section for more details. - **x-timestamp** (string) - Optional - Current timestamp, represented AS unix epoch seconds. Mandatory when x-signature is provided. #### Request Body - **(object)** - Required - The request body is an empty object for this endpoint. ### Request Example ```json { "message": "This endpoint does not require a request body." } ``` ### Response #### Success Response (200) - **(object)** - Success #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found - **500** - Internal Error #### Response Example ```json { "message": "Deposit accepted successfully." } ``` ``` -------------------------------- ### Get Exchange Details Source: https://squarefi-baas-api.readme.io/docs/exchanges Retrieves details of a specific executed exchange using its ID. ```APIDOC ## GET /exchanges/{exchange_id} ### Description Retrieves details of a specific executed exchange. ### Method GET ### Endpoint /exchanges/{exchange_id} ### Parameters #### Path Parameters - **exchange_id** (string) - Required - The ID of the exchange to retrieve. ### Request Body (No request body required for this endpoint) ### Response #### Success Response (200) - **exchange_id** (string) - The ID of the exchange. - **source_account** (string) - The source account used for the exchange. - **destination_account** (string) - The destination account for the exchange. - **source_amount_debited** (number) - The actual amount debited from the source account. - **destination_amount_credited** (number) - The actual amount credited to the destination account. - **status** (string) - The status of the exchange. - **created_at** (string) - Timestamp when the exchange was created. - **completed_at** (string) - Timestamp when the exchange was completed. #### Response Example ```json { "exchange_id": "exchange_xyz789", "source_account": "account_123", "destination_account": "account_456", "source_amount_debited": 100.0, "destination_amount_credited": 0.0049, "status": "COMPLETED", "created_at": "2023-10-27T10:00:00Z", "completed_at": "2023-10-27T10:01:00Z" } ``` ``` -------------------------------- ### Get Access Token using OAuth 2.0 Client Credentials Flow (Python) Source: https://squarefi-baas-api.readme.io/reference This Python snippet shows how to obtain a JWT access token using the OAuth 2.0 client credentials flow. It requires your client ID and client secret to authenticate the request. ```python import requests url = "https://sandbox.baas.sqfi.rest/oauth/token" client_id = "your_client_id" client_secret = "your_client_secret" data = { "grant_type": "client_credentials", "client_id": client_id, "client_secret": client_secret } headers = { "Content-Type": "application/x-www-form-urlencoded" } response = requests.post(url, data=data, headers=headers) print(response.json()) ``` -------------------------------- ### POST /v1/deposits (Push Deposit) Source: https://squarefi-baas-api.readme.io/docs/deposits Requests deposit instructions for a PUSH deposit. This method is used when the source account initiates the transaction. Supported for Fedwire and Swift, and also for ACH. ```APIDOC ## POST /v1/deposits (Push Deposit) ### Description Requests deposit instructions for a PUSH deposit. This method is used when the source account initiates the transaction. Supported for Fedwire and Swift, and also for ACH. ### Method POST ### Endpoint `https://sandbox.baas.sqfi.rest/v1/deposits` ### Parameters #### Request Body - **deposit_type** (string) - Required - Must be `PUSH`. - **deposit_destination** (object) - Required - Specifies where the funds should be deposited. - **destination_account_id** (string) - Required - The ID of the account where funds need to be deposited. - **customer_name** (string) - Required - The name of the customer initiating the deposit. - **customer_id** (string) - Required - The ID of the customer initiating the deposit. ### Request Example ```json { "deposit_type": "PUSH", "deposit_destination": { "destination_account_id": "kziG6fD8M57hri4uNKaTuEFnr61b4m" }, "customer_name": "Jimmy Cimble", "customer_id": "kt0NxhX3LYkRd2y1Dx7RXvbD5gvKUC" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the details of the deposit request. - **id** (string) - Unique identifier for the deposit. - **status** (string) - The current status of the deposit (e.g., `REQUESTED`). - **created_timestamp** (string) - Timestamp when the deposit was created. - **deposit_type** (string) - The type of deposit (`PUSH`). - **deposit_destination** (object) - Details about the deposit destination. - **destination_account_id** (string) - The ID of the destination account. - **asset_type_id** (string) - The type of asset being deposited (e.g., `FIAT_TESTNET_USD`). - **customer_name** (string) - The name of the customer. - **deposit_source** (object) - Information about the source of the deposit. - **deposit_instructions** (array) - An array of available deposit instructions. - **instruction_type** (string) - The type of instruction (e.g., `FEDWIRE`, `ACH`). - **asset_type_id** (string) - The type of asset for this instruction. - **account_holder_name** (string) - The name of the account holder. - **account_number** (string) - The account number for the deposit. - **account_routing_number** (string) - The routing number for the deposit. - **memo** (string) - A unique memo required for the deposit. - **institution_name** (string) - The name of the financial institution. - **account_holder_address** (object) - The address of the account holder. - **address_line1** (string) - **city** (string) - **state** (string) - **postal_code** (string) - **country_code** (string) - **institution_address** (object) - The address of the financial institution. - **address_line1** (string) - **city** (string) - **state** (string) - **postal_code** (string) - **country_code** (string) #### Response Example ```json { "data": { "id": "4d5f954c-1d54-4fa7-a93e-6c0843d5eb69", "status": "REQUESTED", "created_timestamp": "2025-11-04T15:45:35.004361-05:00", "deposit_type": "PUSH", "deposit_destination": { "destination_account_id": "kziG6fD8M57hri4uNKaTuEFnr61b4m", "asset_type_id": "FIAT_TESTNET_USD" }, "customer_name": "Jimmy Cimble", "deposit_source": { "deposit_instructions": [ { "instruction_type": "FEDWIRE", "asset_type_id": "FIAT_TESTNET_USD", "account_holder_name": "John Smith", "account_number": "506548758", "account_routing_number": "021214891", "memo": "SN69F7P", "institution_name": "Cross River Bank", "account_holder_address": { "address_line1": "Static street name", "city": "Los Angeles", "state": "CA", "postal_code": "90001", "country_code": "US" }, "institution_address": { "address_line1": "885 Teaneck Rd", "city": "Teaneck", "state": "NJ", "postal_code": "07666", "country_code": "US" } }, { "instruction_type": "ACH", "asset_type_id": "FIAT_TESTNET_USD", "account_holder_name": "John Smith", "account_number": "506548758", "account_routing_number": "021214891", "memo": "TDE5ZKB", "institution_name": "Cross River Bank" } ] } } } ``` ``` -------------------------------- ### Get Access Token using OAuth 2.0 Client Credentials Flow (Ruby) Source: https://squarefi-baas-api.readme.io/reference This Ruby code snippet illustrates the process of obtaining a JWT access token via the OAuth 2.0 client credentials flow. It requires your client ID and client secret for authentication. ```ruby require 'net/http' require 'uri' require 'json' uri = URI.parse('https://sandbox.baas.sqfi.rest/oauth/token') request = Net::HTTP::Post.new(uri) request.set_form_data({ 'grant_type' => 'client_credentials', 'client_id' => 'your_client_id', 'client_secret' => 'your_client_secret' }) request['Content-Type'] = 'application/x-www-form-urlencoded' response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(request) end puts JSON.parse(response.body) ``` -------------------------------- ### POST /v1/counterparties Source: https://squarefi-baas-api.readme.io/reference/counterpartiescontroller_createcounterparty Create a new counterparty for the purpose of pulling funds into the platform or pushing out. ```APIDOC ## POST /v1/counterparties ### Description Create a new counterparty for the purpose of pulling funds into the platform or pushing out. ### Method POST ### Endpoint /v1/counterparties ### Parameters #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. - **x-l2f-idempotency-id** (string) - Optional - Unique ID used to safely retry an operation. See idempotency section for more details. #### Request Body - **(object)** - Required - The request body schema is defined as an empty object in the OpenAPI specification. Specific fields will depend on the counterparty creation details. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **(object)** - Description: Success. The response body schema is not detailed in the OpenAPI spec, but typically would contain details of the created counterparty. #### Error Responses - **400**: Bad Request - **401**: Unauthorized - **404**: Not Found - **500**: Internal Error #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### GET /v1/transactions Source: https://squarefi-baas-api.readme.io/reference/transactionscontroller_gettransactions Retrieves a list of transactions across all accounts based on the provided query parameters. ```APIDOC ## GET /v1/transactions ### Description Retrieves a list of transactions across all accounts given the query parameters provided. ### Method GET ### Endpoint /v1/transactions ### Parameters #### Query Parameters - **page** (number) - Optional - Page of records to get (default 0 = first page) - **page_size** (number) - Optional - Records to return per page (default = 20) - **order** (string) - Optional - Sort order by transaction date (ASC or DESC) - **start_date** (string) - Optional - Filter for transactions from this date - **end_date** (string) - Optional - Filter for transactions to this date - **account_id** (string) - Optional - Filter transactions by account ID - **category_id** (string) - Optional - Filter transactions by category ID - **category_type** (string) - Optional - Filter transactions by category type (ENUM: ADJUSTMENT, DEPOSIT, EXCHANGE, TRANSFER, WITHDRAWAL) - **transaction_status** (string) - Optional - Filter transactions by transaction status (ENUM: AUTHORIZED, PENDING, POSTED, CANCELLED) #### Headers - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **description** (string) - Success #### Response Example ```json { "example": "Response body will contain a list of transactions" } ``` #### Error Responses - **400**: Bad Request - **401**: Unauthorized - **404**: Not Found - **500**: Internal Error ``` -------------------------------- ### Create Deposit Source: https://squarefi-baas-api.readme.io/reference/depositscontroller_createdeposit This endpoint allows for the creation of a deposit. It handles the necessary parameters and security to process a new deposit transaction. ```APIDOC ## POST /deposits ### Description Creates a new deposit transaction. ### Method POST ### Endpoint /deposits ### Parameters #### Request Body - **account_id** (string) - Required - The ID of the account to deposit into. - **amount** (number) - Required - The amount to deposit. - **currency** (string) - Required - The currency of the deposit (e.g., USD, EUR). - **external_reference_id** (string) - Optional - A unique identifier for the transaction from an external system. - **metadata** (object) - Optional - Additional key-value pairs for custom data. ### Request Example ```json { "account_id": "acc_12345abc", "amount": 100.50, "currency": "USD", "external_reference_id": "ref_xyz789", "metadata": { "source": "web_app" } } ``` ### Response #### Success Response (201) - **deposit_id** (string) - The unique identifier for the created deposit. - **status** (string) - The current status of the deposit (e.g., PENDING, COMPLETED, FAILED). - **created_at** (string) - The timestamp when the deposit was created. #### Response Example ```json { "deposit_id": "dep_98765zyx", "status": "PENDING", "created_at": "2023-10-27T10:00:00Z" } ``` #### Error Responses - **400**: Bad Request - The request was malformed or invalid. - **401**: Unauthorized - Authentication failed or invalid credentials. - **404**: Not Found - The specified resource was not found. - **500**: Internal Error - An unexpected error occurred on the server. ``` -------------------------------- ### Get List of All Payment Accounts Source: https://squarefi-baas-api.readme.io/docs/accounts Retrieves a full list of payment accounts, optionally filtered by customer. ```APIDOC ## GET /accounts/payments ### Description Retrieves the full list of crypto payment accounts. This can be for all customers or a specific customer if a customer identifier is provided. ### Method GET ### Endpoint /accounts/payments ### Parameters #### Query Parameters - **customer_id** (string) - Optional - The ID of the customer to filter accounts by. ### Response #### Success Response (200) - **accounts** (array) - A list of payment account objects. - **account_id** (string) - The ID of the payment account. - **currency** (string) - The currency of the account. #### Response Example ```json { "accounts": [ { "account_id": "pay_fghij", "currency": "BTC" } ] } ``` ``` -------------------------------- ### Get List of All Deposit Accounts Source: https://squarefi-baas-api.readme.io/docs/accounts Retrieves a full list of deposit accounts, optionally filtered by customer. ```APIDOC ## GET /accounts/deposits ### Description Retrieves the full list of deposit accounts. This can be for all customers or a specific customer if a customer identifier is provided. ### Method GET ### Endpoint /accounts/deposits ### Parameters #### Query Parameters - **customer_id** (string) - Optional - The ID of the customer to filter accounts by. ### Response #### Success Response (200) - **accounts** (array) - A list of deposit account objects. - **account_id** (string) - The ID of the deposit account. - **currency** (string) - The currency of the account. #### Response Example ```json { "accounts": [ { "account_id": "acc_abcde", "currency": "USD" } ] } ``` ``` -------------------------------- ### Create Deposit Request Source: https://squarefi-baas-api.readme.io/reference/depositscontroller_createdeposit Initiates a deposit request for a platform account, enabling the transfer of funds into the account. ```APIDOC ## POST /deposits ### Description Creates a deposit request for a platform account to facilitate sending funds into the account. ### Method POST ### Endpoint /deposits ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **accountId** (string) - Required - The unique identifier of the platform account where funds will be deposited. - **amount** (number) - Required - The amount of funds to be deposited. - **currency** (string) - Required - The currency of the deposit (e.g., 'USD', 'EUR'). - **externalReferenceId** (string) - Optional - A unique identifier for the transaction from an external system. ### Request Example ```json { "accountId": "acc_12345abc", "amount": 100.50, "currency": "USD", "externalReferenceId": "ref_xyz789" } ``` ### Response #### Success Response (201 Created) - **depositId** (string) - The unique identifier for the created deposit request. - **status** (string) - The current status of the deposit request (e.g., 'PENDING', 'PROCESSING'). - **createdAt** (string) - The timestamp when the deposit request was created. #### Response Example ```json { "depositId": "dep_98765zyx", "status": "PENDING", "createdAt": "2023-10-27T10:00:00Z" } ``` #### Error Response (400 Bad Request) - **error** (object) - Contains error details. - **code** (string) - An error code. - **message** (string) - A human-readable error message. #### Error Response Example ```json { "error": { "code": "INVALID_AMOUNT", "message": "The provided deposit amount is invalid." } } ``` ``` -------------------------------- ### POST /v1/payments/{payment_id}/accept Source: https://squarefi-baas-api.readme.io/reference/paymentscontroller_acceptpayment Accept a Payment. On acceptance, payment instructions will be returned (if source = counterparty) or funds will begin processing (if source = account). ```APIDOC ## POST /v1/payments/{payment_id}/accept ### Description Accept a Payment. On acceptance, payment instructions will be returned (if source = counterparty) or funds will begin processing (if source = account). ### Method POST ### Endpoint /v1/payments/{payment_id}/accept ### Parameters #### Path Parameters - **payment_id** (string) - Required - Payment ID #### Query Parameters None #### Header Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. - **x-l2f-idempotency-id** (string) - Optional - Unique ID used to safely retry an operation. See idempotency section for more details. #### Request Body - **(object)** - Required - An empty JSON object is expected for this request. ### Request Example ```json { "": "" } ``` ### Response #### Success Response (200) - **(object)** - Description: Success #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Not Found - **500** - Internal Error #### Response Example ```json { "message": "Payment accepted successfully." } ``` ``` -------------------------------- ### Get Payment Account Info and Balance Source: https://squarefi-baas-api.readme.io/docs/accounts Retrieves information and balance details for a specific crypto payment account. ```APIDOC ## GET /accounts/payments/{account_id} ### Description Retrieves information about a crypto payment account, including its total and available balance. Available balance is funds ready for withdrawal, exchange, or transfer, net of pending transactions. Total balance includes all funds, including pending and authorized transactions. ### Method GET ### Endpoint /accounts/payments/{account_id} ### Parameters #### Path Parameters - **account_id** (string) - Required - The ID of the payment account. ### Response #### Success Response (200) - **account_id** (string) - The ID of the payment account. - **currency** (string) - The currency of the account. - **total_balance** (number) - The total balance of the account. - **available_balance** (number) - The available balance for withdrawal, exchange, or transfer. #### Response Example ```json { "account_id": "pay_fghij", "currency": "BTC", "total_balance": 500.75, "available_balance": 450.25 } ``` ``` -------------------------------- ### Create Application (OpenAPI) Source: https://squarefi-baas-api.readme.io/reference/applicationscontroller_createapplication This OpenAPI definition describes the 'createApplication' endpoint for the SquareFi BaaS API. It specifies the HTTP method (POST), request headers, request body schema, and possible responses for creating a new application. ```json { "openapi": "3.0.0", "paths": { "/v1/applications": { "post": { "description": "Start a new application to onboard a person or corporation. Once the application is created, proceed to add individuals and update as needed, and then submit once the status allows for it.", "operationId": "ApplicationsController_createApplication", "parameters": [ { "name": "x-l2f-request-id", "required": false, "in": "header", "description": "Optional Unique ID per request, useful for fault resolution/diagnosis and audit.", "schema": { "type": "string" } }, { "name": "x-l2f-idempotency-id", "required": false, "in": "header", "description": "Unique ID used to safely retry an operation. See idempotency section for more details.", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Success" }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "404": { "description": "Not Found" }, "500": { "description": "Internal Error" } }, "security": [ { "BearerAuth": [] } ], "summary": "Create Application", "tags": [ "Applications" ] } } }, "info": { "title": "SquareFi BaaS API", "description": "SquareFi Payment & Banking API - Multi-tenant financial services platform with access control and business logic. Comprehensive API for payments, deposits, withdrawals, accounts, and more. Visit us at squarefi.co", "version": "1.5.2", "contact": {} }, "servers": [ { "url": "https://sandbox.baas.sqfi.rest", "description": "Sandbox" } ], "components": { "securitySchemes": { "BearerAuth": { "scheme": "bearer", "bearerFormat": "API Key", "type": "http", "description": "Enter your tenant API key (Basic Auth)" } } } } ``` -------------------------------- ### GET /v1/applications/{id} Source: https://squarefi-baas-api.readme.io/reference/applicationscontroller_getapplication Retrieves a specific application record using its unique ID. This endpoint is part of the Applications API. ```APIDOC ## GET /v1/applications/{id} ### Description Retrieves a specific application record given the `application_id` path parameter. ### Method GET ### Endpoint /v1/applications/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Application ID #### Query Parameters - **x-l2f-request-id** (string) - Optional - Optional Unique ID per request, useful for fault resolution/diagnosis and audit. ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **Success** (object) - Description of the success response (details not provided in OpenAPI spec) #### Error Responses - **400** (object) - Bad Request - **401** (object) - Unauthorized - **404** (object) - Not Found - **500** (object) - Internal Error #### Response Example ```json { "example": "Success response body structure not detailed in OpenAPI spec" } ``` ```