### Authenticate with Basic Auth (Python) Source: https://docs.mercury.com/docs/getting-started Use your API key for the basic auth username and an empty string for the password. This example shows how to set up a GET request for accounts. ```python import requests token = 'secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem' req = requests.get('https://api.mercury.com/api/v1/accounts', auth=(token, '')) ``` -------------------------------- ### Authenticate with Basic Auth (Ruby) Source: https://docs.mercury.com/docs/getting-started Use your API key for the basic auth username and an empty string for the password. This example shows how to set up a GET request for accounts. ```ruby req = Net::HTTP::Get.new('https://api.mercury.com/api/v1/accounts') req.basic_auth 'secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem', '' ``` -------------------------------- ### Authenticate with Basic Auth (cURL) Source: https://docs.mercury.com/docs/getting-started Use your API key for the basic auth username and an empty string for the password. This example shows how to make a GET request for accounts. ```bash curl --user secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem: ``` -------------------------------- ### Authenticate with Bearer Token (cURL) Source: https://docs.mercury.com/docs/getting-started Specify the token via a standard Authorization header with 'Bearer' authentication. This example shows how to make a GET request for accounts. ```bash curl -H "Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem" ``` -------------------------------- ### Get Users Paginated Forward Source: https://docs.mercury.com/reference/getusers Retrieves the next page of users using the 'start_after' parameter. Provide the userId of the last user from the previous page to get subsequent results. ```bash curl -X GET \ 'https://api.mercury.com/users?start_after=a1b2c3d4-e5f6-7890-1234-567890abcdef' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Successful Response for Get Account by ID Source: https://docs.mercury.com/reference This is an example of a successful JSON response (200 OK) when retrieving account details. It includes various fields like account number, balances, and status. ```json { "accountNumber": "string", "availableBalance": 0, "canReceiveTransactions": true, "createdAt": "2016-07-22T00:00:00Z", "currentBalance": 0, "dashboardLink": "string", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "kind": "string", "legalBusinessName": "string", "name": "string", "nickname": "string", "routingNumber": "string", "status": "active", "type": "mercury" } ``` -------------------------------- ### Get Users Source: https://docs.mercury.com/reference/getusers Retrieves a paginated list of users. You can control the number of users returned, specify a starting point for pagination, or an ending point for reverse pagination. The results can be ordered in ascending or descending format. ```APIDOC ## GET /users ### Description Retrieves a paginated list of users. You can control the number of users returned, specify a starting point for pagination, or an ending point for reverse pagination. The results can be ordered in ascending or descending format. ### Method GET ### Endpoint /users ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000 - **start_after** (string) - Optional - The ID of the user to start the page after (exclusive). When provided, results will begin with the user immediately following this ID. Use this for standard forward pagination to get the next page of results. Cannot be combined with end_before. - **end_before** (string) - Optional - The ID of the user to end the page before (exclusive). When provided, results will end just before this ID and work backwards. Use this for reverse pagination or to retrieve previous pages. Cannot be combined with start_after. - **order** (string) - Optional - Specifies the order of the results. Allowed values: "asc" (ascending) or "desc" (descending). Defaults to "asc". ### Response #### Success Response (200) - **users** (array) - List of users in the current page. Each user object contains `userId`, `firstName`, `lastName`, `email`, and `organizationRole`. - **page** (object) - Pagination information including cursors for navigating to next/previous pages. Contains `nextPage` and `previousPage` user IDs. ### Response Example ```json { "users": [ { "userId": "123e4567-e89b-12d3-a456-426614174000", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "organizationRole": "administrator" } ], "page": { "nextPage": "123e4567-e89b-12d3-a456-426614174001", "previousPage": null } } ``` ``` -------------------------------- ### Get Users Paginated Backward Source: https://docs.mercury.com/reference/getusers Fetches the previous page of users using the 'end_before' parameter. Provide the userId of the first user from the current page to get preceding results. ```bash curl -X GET \ 'https://api.mercury.com/users?end_before=a1b2c3d4-e5f6-7890-1234-567890abcdef' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Get Customer OpenAPI Definition Source: https://docs.mercury.com/reference/getcustomer This snippet shows the OpenAPI definition for the 'Get a customer' endpoint. It details the response schema for a successful request (200) and the error response for a not found scenario (404). ```json { "application/json": { "schema": { "$ref": "#/components/schemas/ApiV1ArCustomerResponseData" } } }, "description": "" }, "404": { "description": "`customerId` not found" } }, "summary": "Get a customer", "tags": [ "Customers" ] } } ], "security": [ { "bearerAuth": [] } ], "servers": [ { "description": "Mercury API URL", "url": "https://api.mercury.com/api/v1" } ], "tags": [ { "description": "Manage customers", "name": "Customers" } ] } ``` -------------------------------- ### Get Customer Source: https://docs.mercury.com/reference/getcustomer Retrieves the details of a specific customer by their ID. ```APIDOC ## GET /customers/{customerId} ### Description Retrieves the details of a specific customer. ### Method GET ### Endpoint /customers/{customerId} ### Parameters #### Path Parameters - **customerId** (string) - Required - The unique identifier of the customer. ### Response #### Success Response (200) - **application/json** - Schema: ApiV1ArCustomerResponseData #### Error Response - **404** - `customerId` not found ``` -------------------------------- ### Get Users Sorted Ascending Source: https://docs.mercury.com/reference/getusers Retrieves users sorted in ascending order. This is the default sorting behavior. ```bash curl -X GET \ 'https://api.mercury.com/users?order=asc' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Get all users Source: https://docs.mercury.com/reference/getusers Retrieves a paginated list of users. Supports sorting by creation date and filtering by user ID. ```APIDOC ## GET /users ### Description Get all users. ### Method GET ### Endpoint /users ### Query Parameters - **order** (string) - Optional - Sort order. Can be 'asc' or 'desc'. Defaults to 'asc' - **end_before** (string) - Optional - Filter users created before this ID. - **start_after** (string) - Optional - Filter users created after this ID. - **limit** (integer) - Optional - Maximum number of users to return. ### Response #### Success Response (200) - **users** (array) - A list of user objects. - **has_more** (boolean) - Indicates if there are more users to fetch. #### Response Example { "users": [ { "id": "user_123", "name": "John Doe", "email": "john.doe@example.com" } ], "has_more": true } ``` -------------------------------- ### Prevent Token Expiration (cURL) Source: https://docs.mercury.com/docs/getting-started Accessing any endpoint with your token will prevent it from expiring due to inactivity. This example shows a GET request for accounts. ```bash curl https://api.mercury.com/api/v1/accounts --header 'accept: application/json' --header "Authorization: Bearer TOKEN" ``` -------------------------------- ### Create Customer Source: https://docs.mercury.com/reference/createcustomer Creates a new customer with their name, email, and optional address details. ```APIDOC ## POST /websites/mercury/api/v1/ar/customers ### Description Creates a new customer record. ### Method POST ### Endpoint /websites/mercury/api/v1/ar/customers ### Parameters #### Request Body - **name** (string) - Required - The name of the customer. - **email** (Email) - Required - The email address for the customer. - **address** (ApiV1ArCustomerAddressInput) - Optional - The address for the customer. ### Request Example ```json { "name": "John Doe", "email": "john.doe@example.com", "address": { "name": "John Doe", "address1": "123 Main St", "address2": null, "city": "Anytown", "region": "CA", "postalCode": "90210", "country": "US" } } ``` ### Response #### Success Response (200) - **address** (ApiV1ArCustomerAddress) - Address of customer. - **deletedAt** (UTCTime) - The time the customer was deleted, if it was deleted. - **email** (Email) - Email of customer. - **name** (string) - Name of customer. - **id** (string) - The unique identifier for the customer. - **createdAt** (UTCTime) - The time the customer was created. - **updatedAt** (UTCTime) - The time the customer was last updated. ``` -------------------------------- ### Update Customer Request Example Source: https://docs.mercury.com/reference/updatecustomer This snippet shows how to make a POST request to update an existing customer. It includes the customer ID in the path and the updated customer data in the request body. ```bash curl -X POST \ 'https://api.mercury.com/api/v1/ar/customers/a1b2c3d4-e5f6-7890-1234-567890abcdef' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -d '{ "name": "Updated Customer Name", "email": "updated.customer@example.com", "resendOpenInvoices": true }' ``` -------------------------------- ### Submit Onboarding Data Source: https://docs.mercury.com/reference/submitonboardingdata-1 This endpoint allows for the submission of comprehensive onboarding data, including detailed information about beneficial owners. ```APIDOC ## POST /websites/mercury/onboarding/data ### Description Submits onboarding data for a new entity, including details about beneficial owners. ### Method POST ### Endpoint /websites/mercury/onboarding/data ### Request Body - **applicationType** (APIApplicationType) - Required - The type of application being submitted. - **beneficialOwners** (array of APIBeneficialOwner) - Optional - A list of beneficial owners associated with the entity. ### Request Example { "applicationType": "PendingEINApplication", "beneficialOwners": [ { "address1": "123 Main St", "address2": null, "citizenshipStatus": "US Citizen", "city": "Anytown", "country": "US", "dateOfBirth": "1990-01-01", "email": "owner@example.com", "firstName": "John", "identificationBlob": "base64encodedstring", "identificationType": "Passport", "isPep": false, "jobTitle": "CEO", "lastName": "Doe", "otherJobTitle": null, "percentOwnership": 50.00, "phoneNumber": "555-1234", "postalCode": "12345", "region": "CA", "socialProfileLinks": [ "http://linkedin.com/johndoe" ], "state": "CA" } ] } ### Response #### Success Response (200) - **message** (string) - A success message indicating the data was submitted. #### Response Example { "message": "Onboarding data submitted successfully." } ``` -------------------------------- ### Submit Onboarding Data Source: https://docs.mercury.com/reference/submitonboardingdata-1 Submits onboarding data for a new business. This endpoint allows you to provide details about the business, its legal structure, and beneficial owners. It returns a signup link and an onboarding data ID. ```APIDOC ## POST /onboarding ### Description Submits onboarding data for a new business. This endpoint allows you to provide details about the business, its legal structure, and beneficial owners. It returns a signup link and an onboarding data ID. ### Method POST ### Endpoint /onboarding ### Request Body - **partner** (string) - Required - The partner identifier. - **beneficialOwners** (array) - Required - A list of beneficial owners. Minimum of 1 owner required. - Each item should conform to the APIBeneficialOwner schema. - **businessContactDetails** (APIBusinessContactDetails) - Optional - Details about the business contact. - **businessLegalAddress** (APIBusinessAddress) - Optional - The legal address of the business. - **businessPhysicalAddress** (APIBusinessAddress) - Optional - The physical address of the business. - **formationDetails** (APIFormationDetails) - Optional - Details about the business formation. - **inviteEmail** (Email) - Optional - The email address to invite. - **webhookURL** (string) - Optional - The URL for webhook notifications. ### Response #### Success Response (200) - **onboardingDataId** (ExternalOnboardingDataId) - The unique identifier for the submitted onboarding data. - **signupLink** (string) - A link for the user to complete the signup process. #### Response Example { "onboardingDataId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "signupLink": "https://mercury.com/signup?token=..." } ``` -------------------------------- ### Submit Onboarding Data Source: https://docs.mercury.com/reference/submitonboardingdata-1 Submits comprehensive onboarding data for a business, including details about the company, its operations, contact information, and formation documents. ```APIDOC ## POST /websites/mercury/onboarding ### Description Submits onboarding data for a business. ### Method POST ### Endpoint /websites/mercury/onboarding ### Parameters #### Request Body - **about** (APIOnboardingDataAbout) - Optional - Information about the business, including legal name, description, industry, website, and countries of operation. - **applicationType** (APIApplicationType) - Optional - The type of application being submitted. - **businessAddress** (APIBusinessAddress) - Optional - The primary business address. - **businessContactDetails** (APIBusinessContactDetails) - Optional - Contact details for the business. - **formationDetails** (APIFormationDetails) - Required - Details regarding the business's formation, including federal EIN, formation documents, company structure, and origin country. ### Request Example { "about": { "legalBusinessName": "Example Corp", "industry": "Technology", "website": "https://example.com", "countriesOfOperations": ["US"] }, "applicationType": "NEW", "businessAddress": { "address1": "123 Main St", "city": "Anytown", "postalCode": "12345", "country": "US", "region": "CA" }, "businessContactDetails": { "phoneNumber": "+15551234567", "address1": "123 Main St", "city": "Anytown", "postalCode": "12345", "country": "US", "state": "CA" }, "formationDetails": { "federalEin": { "value": "XX-XXXXXXX" }, "formationDocumentFileBlob": { "value": "base64encodedfilecontent" }, "companyStructure": "LLC", "companyOriginCountry": "US" } } ### Response #### Success Response (200) (No specific success response schema provided in the source text.) #### Response Example (No example response provided in the source text.) ``` -------------------------------- ### Get Account Statements Source: https://docs.mercury.com/reference/getaccountstatements Retrieves a paginated list of monthly statements for a specific account. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters, as well as date range filtering with start and end parameters. ```APIDOC ## GET /account/{accountId}/statements ### Description Retrieve a paginated list of monthly statements for a specific account. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters, as well as date range filtering with start and end parameters. ### Method GET ### Endpoint /account/{accountId}/statements ### Parameters #### Path Parameters - **accountId** (string) - Required - ID for a Mercury account. #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000 - **order** (string) - Optional - Sort order. Can be 'asc' or 'desc'. Defaults to 'desc' - **start_after** (string) - Optional - The ID of the statement to start the page after (exclusive). When provided, results will begin with the statement immediately following this ID. Use this for standard forward pagination to get the next page of results. Cannot be combined with end_before. - **end_before** (string) - Optional - The ID of the statement to end the page before (exclusive). When provided, results will end just before this ID and work backwards. Use this for reverse pagination or to retrieve previous pages. Cannot be combined with start_after. - **start** (string) - Optional - Filter statements where the period start date is on or after this date. Format: YYYY-MM-DD - **end** (string) - Optional - Filter statements where the period start date is on or before this date. If the date is in the future, defaults to the current date. Format: YYYY-MM-DD ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "response body" } ERROR HANDLING: - 400: Invalid `end` or `start` or `end_before` or `start_after` or `order` or `limit` - 404: `accountId` not found ``` -------------------------------- ### OpenAPI Definition for Get Attachment Source: https://docs.mercury.com/reference/getattachment This OpenAPI definition outlines the GET /ar/attachments/{attachmentId} endpoint, including request parameters and response structure. ```json { "components": { "schemas": { "ApiV1ArAttachmentResponseData": { "description": " The object representing a file attachment for an invoice.\n The file is not a part of this object itself but information\n for where to download it will be in this object.", "properties": { "fileName": { "description": " The filename for the file.", "type": "string" }, "id": { "allOf": [ { "$ref": "#/components/schemas/AttachmentId" }, { "description": " The ID of the attachment object." } ] }, "url": { "description": " The signed download URL for the file itself.", "type": "string" } }, "required": [ "id", "url", "fileName" ], "type": "object" }, "AttachmentId": { "description": "ID for the attachment.", "format": "uuid", "type": "string" } }, "securitySchemes": { "bearerAuth": { "description": "Bearer token authentication for Mercury API.\n\nUse your API token in the Authorization header:\n`Authorization: Bearer TOKEN`\n\nExample:\n`Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem`\n\nYour Mercury API token should include the 'secret-token:' prefix.\nTokens can be generated from your Mercury dashboard settings.\n", "scheme": "bearer", "type": "http" } } }, "info": { "description": "Streamline financial tasks with secure account management and transaction processing. Enables user registration, balance tracking, and payment handling.", "title": "Mercury API", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/ar/attachments/{attachmentId}": { "get": { "description": "Retrieve attachment details including download URL", "operationId": "getAttachment", "parameters": [ { "in": "path", "name": "attachmentId", "required": true, "schema": { "description": "ID for the attachment.", "format": "uuid", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiV1ArAttachmentResponseData" } } }, "description": "" }, "404": { "description": "`attachmentId` not found" } }, "summary": "Get an attachment", "tags": [ "Invoices" ] } } }, "security": [ { "bearerAuth": [] } ], "servers": [ { "description": "Mercury API URL", "url": "https://api.mercury.com/api/v1" } ], "tags": [ { "description": "Manage invoices", "name": "Invoices" } ] } ``` -------------------------------- ### OpenAPI Definition for Get Account Source: https://docs.mercury.com/reference/getaccount This OpenAPI definition outlines the structure for retrieving an account by its ID. It includes the schema for the Account object and the GET request details. ```json { "components": { "schemas": { "Account": { "properties": { "accountNumber": { "type": "string" }, "availableBalance": { "multipleOf": 0.01, "type": "number" }, "canReceiveTransactions": { "nullable": true, "type": "boolean" }, "createdAt": { "allOf": [ { "$ref": "#/components/schemas/UTCTime" } ] }, "currentBalance": { "multipleOf": 0.01, "type": "number" }, "dashboardLink": { "type": "string" }, "id": { "allOf": [ { "$ref": "#/components/schemas/TransactionPartyId" } ] }, "kind": { "type": "string" }, "legalBusinessName": { "type": "string" }, "name": { "type": "string" }, "nickname": { "nullable": true, "type": "string" }, "routingNumber": { "type": "string" }, "status": { "allOf": [ { "$ref": "#/components/schemas/AccountStatus" } ] }, "type": { "allOf": [ { "$ref": "#/components/schemas/AccountType" } ] } }, "required": [ "id", "accountNumber", "routingNumber", "name", "status", "type", "createdAt", "availableBalance", "currentBalance", "kind", "legalBusinessName", "dashboardLink" ], "type": "object" }, "AccountStatus": { "enum": [ "active", "deleted", "pending", "archived" ], "type": "string" }, "AccountType": { "enum": [ "mercury", "external", "recipient" ], "type": "string" }, "TransactionPartyId": { "description": "ID for a Mercury account.", "format": "uuid", "type": "string" }, "UTCTime": { "example": "2016-07-22T00:00:00Z", "format": "yyyy-mm-ddThh:MM:ssZ", "type": "string" } }, "securitySchemes": { "bearerAuth": { "description": "Bearer token authentication for Mercury API.\n\nUse your API token in the Authorization header:\n`Authorization: Bearer TOKEN`\n\nExample:\n`Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem`\n\nYour Mercury API token should include the 'secret-token:' prefix.\nTokens can be generated from your Mercury dashboard settings.\n", "scheme": "bearer", "type": "http" } } }, "info": { "description": "Streamline financial tasks with secure account management and transaction processing. Enables user registration, balance tracking, and payment handling.", "title": "Mercury API", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/account/{accountId}": { "get": { "operationId": "getAccount", "parameters": [ { "in": "path", "name": "accountId", "required": true, "schema": { "description": "ID for a Mercury account.", "format": "uuid", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } }, "description": "" }, "404": { "description": "`accountId` not found" } }, "summary": "Get account by ID", "tags": [ "Accounts" ] } } }, "security": [ { "bearerAuth": [] } ], "servers": [ { "description": "Mercury API URL", "url": "https://api.mercury.com/api/v1" } ], "tags": [ { "description": "Manage bank accounts", "name": "Accounts" } ] } ``` -------------------------------- ### Get Users with Custom Limit Source: https://docs.mercury.com/reference/getusers Fetches a specific number of users by setting the 'limit' query parameter. The limit can range from 1 to 1000. ```bash curl -X GET \ 'https://api.mercury.com/users?limit=50' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### Start OAuth2 Web Flow Source: https://docs.mercury.com/reference/startoauth2flow Initiates the OAuth2 authorization flow. Redirects the user to Mercury's consent page. ```APIDOC ## GET /oauth2/auth ### Description Initiates the OAuth2 authorization flow. Redirects the user to Mercury's consent page. ### Method GET ### Endpoint https://oauth2.mercury.com/oauth2/auth ### Parameters #### Query Parameters - **client_id** (string) - Required - The client ID you received from Mercury when you registered the client. - **redirect_uri** (string) - Required - The URL in your application where users will be sent after authorization. Must match one of the URLs registered with the client. - **scope** (string) - Optional - A space-separated list of scopes that your client requests. - **state** (string) - Optional - An unguessable random string, at least 8 characters long, used to protect against cross-site request forgery attacks. - **response_type** (string) - Required - Tells the authorization server which type of grant to execute. Must have value "code". - **code_challenge** (string) - Optional - Required for clients with PKCE flow. Base64-URL-encoded string of the SHA256 hash of the code verifier. - **code_challenge_method** (string) - Optional - Required for clients with PKCE flow. Must have value S256, the SHA256 function used to hash the code challenge. ### Response #### Success Response (302) - **Location** (string) - The URL to redirect the user to for consent. #### Error Response (400) - Invalid `code_challenge_method` or `code_challenge` or `response_type` or `state` or `scope` or `redirect_uri` or `client_id` ``` -------------------------------- ### Get Users with Default Pagination Source: https://docs.mercury.com/reference/getusers Retrieves a list of users with the default limit of 1000. This is useful for fetching all users when no specific pagination is required. ```bash curl -X GET \ 'https://api.mercury.com/users' \ -H 'Authorization: Bearer YOUR_API_TOKEN' ``` -------------------------------- ### cURL Request to Get Account by ID Source: https://docs.mercury.com/reference This snippet shows how to make a GET request to the Mercury API to retrieve account details using cURL. Ensure you have the correct account ID. ```shell curl --request GET \ --url https://api.mercury.com/api/v1/account/accountId \ --header 'accept: application/json' ``` -------------------------------- ### Retrieve Accounts with Pagination Source: https://docs.mercury.com/reference/getaccounts Fetches a paginated list of accounts. Supports cursor-based pagination using limit, order, start_after, and end_before query parameters. Defaults to 1000 results if limit is not specified. ```json { "components": { "schemas": { "Account": { "properties": { "accountNumber": { "type": "string" }, "availableBalance": { "multipleOf": 0.01, "type": "number" }, "canReceiveTransactions": { "nullable": true, "type": "boolean" }, "createdAt": { "allOf": [ { "$ref": "#/components/schemas/UTCTime" } ] }, "currentBalance": { "multipleOf": 0.01, "type": "number" }, "dashboardLink": { "type": "string" }, "id": { "allOf": [ { "$ref": "#/components/schemas/TransactionPartyId" } ] }, "kind": { "type": "string" }, "legalBusinessName": { "type": "string" }, "name": { "type": "string" }, "nickname": { "nullable": true, "type": "string" }, "routingNumber": { "type": "string" }, "status": { "allOf": [ { "$ref": "#/components/schemas/AccountStatus" } ] }, "type": { "allOf": [ { "$ref": "#/components/schemas/AccountType" } ] } }, "required": [ "id", "accountNumber", "routingNumber", "name", "status", "type", "createdAt", "availableBalance", "currentBalance", "kind", "legalBusinessName", "dashboardLink" ], "type": "object" }, "AccountStatus": { "enum": [ "active", "deleted", "pending", "archived" ], "type": "string" }, "AccountType": { "enum": [ "mercury", "external", "recipient" ], "type": "string" }, "AccountsPaginatedResponse": { "description": " Paginated response containing a list of accounts.\n | Use the page cursor information to fetch additional pages of accounts.", "properties": { "accounts": { "description": " List of accounts in the current page", "items": { "$ref": "#/components/schemas/Account" }, "type": "array" }, "page": { "description": " Pagination information including cursors for navigating to next/previous pages", "properties": { "nextPage": { "$ref": "#/components/schemas/TransactionPartyId" }, "previousPage": { "$ref": "#/components/schemas/TransactionPartyId" } }, "type": "object" } }, "required": [ "accounts", "page" ], "type": "object" }, "TransactionPartyId": { "description": "ID for a Mercury account.", "format": "uuid", "type": "string" }, "UTCTime": { "example": "2016-07-22T00:00:00Z", "format": "yyyy-mm-ddThh:MM:ssZ", "type": "string" } }, "securitySchemes": { "bearerAuth": { "description": "Bearer token authentication for Mercury API.\n\nUse your API token in the Authorization header:\n`Authorization: Bearer TOKEN`\n\nExample:\n`Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem`\n\nYour Mercury API token should include the 'secret-token:' prefix.\nTokens can be generated from your Mercury dashboard settings.\n", "scheme": "bearer", "type": "http" } } }, "info": { "description": "Streamline financial tasks with secure account management and transaction processing. Enables user registration, balance tracking, and payment handling.", "title": "Mercury API", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/accounts": { "get": { "description": "Retrieve a paginated list of accounts. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters.", "operationId": "getAccounts", "parameters": [ { "in": "query", "name": "limit", "required": false, "schema": { "default": 1000, "description": "Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000", "format": "int64", "maximum": 1000, "minimum": 1, "type": "integer" } }, { "in": "query", "name": "order", "required": false, "schema": { "default": "asc", "enum": [ "asc", "desc" ], "type": "string" } }, { "in": "query", "name": "start_after", "required": false, "schema": { "$ref": "#/components/schemas/TransactionPartyId" } }, { "in": "query", "name": "end_before", "required": false, "schema": { "$ref": "#/components/schemas/TransactionPartyId" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountsPaginatedResponse" } } }, "description": "OK" } } } } } } ``` -------------------------------- ### Submit Onboarding Data Source: https://docs.mercury.com/reference/submitonboardingdata-1 Submit onboarding data for applicants to pre-fill their Mercury application. ```APIDOC ## POST /submit-onboarding-data ### Description Submit onboarding data for applicants to pre-fill their Mercury application. ### Method POST ### Endpoint https://api.mercury.com/api/v1/submit-onboarding-data ### Request Body - **body** (object) - Required - The onboarding data parameters. ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "response body" } ``` -------------------------------- ### Get Organization Source: https://docs.mercury.com/reference/getorganization Fetches information about an organization. ```APIDOC ## GET /organizations/{organizationId} ### Description Retrieves information about a specific organization. ### Method GET ### Endpoint /organizations/{organizationId} ### Parameters #### Path Parameters - **organizationId** (string) - Required - The unique identifier of the organization. ### Response #### Success Response (200) - **OrganizationResponse** (object) - Contains the details of the organization. ### Response Example ```json { "$ref": "#/components/schemas/OrganizationResponse" } ``` ``` -------------------------------- ### List Customers Source: https://docs.mercury.com/reference/listcustomers Retrieves a paginated list of customers. You can control the number of results, sort order, and pagination using `start_after` and `end_before` parameters. ```APIDOC ## GET /ar/customers ### Description Retrieve a paginated list of customers. Supports cursor-based pagination with limit, order, start_after, and end_before query parameters. ### Method GET ### Endpoint /ar/customers ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return. Allowed range: 1 to 1000. Defaults to 1000 - **start_after** (string) - Optional - The ID of the customer to start the page after (exclusive). When provided, results will begin with the customer immediately following this ID. Use this for standard forward pagination to get the next page of results. Cannot be combined with end_before. - **end_before** (string) - Optional - The ID of the customer to end the page before (exclusive). When provided, results will end just before this ID and work backwards. Use this for reverse pagination or to retrieve previous pages. Cannot be combined with start_after. - **order** (string) - Optional - Sort order. Can be 'asc' or 'desc'. Defaults to 'asc' ### Response #### Success Response (200) - The response schema is defined by `#/components/schemas/ApiV1ArCustomerPaginatedResponseData`. #### Error Response (400) - Invalid `order` or `end_before` or `start_after` or `limit` ``` -------------------------------- ### OpenAPI Definition for Get Invoice PDF Source: https://docs.mercury.com/reference/getinvoicepdf This OpenAPI definition outlines the GET endpoint for downloading an invoice PDF. It specifies the path parameter `invoiceId`, the expected `200 OK` response with a PDF document and `Content-Disposition` header, and the `404 Not Found` error. ```json { "components": { "schemas": { "PDFDocument": { "format": "binary", "type": "string" } }, "securitySchemes": { "bearerAuth": { "description": "Bearer token authentication for Mercury API.\n\nUse your API token in the Authorization header:\n`Authorization: Bearer TOKEN`\n\nExample:\n`Authorization: Bearer secret-token:mercury_production_wma_24SCp4G81X3yHL4Wq8FgzuaP9ye3VKf2mgTDctXyRg5HY_yrucrem`\n\nYour Mercury API token should include the 'secret-token:' prefix.\nTokens can be generated from your Mercury dashboard settings.", "scheme": "bearer", "type": "http" } } }, "info": { "description": "Streamline financial tasks with secure account management and transaction processing. Enables user registration, balance tracking, and payment handling.", "title": "Mercury API", "version": "1.0.0" }, "openapi": "3.0.0", "paths": { "/ar/invoices/{invoiceId}/pdf": { "get": { "description": "Downloads a PDF file for the specified invoice. The response includes a Content-Disposition header set to 'attachment' with the filename.", "operationId": "getInvoicePdf", "parameters": [ { "in": "path", "name": "invoiceId", "required": true, "schema": { "description": "ID for the invoice.", "format": "uuid", "type": "string" } } ], "responses": { "200": { "content": { "application/pdf": { "schema": { "$ref": "#/components/schemas/PDFDocument" } } }, "description": "", "headers": { "Content-Disposition": { "schema": { "type": "string" } } } }, "404": { "description": "`invoiceId` not found" } }, "summary": "Download invoice PDF", "tags": [ "Invoices" ] } } }, "security": [ { "bearerAuth": [] } ], "servers": [ { "description": "Mercury API URL", "url": "https://api.mercury.com/api/v1" } ], "tags": [ { "description": "Manage invoices", "name": "Invoices" } ] } ``` -------------------------------- ### Get Transaction By ID Source: https://docs.mercury.com/reference/gettransactionbyid Fetches a transaction by its unique identifier. ```APIDOC ## GET /transactions/{transactionId} ### Description Retrieves the details of a specific transaction using its ID. ### Method GET ### Endpoint /transactions/{transactionId} ### Parameters #### Path Parameters - **transactionId** (string) - Required - The unique identifier of the transaction. ### Response #### Success Response (200) - **TransactionMetadataId** (string) - ID for this transaction - **TransactionType** (string) - The type of the transaction. - **TransactionStatus** (string) - The current status of the transaction. - **TransactionRelationKind** (string) - The kind of relation this transaction has to another. - **TransactionPartyId** (string) - ID for a Mercury account. - **TransactionMethodData** (object) - Data related to the transaction method. - **address** (object) - Address data. - **creditCardInfo** (object) - Credit card information. - **debitCardInfo** (object) - Debit card information. - **domesticWireRoutingInfo** (object) - Domestic wire routing information. - **electronicRoutingInfo** (object) - Electronic routing information. - **internationalWireRoutingInfo** (object) - International wire routing information. #### Response Example { "TransactionMetadataId": "123e4567-e89b-12d3-a456-426614174000", "TransactionType": "creditCardTransaction", "TransactionStatus": "sent", "TransactionRelationKind": "ProvisionalCreditReversalToMerchantRefund", "TransactionPartyId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "TransactionMethodData": { "creditCardInfo": { "lastFour": "1234" } } } ```