### Retrieve Account Details with Query Parameters (Node.js) Source: https://docs.equalsmoney.com/openapi/em-cis/operation/findOneAccount This Node.js example uses the 'node-fetch' library to make a GET request to the Equalsmoney API for account details. It demonstrates how to pass query parameters like personId and include, and how to set the Authorization header. Remember to install 'node-fetch' if you haven't already. ```javascript const fetch = require('node-fetch'); const accountId = '{accountId}'; const personId = '775596ae-2624-40af-a9dc-9756110a4a04'; const include = 'currencies,market'; const apiKey = 'YOUR_API_KEY_HERE'; fetch(`https://api.equalsmoney.com/v2/accounts/${accountId}?personId=${personId}&include=${include}`, { method: 'GET', headers: { 'Authorization': apiKey, 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Retrieve Account Activity with Filters (Node.js) Source: https://docs.equalsmoney.com/openapi/em-transactions/operation/findAll This Node.js example uses the 'node-fetch' library to make a GET request to the Equalsmoney activity endpoint. It demonstrates how to build the request URL with multiple query parameters for filtering transactions. Remember to install 'node-fetch' (`npm install node-fetch`) and replace placeholders. ```javascript const fetch = require('node-fetch'); const accountId = '{accountId}'; const apiKey = 'YOUR_API_KEY_HERE'; const url = `https://api.equalsmoney.com/v2/activity/${accountId}?limit=200&offset=100&include=bankFeedDetails%2Cannotations&personId=string&type=payment%252Cload&excludeType=payment%252Cload&status=complete%252Ccancelled&budgetId=string&budgetName=Account%252Cmarketing¤cy=GBP%252CUSD&sellCurrency=USD%252CEUR&buyCurrency=GBP&startDate=2021-02-15&endDate=2021-02-16&search=Cesar%2BTreutel&annotationStatus=draft%252Csubmitted&attachmentStatus=absent%252Cpresent&batchPaymentOrders=true&directDebitId=string`; fetch(url, { method: 'GET', headers: { 'Authorization': apiKey } }) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` -------------------------------- ### Retrieve Accounts with Node.js Source: https://docs.equalsmoney.com/openapi/em-cis/operation/findAllAccounts This Node.js example utilizes the 'axios' library to make a GET request to the EqualsMoney accounts endpoint. It shows how to configure query parameters and the necessary Authorization header. Error handling is included for robustness. ```javascript const axios = require('axios'); const apiUrl = 'https://api.equalsmoney.com/v2/accounts'; const apiKey = 'YOUR_API_KEY_HERE'; axios.get(apiUrl, { params: { limit: 200, offset: 100, primaryEmailAddress: 'test@example.com', search: 'string' }, headers: { 'Authorization': `Bearer ${apiKey}` } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching accounts:', error); }); ``` -------------------------------- ### POST /v2/onboarding Source: https://docs.equalsmoney.com/pages/accounts/tutorial/step2 Creates a new account with EqualsMoney. You can specify account type, contact details, company information, and KYC details. Note that `features` and `accountType` cannot be modified after account creation. ```APIDOC ## POST /v2/onboarding ### Description Creates a new account with EqualsMoney. You can specify account type, contact details, company information, and KYC details. Note that `features` and `accountType` cannot be modified after account creation. ### Method POST ### Endpoint `https://api-sandbox.equalsmoney.com/v2/onboarding` or `https://api.equalsmoney.com/v2/onboarding` ### Parameters #### Request Body - **accountType** (string) - Required - The type of account to create (e.g., "business"). - **contact** (object) - Required - Contact person's details. - **firstName** (string) - Required - First name. - **lastName** (string) - Required - Last name. - **phone** (string) - Required - Phone number. - **email** (string) - Required - Email address. - **countryCode** (string) - Required - Two-letter country code. - **address** (object) - Required - Contact address. - **addressLine1** (string) - Required - Address line 1. - **townCity** (string) - Required - City or town. - **postCode** (string) - Required - Postal code. - **countryCode** (string) - Required - Two-letter country code. - **account** (object) - Required - Account specific details. - **companyName** (string) - Required - Company name. - **companyNumber** (string) - Optional - Company registration number. - **incorporationDate** (string) - Optional - Date of incorporation (YYYY-MM-DD). - **address** (object) - Required - Company address. - **addressLine1** (string) - Required - Address line 1. - **townCity** (string) - Required - City or town. - **postCode** (string) - Required - Postal code. - **countryCode** (string) - Required - Two-letter country code. - **onboardingDetail** (string) - Optional - Additional onboarding details. - **type** (string) - Required - Company type (e.g., "ltd"). - **kyc** (object) - Required - Know Your Customer details. - **annualVolume** (string) - Required - Estimated annual transaction volume. - **numberOfPayments** (string) - Required - Estimated number of payments per month/year. - **mainPurpose** (array of strings) - Required - Main purpose of the account. - **sourceOfFunds** (array of strings) - Required - Source of funds. - **destinationOfFunds** (array of strings) - Required - Destination of funds. - **currenciesRequired** (array of strings) - Required - Currencies needed for the account. ### Request Example ```json { "accountType": "business", "contact": { "firstName": "John", "lastName": "Smith", "phone": "07700 900391", "email": "john.smith@example.com", "countryCode": "GB", "address": { "addressLine1": "223 Glossop Road", "townCity": "London", "postCode": "N14 4ES", "countryCode": "GB" } }, "account": { "companyName": "ACME", "companyNumber": "5250007732", "incorporationDate": "2021-06-04", "address": { "addressLine1": "1556 S. Michigan Avenue", "townCity": "London", "postCode": "N14 4ES", "countryCode": "GB" }, "onboardingDetail": "Directors are John Smith and William Walker", "type": "ltd" }, "kyc": { "annualVolume": "Less than £10,000", "numberOfPayments": "More than 20 payments", "mainPurpose": [ "Investment" ], "sourceOfFunds": [ "salary" ], "destinationOfFunds": [ "GB" ], "currenciesRequired": [ "GBP" ] } } ``` ### Response #### Success Response (200) - **ok** (boolean) - Indicates if the request was successful. - **account** (object) - Details of the newly created account. - **product** (string) - The product associated with the account. - **market** (string) - The market the account is for. - **features** (array of strings) - Enabled features for the account. - **accountType** (string) - The type of the account. - **affiliateId** (string) - Unique identifier for the affiliate. - **companyId** (string) - Unique identifier for the company. - **contact** (object) - Contact person's details. - **account** (object) - Account specific details. - **kyc** (object) - KYC details. - **correlationId** (string) - A unique ID for tracing the request. #### Response Example ```json { "ok": true, "account": { "product": "EQUALSMONEY", "market": "UK", "features": [ "payments" ], "accountType": "business", "affiliateId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "companyId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "contact": { "firstName": "John", "lastName": "Smith", "email": "john.smith@example.com", "phone": "07700 900391", "address": { "addressLine1": "223 Glossop Road", "townCity": "Chicago", "postCode": "60605", "countryCode": "GB" } }, "account": { "companyName": "ACME", "companyNumber": "5250007732", "incorporationDate": "2021-06-04", "type": "ltd", "onboardingDetail": "Directors are William Walker and John Smith", "address": { "addressLine1": "1556 S. Michigan Avenue", "townCity": "Chicago", "postCode": "60605", "countryCode": "US" } }, "kyc": { "annualVolume": "Less than £10,000", "numberOfPayments": "More than 20 payments", "mainPurpose": [ "Investment" ], "sourceOfFunds": [ "salary" ], "destinationOfFunds": [ "GB" ], "currenciesRequired": [ "GBP" ] }, "correlationId": "420e4d3c-2d51-4cad-9caf-d7300258cefd" } } ``` ``` -------------------------------- ### List Direct Debit Payment Requests using Node.js Source: https://docs.equalsmoney.com/openapi/em-budgets/operation/findAllDirectDebitPayments An example using Node.js with the 'axios' library to retrieve direct debit payment requests. This code makes a GET request to the API endpoint, passing required and optional parameters. Remember to install axios (`npm install axios`) and replace placeholder values. ```javascript const axios = require('axios'); const budgetId = '775596ae-2624-40af-a9dc-9756110a4a03'; const directDebitId = '775596ae-2624-40af-a9dc-9756110a4a03'; const accountId = 'F50091'; const limit = 200; const offset = 100; axios.get(`https://api.equalsmoney.com/v1/budgets/${budgetId}/direct-debits/${directDebitId}/payment-requests`, { params: { accountId: accountId, limit: limit, offset: offset }, headers: { 'Accept': 'application/json', 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### POST /websites/equalsmoney/onboarding/applications Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/createApplication Creates a new onboarding application. This endpoint is currently in beta. ```APIDOC ## POST /websites/equalsmoney/onboarding/applications ### Description Creates a new onboarding application. This endpoint is currently in beta. ### Method POST ### Endpoint /websites/equalsmoney/onboarding/applications ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body This endpoint requires a request body, but the schema is not provided in the input. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) The response schema is not provided in the input. #### Response Example ```json { "example": "response body" } ``` ### Security CommonAuth ``` -------------------------------- ### POST /onboarding Source: https://docs.equalsmoney.com/openapi/em-cis/operation/onboardAccount Initiates the account onboarding process. This endpoint requires product-level permissions and allows for the creation of either business or personal accounts. ```APIDOC ## POST /onboarding ### Description Starts the process of onboarding an account. This endpoint can only be accessed by product-level permissions. ### Method POST ### Endpoint /v2/onboarding ### Parameters #### Query Parameters - **productId** (string) - Optional - The ID of the product to work with. Example: `productId=3ef24d53-6e22-4103-a16b-d268e4f7346d` (Deprecated) #### Request Body - **accountType** (string) - Required - The type of account that you want to onboard. Enum: "business", "personal" - **affiliateId** (string) - Optional - The affiliate ID. - **companyId** (string) - Optional - The company ID. - **contact** (object) - Required - Contact details for the account. - **firstName** (string) - Required - First name. - **lastName** (string) - Required - Last name. - **nationality** (string) - Required - Nationality. - **annualIncome** (object) - Required - Annual income details. - **currencyCode** (string) - Required - Currency code (e.g., USD). - **value** (number) - Required - Income value. - **email** (string) - Required - Email address. - **phone** (string) - Required - Phone number. - **dob** (string) - Required - Date of birth (DD/MM/YYYY). - **address** (object) - Required - Address details. - **addressLine1** (string) - Required - First line of the address. - **addressLine2** (string) - Optional - Second line of the address. - **townCity** (string) - Required - Town or city. - **postCode** (string) - Required - Postal code. - **countryCode** (string) - Required - Country code (ISO 3166-1 alpha-2). - **account** (object) - Required - Account details. - **companyName** (string) - Required - Company name. - **companyNumber** (string) - Required - Company registration number. - **incorporationDate** (string) - Required - Incorporation date (YYYY-MM-DD). - **type** (string) - Required - Company type (e.g., "ltd"). - **website** (string) - Optional - Company website. - **onboardingDetail** (string) - Optional - Additional onboarding details. - **address** (object) - Required - Company address details (same structure as contact address). - **kyc** (object) - Required - Know Your Customer (KYC) information. - **mainPurpose** (string) - Required - Main purpose of the account. - **sourceOfFunds** (string) - Required - Source of funds. - **destinationOfFunds** (string) - Required - Destination of funds. - **currenciesRequired** (string) - Required - Currencies required. - **annualVolume** (string) - Required - Estimated annual volume. - **numberOfPayments** (string) - Required - Expected number of payments. - **expectedCardUse** (string) - Required - Expected card usage. - **averageLoad** (string) - Required - Average load value. - **numberOfCards** (string) - Required - Number of cards required. - **cardFourthLine** (string) - Required - Card fourth line information. - **employeeCards** (boolean) - Required - Whether employee cards are needed. - **atmWithdrawals** (boolean) - Required - Whether ATM withdrawals are enabled. - **market** (string) - Optional - The market relating to the license. Default: "UK". Enum: "UK", "US", "EU", "UP". - **features** (Array of strings) - Optional - Features to enable. Enum: "payments", "cards". ### Request Example ```json { "accountType": "business", "affiliateId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "companyId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "contact": { "firstName": "John", "lastName": "Doe", "nationality": "GB", "annualIncome": { "currencyCode": "USD", "value": 0 }, "email": "test@example.com", "phone": "07123456789", "dob": "19/01/1946", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "account": { "companyName": "My Company", "companyNumber": "1111111111", "incorporationDate": "2004-01-30", "type": "ltd", "website": "https://www.my-business.com", "onboardingDetail": "detail", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "kyc": { "mainPurpose": "Sale of shares", "sourceOfFunds": "salary", "destinationOfFunds": "GB", "currenciesRequired": "GBP", "annualVolume": "Less than £10,000", "numberOfPayments": "More than 20 payments", "expectedCardUse": "advertising_and_marketing", "averageLoad": "10000_25000", "numberOfCards": "11_50", "cardFourthLine": "CUSTOMER", "employeeCards": true, "atmWithdrawals": true }, "market": "UK", "features": ["payments"] } ``` ### Response #### Success Response (202) - **ok** (boolean) - Indicates if the request was accepted. - **correlationId** (string) - A unique identifier for the request. - **account** (object) - Details of the created account. - **product** (string) - The product associated with the account. - **market** (string) - The market of the account. - **features** (string) - Enabled features. - **accountType** (string) - Type of the account. - **affiliateId** (string) - Affiliate ID. - **companyId** (string) - Company ID. - **contact** (object) - Contact details. - **account** (object) - Account details. - **kyc** (object) - KYC information. #### Response Example ```json { "ok": true, "correlationId": "string", "account": { "product": "EQUALSMONEY", "market": "UK", "features": "payments", "accountType": "business", "affiliateId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "companyId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "contact": { "firstName": "John", "lastName": "Doe", "nationality": "GB", "annualIncome": { "currencyCode": "USD", "value": 0 }, "email": "test@example.com", "phone": "07123456789", "dob": "19/01/1946", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "account": { "companyName": "My Company", "companyNumber": "1111111111", "incorporationDate": "1980-01-30", "type": "ltd", "website": "https://www.my-business.com", "onboardingDetail": "detail", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "kyc": { "expectedCardUse": "advertising_and_marketing", "onboardingDetail": "Extra info supplied by customer", "sourceOfFunds": "salary", "currenciesRequired": "GBP", "averageLoad": "10000_25000", "numberOfCards": "11_50", "numberOfPayments": "More than 20 payments", "destinationOfFunds": "GB", "mainPurpose": "Sale of shares", "cardFourthLine": "CUSTOMER", "employeeCards": true, "atmWithdrawals": true, "annualVolume": "Less than £10,000" } } } ``` ``` -------------------------------- ### List Roles API Request (Node.js) Source: https://docs.equalsmoney.com/openapi/em-cis/operation/findAllRoles This Node.js example uses the 'node-fetch' library to make a GET request to the List Roles API. It demonstrates setting up the request URL, headers, and handling the JSON response. Ensure 'node-fetch' is installed. ```javascript const fetch = require('node-fetch'); const url = 'https://api.equalsmoney.com/v2/roles?accountId=string&limit=200&offset=100'; const apiKey = 'YOUR_API_KEY_HERE'; fetch(url, { method: 'GET', headers: { 'Authorization': apiKey, 'Content-Type': 'application/json' } }) .then(res => res.json()) .then(json => console.log(json)) .catch(err => console.error(err)); ``` -------------------------------- ### Create Account using cURL Source: https://docs.equalsmoney.com/openapi/em-cis/operation/onboardAccount This snippet demonstrates how to initiate the account onboarding process using a cURL request. It requires product-level permissions and includes details about the account type, contact information, company details, and KYC information. ```curl curl -i -X POST \ 'https://api.equalsmoney.com/v2/onboarding?productId=3ef24d53-6e22-4103-a16b-d268e4f7346d' \ -H 'Authorization: YOUR_API_KEY_HERE' \ -H 'Content-Type: application/json' \ -d '{ "accountType": "business", "affiliateId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "companyId": "420e4d3c-2d51-4cad-9caf-d7300258cefd", "contact": { "firstName": "John", "lastName": "Doe", "nationality": "GB", "annualIncome": { "currencyCode": "USD", "value": 0 }, "email": "test@example.com", "phone": "07123456789", "dob": "19/01/1946", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "account": { "companyName": "My Company", "companyNumber": "1111111111", "incorporationDate": "2004-01-30", "type": "ltd", "website": "https://www.my-business.com", "onboardingDetail": "detail", "address": { "addressLine1": "Great Building", "addressLine2": "Greater Building", "townCity": "My Town", "postCode": "SE13UB", "countryCode": "GB" } }, "kyc": { "mainPurpose": "Sale of shares", "sourceOfFunds": "salary", "destinationOfFunds": "GB", "currenciesRequired": "GBP", "annualVolume": "Less than £10,000", "numberOfPayments": "More than 20 payments", "expectedCardUse": "advertising_and_marketing", "averageLoad": "10000_25000", "numberOfCards": "11_50", "cardFourthLine": "CUSTOMER", "employeeCards": true, "atmWithdrawals": true }, "market": "UK", "features": "payments" }' ``` -------------------------------- ### Create Account Source: https://docs.equalsmoney.com/openapi/accounts Submit details about a business or person to start the onboarding process and create an account. ```APIDOC ## POST /v2/onboarding ### Description Creates a new account by submitting business or personal details for the onboarding process. ### Method POST ### Endpoint /v2/onboarding ### Parameters #### Request Body - **accountDetails** (object) - Required - Details required for account creation (e.g., business type, personal information). ### Request Example ```json { "accountDetails": { "type": "business", "businessName": "Example Corp", "contactPerson": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" } } } ``` ### Response #### Success Response (201 Created) - **accountId** (string) - The unique identifier for the newly created account. - **status** (string) - The current status of the account onboarding process. #### Response Example ```json { "accountId": "acc_12345abcde", "status": "pending_verification" } ``` ``` -------------------------------- ### GET Request to List Associated People (Node.js) Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/listAssociatedPeople Example of how to make a GET request to the associated people endpoint using Node.js with the 'axios' library. This shows how to configure the request with query parameters and the necessary Authorization header. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://api.equalsmoney.com/v2/applications/associated-people', params: { limit: '200', offset: '100', search: 'Cesar+Treutel' }, headers: { 'Authorization': 'YOUR_API_KEY_HERE', 'Content-Type': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### GET Request to List Associated People (curl) Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/listAssociatedPeople Example of how to make a GET request to the associated people endpoint using curl. This includes setting query parameters for limit, offset, and search, as well as the Authorization header. ```curl curl -i -X GET \ 'https://api.equalsmoney.com/v2/applications/associated-people?limit=200&offset=100&search=Cesar%2BTreutel' \ -H 'Authorization: YOUR_API_KEY_HERE' ``` -------------------------------- ### List Onboarding Applications (Beta) Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/listApplications Retrieves a paginated list of onboarding applications. Results are sorted by creation date in descending order (newest first). Supports filtering by a search term and controlling the number of results and offset. ```APIDOC ## GET /v2/applications ### Description Returns a paginated list of onboarding applications. Results are sorted by createdAt descending (newest first). ### Method GET ### Endpoint /v2/applications ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. Default: 100. Example: limit=200 - **offset** (integer) - Optional - The number of items to skip before returning results. Default: 0. Example: offset=100 - **search** (string) - Optional - The term to search the records for. Maximum length: 100 characters. Example: search=Cesar+Treutel ### Request Example ```curl curl -i -X GET \ 'https://api.equalsmoney.com/v2/applications?limit=200&offset=100&search=Cesar%2BTreutel' \ -H 'Authorization: YOUR_API_KEY_HERE' ``` ### Response #### Success Response (200) - **limit** (integer) - The number of results returned. - **offset** (integer) - The number of items skipped. - **count** (integer) - The total number of applications matching the query. - **rows** (array) - An array of application objects. - **id** (string) - The unique identifier for the application. - **status** (string) - The current status of the application (e.g., DRAFT). - **accountId** (string) - The ID of the associated account. - **market** (string) - The market the application is for (e.g., UK). - **createdAt** (string) - The timestamp when the application was created. - **updatedAt** (string) - The timestamp when the application was last updated. - **type** (string) - The type of entity applying (e.g., PRIVATE_COMPANY). - **countryOfIncorporation** (string) - The country of incorporation. - **regionOfIncorporation** (string) - The region of incorporation. - **registeredName** (string) - The registered name of the business. - **registrationNumber** (string) - The business registration number. - **tradingNames** (array) - An array of trading names for the business. - **businessOverview** (string) - A description of the business. - **industry** (object) - Information about the business industry. - **main** (string) - The main industry category. - **sub** (string) - The sub-category of the industry. - **employeeCount** (string) - The number of employees (e.g., ONE_TO_TEN). - **incorporationDate** (string) - The date of incorporation. - **phoneNumber** (string) - The business phone number. - **taxId** (string) - The business tax ID. - **website** (string) - The business website URL. - **businessPromotionDescription** (string) - Description of business promotion activities. - **associatedPeople** (array) - An array of associated people with the application. - **associatedPersonId** (string) - The ID of the associated person. - **associationType** (string) - The type of association (e.g., APPLICANT). - **jobTitle** (string) - The job title of the associated person. - **featureInformation** (object) - Details about requested features. - **requestedFeatures** (array) - List of requested features (e.g., PAYMENTS). - **cardsInformation** (object) - Information related to card requests. - **businessDisplayName** (string) - Display name for the cardholder. - **purposes** (array) - Purposes for which cards are required. - **estimatedAnnualSpend** (string) - Estimated annual spend on cards. - **numberOfCardsRequired** (string) - Number of cards required. - **cardsAreForEmployees** (boolean) - Indicates if cards are for employees. - **atmWithdrawalsRequired** (boolean) - Indicates if ATM withdrawals are required. - **paymentsInformation** (object) - Information related to payment services. - **purposes** (array) - Purposes for which payment services are required. - **accountFundingSource** (array) - Sources of account funding. - **estimatedPaymentCount** (string) - Estimated number of payments. - **estimatedPaymentVolume** (string) - Estimated payment volume. - **inboundCurrencies** (array) - Currencies expected to be received. - **outboundCurrencies** (array) - Currencies expected to be sent. - **receivingCountries** (array) - Countries from which payments will be received. - **sendingCountries** (array) - Countries to which payments will be sent. - **addresses** (array) - An array of addresses associated with the application. - **addressType** (string) - The type of address (e.g., REGISTERED). - **streetName** (string) - The street name. - **buildingNumber** (string) - The building number. - **buildingName** (string) - The building name. - **postcode** (string) - The postal code. - **city** (string) - The city. - **region** (string) - The region. - **countryCode** (string) - The country code. #### Response Example ```json { "limit": 200, "offset": 100, "count": 67, "rows": [ { "id": "e9293471-5eb3-4dbc-916c-dbaf9e2deefd", "status": "DRAFT", "accountId": "F50091", "market": "UK", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "type": "PRIVATE_COMPANY", "countryOfIncorporation": "GB", "regionOfIncorporation": "string", "registeredName": "Equals Money Plc", "registrationNumber": "05539698", "tradingNames": [ "Equals Railsr" ], "businessOverview": "We are a small business that provides financial services to small businesses.", "industry": { "main": "ACCOMMODATION_FOOD", "sub": "ACCOMMODATION" }, "employeeCount": "ONE_TO_TEN", "incorporationDate": "2020-01-01", "phoneNumber": "+447911123456", "taxId": "GB123456789", "website": "https://equals.money", "businessPromotionDescription": "We send out leaflets in the post.", "associatedPeople": [ { "associatedPersonId": "e9293471-5eb3-4dbc-916c-dbaf9e2deefd", "associationType": "APPLICANT", "jobTitle": "Director" } ], "featureInformation": { "requestedFeatures": [ "PAYMENTS" ], "cardsInformation": { "businessDisplayName": "CUSTOMER", "purposes": [ "ADVERTISING_AND_MARKETING" ], "estimatedAnnualSpend": "0-10000", "numberOfCardsRequired": "0-10", "cardsAreForEmployees": true, "atmWithdrawalsRequired": true }, "paymentsInformation": { "purposes": [ "PAYING_SUPPLIERS" ], "accountFundingSource": [ "RECEIVING_FUNDS_FROM_OWN_ACCOUNTS" ], "estimatedPaymentCount": "5-20", "estimatedPaymentVolume": "0-10000", "inboundCurrencies": [ "USD" ], "outboundCurrencies": [ "USD" ], "receivingCountries": [ "GB" ], "sendingCountries": [ "GB" ] } }, "addresses": [ { "addressType": "REGISTERED", "streetName": "Upper Thames Street", "buildingNumber": "68", "buildingName": "Vintners Place", "postcode": "EC4V 3BJ", "city": "London", "region": "Greater London", "countryCode": "GB" } ] } ] } ``` ``` -------------------------------- ### GET Request to List Associated People (JavaScript) Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/listAssociatedPeople Example of how to make a GET request to the associated people endpoint using JavaScript's fetch API. This demonstrates setting query parameters and the Authorization header for authenticated requests. ```javascript fetch('https://api.equalsmoney.com/v2/applications/associated-people?limit=200&offset=100&search=Cesar%2BTreutel', { method: 'GET', headers: { 'Authorization': 'YOUR_API_KEY_HERE', 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Create Budget Request using Node.js Source: https://docs.equalsmoney.com/openapi/em-budgets/operation/create This snippet demonstrates creating a budget in Node.js using the 'node-fetch' library. It mirrors the JavaScript example by setting up headers and the request body for the API call. ```javascript const fetch = require('node-fetch'); const accountId = 'F50091'; const apiKey = 'YOUR_API_KEY_HERE'; const budgetData = { "parentId": "775596ae-2624-40af-a9dc-9756110a4a03", "boxId": "a43231c221", "name": "Team Party", "features": [ "payments" ], "currencies": [ "USD" ], "type": "accountBalance", "status": "active", "personaId": "0387819c-a33e-454c-ad84-570bf53cd75f" }; fetch(`https://api.equalsmoney.com/v2/budgets?accountId=${accountId}`, { method: 'POST', headers: { 'Authorization': apiKey, 'Content-Type': 'application/json' }, body: JSON.stringify(budgetData) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### POST /v2/onboarding Source: https://docs.equalsmoney.com/pages/accounts/tutorial/checklist Submit account details to onboard a new account. This endpoint is crucial for initiating the account creation process and should be tested with production-like data, including card details if applicable. ```APIDOC ## POST /v2/onboarding ### Description Submits account details to onboard a new account. Ensure that the onboarding request is submitted correctly, including all fields intended for production use, such as card details if needed. Verify that the JSON payload is passed correctly and that the response is handled gracefully. ### Method POST ### Endpoint `/v2/onboarding?productId={productId}` ### Parameters #### Query Parameters - **productId** (string) - Required - The unique identifier for the product. #### Request Body - **(object)** - Required - Contains the account details for onboarding. The specific fields will depend on the `productId` and your integration requirements. ### Request Example ```json { "productId": "prod_12345", "accountDetails": { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" // ... other required fields }, "cardDetails": { // ... card information if applicable } } ``` ### Response #### Success Response (200) - **accountId** (string) - The unique identifier for the newly created account. - **status** (string) - The current status of the onboarding process. #### Response Example ```json { "accountId": "acc_abcde12345", "status": "PENDING_VERIFICATION" } ``` ``` -------------------------------- ### Retrieve Cards with Query Parameters (Node.js) Source: https://docs.equalsmoney.com/openapi/em-cards/operation/findAllCards This Node.js code snippet demonstrates how to fetch card data using the 'axios' library. It constructs a URL with comprehensive query parameters for filtering and pagination, similar to the cURL and JavaScript examples. Remember to replace 'YOUR_API_KEY_HERE' with your actual API key and install axios if you haven't already (`npm install axios`). ```javascript const axios = require('axios'); async function getCards() { const url = 'https://api.equalsmoney.com/v2/cards'; const apiKey = 'YOUR_API_KEY_HERE'; const params = { accountId: 'F50091', include: 'digitalWalletSettings', state: 'ACTIVE,REPLACED', orderBy: 'asc', startDate: '2020-01-01', endDate: '2020-01-01', search: 'Cesar+Treutel', budgetId: '775596ae-2624-40af-a9dc-9756110a4a03', cardId: 'e9293471-5eb3-4dbc-916c-dbaf9e2deefd', cardIds: 'string', cardOwnerType: 'PEOPLE', personId: '775596ae-2624-40af-a9dc-9756110a4a04', personIds: 'string', limit: 200, offset: 100 }; try { const response = await axios.get(url, { headers: { 'Authorization': apiKey, 'Content-Type': 'application/json' }, params: params }); console.log(response.data); } catch (error) { console.error('Error fetching cards:', error); } } getCards(); ``` -------------------------------- ### List Addresses using Node.js Source: https://docs.equalsmoney.com/openapi/em-cis/operation/findAllAddresses Example of how to list addresses using Node.js. This code demonstrates making an HTTP GET request to the Equalsmoney API to retrieve address data. ```javascript const https = require('https'); const options = { hostname: 'api.equalsmoney.com', port: 443, path: '/v2/addresses?accountId=F50091&limit=200&offset=100&search=Cesar%2BTreutel&type=registered%2Coffice&format=iso20022', method: 'GET', headers: { 'Authorization': 'YOUR_API_KEY_HERE' } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { console.log(JSON.parse(data)); }); }); req.on('error', (error) => { console.error('Error:', error); }); req.end(); ``` -------------------------------- ### List Onboarding Applications (Node.js) Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/listApplications This Node.js code snippet illustrates how to retrieve a paginated list of onboarding applications using the 'axios' library. It constructs the API URL with query parameters and includes the necessary Authorization header. The response data is then logged to the console. ```javascript const axios = require('axios'); async function listApplicationsNode() { const apiKey = 'YOUR_API_KEY_HERE'; const limit = 200; const offset = 100; const search = 'Cesar+Treutel'; const url = `https://api.equalsmoney.com/v2/applications?limit=${limit}&offset=${offset}&search=${search}`; try { const response = await axios.get(url, { headers: { 'Authorization': apiKey } }); console.log(response.data); return response.data; } catch (error) { console.error('Error fetching applications:', error); } } listApplicationsNode(); ``` -------------------------------- ### List Addresses using JavaScript Source: https://docs.equalsmoney.com/openapi/em-cis/operation/findAllAddresses Example of how to list addresses using JavaScript. This code snippet shows how to make a GET request to the addresses endpoint with various query parameters. ```javascript fetch('https://api.equalsmoney.com/v2/addresses?accountId=F50091&limit=200&offset=100&search=Cesar%2BTreutel&type=registered%2Coffice&format=iso20022', { method: 'GET', headers: { 'Authorization': 'YOUR_API_KEY_HERE', 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Submit Onboarding Application using Node.js Source: https://docs.equalsmoney.com/openapi/em-onboarding/operation/submitApplication This snippet provides an example of submitting an onboarding application using Node.js. It uses the 'axios' library to make a POST request, including the API key in the Authorization header and an empty JSON object as the request body. ```javascript const axios = require('axios'); const applicationId = 'YOUR_APPLICATION_ID'; const apiKey = 'YOUR_API_KEY_HERE'; axios.post(`https://api.equalsmoney.com/v2/applications/${applicationId}/submit`, {}, { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error:', error); }); ```