# Stack API Reference

Source: https://docs.formance.com/stack-api-reference

Stack: v3.2

The Formance Platform exposes a unified REST API across all modules. All endpoints use JSON for request and response bodies, and authentication is handled via OAuth2 bearer tokens.

```bash
export FORMANCE_API_URL="https://<your-stack>.sandbox.formance.cloud"
export FORMANCE_TOKEN=$(fctl cloud generate-personal-token)
```

<a id="auth-getOIDCWellKnowns"></a>

### GET /api/auth/.well-known/openid-configuration

Get OpenID Configuration

Retrieve the OpenID Connect discovery document containing authorization server metadata.

This endpoint returns configuration information including:

- Token endpoint URLs
- Supported scopes and grant types
- Signing algorithms
- JWKS URI for token verification

See the [OpenID Connect Discovery spec](https://openid.net/specs/openid-connect-discovery-1_0.html) for more details.

```json
{
  "method": "GET",
  "path": "/api/auth/.well-known/openid-configuration",
  "summary": "Get OpenID Configuration",
  "description": "Retrieve the OpenID Connect discovery document containing authorization server metadata.\n\nThis endpoint returns configuration information including:\n- Token endpoint URLs\n- Supported scopes and grant types\n- Signing algorithms\n- JWKS URI for token verification\n\nSee the [OpenID Connect Discovery spec](https://openid.net/specs/openid-connect-discovery-1_0.html) for more details.\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "responses": [
    {
      "code": "200",
      "description": "OpenID provider configuration"
    }
  ]
}
```

<a id="auth-getServerInfo"></a>

### GET /api/auth/\_info

Get Server Info

Retrieve server version and status information.

```json
{
  "method": "GET",
  "path": "/api/auth/_info",
  "summary": "Get Server Info",
  "description": "Retrieve server version and status information.",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="auth-listClients"></a>

### GET /api/auth/clients

List Clients

List all OAuth2/OIDC clients registered in the system.

**What is a Client?**
A client is an application that can request tokens to access Formance APIs. Each client has credentials (ID and secrets) used for authentication.

**Client Types:**

- **Confidential**: Server-side apps that can securely store secrets
- **Public**: Mobile/SPA apps that cannot store secrets securely

```json
{
  "method": "GET",
  "path": "/api/auth/clients",
  "summary": "List Clients",
  "description": "List all OAuth2/OIDC clients registered in the system.\n\n**What is a Client?**\nA client is an application that can request tokens to access Formance APIs. Each client has credentials (ID and secrets) used for authentication.\n\n**Client Types:**\n- **Confidential**: Server-side apps that can securely store secrets\n- **Public**: Mobile/SPA apps that cannot store secrets securely\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "responses": [
    {
      "code": "200",
      "description": "List of clients",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListClientsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of Client"
          }
        ]
      }
    }
  ]
}
```

<a id="auth-createClient"></a>

### POST /api/auth/clients

Create Client

Create a new OAuth2/OIDC client.

**Example: Create a Server-Side Application Client**

```json
{
  "name": "My Backend Service",
  "public": false,
  "description": "Backend service for processing payments",
  "redirectUris": ["https://myapp.com/callback"],
  "postLogoutRedirectUris": ["https://myapp.com/logout"],
  "scopes": ["ledger:read", "ledger:write", "payments:read"]
}
```

After creation, you'll need to create a secret for the client using the Create Secret endpoint.

````json
{
  "method": "POST",
  "path": "/api/auth/clients",
  "summary": "Create Client",
  "description": "Create a new OAuth2/OIDC client.\n\n**Example: Create a Server-Side Application Client**\n```json\n{\n  \"name\": \"My Backend Service\",\n  \"public\": false,\n  \"description\": \"Backend service for processing payments\",\n  \"redirectUris\": [\"https://myapp.com/callback\"],\n  \"postLogoutRedirectUris\": [\"https://myapp.com/logout\"],\n  \"scopes\": [\"ledger:read\", \"ledger:write\", \"payments:read\"]\n}\n```\n\nAfter creation, you'll need to create a secret for the client using the Create Secret endpoint.\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The client configuration.\n",
    "schema": {
      "type": "object",
      "ref": "CreateClientRequest",
      "properties": [
        {
          "name": "public",
          "type": "boolean"
        },
        {
          "name": "redirectUris",
          "type": "array of string"
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "trusted",
          "type": "boolean"
        },
        {
          "name": "postLogoutRedirectUris",
          "type": "array of string"
        },
        {
          "name": "metadata",
          "type": "Metadata"
        },
        {
          "name": "scopes",
          "type": "array of string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Client created successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateClientResponse",
        "properties": [
          {
            "name": "data",
            "type": "Client"
          }
        ]
      }
    }
  ]
}
````

<a id="auth-readClient"></a>

### GET /api/auth/clients/{clientId}

Read Client

Retrieve details of a specific OAuth2 client.

**Response includes:**

- Client ID and name
- Public/confidential status
- Redirect URIs
- Authorized scopes
- Associated secrets (IDs only, not values)

```json
{
  "method": "GET",
  "path": "/api/auth/clients/{clientId}",
  "summary": "Read Client",
  "description": "Retrieve details of a specific OAuth2 client.\n\n**Response includes:**\n- Client ID and name\n- Public/confidential status\n- Redirect URIs\n- Authorized scopes\n- Associated secrets (IDs only, not values)\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "pathParams": [
    {
      "name": "clientId",
      "description": "Client ID"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Client details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReadClientResponse",
        "properties": [
          {
            "name": "data",
            "type": "Client"
          }
        ]
      }
    }
  ]
}
```

<a id="auth-updateClient"></a>

### PUT /api/auth/clients/{clientId}

Update Client

Update an OAuth2 client's configuration.

You can update:

- Name and description
- Public/confidential status
- Redirect URIs
- Post-logout redirect URIs
- Authorized scopes

```json
{
  "method": "PUT",
  "path": "/api/auth/clients/{clientId}",
  "summary": "Update Client",
  "description": "Update an OAuth2 client's configuration.\n\nYou can update:\n- Name and description\n- Public/confidential status\n- Redirect URIs\n- Post-logout redirect URIs\n- Authorized scopes\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "pathParams": [
    {
      "name": "clientId",
      "description": "Client ID"
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "description": "The updated client configuration.\n",
    "schema": {
      "type": "object",
      "ref": "UpdateClientRequest",
      "properties": [
        {
          "name": "public",
          "type": "boolean"
        },
        {
          "name": "redirectUris",
          "type": "array of string"
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "trusted",
          "type": "boolean"
        },
        {
          "name": "postLogoutRedirectUris",
          "type": "array of string"
        },
        {
          "name": "metadata",
          "type": "Metadata"
        },
        {
          "name": "scopes",
          "type": "array of string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Client updated successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "UpdateClientResponse",
        "properties": [
          {
            "name": "data",
            "type": "Client"
          }
        ]
      }
    }
  ]
}
```

<a id="auth-deleteClient"></a>

### DELETE /api/auth/clients/{clientId}

Delete Client

Delete an OAuth2 client.

**Warning:** This will:

- Revoke all existing tokens for this client
- Delete all associated secrets
- Prevent any future authentication attempts

This action cannot be undone.

```json
{
  "method": "DELETE",
  "path": "/api/auth/clients/{clientId}",
  "summary": "Delete Client",
  "description": "Delete an OAuth2 client.\n\n**Warning:** This will:\n- Revoke all existing tokens for this client\n- Delete all associated secrets\n- Prevent any future authentication attempts\n\nThis action cannot be undone.\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "pathParams": [
    {
      "name": "clientId",
      "description": "Client ID"
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "Client deleted successfully"
    }
  ]
}
```

<a id="auth-createSecret"></a>

### POST /api/auth/clients/{clientId}/secrets

Create Secret

Create a new secret for an OAuth2 client.

**Important:** The secret value is only returned once in the response. Store it securely as it cannot be retrieved later.

**Example:**

```json
{
  "name": "Production API Key",
  "metadata": {
    "environment": "production",
    "created_by": "admin"
  }
}
```

A client can have multiple secrets for rotation purposes.

````json
{
  "method": "POST",
  "path": "/api/auth/clients/{clientId}/secrets",
  "summary": "Create Secret",
  "description": "Create a new secret for an OAuth2 client.\n\n**Important:** The secret value is only returned once in the response. Store it securely as it cannot be retrieved later.\n\n**Example:**\n```json\n{\n  \"name\": \"Production API Key\",\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"created_by\": \"admin\"\n  }\n}\n```\n\nA client can have multiple secrets for rotation purposes.\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "pathParams": [
    {
      "name": "clientId",
      "description": "Client ID"
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "description": "The secret configuration.\n",
    "schema": {
      "type": "object",
      "ref": "CreateSecretRequest",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "metadata",
          "type": "Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Secret created successfully. **Save the `clear` value immediately - it cannot be retrieved again.**\n",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateSecretResponse",
        "properties": [
          {
            "name": "data",
            "type": "Secret"
          }
        ]
      }
    }
  ]
}
````

<a id="auth-deleteSecret"></a>

### DELETE /api/auth/clients/{clientId}/secrets/{secretId}

Delete Secret

Delete a client secret.

**Use Cases:**

- Rotating credentials (create new secret, update apps, delete old secret)
- Revoking compromised credentials
- Cleaning up unused secrets

After deletion, any authentication attempts using this secret will fail.

```json
{
  "method": "DELETE",
  "path": "/api/auth/clients/{clientId}/secrets/{secretId}",
  "summary": "Delete Secret",
  "description": "Delete a client secret.\n\n**Use Cases:**\n- Rotating credentials (create new secret, update apps, delete old secret)\n- Revoking compromised credentials\n- Cleaning up unused secrets\n\nAfter deletion, any authentication attempts using this secret will fail.\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Clients",
  "pathParams": [
    {
      "name": "clientId",
      "description": "Client ID"
    },
    {
      "name": "secretId",
      "description": "Secret ID"
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "Secret deleted successfully"
    }
  ]
}
```

<a id="auth-listUsers"></a>

### GET /api/auth/users

List Users

List all users registered in the authentication system.

**Response includes for each user:**

- User ID
- Email address
- Subject identifier (from identity provider)

```json
{
  "method": "GET",
  "path": "/api/auth/users",
  "summary": "List Users",
  "description": "List all users registered in the authentication system.\n\n**Response includes for each user:**\n- User ID\n- Email address\n- Subject identifier (from identity provider)\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Users",
  "responses": [
    {
      "code": "200",
      "description": "List of users",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListUsersResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of User"
          }
        ]
      }
    }
  ]
}
```

<a id="auth-readUser"></a>

### GET /api/auth/users/{userId}

Read User

Retrieve details of a specific user.

**Response includes:**

- User ID
- Email address
- Subject identifier
- Creation timestamp

```json
{
  "method": "GET",
  "path": "/api/auth/users/{userId}",
  "summary": "Read User",
  "description": "Retrieve details of a specific user.\n\n**Response includes:**\n- User ID\n- Email address\n- Subject identifier\n- Creation timestamp\n",
  "tags": [
    "auth.v1"
  ],
  "module": "Auth",
  "resourceGroup": "Users",
  "pathParams": [
    {
      "name": "userId",
      "description": "User ID"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "User details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReadUserResponse",
        "properties": [
          {
            "name": "data",
            "type": "User"
          }
        ]
      }
    }
  ]
}
```

<a id="other-getVersions"></a>

### GET /versions

Show stack version information

```json
{
  "method": "GET",
  "path": "/versions",
  "summary": "Show stack version information",
  "description": "",
  "tags": [],
  "module": "Other",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetVersionsResponse",
        "properties": [
          {
            "name": "region",
            "type": "string",
            "required": true
          },
          {
            "name": "env",
            "type": "string",
            "required": true
          },
          {
            "name": "versions",
            "type": "array of Version",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getInfo"></a>

### GET /api/ledger/\_info

Show server information

```json
{
  "method": "GET",
  "path": "/api/ledger/_info",
  "summary": "Show server information",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigInfoResponse",
        "properties": [
          {
            "name": "data",
            "type": "ConfigInfo",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getLedgerInfo"></a>

### GET /api/ledger/{ledger}/\_info

Get information about a ledger

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/_info",
  "summary": "Get information about a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "LedgerInfoResponse",
        "properties": [
          {
            "name": "data",
            "type": "LedgerInfo"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-countAccounts"></a>

### HEAD /api/ledger/{ledger}/accounts

Count the accounts from a ledger

```json
{
  "method": "HEAD",
  "path": "/api/ledger/{ledger}/accounts",
  "summary": "Count the accounts from a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "address",
      "description": "Filter accounts by address pattern (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter accounts by metadata key value pairs. The filter can be used like this metadata[key]=value1&metadata[a.nested.key]=value2",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[INSUFFICIENT_FUND] account had insufficient funds"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-listAccounts"></a>

### GET /api/ledger/{ledger}/accounts

List accounts from a ledger

List accounts from a ledger, sorted by address in descending order.

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/accounts",
  "summary": "List accounts from a ledger",
  "description": "List accounts from a ledger, sorted by address in descending order.",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page.\n",
      "required": false
    },
    {
      "name": "page_size",
      "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n",
      "required": false
    },
    {
      "name": "after",
      "description": "Pagination cursor, will return accounts after given address, in descending order.",
      "required": false
    },
    {
      "name": "address",
      "description": "Filter accounts by address pattern (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below.",
      "required": false
    },
    {
      "name": "balance",
      "description": "Filter accounts by their balance (default operator is gte)",
      "required": false
    },
    {
      "name": "balanceOperator",
      "description": "Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.\n",
      "required": false
    },
    {
      "name": "balance_operator",
      "description": "Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.\nDeprecated, please use `balanceOperator` instead.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n",
      "required": false
    },
    {
      "name": "pagination_token",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\nDeprecated, please use `cursor` instead.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "AccountsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of Account",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getAccount"></a>

### GET /api/ledger/{ledger}/accounts/{address}

Get account by its address

````json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/accounts/{address}",
  "summary": "Get account by its address",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "address",
      "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "AccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "AccountWithVolumesAndBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-addMetadataToAccount"></a>

### POST /api/ledger/{ledger}/accounts/{address}/metadata

Add metadata to an account

````json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/accounts/{address}/metadata",
  "summary": "Add metadata to an account",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "address",
      "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n"
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "metadata",
    "schema": {
      "type": "object",
      "ref": "ledgerMetadata"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[INSUFFICIENT_FUND] account had insufficient funds"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-getMapping"></a>

### GET /api/ledger/{ledger}/mapping

Get the mapping of a ledger

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/mapping",
  "summary": "Get the mapping of a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "MappingResponse",
        "properties": [
          {
            "name": "data",
            "type": "Mapping"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-updateMapping"></a>

### PUT /api/ledger/{ledger}/mapping

Update the mapping of a ledger

```json
{
  "method": "PUT",
  "path": "/api/ledger/{ledger}/mapping",
  "summary": "Update the mapping of a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "Mapping",
      "properties": [
        {
          "name": "contracts",
          "type": "array of Contract",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "MappingResponse",
        "properties": [
          {
            "name": "data",
            "type": "Mapping"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-runScript"></a>

### POST /api/ledger/{ledger}/script

Execute a Numscript

This route is deprecated, and has been merged into `POST /{ledger}/transactions`.

```json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/script",
  "summary": "Execute a Numscript",
  "description": "This route is deprecated, and has been merged into `POST /{ledger}/transactions`.\n",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "preview",
      "description": "Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "Script",
      "properties": [
        {
          "name": "plain",
          "type": "string",
          "required": true,
          "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n"
        },
        {
          "name": "vars",
          "type": "object",
          "example": {
            "user": "users:042"
          }
        },
        {
          "name": "reference",
          "type": "string",
          "description": "Reference to attach to the generated transaction",
          "example": "order_1234"
        },
        {
          "name": "metadata",
          "type": "ledgerMetadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "On success, it will return a 200 status code, and the resulting transaction under the `transaction` field.\n\nOn failure, it will also return a 200 status code, and the following fields:\n\n  - `details`: contains a URL. When there is an error parsing Numscript, the result can be difficult to read—the provided URL will render the error in an easy-to-read format.\n  - `errorCode` and `error_code` (deprecated): contains the string code of the error\n  - `errorMessage` and `error_message` (deprecated): contains a human-readable indication of what went wrong, for example that an account had insufficient funds, or that there was an error in the provided Numscript.\n",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ScriptResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "ErrorsEnum"
          },
          {
            "name": "errorMessage",
            "type": "string",
            "example": "account had insufficient funds"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          },
          {
            "name": "transaction",
            "type": "Transaction"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-readStats"></a>

### GET /api/ledger/{ledger}/stats

Get statistics from a ledger

Get statistics from a ledger. (aggregate metrics on accounts and transactions)

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/stats",
  "summary": "Get statistics from a ledger",
  "description": "Get statistics from a ledger. (aggregate metrics on accounts and transactions)\n",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "name of the ledger"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "StatsResponse",
        "properties": [
          {
            "name": "data",
            "type": "Stats",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-countTransactions"></a>

### HEAD /api/ledger/{ledger}/transactions

Count the transactions from a ledger

```json
{
  "method": "HEAD",
  "path": "/api/ledger/{ledger}/transactions",
  "summary": "Count the transactions from a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "reference",
      "description": "Filter transactions by reference field.",
      "required": false
    },
    {
      "name": "account",
      "description": "Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "source",
      "description": "Filter transactions with postings involving given account at source (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "destination",
      "description": "Filter transactions with postings involving given account at destination (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "startTime",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "start_time",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\nDeprecated, please use `startTime` instead.\n",
      "required": false
    },
    {
      "name": "endTime",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "end_time",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\nDeprecated, please use `endTime` instead.\n",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below.",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK"
    }
  ]
}
```

<a id="ledger-listTransactions"></a>

### GET /api/ledger/{ledger}/transactions

List transactions from a ledger

List transactions from a ledger, sorted by txid in descending order.

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/transactions",
  "summary": "List transactions from a ledger",
  "description": "List transactions from a ledger, sorted by txid in descending order.",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page.\n",
      "required": false
    },
    {
      "name": "page_size",
      "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n",
      "required": false
    },
    {
      "name": "after",
      "description": "Pagination cursor, will return transactions after given txid (in descending order).",
      "required": false
    },
    {
      "name": "reference",
      "description": "Find transactions by reference field.",
      "required": false
    },
    {
      "name": "account",
      "description": "Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "source",
      "description": "Filter transactions with postings involving given account at source (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "destination",
      "description": "Filter transactions with postings involving given account at destination (regular expression placed between ^ and $).",
      "required": false
    },
    {
      "name": "startTime",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "start_time",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\nDeprecated, please use `startTime` instead.\n",
      "required": false
    },
    {
      "name": "endTime",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "end_time",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\nDeprecated, please use `endTime` instead.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n",
      "required": false
    },
    {
      "name": "pagination_token",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\nDeprecated, please use `cursor` instead.\n",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below.",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransactionsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of Transaction",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-createTransaction"></a>

### POST /api/ledger/{ledger}/transactions

Create a new transaction to a ledger

```json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/transactions",
  "summary": "Create a new transaction to a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "preview",
      "description": "Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "The request body must contain at least one of the following objects:\n  - `postings`: suitable for simple transactions\n  - `script`: enabling more complex transactions with Numscript\n",
    "schema": {
      "type": "object",
      "ref": "PostTransaction",
      "properties": [
        {
          "name": "timestamp",
          "type": "string (date-time)"
        },
        {
          "name": "postings",
          "type": "array of Posting"
        },
        {
          "name": "script",
          "type": "object",
          "inlineSchema": {
            "type": "object",
            "properties": [
              {
                "name": "plain",
                "type": "string",
                "required": true,
                "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n"
              },
              {
                "name": "vars",
                "type": "object",
                "example": {
                  "user": "users:042"
                }
              }
            ]
          }
        },
        {
          "name": "reference",
          "type": "string",
          "example": "ref:001"
        },
        {
          "name": "metadata",
          "type": "ledgerMetadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransactionsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getTransaction"></a>

### GET /api/ledger/{ledger}/transactions/{txid}

Get transaction from a ledger by its ID

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/transactions/{txid}",
  "summary": "Get transaction from a ledger by its ID",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "txid",
      "description": "Transaction ID."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransactionResponse",
        "properties": [
          {
            "name": "data",
            "type": "Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-addMetadataOnTransaction"></a>

### POST /api/ledger/{ledger}/transactions/{txid}/metadata

Set the metadata of a transaction by its ID

```json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/transactions/{txid}/metadata",
  "summary": "Set the metadata of a transaction by its ID",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "txid",
      "description": "Transaction ID."
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "metadata",
    "schema": {
      "type": "object",
      "ref": "ledgerMetadata"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[INSUFFICIENT_FUND] account had insufficient funds"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-revertTransaction"></a>

### POST /api/ledger/{ledger}/transactions/{txid}/revert

Revert a ledger transaction by its ID

```json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/transactions/{txid}/revert",
  "summary": "Revert a ledger transaction by its ID",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "txid",
      "description": "Transaction ID."
    }
  ],
  "queryParams": [
    {
      "name": "disableChecks",
      "description": "Allow to disable balances checks",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "201",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransactionResponse",
        "properties": [
          {
            "name": "data",
            "type": "Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-CreateTransactions"></a>

### POST /api/ledger/{ledger}/transactions/batch

Create a new batch of transactions to a ledger

```json
{
  "method": "POST",
  "path": "/api/ledger/{ledger}/transactions/batch",
  "summary": "Create a new batch of transactions to a ledger",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "Transactions",
      "properties": [
        {
          "name": "transactions",
          "type": "array of TransactionData",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransactionsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getBalances"></a>

### GET /api/ledger/{ledger}/balances

Get the balances from a ledger's account

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/balances",
  "summary": "Get the balances from a ledger's account",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "address",
      "description": "Filter balances involving given account, either as source or destination.",
      "required": false
    },
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page.\n",
      "required": false
    },
    {
      "name": "after",
      "description": "Pagination cursor, will return accounts after given address, in descending order.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n",
      "required": false
    },
    {
      "name": "pagination_token",
      "description": "Parameter used in pagination requests.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nDeprecated, please use `cursor` instead.",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BalancesCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of AccountsBalances",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getBalancesAggregated"></a>

### GET /api/ledger/{ledger}/aggregate/balances

Get the aggregated balances from selected accounts

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/aggregate/balances",
  "summary": "Get the aggregated balances from selected accounts",
  "description": "",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "address",
      "description": "Filter balances involving given account, either as source or destination.",
      "required": false
    },
    {
      "name": "useInsertionDate",
      "description": "Use insertion date instead of effective date",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "AggregateBalancesResponse",
        "properties": [
          {
            "name": "data",
            "type": "AssetsBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-listLogs"></a>

### GET /api/ledger/{ledger}/logs

List the logs from a ledger

List the logs from a ledger, sorted by ID in descending order.

```json
{
  "method": "GET",
  "path": "/api/ledger/{ledger}/logs",
  "summary": "List the logs from a ledger",
  "description": "List the logs from a ledger, sorted by ID in descending order.",
  "tags": [
    "ledger.v1"
  ],
  "module": "Ledger",
  "resourceGroup": "v1 (deprecated)",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page.\n",
      "required": false
    },
    {
      "name": "page_size",
      "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n",
      "required": false
    },
    {
      "name": "after",
      "description": "Pagination cursor, will return the logs after a given ID. (in descending order).",
      "required": false
    },
    {
      "name": "startTime",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "start_time",
      "description": "Filter transactions that occurred after this timestamp.\nThe format is RFC3339 and is inclusive (for example, \"2023-01-02T15:04:01Z\" includes the first second of 4th minute).\nDeprecated, please use `startTime` instead.\n",
      "required": false
    },
    {
      "name": "endTime",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\n",
      "required": false
    },
    {
      "name": "end_time",
      "description": "Filter transactions that occurred before this timestamp.\nThe format is RFC3339 and is exclusive (for example, \"2023-01-02T15:04:01Z\" excludes the first second of 4th minute).\nDeprecated, please use `endTime` instead.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n",
      "required": false
    },
    {
      "name": "pagination_token",
      "description": "Parameter used in pagination requests. Maximum page size is set to 1000.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\nDeprecated, please use `cursor` instead.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "LogsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of Log",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetInfo"></a>

### GET /api/ledger/\_/info

Show server information

```json
{
  "method": "GET",
  "path": "/api/ledger/_/info",
  "summary": "Show server information",
  "description": "",
  "tags": [
    "ledger"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ConfigInfoResponse",
        "properties": [
          {
            "name": "server",
            "type": "string",
            "required": true
          },
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-getMetrics"></a>

### GET /api/ledger/\_/metrics

Read in memory metrics

```json
{
  "method": "GET",
  "path": "/api/ledger/_/metrics",
  "summary": "Read in memory metrics",
  "description": "",
  "tags": [
    "ledger"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object"
      }
    }
  ]
}
```

<a id="ledger-v2ListLedgers"></a>

### GET /api/ledger/v2

List Ledgers

Retrieve all ledgers in the system. Each ledger is an isolated double-entry accounting system.

````json
{
  "method": "GET",
  "path": "/api/ledger/v2",
  "summary": "List Ledgers",
  "description": "Retrieve all ledgers in the system. Each ledger is an isolated double-entry accounting system.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "queryParams": [
    {
      "name": "pageSize",
      "description": "Number of ledgers to return per page. Defaults to 15, maximum 1000.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response.",
      "required": false
    },
    {
      "name": "includeDeleted",
      "description": "When true, includes soft-deleted ledgers in the results.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by ledger name or metadata. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"metadata[environment]\": \"production\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2LedgerListResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                },
                {
                  "name": "data",
                  "type": "array of V2Ledger",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2GetLedger"></a>

### GET /api/ledger/v2/{ledger}

Get Ledger

Retrieve details about a specific ledger including its configuration and metadata.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}",
  "summary": "Get Ledger",
  "description": "Retrieve details about a specific ledger including its configuration and metadata.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetLedgerResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Ledger",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CreateLedger"></a>

### POST /api/ledger/v2/{ledger}

Create Ledger

Create a new ledger. Each ledger is an isolated accounting system with its own accounts, transactions, and balances.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}",
  "summary": "Create Ledger",
  "description": "Create a new ledger. Each ledger is an isolated accounting system with its own accounts, transactions, and balances.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "V2CreateLedgerRequest",
      "properties": [
        {
          "name": "bucket",
          "type": "string"
        },
        {
          "name": "metadata",
          "type": "V2Metadata"
        },
        {
          "name": "features",
          "type": "object"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2InsertSchema"></a>

### POST /api/ledger/v2/{ledger}/schemas/{version}

Insert a schema for a ledger

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/schemas/{version}",
  "summary": "Insert a schema for a ledger",
  "description": "",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "V2SchemaData",
      "description": "Schema data structure for ledger schemas",
      "properties": [
        {
          "name": "chart",
          "type": "V2ChartOfAccounts",
          "required": true
        },
        {
          "name": "transactions",
          "type": "V2TransactionTemplates"
        },
        {
          "name": "queries",
          "type": "V2QueryTemplates"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Schema inserted successfully"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetSchema"></a>

### GET /api/ledger/v2/{ledger}/schemas/{version}

Get a schema for a ledger by version

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/schemas/{version}",
  "summary": "Get a schema for a ledger by version",
  "description": "",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "200",
      "description": "Schema retrieved successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2SchemaResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Schema",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ListSchemas"></a>

### GET /api/ledger/v2/{ledger}/schemas

List all schemas for a ledger

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/schemas",
  "summary": "List all schemas for a ledger",
  "description": "",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "queryParams": [
    {
      "name": "cursor",
      "description": "The pagination cursor value",
      "required": false
    },
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page",
      "required": false
    },
    {
      "name": "sort",
      "description": "The field to sort by",
      "required": false
    },
    {
      "name": "order",
      "description": "The sort order",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Schemas retrieved successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2SchemasCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "V2SchemasCursor",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2UpdateLedgerMetadata"></a>

### PUT /api/ledger/v2/{ledger}/metadata

Update Ledger Metadata

Update the metadata attached to a ledger. Use for storing environment labels, owner information, or configuration flags.

```json
{
  "method": "PUT",
  "path": "/api/ledger/v2/{ledger}/metadata",
  "summary": "Update Ledger Metadata",
  "description": "Update the metadata attached to a ledger. Use for storing environment labels, owner information, or configuration flags.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Metadata",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Metadata key-value pairs to set on the ledger.",
    "schema": {
      "type": "object",
      "ref": "V2UpdateLedgerMetadataRequest"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeleteLedgerMetadata"></a>

### DELETE /api/ledger/v2/{ledger}/metadata/{key}

Delete Ledger Metadata

Remove a specific metadata key from the ledger.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/{ledger}/metadata/{key}",
  "summary": "Delete Ledger Metadata",
  "description": "Remove a specific metadata key from the ledger.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Metadata",
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetLedgerInfo"></a>

### GET /api/ledger/v2/{ledger}/\_info

Get Ledger Info

Retrieve storage and migration status information for a ledger. Useful for monitoring ledger health.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/_info",
  "summary": "Get Ledger Info",
  "description": "Retrieve storage and migration status information for a ledger. Useful for monitoring ledger health.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2LedgerInfoResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2LedgerInfo"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CreateBulk"></a>

### POST /api/ledger/v2/{ledger}/\_bulk

Bulk Operations

Execute multiple ledger operations in a single request. Supports creating transactions, adding metadata, and reverting transactions in batch.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/_bulk",
  "summary": "Bulk Operations",
  "description": "Execute multiple ledger operations in a single request. Supports creating transactions, adding metadata, and reverting transactions in batch.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Bulk Operations",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger."
    }
  ],
  "queryParams": [
    {
      "name": "continueOnFailure",
      "description": "When true, continues processing remaining operations even if one fails.",
      "required": false
    },
    {
      "name": "atomic",
      "description": "When true, all operations succeed or fail together as a single transaction.",
      "required": false
    },
    {
      "name": "parallel",
      "description": "When true, processes operations in parallel for better performance. Not compatible with `atomic`.",
      "required": false
    },
    {
      "name": "schemaVersion",
      "description": "Default schema version to use for validation (can be overridden per element)",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Array of bulk operations to execute.",
    "schema": {
      "type": "array",
      "ref": "V2Bulk",
      "items": {
        "type": "object",
        "ref": "V2BulkElement",
        "oneOf": [
          {
            "type": "object",
            "ref": "V2BulkElementCreateTransaction",
            "properties": [
              {
                "name": "action",
                "type": "string",
                "required": true
              },
              {
                "name": "ik",
                "type": "string"
              },
              {
                "name": "data",
                "type": "V2PostTransaction"
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2BulkElementAddMetadata",
            "properties": [
              {
                "name": "action",
                "type": "string",
                "required": true
              },
              {
                "name": "ik",
                "type": "string"
              },
              {
                "name": "data",
                "type": "object",
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "targetId",
                      "type": "V2TargetId",
                      "required": true
                    },
                    {
                      "name": "targetType",
                      "type": "V2TargetType",
                      "required": true
                    },
                    {
                      "name": "metadata",
                      "type": "object",
                      "required": true
                    }
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2BulkElementRevertTransaction",
            "properties": [
              {
                "name": "action",
                "type": "string",
                "required": true
              },
              {
                "name": "ik",
                "type": "string"
              },
              {
                "name": "data",
                "type": "object",
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "id",
                      "type": "integer (bigint)",
                      "required": true
                    },
                    {
                      "name": "force",
                      "type": "boolean"
                    },
                    {
                      "name": "atEffectiveDate",
                      "type": "boolean"
                    },
                    {
                      "name": "metadata",
                      "type": "V2Metadata"
                    }
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2BulkElementDeleteMetadata",
            "properties": [
              {
                "name": "action",
                "type": "string",
                "required": true
              },
              {
                "name": "ik",
                "type": "string"
              },
              {
                "name": "data",
                "type": "object",
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "targetId",
                      "type": "V2TargetId",
                      "required": true
                    },
                    {
                      "name": "targetType",
                      "type": "V2TargetType",
                      "required": true
                    },
                    {
                      "name": "key",
                      "type": "string",
                      "required": true
                    }
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2BulkResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of V2BulkElementResult"
          },
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum"
          },
          {
            "name": "errorMessage",
            "type": "string",
            "example": "[VALIDATION] invalid 'cursor' query param"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CountAccounts"></a>

### HEAD /api/ledger/v2/{ledger}/accounts

Count Accounts

Returns the total count of accounts matching the filter criteria. The count is returned in the `Count` response header.

````json
{
  "method": "HEAD",
  "path": "/api/ledger/v2/{ledger}/accounts",
  "summary": "Count Accounts",
  "description": "Returns the total count of accounts matching the filter criteria. The count is returned in the `Count` response header.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Accounts",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to count accounts from."
    }
  ],
  "queryParams": [
    {
      "name": "pit",
      "description": "Point-in-time query. Returns the count as it existed at this timestamp.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by address pattern or metadata before counting. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"address\": \"users::wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2ListAccounts"></a>

### GET /api/ledger/v2/{ledger}/accounts

List Accounts

Retrieve a paginated list of accounts from the ledger. Accounts are created automatically when they appear in transactions.

````json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/accounts",
  "summary": "List Accounts",
  "description": "Retrieve a paginated list of accounts from the ledger. Accounts are created automatically when they appear in transactions.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Accounts",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to query accounts from."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "Number of accounts to return per page. Defaults to 15, maximum 1000.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response. Use the `next` or `previous` value to navigate pages.",
      "required": false
    },
    {
      "name": "expand",
      "description": "Include additional data. Use `volumes` to include balance and volume information for each account.",
      "required": false
    },
    {
      "name": "pit",
      "description": "Point-in-time query. Returns account state as it existed at this timestamp.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by address pattern or metadata. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"address\": \"users::wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2AccountsCursorResponse",
        "properties": [
          {
            "name": "resource",
            "type": "string",
            "enumValues": [
              "accounts"
            ]
          },
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                },
                {
                  "name": "data",
                  "type": "array of V2Account",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2GetAccount"></a>

### GET /api/ledger/v2/{ledger}/accounts/{address}

Get Account

Retrieve details for a specific account including its balances and metadata.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/accounts/{address}",
  "summary": "Get Account",
  "description": "Retrieve details for a specific account including its balances and metadata.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Accounts",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the account."
    },
    {
      "name": "address",
      "description": "The account address. Uses colon-separated segments (e.g., `users:john:wallet`). Pattern must match `^\\w+(:\\w+)*$`."
    }
  ],
  "queryParams": [
    {
      "name": "expand",
      "description": "Include additional data. Use `volumes` to include balance and volume details.",
      "required": false
    },
    {
      "name": "pit",
      "description": "Point-in-time query. Returns account state as it existed at this timestamp.",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2AccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Account",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2AddMetadataToAccount"></a>

### POST /api/ledger/v2/{ledger}/accounts/{address}/metadata

Add Account Metadata

Attach key-value metadata to an account. Use for storing customer IDs, account types, KYC status, or any business context.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/accounts/{address}/metadata",
  "summary": "Add Account Metadata",
  "description": "Attach key-value metadata to an account. Use for storing customer IDs, account types, KYC status, or any business context.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Accounts",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the account."
    },
    {
      "name": "address",
      "description": "The account address to add metadata to."
    }
  ],
  "queryParams": [
    {
      "name": "dryRun",
      "description": "When true, validates the request without persisting changes.",
      "required": false
    },
    {
      "name": "schemaVersion",
      "description": "Schema version to use for validation",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Key-value pairs to add to the account. Existing keys will be overwritten.",
    "schema": {
      "type": "object",
      "ref": "V2Metadata"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeleteAccountMetadata"></a>

### DELETE /api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}

Delete Account Metadata

Remove a specific metadata key from an account.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}",
  "summary": "Delete Account Metadata",
  "description": "Remove a specific metadata key from an account.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Accounts",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the account."
    },
    {
      "name": "address",
      "description": "The account address to delete metadata from."
    },
    {
      "name": "key",
      "description": "The metadata key to delete."
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "Key deleted"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ReadStats"></a>

### GET /api/ledger/v2/{ledger}/stats

Get Ledger Stats

Retrieve aggregate statistics including total account count and transaction count for a ledger.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/stats",
  "summary": "Get Ledger Stats",
  "description": "Retrieve aggregate statistics including total account count and transaction count for a ledger.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Stats",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2StatsResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Stats",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CountTransactions"></a>

### HEAD /api/ledger/v2/{ledger}/transactions

Count Transactions

Returns the total count of transactions matching the filter criteria. The count is returned in the `Count` response header.

````json
{
  "method": "HEAD",
  "path": "/api/ledger/v2/{ledger}/transactions",
  "summary": "Count Transactions",
  "description": "Returns the total count of transactions matching the filter criteria. The count is returned in the `Count` response header.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to count transactions from."
    }
  ],
  "queryParams": [
    {
      "name": "pit",
      "description": "Point-in-time query. Returns the count as it existed at this timestamp.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by account, reference, or metadata before counting. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"account\": \"users:john:wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2ListTransactions"></a>

### GET /api/ledger/v2/{ledger}/transactions

List Transactions

Retrieve a paginated list of transactions from the ledger, sorted by ID in descending order (newest first).

````json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/transactions",
  "summary": "List Transactions",
  "description": "Retrieve a paginated list of transactions from the ledger, sorted by ID in descending order (newest first).",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to query transactions from."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "Number of transactions to return per page. Defaults to 15, maximum 1000.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response. Use the `next` or `previous` value from the response to navigate pages.",
      "required": false
    },
    {
      "name": "expand",
      "description": "Include additional data in the response. Use `volumes` to include account volume changes for each transaction.",
      "required": false
    },
    {
      "name": "pit",
      "description": "Point-in-time query. Returns the ledger state as it existed at this timestamp. Useful for historical queries and audit trails.",
      "required": false
    },
    {
      "name": "order",
      "description": "Deprecated: Use the `sort` parameter instead.",
      "required": false
    },
    {
      "name": "reverse",
      "description": "When true, returns results in ascending order (oldest first) instead of descending.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by account, metadata, reference, or other fields. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"account\": \"users:john:wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2TransactionsCursorResponse",
        "properties": [
          {
            "name": "resource",
            "type": "string",
            "enumValues": [
              "transactions"
            ]
          },
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                },
                {
                  "name": "data",
                  "type": "array of V2Transaction",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2CreateTransaction"></a>

### POST /api/ledger/v2/{ledger}/transactions

Create Transaction

Create a new transaction to transfer value between accounts. This is the core operation of the ledger.

**Using Numscript:**

```json
{
  "script": {
    "plain": "send [USD/2 10000] (\n  source = @user:john:wallet allowing unbounded overdraft\n  destination = @user:mary:wallet\n)"
  },
  "reference": "payment-001"
}
```

**Using Postings:**

```json
{
  "postings": [
    {
      "source": "world",
      "destination": "user:alice:wallet",
      "amount": 5000,
      "asset": "USD/2"
    }
  ],
  "reference": "deposit-001"
}
```

````json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/transactions",
  "summary": "Create Transaction",
  "description": "Create a new transaction to transfer value between accounts. This is the core operation of the ledger.\n\n**Using Numscript:**\n```json\n{\n  \"script\": {\n    \"plain\": \"send [USD/2 10000] (\\n  source = @user:john:wallet allowing unbounded overdraft\\n  destination = @user:mary:wallet\\n)\"\n  },\n  \"reference\": \"payment-001\"\n}\n```\n\n**Using Postings:**\n```json\n{\n  \"postings\": [\n    {\n      \"source\": \"world\",\n      \"destination\": \"user:alice:wallet\",\n      \"amount\": 5000,\n      \"asset\": \"USD/2\"\n    }\n  ],\n  \"reference\": \"deposit-001\"\n}\n```\n",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to create the transaction in."
    }
  ],
  "queryParams": [
    {
      "name": "dryRun",
      "description": "When true, validates the transaction without persisting it. Useful for testing Numscript logic before committing.",
      "required": false
    },
    {
      "name": "force",
      "description": "When true, allows accounts to go negative (overdraft). By default, transactions fail if a source account has insufficient funds.",
      "required": false
    },
    {
      "name": "schemaVersion",
      "description": "Schema version to use for validation",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "The transaction definition. Use `script` for Numscript or `postings` for explicit transfers. See examples above.\n",
    "schema": {
      "type": "object",
      "ref": "V2PostTransaction",
      "properties": [
        {
          "name": "timestamp",
          "type": "string (date-time)"
        },
        {
          "name": "postings",
          "type": "array of V2Posting"
        },
        {
          "name": "script",
          "type": "object",
          "inlineSchema": {
            "type": "object",
            "properties": [
              {
                "name": "template",
                "type": "string",
                "example": "CUSTOMER_DEPOSIT"
              },
              {
                "name": "plain",
                "type": "string",
                "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n"
              },
              {
                "name": "vars",
                "type": "object",
                "example": {
                  "user": "users:042"
                },
                "inlineSchema": {
                  "type": "object",
                  "properties": []
                }
              }
            ]
          }
        },
        {
          "name": "runtime",
          "type": "Runtime"
        },
        {
          "name": "reference",
          "type": "string",
          "example": "ref:001"
        },
        {
          "name": "metadata",
          "type": "V2Metadata",
          "required": true
        },
        {
          "name": "accountMetadata",
          "type": "object"
        },
        {
          "name": "force",
          "type": "boolean"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2CreateTransactionResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2GetTransaction"></a>

### GET /api/ledger/v2/{ledger}/transactions/{id}

Get Transaction

Retrieve a specific transaction by its ID, including all postings, metadata, and timestamps.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/transactions/{id}",
  "summary": "Get Transaction",
  "description": "Retrieve a specific transaction by its ID, including all postings, metadata, and timestamps.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the transaction."
    },
    {
      "name": "id",
      "description": "The unique transaction ID (auto-incrementing integer assigned at creation)."
    }
  ],
  "queryParams": [
    {
      "name": "expand",
      "description": "Include additional data. Use `volumes` to include account volume changes from this transaction.",
      "required": false
    },
    {
      "name": "pit",
      "description": "Point-in-time query. Returns the transaction state at this timestamp (useful if metadata was modified after creation).",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetTransactionResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2AddMetadataOnTransaction"></a>

### POST /api/ledger/v2/{ledger}/transactions/{id}/metadata

Add Transaction Metadata

Attach key-value metadata to a transaction. Use for storing order IDs, customer references, or audit information.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/transactions/{id}/metadata",
  "summary": "Add Transaction Metadata",
  "description": "Attach key-value metadata to a transaction. Use for storing order IDs, customer references, or audit information.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the transaction."
    },
    {
      "name": "id",
      "description": "The transaction ID to add metadata to."
    }
  ],
  "queryParams": [
    {
      "name": "dryRun",
      "description": "When true, validates the request without persisting changes.",
      "required": false
    },
    {
      "name": "schemaVersion",
      "description": "Schema version to use for validation",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Key-value pairs to add to the transaction.",
    "schema": {
      "type": "object",
      "ref": "V2Metadata"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeleteTransactionMetadata"></a>

### DELETE /api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}

Delete Transaction Metadata

Remove a specific metadata key from a transaction.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}",
  "summary": "Delete Transaction Metadata",
  "description": "Remove a specific metadata key from a transaction.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the transaction."
    },
    {
      "name": "id",
      "description": "The transaction ID to delete metadata from."
    },
    {
      "name": "key",
      "description": "The metadata key to delete."
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "Key deleted"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2RevertTransaction"></a>

### POST /api/ledger/v2/{ledger}/transactions/{id}/revert

Revert Transaction

Create a new transaction that reverses the effects of a previous transaction. The original transaction is not deleted—a compensating transaction is created instead.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/transactions/{id}/revert",
  "summary": "Revert Transaction",
  "description": "Create a new transaction that reverses the effects of a previous transaction. The original transaction is not deleted—a compensating transaction is created instead.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Transactions",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger containing the transaction."
    },
    {
      "name": "id",
      "description": "The ID of the transaction to revert."
    }
  ],
  "queryParams": [
    {
      "name": "force",
      "description": "When true, allows the revert even if it would cause accounts to go negative.",
      "required": false
    },
    {
      "name": "atEffectiveDate",
      "description": "When true, the revert transaction uses the same effective date as the original. Useful for maintaining accurate historical records.",
      "required": false
    },
    {
      "name": "dryRun",
      "description": "When true, validates the revert without creating the compensating transaction.",
      "required": false
    },
    {
      "name": "schemaVersion",
      "description": "Schema version to use for validation",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V2RevertTransactionRequest",
      "properties": [
        {
          "name": "metadata",
          "type": "object"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2RevertTransactionResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Transaction",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetBalancesAggregated"></a>

### GET /api/ledger/v2/{ledger}/aggregate/balances

Get Aggregate Balances

Calculate the sum of balances across a filtered set of accounts. Useful for computing totals like total customer funds, revenue by category, or liability tracking.

````json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/aggregate/balances",
  "summary": "Get Aggregate Balances",
  "description": "Calculate the sum of balances across a filtered set of accounts. Useful for computing totals like total customer funds, revenue by category, or liability tracking.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Balances & Volumes",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to aggregate balances from."
    }
  ],
  "queryParams": [
    {
      "name": "pit",
      "description": "Point-in-time query. Returns balances as they existed at this timestamp.",
      "required": false
    },
    {
      "name": "useInsertionDate",
      "description": "When true, uses the insertion timestamp instead of the effective date for calculations.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria to select which accounts to aggregate. Use `$match` with address patterns to sum balances. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"address\": \"users::wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2AggregateBalancesResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2AssetsBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2GetVolumesWithBalances"></a>

### GET /api/ledger/v2/{ledger}/volumes

List Volumes

Retrieve volume data (inputs, outputs, balance) for accounts. Volumes track the total flow of assets through each account.

````json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/volumes",
  "summary": "List Volumes",
  "description": "Retrieve volume data (inputs, outputs, balance) for accounts. Volumes track the total flow of assets through each account.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Balances & Volumes",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to query volumes from."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "Number of results to return per page. Defaults to 15, maximum 1000.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response. Use the `next` or `previous` value to navigate pages.",
      "required": false
    },
    {
      "name": "endTime",
      "description": "Only include transactions up to this timestamp.",
      "required": false
    },
    {
      "name": "startTime",
      "description": "Only include transactions from this timestamp onwards.",
      "required": false
    },
    {
      "name": "insertionDate",
      "description": "When true, uses insertion timestamps instead of effective dates.",
      "required": false
    },
    {
      "name": "groupBy",
      "description": "Group volumes by address segment level. For example, `groupBy=2` on `users:john:wallet` groups by `users:john`.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by account address pattern before computing volumes. See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"account\": \"users::wallet\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2VolumesWithBalanceCursorResponse",
        "properties": [
          {
            "name": "resource",
            "type": "string",
            "enumValues": [
              "volumes"
            ]
          },
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                },
                {
                  "name": "data",
                  "type": "array of V2VolumesWithBalance",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2ListLogs"></a>

### GET /api/ledger/v2/{ledger}/logs

List Logs

Retrieve the immutable audit log of all ledger operations. Each log entry represents a state change (transaction created, metadata set, etc.).

````json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/logs",
  "summary": "List Logs",
  "description": "Retrieve the immutable audit log of all ledger operations. Each log entry represents a state change (transaction created, metadata set, etc.).",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Logs",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to query logs from."
    }
  ],
  "queryParams": [
    {
      "name": "pageSize",
      "description": "Number of logs to return per page. Defaults to 15, maximum 1000.",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response.",
      "required": false
    },
    {
      "name": "pit",
      "description": "Point-in-time query. Returns logs as they existed at this timestamp.",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Filter criteria. Use `$match` to filter by log type (NEW_TRANSACTION, SET_METADATA, REVERTED_TRANSACTION, DELETE_METADATA). See [Filtering Queries](/modules/ledger/working-with/filtering-queries) for full syntax.\n\n**Example:**\n```json\n{\n  \"$match\": {\n    \"type\": \"NEW_TRANSACTION\"\n  }\n}\n```\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2LogsCursorResponse",
        "properties": [
          {
            "name": "resource",
            "type": "string",
            "enumValues": [
              "logs"
            ]
          },
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                },
                {
                  "name": "data",
                  "type": "array of V2Log",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="ledger-v2ImportLogs"></a>

### POST /api/ledger/v2/{ledger}/logs/import

Import Logs

Import logs from a backup or another ledger. Used for disaster recovery and ledger migration scenarios.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/logs/import",
  "summary": "Import Logs",
  "description": "Import logs from a backup or another ledger. Used for disaster recovery and ledger migration scenarios.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Logs",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to import logs into."
    }
  ],
  "responses": [
    {
      "code": "204",
      "description": "Import OK"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ExportLogs"></a>

### POST /api/ledger/v2/{ledger}/logs/export

Export Logs

Export all logs from the ledger in binary format. Used for backups, disaster recovery, and migrating data between environments.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/logs/export",
  "summary": "Export Logs",
  "description": "Export all logs from the ledger in binary format. Used for backups, disaster recovery, and migrating data between environments.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Logs",
  "pathParams": [
    {
      "name": "ledger",
      "description": "The name of the ledger to export logs from."
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Import OK"
    }
  ]
}
```

<a id="ledger-v2RunQuery"></a>

### POST /api/ledger/v2/{ledger}/queries/{id}/run

Run a query template

Run a query template on a ledger

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/queries/{id}/run",
  "summary": "Run a query template",
  "description": "Run a query template on a ledger",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "pathParams": [
    {
      "name": "ledger",
      "description": "Name of the ledger."
    },
    {
      "name": "id",
      "description": "Query template ID."
    }
  ],
  "queryParams": [
    {
      "name": "schemaVersion",
      "description": "Schema version to use for validation",
      "required": true
    },
    {
      "name": "pageSize",
      "description": "The maximum number of results to return per page.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Parameter used in pagination requests. Maximum page size is set to 15.\nSet to the value of next for the next page of results.\nSet to the value of previous for the previous page of results.\nNo other parameters can be set when this parameter is set.\n",
      "required": false
    },
    {
      "name": "expand",
      "description": "",
      "required": false
    },
    {
      "name": "pit",
      "description": "",
      "required": false
    },
    {
      "name": "order",
      "description": "Deprecated: Use sort param",
      "required": false
    },
    {
      "name": "reverse",
      "description": "",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "properties": [
        {
          "name": "cursor",
          "type": "string"
        },
        {
          "name": "params",
          "type": "V2QueryParams"
        },
        {
          "name": "vars",
          "type": "object"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "oneOf": [
          {
            "type": "object",
            "ref": "V2TransactionsCursorResponse",
            "properties": [
              {
                "name": "resource",
                "type": "string",
                "enumValues": [
                  "transactions"
                ]
              },
              {
                "name": "cursor",
                "type": "object",
                "required": true,
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "pageSize",
                      "type": "integer (int64)",
                      "required": true,
                      "example": 15
                    },
                    {
                      "name": "hasMore",
                      "type": "boolean",
                      "required": true,
                      "example": false
                    },
                    {
                      "name": "previous",
                      "type": "string",
                      "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                    },
                    {
                      "name": "next",
                      "type": "string",
                      "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                    },
                    {
                      "name": "data",
                      "type": "array of V2Transaction",
                      "required": true
                    }
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2AccountsCursorResponse",
            "properties": [
              {
                "name": "resource",
                "type": "string",
                "enumValues": [
                  "accounts"
                ]
              },
              {
                "name": "cursor",
                "type": "object",
                "required": true,
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "pageSize",
                      "type": "integer (int64)",
                      "required": true,
                      "example": 15
                    },
                    {
                      "name": "hasMore",
                      "type": "boolean",
                      "required": true,
                      "example": false
                    },
                    {
                      "name": "previous",
                      "type": "string",
                      "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                    },
                    {
                      "name": "next",
                      "type": "string",
                      "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                    },
                    {
                      "name": "data",
                      "type": "array of V2Account",
                      "required": true
                    }
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2LogsCursorResponse",
            "properties": [
              {
                "name": "resource",
                "type": "string",
                "enumValues": [
                  "logs"
                ]
              },
              {
                "name": "cursor",
                "type": "object",
                "required": true,
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "pageSize",
                      "type": "integer (int64)",
                      "required": true,
                      "example": 15
                    },
                    {
                      "name": "hasMore",
                      "type": "boolean",
                      "required": true,
                      "example": false
                    },
                    {
                      "name": "previous",
                      "type": "string",
                      "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                    },
                    {
                      "name": "next",
                      "type": "string",
                      "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                    },
                    {
                      "name": "data",
                      "type": "array of V2Log",
                      "required": true
                    }
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "ref": "V2VolumesWithBalanceCursorResponse",
            "properties": [
              {
                "name": "resource",
                "type": "string",
                "enumValues": [
                  "volumes"
                ]
              },
              {
                "name": "cursor",
                "type": "object",
                "required": true,
                "inlineSchema": {
                  "type": "object",
                  "properties": [
                    {
                      "name": "pageSize",
                      "type": "integer (int64)",
                      "required": true,
                      "example": 15
                    },
                    {
                      "name": "hasMore",
                      "type": "boolean",
                      "required": true,
                      "example": false
                    },
                    {
                      "name": "previous",
                      "type": "string",
                      "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                    },
                    {
                      "name": "next",
                      "type": "string",
                      "example": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ="
                    },
                    {
                      "name": "data",
                      "type": "array of V2VolumesWithBalance",
                      "required": true
                    }
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ListExporters"></a>

### GET /api/ledger/v2/\_/exporters

List Exporters

Retrieve all configured exporters. Exporters stream ledger data to external systems like data warehouses or analytics platforms.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/_/exporters",
  "summary": "List Exporters",
  "description": "Retrieve all configured exporters. Exporters stream ledger data to external systems like data warehouses or analytics platforms.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Exporters",
  "responses": [
    {
      "code": "200",
      "description": "Exporters list",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "cursor",
            "type": "any"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CreateExporter"></a>

### POST /api/ledger/v2/\_/exporters

Create Exporter

Configure a new exporter to stream ledger data to an external destination. Supports various output formats and destinations.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/_/exporters",
  "summary": "Create Exporter",
  "description": "Configure a new exporter to stream ledger data to an external destination. Supports various output formats and destinations.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Exporters",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Exporter configuration including destination type and connection details.",
    "schema": {
      "type": "object",
      "ref": "V2CreateExporterRequest",
      "properties": [
        {
          "name": "driver",
          "type": "string",
          "required": true
        },
        {
          "name": "config",
          "type": "object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created exporter",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "data",
            "type": "V2Exporter",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetExporterState"></a>

### GET /api/ledger/v2/\_/exporters/{exporterID}

Get Exporter State

Retrieve the current state and configuration of an exporter, including sync status and any errors.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/_/exporters/{exporterID}",
  "summary": "Get Exporter State",
  "description": "Retrieve the current state and configuration of an exporter, including sync status and any errors.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Exporters",
  "responses": [
    {
      "code": "200",
      "description": "Exporter information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "data",
            "type": "V2Exporter",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2UpdateExporter"></a>

### PUT /api/ledger/v2/\_/exporters/{exporterID}

Update Exporter

Modify an existing exporter's configuration. Use this to change destinations or update connection credentials.

```json
{
  "method": "PUT",
  "path": "/api/ledger/v2/_/exporters/{exporterID}",
  "summary": "Update Exporter",
  "description": "Modify an existing exporter's configuration. Use this to change destinations or update connection credentials.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Exporters",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "Updated exporter configuration.",
    "schema": {
      "type": "object",
      "ref": "V2UpdateExporterRequest",
      "properties": [
        {
          "name": "driver",
          "type": "string",
          "required": true
        },
        {
          "name": "config",
          "type": "object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Exporter updated"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeleteExporter"></a>

### DELETE /api/ledger/v2/\_/exporters/{exporterID}

Delete Exporter

Remove an exporter and stop streaming data to its destination. This does not delete previously exported data.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/_/exporters/{exporterID}",
  "summary": "Delete Exporter",
  "description": "Remove an exporter and stop streaming data to its destination. This does not delete previously exported data.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Exporters",
  "responses": [
    {
      "code": "204",
      "description": "Exporter deleted"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeleteBucket"></a>

### DELETE /api/ledger/v2/\_/buckets/{bucket}

Delete bucket

Delete a bucket by marking all ledgers in the bucket as deleted (soft delete). All ledgers in the bucket will have their deleted\_at field set to the current timestamp.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/_/buckets/{bucket}",
  "summary": "Delete bucket",
  "description": "Delete a bucket by marking all ledgers in the bucket as deleted (soft delete). All ledgers in the bucket will have their deleted_at field set to the current timestamp.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "204",
      "description": "Bucket deleted"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2RestoreBucket"></a>

### POST /api/ledger/v2/\_/buckets/{bucket}/restore

Restore bucket

Restore a deleted bucket by unmarking all ledgers in the bucket as deleted. All ledgers in the bucket will have their deleted\_at field set to NULL.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/_/buckets/{bucket}/restore",
  "summary": "Restore bucket",
  "description": "Restore a deleted bucket by unmarking all ledgers in the bucket as deleted. All ledgers in the bucket will have their deleted_at field set to NULL.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Ledger Management",
  "responses": [
    {
      "code": "204",
      "description": "Bucket restored"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ListPipelines"></a>

### GET /api/ledger/v2/{ledger}/pipelines

List Pipelines

Retrieve all data processing pipelines configured for this ledger. Pipelines enable real-time data streaming to external systems.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/pipelines",
  "summary": "List Pipelines",
  "description": "Retrieve all data processing pipelines configured for this ledger. Pipelines enable real-time data streaming to external systems.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "200",
      "description": "Pipelines list",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "cursor",
            "type": "any"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2CreatePipeline"></a>

### POST /api/ledger/v2/{ledger}/pipelines

Create Pipeline

Configure a new data pipeline to stream ledger events to an external destination in real-time.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/pipelines",
  "summary": "Create Pipeline",
  "description": "Configure a new data pipeline to stream ledger events to an external destination in real-time.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Pipeline configuration including destination and filtering options.",
    "schema": {
      "type": "object",
      "ref": "V2CreatePipelineRequest",
      "properties": [
        {
          "name": "exporterID",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created ipeline",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "data",
            "type": "V2Pipeline",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2GetPipelineState"></a>

### GET /api/ledger/v2/{ledger}/pipelines/{pipelineID}

Get Pipeline State

Retrieve the current state of a pipeline including sync progress, errors, and configuration.

```json
{
  "method": "GET",
  "path": "/api/ledger/v2/{ledger}/pipelines/{pipelineID}",
  "summary": "Get Pipeline State",
  "description": "Retrieve the current state of a pipeline including sync progress, errors, and configuration.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "200",
      "description": "Pipeline information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "properties": [
          {
            "name": "data",
            "type": "V2Pipeline",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2DeletePipeline"></a>

### DELETE /api/ledger/v2/{ledger}/pipelines/{pipelineID}

Delete Pipeline

Remove a pipeline and stop streaming data. Previously streamed data is not affected.

```json
{
  "method": "DELETE",
  "path": "/api/ledger/v2/{ledger}/pipelines/{pipelineID}",
  "summary": "Delete Pipeline",
  "description": "Remove a pipeline and stop streaming data. Previously streamed data is not affected.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "204",
      "description": "Pipeline deleted"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V2ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] invalid 'cursor' query param"
          },
          {
            "name": "details",
            "type": "string",
            "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
          }
        ]
      }
    }
  ]
}
```

<a id="ledger-v2ResetPipeline"></a>

### POST /api/ledger/v2/{ledger}/pipelines/{pipelineID}/reset

Reset Pipeline

Reset a pipeline to reprocess all data from the beginning. Useful when destination data needs to be rebuilt.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/pipelines/{pipelineID}/reset",
  "summary": "Reset Pipeline",
  "description": "Reset a pipeline to reprocess all data from the beginning. Useful when destination data needs to be rebuilt.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "202",
      "description": "Pipeline reset"
    }
  ]
}
```

<a id="ledger-v2StartPipeline"></a>

### POST /api/ledger/v2/{ledger}/pipelines/{pipelineID}/start

Start Pipeline

Start or resume a stopped pipeline. The pipeline will begin streaming new events and catch up on any missed data.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/pipelines/{pipelineID}/start",
  "summary": "Start Pipeline",
  "description": "Start or resume a stopped pipeline. The pipeline will begin streaming new events and catch up on any missed data.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "202",
      "description": "Pipeline started"
    }
  ]
}
```

<a id="ledger-v2StopPipeline"></a>

### POST /api/ledger/v2/{ledger}/pipelines/{pipelineID}/stop

Stop Pipeline

Pause a pipeline temporarily. No data will be streamed until the pipeline is started again.

```json
{
  "method": "POST",
  "path": "/api/ledger/v2/{ledger}/pipelines/{pipelineID}/stop",
  "summary": "Stop Pipeline",
  "description": "Pause a pipeline temporarily. No data will be streamed until the pipeline is started again.",
  "tags": [
    "ledger.v2"
  ],
  "module": "Ledger",
  "resourceGroup": "Pipelines",
  "responses": [
    {
      "code": "202",
      "description": "Pipeline stopped"
    }
  ]
}
```

<a id="payments-paymentsgetServerInfo"></a>

### GET /api/payments/\_info

Get server info

```json
{
  "method": "GET",
  "path": "/api/payments/_info",
  "summary": "Get server info",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "paymentsServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string"
          },
          {
            "name": "debug",
            "type": "boolean"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-createPayment"></a>

### POST /api/payments/payments

Create a payment

Create a payment

```json
{
  "method": "POST",
  "path": "/api/payments/payments",
  "summary": "Create a payment",
  "description": "Create a payment",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "PaymentRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string",
          "required": true
        },
        {
          "name": "createdAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true,
          "example": 100
        },
        {
          "name": "type",
          "type": "PaymentType",
          "required": true
        },
        {
          "name": "status",
          "type": "PaymentStatus",
          "required": true
        },
        {
          "name": "scheme",
          "type": "PaymentScheme",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true,
          "example": "USD"
        },
        {
          "name": "sourceAccountID",
          "type": "string"
        },
        {
          "name": "destinationAccountID",
          "type": "string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentResponse",
        "properties": [
          {
            "name": "data",
            "type": "Payment",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listPayments"></a>

### GET /api/payments/payments

List payments

```json
{
  "method": "GET",
  "path": "/api/payments/payments",
  "summary": "List payments",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getPayment"></a>

### GET /api/payments/payments/{paymentId}

Get a payment

```json
{
  "method": "GET",
  "path": "/api/payments/payments/{paymentId}",
  "summary": "Get a payment",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentResponse",
        "properties": [
          {
            "name": "data",
            "type": "Payment",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-updateMetadata"></a>

### PATCH /api/payments/payments/{paymentId}/metadata

Update metadata

```json
{
  "method": "PATCH",
  "path": "/api/payments/payments/{paymentId}/metadata",
  "summary": "Update metadata",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "PaymentMetadata"
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listTransferInitiations"></a>

### GET /api/payments/transfer-initiations

List Transfer Initiations

```json
{
  "method": "GET",
  "path": "/api/payments/transfer-initiations",
  "summary": "List Transfer Initiations",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransferInitiationsCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-createTransferInitiation"></a>

### POST /api/payments/transfer-initiations

Create a TransferInitiation

Create a transfer initiation

```json
{
  "method": "POST",
  "path": "/api/payments/transfer-initiations",
  "summary": "Create a TransferInitiation",
  "description": "Create a transfer initiation",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "TransferInitiationRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true,
          "example": "XXX"
        },
        {
          "name": "scheduledAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "description",
          "type": "string",
          "required": true
        },
        {
          "name": "sourceAccountID",
          "type": "string",
          "required": true
        },
        {
          "name": "destinationAccountID",
          "type": "string",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string"
        },
        {
          "name": "type",
          "type": "string",
          "required": true,
          "enumValues": [
            "TRANSFER",
            "PAYOUT"
          ]
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true,
          "example": "USD"
        },
        {
          "name": "validated",
          "type": "boolean",
          "required": true
        },
        {
          "name": "metadata",
          "type": "object"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransferInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "TransferInitiation",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getTransferInitiation"></a>

### GET /api/payments/transfer-initiations/{transferId}

Get a transfer initiation

```json
{
  "method": "GET",
  "path": "/api/payments/transfer-initiations/{transferId}",
  "summary": "Get a transfer initiation",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransferInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "TransferInitiation",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-deleteTransferInitiation"></a>

### DELETE /api/payments/transfer-initiations/{transferId}

Delete a transfer initiation

Delete a transfer initiation by its id.

```json
{
  "method": "DELETE",
  "path": "/api/payments/transfer-initiations/{transferId}",
  "summary": "Delete a transfer initiation",
  "description": "Delete a transfer initiation by its id.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-updateTransferInitiationStatus"></a>

### POST /api/payments/transfer-initiations/{transferId}/status

Update the status of a transfer initiation

Update a transfer initiation status

```json
{
  "method": "POST",
  "path": "/api/payments/transfer-initiations/{transferId}/status",
  "summary": "Update the status of a transfer initiation",
  "description": "Update a transfer initiation status",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "UpdateTransferInitiationStatusRequest",
      "properties": [
        {
          "name": "status",
          "type": "string",
          "required": true,
          "enumValues": [
            "REJECTED",
            "VALIDATED"
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-reverseTransferInitiation"></a>

### POST /api/payments/transfer-initiations/{transferId}/reverse

Reverse a transfer initiation

Reverse transfer initiation

```json
{
  "method": "POST",
  "path": "/api/payments/transfer-initiations/{transferId}/reverse",
  "summary": "Reverse a transfer initiation",
  "description": "Reverse transfer initiation",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ReverseTransferInitiationRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true,
          "example": "XXX"
        },
        {
          "name": "description",
          "type": "string",
          "required": true
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true,
          "example": "USD"
        },
        {
          "name": "metadata",
          "type": "object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-retryTransferInitiation"></a>

### POST /api/payments/transfer-initiations/{transferId}/retry

Retry a failed transfer initiation

Retry a failed transfer initiation

```json
{
  "method": "POST",
  "path": "/api/payments/transfer-initiations/{transferId}/retry",
  "summary": "Retry a failed transfer initiation",
  "description": "Retry a failed transfer initiation",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listPools"></a>

### GET /api/payments/pools

List Pools

```json
{
  "method": "GET",
  "path": "/api/payments/pools",
  "summary": "List Pools",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoolsCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-createPool"></a>

### POST /api/payments/pools

Create a Pool

Create a Pool

```json
{
  "method": "POST",
  "path": "/api/payments/pools",
  "summary": "Create a Pool",
  "description": "Create a Pool",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "PoolRequest",
      "description": "Query and dynamic pools are available from Connectivity v3.1",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "query",
          "type": "object",
          "description": "The same query than in ListAccount. Allowed properties are id, reference, connector_id, type, default_asset, name, psu_id, open_banking_connection_id and metadata."
        },
        {
          "name": "accountIDs",
          "type": "array of string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoolResponse",
        "properties": [
          {
            "name": "data",
            "type": "Pool",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getPool"></a>

### GET /api/payments/pools/{poolId}

Get a Pool

```json
{
  "method": "GET",
  "path": "/api/payments/pools/{poolId}",
  "summary": "Get a Pool",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoolResponse",
        "properties": [
          {
            "name": "data",
            "type": "Pool",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-deletePool"></a>

### DELETE /api/payments/pools/{poolId}

Delete a Pool

Delete a pool by its id.

```json
{
  "method": "DELETE",
  "path": "/api/payments/pools/{poolId}",
  "summary": "Delete a Pool",
  "description": "Delete a pool by its id.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-updatePoolQuery"></a>

### PATCH /api/payments/pools/{poolId}/query

Update the query of a pool

```json
{
  "method": "PATCH",
  "path": "/api/payments/pools/{poolId}/query",
  "summary": "Update the query of a pool",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "UpdatePoolQueryRequest",
      "properties": [
        {
          "name": "query",
          "type": "object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-addAccountToPool"></a>

### POST /api/payments/pools/{poolId}/accounts

Add an account to a pool

Add an account to a pool

```json
{
  "method": "POST",
  "path": "/api/payments/pools/{poolId}/accounts",
  "summary": "Add an account to a pool",
  "description": "Add an account to a pool",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "AddAccountToPoolRequest",
      "properties": [
        {
          "name": "accountID",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-removeAccountFromPool"></a>

### DELETE /api/payments/pools/{poolId}/accounts/{accountId}

Remove an account from a pool

Remove an account from a pool by its id.

```json
{
  "method": "DELETE",
  "path": "/api/payments/pools/{poolId}/accounts/{accountId}",
  "summary": "Remove an account from a pool",
  "description": "Remove an account from a pool by its id.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getPoolBalances"></a>

### GET /api/payments/pools/{poolId}/balances

Get historical pool balances at a particular point in time

```json
{
  "method": "GET",
  "path": "/api/payments/pools/{poolId}/balances",
  "summary": "Get historical pool balances at a particular point in time",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "queryParams": [
    {
      "name": "at",
      "description": "Filter balances by date.\n",
      "required": true
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoolBalancesResponse",
        "properties": [
          {
            "name": "data",
            "type": "PoolBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getPoolBalancesLatest"></a>

### GET /api/payments/pools/{poolId}/balances/latest

Get latest pool balances

```json
{
  "method": "GET",
  "path": "/api/payments/pools/{poolId}/balances/latest",
  "summary": "Get latest pool balances",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoolBalancesLatestResponse",
        "properties": [
          {
            "name": "data",
            "type": "PoolBalancesLatest",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-createAccount"></a>

### POST /api/payments/accounts

Create an account

Create an account

```json
{
  "method": "POST",
  "path": "/api/payments/accounts",
  "summary": "Create an account",
  "description": "Create an account",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "AccountRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string",
          "required": true
        },
        {
          "name": "createdAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "type",
          "type": "AccountType",
          "required": true
        },
        {
          "name": "defaultAsset",
          "type": "string"
        },
        {
          "name": "accountName",
          "type": "string"
        },
        {
          "name": "metadata",
          "type": "AccountMetadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "paymentsAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "paymentsAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-paymentslistAccounts"></a>

### GET /api/payments/accounts

List accounts

```json
{
  "method": "GET",
  "path": "/api/payments/accounts",
  "summary": "List accounts",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "AccountsCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-paymentsgetAccount"></a>

### GET /api/payments/accounts/{accountId}

Get an account

```json
{
  "method": "GET",
  "path": "/api/payments/accounts/{accountId}",
  "summary": "Get an account",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "paymentsAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "paymentsAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getAccountBalances"></a>

### GET /api/payments/accounts/{accountId}/balances

Get account balances

```json
{
  "method": "GET",
  "path": "/api/payments/accounts/{accountId}/balances",
  "summary": "Get account balances",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "queryParams": [
    {
      "name": "limit",
      "description": "The maximum number of results to return per page.",
      "required": false
    },
    {
      "name": "asset",
      "description": "Filter balances by currency.\nIf not specified, all account's balances will be returned.\n",
      "required": false
    },
    {
      "name": "from",
      "description": "Filter balances by date.\nIf not specified, all account's balances will be returned.\n",
      "required": false
    },
    {
      "name": "to",
      "description": "Filter balances by date.\nIf not specified, default will be set to now.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BalancesCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-createBankAccount"></a>

### POST /api/payments/bank-accounts

Create a BankAccount in Payments and on the PSP

Create a bank account in Payments and on the PSP.

```json
{
  "method": "POST",
  "path": "/api/payments/bank-accounts",
  "summary": "Create a BankAccount in Payments and on the PSP",
  "description": "Create a bank account in Payments and on the PSP.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "BankAccountRequest",
      "properties": [
        {
          "name": "country",
          "type": "string",
          "required": true,
          "example": "GB"
        },
        {
          "name": "connectorID",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string",
          "required": true,
          "example": "My account"
        },
        {
          "name": "accountNumber",
          "type": "string"
        },
        {
          "name": "iban",
          "type": "string"
        },
        {
          "name": "swiftBicCode",
          "type": "string"
        },
        {
          "name": "metadata",
          "type": "BankAccountMetadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "BankAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listBankAccounts"></a>

### GET /api/payments/bank-accounts

List bank accounts created by user on Formance

List all bank accounts created by user on Formance.

```json
{
  "method": "GET",
  "path": "/api/payments/bank-accounts",
  "summary": "List bank accounts created by user on Formance",
  "description": "List all bank accounts created by user on Formance.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BankAccountsCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getBankAccount"></a>

### GET /api/payments/bank-accounts/{bankAccountId}

Get a bank account created by user on Formance

```json
{
  "method": "GET",
  "path": "/api/payments/bank-accounts/{bankAccountId}",
  "summary": "Get a bank account created by user on Formance",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "BankAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-forwardBankAccount"></a>

### POST /api/payments/bank-accounts/{bankAccountId}/forward

Forward a bank account to a connector

```json
{
  "method": "POST",
  "path": "/api/payments/bank-accounts/{bankAccountId}/forward",
  "summary": "Forward a bank account to a connector",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ForwardBankAccountRequest",
      "properties": [
        {
          "name": "connectorID",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "BankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "BankAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-updateBankAccountMetadata"></a>

### PATCH /api/payments/bank-accounts/{bankAccountId}/metadata

Update metadata of a bank account

```json
{
  "method": "PATCH",
  "path": "/api/payments/bank-accounts/{bankAccountId}/metadata",
  "summary": "Update metadata of a bank account",
  "description": "",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "UpdateBankAccountMetadataRequest",
      "properties": [
        {
          "name": "metadata",
          "type": "BankAccountMetadata",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listAllConnectors"></a>

### GET /api/payments/connectors

List all installed connectors

List all installed connectors.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors",
  "summary": "List all installed connectors",
  "description": "List all installed connectors.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConnectorsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of object",
            "required": true,
            "inlineSchema": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": [
                  {
                    "name": "provider",
                    "type": "Connector",
                    "required": true
                  },
                  {
                    "name": "name",
                    "type": "string",
                    "required": true
                  },
                  {
                    "name": "connectorID",
                    "type": "string",
                    "required": true
                  },
                  {
                    "name": "enabled",
                    "type": "boolean"
                  }
                ]
              }
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listConfigsAvailableConnectors"></a>

### GET /api/payments/connectors/configs

List the configs of each available connector

List the configs of each available connector.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/configs",
  "summary": "List the configs of each available connector",
  "description": "List the configs of each available connector.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConnectorsConfigsResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-installConnector"></a>

### POST /api/payments/connectors/{connector}

Install a connector

Install a connector by its name and config.

```json
{
  "method": "POST",
  "path": "/api/payments/connectors/{connector}",
  "summary": "Install a connector",
  "description": "Install a connector by its name and config.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ConnectorConfig",
      "oneOf": [
        {
          "type": "object",
          "ref": "StripeConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Stripe Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.\n",
              "example": "120m"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pageSize",
              "type": "integer (int64)",
              "description": "Number of BalanceTransaction to fetch at each polling interval.\n",
              "example": 50
            }
          ]
        },
        {
          "type": "object",
          "ref": "DummyPayConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My DummyPay Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "filePollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new payment objects from the directory",
              "example": "60s"
            },
            {
              "name": "directory",
              "type": "string",
              "required": true,
              "example": "/tmp/dummypay"
            },
            {
              "name": "prefixFileToIngest",
              "type": "string"
            },
            {
              "name": "numberOfAccountsPreGenerated",
              "type": "integer (int64)"
            },
            {
              "name": "numberOfPaymentsPreGenerated",
              "type": "integer (int64)"
            }
          ]
        },
        {
          "type": "object",
          "ref": "WiseConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Wise Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Wise API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "ModulrConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Modulr Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Modulr API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "CurrencyCloudConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My CurrencyCloud Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "loginID",
              "type": "string",
              "description": "Username of the API Key holder",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will fetch transactions",
              "example": "60s"
            },
            {
              "name": "endpoint",
              "type": "string",
              "description": "The endpoint to use for the API. Defaults to https://devapi.currencycloud.com",
              "example": "XXX"
            }
          ]
        },
        {
          "type": "object",
          "ref": "BankingCircleConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Banking Circle Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "username",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "password",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "authorizationEndpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "userCertificate",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "userCertificateKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Banking Circle API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "MangoPayConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My MangoPay Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MangoPay API.\n",
              "example": "120m"
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            }
          ]
        },
        {
          "type": "object",
          "ref": "MoneycorpConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Moneycorp Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MoneyCorp API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "AtlarConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Atlar Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "baseUrl",
              "type": "string",
              "description": "The base URL the client uses for making requests towards the Atlar API.\n",
              "example": "https://api.example.com"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector tries to fetch new Transaction objects from the Atlar API.\n",
              "example": "120m"
            },
            {
              "name": "transferInitiationStatusPollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector tries to fetch the status of payment initiations from the Atlar API.\n",
              "example": "60s"
            },
            {
              "name": "accessKey",
              "type": "string",
              "description": "The access key used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated secret from the Atlar dashboard.\n",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "secret",
              "type": "string",
              "description": "The secret used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated access key from the Atlar dashboard.\n",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pageSize",
              "type": "integer (int64)",
              "description": "Number of items to fetch when querying paginated APIs.\n",
              "example": 50
            }
          ]
        },
        {
          "type": "object",
          "ref": "AdyenConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Adyen Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "hmacKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "liveEndpointPrefix",
              "type": "string",
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Adyen API.\n",
              "example": "60s"
            }
          ]
        },
        {
          "type": "object",
          "ref": "GenericConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Generic Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from the API.\n",
              "example": "120m"
            }
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConnectorResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "connectorID",
                  "type": "string",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-uninstallConnector"></a>

### DELETE /api/payments/connectors/{connector}

Uninstall a connector

Uninstall a connector by its name.

```json
{
  "method": "DELETE",
  "path": "/api/payments/connectors/{connector}",
  "summary": "Uninstall a connector",
  "description": "Uninstall a connector by its name.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-uninstallConnectorV1"></a>

### DELETE /api/payments/connectors/{connector}/{connectorId}

Uninstall a connector

Uninstall a connector by its name.

```json
{
  "method": "DELETE",
  "path": "/api/payments/connectors/{connector}/{connectorId}",
  "summary": "Uninstall a connector",
  "description": "Uninstall a connector by its name.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-readConnectorConfig"></a>

### GET /api/payments/connectors/{connector}/config

Read the config of a connector

Read connector config

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/config",
  "summary": "Read the config of a connector",
  "description": "Read connector config",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConnectorConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "ConnectorConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-updateConnectorConfigV1"></a>

### POST /api/payments/connectors/{connector}/{connectorId}/config

Update the config of a connector

Update connector config

```json
{
  "method": "POST",
  "path": "/api/payments/connectors/{connector}/{connectorId}/config",
  "summary": "Update the config of a connector",
  "description": "Update connector config",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ConnectorConfig",
      "oneOf": [
        {
          "type": "object",
          "ref": "StripeConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Stripe Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.\n",
              "example": "120m"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pageSize",
              "type": "integer (int64)",
              "description": "Number of BalanceTransaction to fetch at each polling interval.\n",
              "example": 50
            }
          ]
        },
        {
          "type": "object",
          "ref": "DummyPayConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My DummyPay Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "filePollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new payment objects from the directory",
              "example": "60s"
            },
            {
              "name": "directory",
              "type": "string",
              "required": true,
              "example": "/tmp/dummypay"
            },
            {
              "name": "prefixFileToIngest",
              "type": "string"
            },
            {
              "name": "numberOfAccountsPreGenerated",
              "type": "integer (int64)"
            },
            {
              "name": "numberOfPaymentsPreGenerated",
              "type": "integer (int64)"
            }
          ]
        },
        {
          "type": "object",
          "ref": "WiseConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Wise Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Wise API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "ModulrConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Modulr Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Modulr API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "CurrencyCloudConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My CurrencyCloud Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "loginID",
              "type": "string",
              "description": "Username of the API Key holder",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will fetch transactions",
              "example": "60s"
            },
            {
              "name": "endpoint",
              "type": "string",
              "description": "The endpoint to use for the API. Defaults to https://devapi.currencycloud.com",
              "example": "XXX"
            }
          ]
        },
        {
          "type": "object",
          "ref": "BankingCircleConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Banking Circle Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "username",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "password",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "authorizationEndpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "userCertificate",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "userCertificateKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Banking Circle API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "MangoPayConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My MangoPay Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MangoPay API.\n",
              "example": "120m"
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            }
          ]
        },
        {
          "type": "object",
          "ref": "MoneycorpConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Moneycorp Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MoneyCorp API.\n",
              "example": "120m"
            }
          ]
        },
        {
          "type": "object",
          "ref": "AtlarConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Atlar Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "baseUrl",
              "type": "string",
              "description": "The base URL the client uses for making requests towards the Atlar API.\n",
              "example": "https://api.example.com"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector tries to fetch new Transaction objects from the Atlar API.\n",
              "example": "120m"
            },
            {
              "name": "transferInitiationStatusPollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector tries to fetch the status of payment initiations from the Atlar API.\n",
              "example": "60s"
            },
            {
              "name": "accessKey",
              "type": "string",
              "description": "The access key used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated secret from the Atlar dashboard.\n",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "secret",
              "type": "string",
              "description": "The secret used by the connector for authorizing requests to the Atlar API.\nYou can obtain it along with the associated access key from the Atlar dashboard.\n",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pageSize",
              "type": "integer (int64)",
              "description": "Number of items to fetch when querying paginated APIs.\n",
              "example": 50
            }
          ]
        },
        {
          "type": "object",
          "ref": "AdyenConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Adyen Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "hmacKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "liveEndpointPrefix",
              "type": "string",
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Adyen API.\n",
              "example": "60s"
            }
          ]
        },
        {
          "type": "object",
          "ref": "GenericConfig",
          "properties": [
            {
              "name": "name",
              "type": "string",
              "required": true,
              "example": "My Generic Account"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "apiKey",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true,
              "example": "XXX"
            },
            {
              "name": "pollingPeriod",
              "type": "string",
              "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from the API.\n",
              "example": "120m"
            }
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-readConnectorConfigV1"></a>

### GET /api/payments/connectors/{connector}/{connectorId}/config

Read the config of a connector

Read connector config

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/{connectorId}/config",
  "summary": "Read the config of a connector",
  "description": "Read connector config",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConnectorConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "ConnectorConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-resetConnector"></a>

### POST /api/payments/connectors/{connector}/reset

Reset a connector

Reset a connector by its name.
It will remove the connector and ALL PAYMENTS generated with it.

```json
{
  "method": "POST",
  "path": "/api/payments/connectors/{connector}/reset",
  "summary": "Reset a connector",
  "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-resetConnectorV1"></a>

### POST /api/payments/connectors/{connector}/{connectorId}/reset

Reset a connector

Reset a connector by its name.
It will remove the connector and ALL PAYMENTS generated with it.

```json
{
  "method": "POST",
  "path": "/api/payments/connectors/{connector}/{connectorId}/reset",
  "summary": "Reset a connector",
  "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listConnectorTasks"></a>

### GET /api/payments/connectors/{connector}/tasks

List tasks from a connector

List all tasks associated with this connector.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/tasks",
  "summary": "List tasks from a connector",
  "description": "List all tasks associated with this connector.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TasksCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-listConnectorTasksV1"></a>

### GET /api/payments/connectors/{connector}/{connectorId}/tasks

List tasks from a connector

List all tasks associated with this connector.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/{connectorId}/tasks",
  "summary": "List tasks from a connector",
  "description": "List all tasks associated with this connector.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TasksCursor",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getConnectorTask"></a>

### GET /api/payments/connectors/{connector}/tasks/{taskId}

Read a specific task of the connector

Get a specific task associated to the connector.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/tasks/{taskId}",
  "summary": "Read a specific task of the connector",
  "description": "Get a specific task associated to the connector.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TaskResponse",
        "properties": [
          {
            "name": "data",
            "type": "oneOf",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "oneOf": [
                {
                  "type": "object",
                  "ref": "TaskStripe",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string",
                            "required": true
                          },
                          {
                            "name": "main",
                            "type": "boolean"
                          },
                          {
                            "name": "account",
                            "type": "string",
                            "required": true
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskWise",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "profileID",
                            "type": "integer (int64)"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskCurrencyCloud",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskDummyPay",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "fileName",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskModulr",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "accountID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskBankingCircle",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskMangoPay",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "userID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskMoneycorp",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "accountID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-getConnectorTaskV1"></a>

### GET /api/payments/connectors/{connector}/{connectorId}/tasks/{taskId}

Read a specific task of the connector

Get a specific task associated to the connector.

```json
{
  "method": "GET",
  "path": "/api/payments/connectors/{connector}/{connectorId}/tasks/{taskId}",
  "summary": "Read a specific task of the connector",
  "description": "Get a specific task associated to the connector.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TaskResponse",
        "properties": [
          {
            "name": "data",
            "type": "oneOf",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "oneOf": [
                {
                  "type": "object",
                  "ref": "TaskStripe",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string",
                            "required": true
                          },
                          {
                            "name": "main",
                            "type": "boolean"
                          },
                          {
                            "name": "account",
                            "type": "string",
                            "required": true
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskWise",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "profileID",
                            "type": "integer (int64)"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskCurrencyCloud",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskDummyPay",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "fileName",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskModulr",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "accountID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskBankingCircle",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskMangoPay",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "userID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "ref": "TaskMoneycorp",
                  "properties": [
                    {
                      "name": "id",
                      "type": "string (uuid)",
                      "required": true
                    },
                    {
                      "name": "connectorID",
                      "type": "string",
                      "required": true
                    },
                    {
                      "name": "createdAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "updatedAt",
                      "type": "string (date-time)",
                      "required": true
                    },
                    {
                      "name": "status",
                      "type": "TaskStatus",
                      "required": true
                    },
                    {
                      "name": "state",
                      "type": "object"
                    },
                    {
                      "name": "error",
                      "type": "string"
                    },
                    {
                      "name": "descriptor",
                      "type": "object",
                      "required": true,
                      "inlineSchema": {
                        "type": "object",
                        "properties": [
                          {
                            "name": "name",
                            "type": "string"
                          },
                          {
                            "name": "key",
                            "type": "string"
                          },
                          {
                            "name": "accountID",
                            "type": "string"
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-connectorsTransfer"></a>

### POST /api/payments/connectors/{connector}/transfers

Transfer funds between Connector accounts

Execute a transfer between two accounts.

```json
{
  "method": "POST",
  "path": "/api/payments/connectors/{connector}/transfers",
  "summary": "Transfer funds between Connector accounts",
  "description": "Execute a transfer between two accounts.",
  "tags": [
    "payments.v1"
  ],
  "module": "Payments",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "TransferRequest",
      "properties": [
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true,
          "example": 100
        },
        {
          "name": "asset",
          "type": "string",
          "required": true,
          "example": "USD"
        },
        {
          "name": "destination",
          "type": "string",
          "required": true,
          "example": "acct_1Gqj58KZcSIg2N2q"
        },
        {
          "name": "source",
          "type": "string",
          "example": "acct_1Gqj58KZcSIg2N2q"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "TransferResponse",
        "properties": [
          {
            "name": "id",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreateAccount"></a>

### POST /api/payments/v3/accounts

Create Account

Create a Formance account object for internal tracking.

**Note:** This account is NOT forwarded to the connector - it is used for internal purposes only.

**Request Body:**

```json
{
  "reference": "acc_stripe_123",
  "createdAt": "2024-01-15T10:30:00Z",
  "connectorID": "stripe",
  "type": "INTERNAL",
  "accountName": "Main Stripe Account",
  "defaultAsset": "USD/2",
  "metadata": {
    "owner": "treasury"
  }
}
```

See [Accounts Concepts](https://docs.formance.com/modules/payments/accounts) for more details.

````json
{
  "method": "POST",
  "path": "/api/payments/v3/accounts",
  "summary": "Create Account",
  "description": "Create a Formance account object for internal tracking.\n\n**Note:** This account is NOT forwarded to the connector - it is used for internal purposes only.\n\n**Request Body:**\n```json\n{\n  \"reference\": \"acc_stripe_123\",\n  \"createdAt\": \"2024-01-15T10:30:00Z\",\n  \"connectorID\": \"stripe\",\n  \"type\": \"INTERNAL\",\n  \"accountName\": \"Main Stripe Account\",\n  \"defaultAsset\": \"USD/2\",\n  \"metadata\": {\n    \"owner\": \"treasury\"\n  }\n}\n```\n\nSee [Accounts Concepts](/modules/payments/accounts) for more details.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Account details to create. The `createdAt` field is required.",
    "schema": {
      "type": "object",
      "ref": "V3CreateAccountRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string (byte)",
          "required": true
        },
        {
          "name": "createdAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "accountName",
          "type": "string",
          "required": true
        },
        {
          "name": "type",
          "type": "V3AccountTypeEnum",
          "required": true
        },
        {
          "name": "defaultAsset",
          "type": "string"
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3CreateAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Account",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListAccounts"></a>

### GET /api/payments/v3/accounts

List Accounts

List all payment accounts across all connected payment service providers.

**Account Types:**

- **INTERNAL**: Accounts where you have operational control (e.g., digital wallets, PSP accounts)
- **EXTERNAL**: Destination accounts for payouts (bank accounts)

See [Accounts Concepts](https://docs.formance.com/modules/payments/accounts) for more details.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/accounts",
  "summary": "List Accounts",
  "description": "List all payment accounts across all connected payment service providers.\n\n**Account Types:**\n- **INTERNAL**: Accounts where you have operational control (e.g., digital wallets, PSP accounts)\n- **EXTERNAL**: Destination accounts for payouts (bank accounts)\n\nSee [Accounts Concepts](/modules/payments/accounts) for more details.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3AccountsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Account",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetAccount"></a>

### GET /api/payments/v3/accounts/{accountID}

Get Account

Retrieve detailed information about a specific payment account.

**Response includes:**

- **ID**: Unique identifier within Formance
- **Reference**: Account reference on the payments provider
- **Type**: INTERNAL or EXTERNAL
- **DefaultAsset**: Default currency/asset
- **AccountName**: Human-readable name

```json
{
  "method": "GET",
  "path": "/api/payments/v3/accounts/{accountID}",
  "summary": "Get Account",
  "description": "Retrieve detailed information about a specific payment account.\n\n**Response includes:**\n- **ID**: Unique identifier within Formance\n- **Reference**: Account reference on the payments provider\n- **Type**: INTERNAL or EXTERNAL\n- **DefaultAsset**: Default currency/asset\n- **AccountName**: Human-readable name\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Account",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetAccountBalances"></a>

### GET /api/payments/v3/accounts/{accountID}/balances

Get Account Balances

Retrieve current balances for a specific account.

Only available for INTERNAL accounts. Balances are returned using Unambiguous Monetary Notation (e.g., USD/2).

```json
{
  "method": "GET",
  "path": "/api/payments/v3/accounts/{accountID}/balances",
  "summary": "Get Account Balances",
  "description": "Retrieve current balances for a specific account.\n\nOnly available for INTERNAL accounts. Balances are returned using Unambiguous Monetary Notation (e.g., USD/2).\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3BalancesCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Balance",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreateBankAccount"></a>

### POST /api/payments/v3/bank-accounts

Create Bank Account

Create an EXTERNAL bank account for payouts.

**Two-Step Process:**

1. **Create** (this endpoint): Store bank account details in Formance
2. **Forward**: Send to PSP via Forward Bank Account endpoint

**Request Body:**

```json
{
  "name": "John Doe Checking",
  "accountNumber": "1234567890",
  "iban": "DE89370400440532013000",
  "bic": "COBADEFFXXX",
  "country": "DE",
  "metadata": {
    "beneficiary": "john_doe"
  }
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/bank-accounts",
  "summary": "Create Bank Account",
  "description": "Create an EXTERNAL bank account for payouts.\n\n**Two-Step Process:**\n1. **Create** (this endpoint): Store bank account details in Formance\n2. **Forward**: Send to PSP via Forward Bank Account endpoint\n\n**Request Body:**\n```json\n{\n  \"name\": \"John Doe Checking\",\n  \"accountNumber\": \"1234567890\",\n  \"iban\": \"DE89370400440532013000\",\n  \"bic\": \"COBADEFFXXX\",\n  \"country\": \"DE\",\n  \"metadata\": {\n    \"beneficiary\": \"john_doe\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Bank account details",
    "schema": {
      "type": "object",
      "ref": "V3CreateBankAccountRequest",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "accountNumber",
          "type": "string"
        },
        {
          "name": "iban",
          "type": "string"
        },
        {
          "name": "swiftBicCode",
          "type": "string"
        },
        {
          "name": "country",
          "type": "string"
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3CreateBankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "string",
            "description": "The ID of the created bank account",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListBankAccounts"></a>

### GET /api/payments/v3/bank-accounts

List Bank Accounts

List all bank accounts stored in the system.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/bank-accounts",
  "summary": "List Bank Accounts",
  "description": "List all bank accounts stored in the system.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3BankAccountsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3BankAccount",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetBankAccount"></a>

### GET /api/payments/v3/bank-accounts/{bankAccountID}

Get Bank Account

Retrieve details of a specific bank account including IBAN, BIC, and forwarding status.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/bank-accounts/{bankAccountID}",
  "summary": "Get Bank Account",
  "description": "Retrieve details of a specific bank account including IBAN, BIC, and forwarding status.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetBankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3BankAccount",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UpdateBankAccountMetadata"></a>

### PATCH /api/payments/v3/bank-accounts/{bankAccountID}/metadata

Update Bank Account Metadata

Update custom metadata attached to a bank account.

**Request Body:**

```json
{
  "metadata": {
    "verified": "true",
    "verification_date": "2024-01-15"
  }
}
```

````json
{
  "method": "PATCH",
  "path": "/api/payments/v3/bank-accounts/{bankAccountID}/metadata",
  "summary": "Update Bank Account Metadata",
  "description": "Update custom metadata attached to a bank account.\n\n**Request Body:**\n```json\n{\n  \"metadata\": {\n    \"verified\": \"true\",\n    \"verification_date\": \"2024-01-15\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Metadata to update",
    "schema": {
      "type": "object",
      "ref": "V3UpdateBankAccountMetadataRequest",
      "properties": [
        {
          "name": "metadata",
          "type": "V3Metadata",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ForwardBankAccount"></a>

### POST /api/payments/v3/bank-accounts/{bankAccountID}/forward

Forward Bank Account

Forward a bank account to a Payment Service Provider.

This sends the bank account details to the connector so it can be used as a payout destination.

**Request Body:**

```json
{
  "connectorID": "stripe_123"
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/bank-accounts/{bankAccountID}/forward",
  "summary": "Forward Bank Account",
  "description": "Forward a bank account to a Payment Service Provider.\n\nThis sends the bank account details to the connector so it can be used as a payout destination.\n\n**Request Body:**\n```json\n{\n  \"connectorID\": \"stripe_123\"\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Connector to forward to",
    "schema": {
      "type": "object",
      "ref": "V3ForwardBankAccountRequest",
      "properties": [
        {
          "name": "connectorID",
          "type": "string (byte)",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ForwardBankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to forward the bank account to the PSP. You can use the task API to check the status of the task and get the resulting bank account ID.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListConnectors"></a>

### GET /api/payments/v3/connectors

List Connectors

List all installed connectors.

Returns connectors that have been installed and configured in your system, NOT the available connector types.

**Response includes for each connector:**

- ConnectorID - Unique identifier
- Provider - The PSP type (stripe, wise, adyen, etc.)
- Enabled - Whether the connector is active
- CreatedAt - Installation timestamp

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors",
  "summary": "List Connectors",
  "description": "List all installed connectors.\n\nReturns connectors that have been installed and configured in your system, NOT the available connector types.\n\n**Response includes for each connector:**\n- ConnectorID - Unique identifier\n- Provider - The PSP type (stripe, wise, adyen, etc.)\n- Enabled - Whether the connector is active\n- CreatedAt - Installation timestamp\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ConnectorsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Connector",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3InstallConnector"></a>

### POST /api/payments/v3/connectors/install/{connector}

Install Connector

Install a connection to an external Payment Service Provider (PSP).

**After installation:**

- Historical transactions are synced (backfill)
- Webhooks are configured for real-time updates
- Accounts are imported from the provider

**Example Request Bodies:**

**Stripe:**

```json
{
  "name": "My Stripe Connection",
  "apiKey": "sk_live_xxx"
}
```

**Wise:**

```json
{
  "name": "My Wise Connection",
  "apiKey": "your-api-key",
  "profileID": "12345"
}
```

**Modulr:**

```json
{
  "name": "My Modulr Connection",
  "apiKey": "your-api-key",
  "apiSecret": "your-api-secret",
  "endpoint": "https://api-sandbox.modulrfinance.com"
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/connectors/install/{connector}",
  "summary": "Install Connector",
  "description": "Install a connection to an external Payment Service Provider (PSP).\n\n**After installation:**\n- Historical transactions are synced (backfill)\n- Webhooks are configured for real-time updates\n- Accounts are imported from the provider\n\n**Example Request Bodies:**\n\n**Stripe:**\n```json\n{\n  \"name\": \"My Stripe Connection\",\n  \"apiKey\": \"sk_live_xxx\"\n}\n```\n\n**Wise:**\n```json\n{\n  \"name\": \"My Wise Connection\",\n  \"apiKey\": \"your-api-key\",\n  \"profileID\": \"12345\"\n}\n```\n\n**Modulr:**\n```json\n{\n  \"name\": \"My Modulr Connection\",\n  \"apiKey\": \"your-api-key\",\n  \"apiSecret\": \"your-api-secret\",\n  \"endpoint\": \"https://api-sandbox.modulrfinance.com\"\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Connector configuration. The `name` field is required for all connectors. Other fields vary by connector type.\n",
    "schema": {
      "type": "object",
      "ref": "V3InstallConnectorRequest",
      "oneOf": [
        {
          "type": "object",
          "ref": "V3AdyenConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "companyID",
              "type": "string",
              "required": true
            },
            {
              "name": "liveEndpointPrefix",
              "type": "string"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookPassword",
              "type": "string"
            },
            {
              "name": "webhookUsername",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3AtlarConfig",
          "properties": [
            {
              "name": "accessKey",
              "type": "string",
              "required": true
            },
            {
              "name": "baseUrl",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "secret",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3BankingcircleConfig",
          "properties": [
            {
              "name": "authorizationEndpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "password",
              "type": "string",
              "required": true
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "userCertificate",
              "type": "string",
              "required": true
            },
            {
              "name": "userCertificateKey",
              "type": "string",
              "required": true
            },
            {
              "name": "username",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3ColumnConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3CurrencycloudConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "loginID",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3DummypayConfig",
          "properties": [
            {
              "name": "directory",
              "type": "string",
              "required": true
            },
            {
              "name": "linkFlowError",
              "type": "boolean"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "updateLinkFlowError",
              "type": "boolean"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3GenericConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3IncreaseConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookSharedSecret",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3MangopayConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3ModulrConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3MoneycorpConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3PlaidConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "isSandbox",
              "type": "boolean"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3PowensConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "configurationToken",
              "type": "string",
              "required": true
            },
            {
              "name": "domain",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "maxConnectionsPerLink",
              "type": "integer",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3QontoConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "stagingToken",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3StripeConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3TinkConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3WiseConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookPublicKey",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3CoinbaseprimeConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "passphrase",
              "type": "string",
              "required": true
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "portfolioId",
              "type": "string",
              "required": true
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3FireblocksConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "privateKey",
              "type": "string",
              "required": true
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "202",
      "description": "Accepted - Connector installation started",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3InstallConnectorResponse",
        "properties": [
          {
            "name": "data",
            "type": "string",
            "description": "The ID of the created connector",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListConnectorConfigs"></a>

### GET /api/payments/v3/connectors/configs

List Connector Configs

List all installed connector configurations.

Returns the configuration schema for each installed connector type.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors/configs",
  "summary": "List Connector Configs",
  "description": "List all installed connector configurations.\n\nReturns the configuration schema for each installed connector type.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ConnectorConfigsResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UninstallConnector"></a>

### DELETE /api/payments/v3/connectors/{connectorID}

Uninstall Connector

Uninstall a connector.

**Warning:** This stops syncing and removes the connection. Historical data remains but no new data will be imported.

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/connectors/{connectorID}",
  "summary": "Uninstall Connector",
  "description": "Uninstall a connector.\n\n**Warning:** This stops syncing and removes the connection. Historical data remains but no new data will be imported.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3UninstallConnectorResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to uninstall the connector. You can use the task API to check the status of the task and get the results.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetConnectorConfig"></a>

### GET /api/payments/v3/connectors/{connectorID}/config

Get Connector Config

Get the configuration for a specific installed connector.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors/{connectorID}/config",
  "summary": "Get Connector Config",
  "description": "Get the configuration for a specific installed connector.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetConnectorConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3ConnectorConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UpdateConnectorConfig"></a>

### PATCH /api/payments/v3/connectors/{connectorID}/config

Update Connector Config

Update the configuration for an installed connector.

**Request Body:**

```json
{
  "name": "Updated Connector Name",
  "pollingPeriod": "60s"
}
```

````json
{
  "method": "PATCH",
  "path": "/api/payments/v3/connectors/{connectorID}/config",
  "summary": "Update Connector Config",
  "description": "Update the configuration for an installed connector.\n\n**Request Body:**\n```json\n{\n  \"name\": \"Updated Connector Name\",\n  \"pollingPeriod\": \"60s\"\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Configuration fields to update",
    "schema": {
      "type": "object",
      "ref": "V3UpdateConnectorRequest",
      "oneOf": [
        {
          "type": "object",
          "ref": "V3AdyenConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "companyID",
              "type": "string",
              "required": true
            },
            {
              "name": "liveEndpointPrefix",
              "type": "string"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookPassword",
              "type": "string"
            },
            {
              "name": "webhookUsername",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3AtlarConfig",
          "properties": [
            {
              "name": "accessKey",
              "type": "string",
              "required": true
            },
            {
              "name": "baseUrl",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "secret",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3BankingcircleConfig",
          "properties": [
            {
              "name": "authorizationEndpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "password",
              "type": "string",
              "required": true
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "userCertificate",
              "type": "string",
              "required": true
            },
            {
              "name": "userCertificateKey",
              "type": "string",
              "required": true
            },
            {
              "name": "username",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3ColumnConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3CurrencycloudConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "loginID",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3DummypayConfig",
          "properties": [
            {
              "name": "directory",
              "type": "string",
              "required": true
            },
            {
              "name": "linkFlowError",
              "type": "boolean"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "updateLinkFlowError",
              "type": "boolean"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3GenericConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3IncreaseConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookSharedSecret",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3MangopayConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3ModulrConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3MoneycorpConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3PlaidConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "isSandbox",
              "type": "boolean"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3PowensConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "configurationToken",
              "type": "string",
              "required": true
            },
            {
              "name": "domain",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "maxConnectionsPerLink",
              "type": "integer",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3QontoConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "stagingToken",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3StripeConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3TinkConfig",
          "properties": [
            {
              "name": "clientID",
              "type": "string",
              "required": true
            },
            {
              "name": "clientSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3WiseConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "provider",
              "type": "string"
            },
            {
              "name": "webhookPublicKey",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3CoinbaseprimeConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "apiSecret",
              "type": "string",
              "required": true
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "passphrase",
              "type": "string",
              "required": true
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "portfolioId",
              "type": "string",
              "required": true
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        },
        {
          "type": "object",
          "ref": "V3FireblocksConfig",
          "properties": [
            {
              "name": "apiKey",
              "type": "string",
              "required": true
            },
            {
              "name": "endpoint",
              "type": "string"
            },
            {
              "name": "name",
              "type": "string",
              "required": true
            },
            {
              "name": "pageSize",
              "type": "integer"
            },
            {
              "name": "pollingPeriod",
              "type": "string"
            },
            {
              "name": "privateKey",
              "type": "string",
              "required": true
            },
            {
              "name": "provider",
              "type": "string"
            }
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PaymentsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "PaymentsErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing reference"
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ResetConnector"></a>

### POST /api/payments/v3/connectors/{connectorID}/reset

Reset Connector

Reset a connector.

This clears all synced data and triggers a fresh backfill from the beginning. Use with caution.

```json
{
  "method": "POST",
  "path": "/api/payments/v3/connectors/{connectorID}/reset",
  "summary": "Reset Connector",
  "description": "Reset a connector.\n\nThis clears all synced data and triggers a fresh backfill from the beginning. Use with caution.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "202",
      "description": "Accepted - Reset started",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ResetConnectorResponse",
        "properties": [
          {
            "name": "data",
            "type": "string",
            "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to reset the connector. You can use the task API to check the status of the task and get the results.\n",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListConnectorSchedules"></a>

### GET /api/payments/v3/connectors/{connectorID}/schedules

List Connector Schedules

List all sync schedules for a connector.

Schedules define how often the connector polls for new data from the PSP.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors/{connectorID}/schedules",
  "summary": "List Connector Schedules",
  "description": "List all sync schedules for a connector.\n\nSchedules define how often the connector polls for new data from the PSP.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ConnectorSchedulesCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Schedule",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetConnectorSchedule"></a>

### GET /api/payments/v3/connectors/{connectorID}/schedules/{scheduleID}

Get Connector Schedule

Get details of a specific sync schedule.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors/{connectorID}/schedules/{scheduleID}",
  "summary": "Get Connector Schedule",
  "description": "Get details of a specific sync schedule.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ConnectorScheduleResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Schedule",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListConnectorScheduleInstances"></a>

### GET /api/payments/v3/connectors/{connectorID}/schedules/{scheduleID}/instances

List Schedule Instances

List all execution instances of a schedule.

Each instance represents a single execution of the scheduled sync task.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/connectors/{connectorID}/schedules/{scheduleID}/instances",
  "summary": "List Schedule Instances",
  "description": "List all execution instances of a schedule.\n\nEach instance represents a single execution of the scheduled sync task.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ConnectorScheduleInstancesCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Instance",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreatePayment"></a>

### POST /api/payments/v3/payments

Create Payment

Create a payment record manually.

Use this to record payments that occurred outside of Formance or to create adjustments.

**Request Body:**

```json
{
  "reference": "pay_manual_001",
  "createdAt": "2024-01-15T10:30:00Z",
  "connectorID": "stripe_123",
  "type": "PAY-IN",
  "status": "SUCCEEDED",
  "amount": 10000,
  "asset": "USD/2",
  "scheme": "visa",
  "sourceAccountID": "acct_external",
  "destinationAccountID": "acct_internal",
  "metadata": {
    "order_id": "order_123"
  }
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/payments",
  "summary": "Create Payment",
  "description": "Create a payment record manually.\n\nUse this to record payments that occurred outside of Formance or to create adjustments.\n\n**Request Body:**\n```json\n{\n  \"reference\": \"pay_manual_001\",\n  \"createdAt\": \"2024-01-15T10:30:00Z\",\n  \"connectorID\": \"stripe_123\",\n  \"type\": \"PAY-IN\",\n  \"status\": \"SUCCEEDED\",\n  \"amount\": 10000,\n  \"asset\": \"USD/2\",\n  \"scheme\": \"visa\",\n  \"sourceAccountID\": \"acct_external\",\n  \"destinationAccountID\": \"acct_internal\",\n  \"metadata\": {\n    \"order_id\": \"order_123\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payments",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Payment details. The `createdAt` field is required.",
    "schema": {
      "type": "object",
      "ref": "V3CreatePaymentRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string (byte)",
          "required": true
        },
        {
          "name": "createdAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "type",
          "type": "V3PaymentTypeEnum",
          "required": true
        },
        {
          "name": "initialAmount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true
        },
        {
          "name": "scheme",
          "type": "string",
          "required": true
        },
        {
          "name": "sourceAccountID",
          "type": "string (byte)"
        },
        {
          "name": "destinationAccountID",
          "type": "string (byte)"
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        },
        {
          "name": "adjustments",
          "type": "array of V3CreatePaymentAdjustmentRequest"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3CreatePaymentResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Payment",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListPayments"></a>

### GET /api/payments/v3/payments

List Payments

List all payments across all connectors.

Formance normalizes payments from different providers into a unified model.

**Payment Types:**

- **PAY-IN**: Incoming payments (money coming in)
- **PAYOUT**: Outgoing payments (money going out)
- **TRANSFER**: Transfer between accounts
- **OTHER**: Other types of payments

See [Payments Concepts](https://docs.formance.com/modules/payments/payments) for more details.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payments",
  "summary": "List Payments",
  "description": "List all payments across all connectors.\n\nFormance normalizes payments from different providers into a unified model.\n\n**Payment Types:**\n- **PAY-IN**: Incoming payments (money coming in)\n- **PAYOUT**: Outgoing payments (money going out)\n- **TRANSFER**: Transfer between accounts\n- **OTHER**: Other types of payments\n\nSee [Payments Concepts](/modules/payments/payments) for more details.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payments",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Payment",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPayment"></a>

### GET /api/payments/v3/payments/{paymentID}

Get Payment

Retrieve details of a specific payment.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payments/{paymentID}",
  "summary": "Get Payment",
  "description": "Retrieve details of a specific payment.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payments",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetPaymentResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Payment",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UpdatePaymentMetadata"></a>

### PATCH /api/payments/v3/payments/{paymentID}/metadata

Update Payment Metadata

Update custom metadata on a payment.

**Request Body:**

```json
{
  "metadata": {
    "reconciled": "true",
    "notes": "Matched with ledger entry"
  }
}
```

````json
{
  "method": "PATCH",
  "path": "/api/payments/v3/payments/{paymentID}/metadata",
  "summary": "Update Payment Metadata",
  "description": "Update custom metadata on a payment.\n\n**Request Body:**\n```json\n{\n  \"metadata\": {\n    \"reconciled\": \"true\",\n    \"notes\": \"Matched with ledger entry\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payments",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Metadata to update",
    "schema": {
      "type": "object",
      "ref": "V3UpdatePaymentMetadataRequest",
      "properties": [
        {
          "name": "metadata",
          "type": "V3Metadata",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3InitiatePayment"></a>

### POST /api/payments/v3/payment-initiations

Initiate Payment

Initiate a new payment through a connector (e.g., payout to bank account).

**Workflow:**

1. **Create**: Submit initiation request
2. **Approve/Reject**: Optional manual approval step
3. **Process**: Connector executes the payment

**Request Body:**

```json
{
  "reference": "payout_001",
  "connectorID": "stripe_123",
  "type": "PAYOUT",
  "amount": 50000,
  "asset": "USD/2",
  "sourceAccountID": "acct_internal",
  "destinationAccountID": "acct_external_bank",
  "description": "Vendor payment",
  "metadata": {
    "invoice_id": "inv_123"
  }
}
```

See [Transfer Initiations](https://docs.formance.com/modules/payments/transfer-initiation) for more details.

````json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-initiations",
  "summary": "Initiate Payment",
  "description": "Initiate a new payment through a connector (e.g., payout to bank account).\n\n**Workflow:**\n1. **Create**: Submit initiation request\n2. **Approve/Reject**: Optional manual approval step\n3. **Process**: Connector executes the payment\n\n**Request Body:**\n```json\n{\n  \"reference\": \"payout_001\",\n  \"connectorID\": \"stripe_123\",\n  \"type\": \"PAYOUT\",\n  \"amount\": 50000,\n  \"asset\": \"USD/2\",\n  \"sourceAccountID\": \"acct_internal\",\n  \"destinationAccountID\": \"acct_external_bank\",\n  \"description\": \"Vendor payment\",\n  \"metadata\": {\n    \"invoice_id\": \"inv_123\"\n  }\n}\n```\n\nSee [Transfer Initiations](/modules/payments/transfer-initiation) for more details.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Payment initiation details",
    "schema": {
      "type": "object",
      "ref": "V3InitiatePaymentRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "scheduledAt",
          "type": "string (date-time)",
          "required": true
        },
        {
          "name": "connectorID",
          "type": "string (byte)",
          "required": true
        },
        {
          "name": "description",
          "type": "string",
          "required": true
        },
        {
          "name": "type",
          "type": "V3PaymentInitiationTypeEnum",
          "required": true
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true
        },
        {
          "name": "sourceAccountID",
          "type": "string (byte)"
        },
        {
          "name": "destinationAccountID",
          "type": "string (byte)"
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3InitiatePaymentResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "paymentInitiationID",
                  "type": "string",
                  "description": "Related payment initiation object ID created.\n"
                },
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Will be filled if the noValidation query parameter is set to true. Since this call is asynchronous, the response will contain the ID of the task that was created to create the payment on the PSP. You can use the task API to check the status of the task and get the resulting payment ID\n"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListPaymentInitiations"></a>

### GET /api/payments/v3/payment-initiations

List Payment Initiations

List all payment initiations.

**Statuses:**

- **WAITING\_FOR\_VALIDATION**: Pending approval
- **PROCESSING**: Being executed
- **PROCESSED**: Completed successfully
- **FAILED**: Failed to execute
- **REJECTED**: Manually rejected
- **REVERSED**: Reversed after completion

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-initiations",
  "summary": "List Payment Initiations",
  "description": "List all payment initiations.\n\n**Statuses:**\n- **WAITING_FOR_VALIDATION**: Pending approval\n- **PROCESSING**: Being executed\n- **PROCESSED**: Completed successfully\n- **FAILED**: Failed to execute\n- **REJECTED**: Manually rejected\n- **REVERSED**: Reversed after completion\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentInitiationsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentInitiation",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3DeletePaymentInitiation"></a>

### DELETE /api/payments/v3/payment-initiations/{paymentInitiationID}

Delete Payment Initiation

Delete a payment initiation.

Only initiations in WAITING\_FOR\_VALIDATION status can be deleted.

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}",
  "summary": "Delete Payment Initiation",
  "description": "Delete a payment initiation.\n\nOnly initiations in WAITING_FOR_VALIDATION status can be deleted.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPaymentInitiation"></a>

### GET /api/payments/v3/payment-initiations/{paymentInitiationID}

Get Payment Initiation

Retrieve details of a specific payment initiation.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}",
  "summary": "Get Payment Initiation",
  "description": "Retrieve details of a specific payment initiation.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetPaymentInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3PaymentInitiation",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3RetryPaymentInitiation"></a>

### POST /api/payments/v3/payment-initiations/{paymentInitiationID}/retry

Retry Payment Initiation

Retry a failed payment initiation.

This creates a new attempt to process the payment through the connector.

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/retry",
  "summary": "Retry Payment Initiation",
  "description": "Retry a failed payment initiation.\n\nThis creates a new attempt to process the payment through the connector.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3RetryPaymentInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to retry the payment initiation to the PSP. You can use the task API to check the status of the task and get the resulting payment ID.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ApprovePaymentInitiation"></a>

### POST /api/payments/v3/payment-initiations/{paymentInitiationID}/approve

Approve Payment Initiation

Approve a payment initiation that is waiting for validation.

This moves the initiation to PROCESSING status.

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/approve",
  "summary": "Approve Payment Initiation",
  "description": "Approve a payment initiation that is waiting for validation.\n\nThis moves the initiation to PROCESSING status.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ApprovePaymentInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to approve the payment initiation. You can use the task API to check the status of the task and get the resulting payment ID.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3RejectPaymentInitiation"></a>

### POST /api/payments/v3/payment-initiations/{paymentInitiationID}/reject

Reject Payment Initiation

Reject a payment initiation that is waiting for validation.

This permanently rejects the initiation and prevents it from being processed.

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/reject",
  "summary": "Reject Payment Initiation",
  "description": "Reject a payment initiation that is waiting for validation.\n\nThis permanently rejects the initiation and prevents it from being processed.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ReversePaymentInitiation"></a>

### POST /api/payments/v3/payment-initiations/{paymentInitiationID}/reverse

Reverse Payment Initiation

Reverse a processed payment initiation.

This creates a reversal through the connector. Availability depends on the PSP.

**Request Body:**

```json
{
  "reference": "reversal_001",
  "description": "Customer refund request",
  "amount": 50000,
  "asset": "USD/2",
  "metadata": {
    "reason": "customer_request"
  }
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/reverse",
  "summary": "Reverse Payment Initiation",
  "description": "Reverse a processed payment initiation.\n\nThis creates a reversal through the connector. Availability depends on the PSP.\n\n**Request Body:**\n```json\n{\n  \"reference\": \"reversal_001\",\n  \"description\": \"Customer refund request\",\n  \"amount\": 50000,\n  \"asset\": \"USD/2\",\n  \"metadata\": {\n    \"reason\": \"customer_request\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Reversal details",
    "schema": {
      "type": "object",
      "ref": "V3ReversePaymentInitiationRequest",
      "properties": [
        {
          "name": "reference",
          "type": "string",
          "required": true
        },
        {
          "name": "description",
          "type": "string",
          "required": true
        },
        {
          "name": "amount",
          "type": "integer (bigint)",
          "required": true
        },
        {
          "name": "asset",
          "type": "string",
          "required": true
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ReversePaymentInitiationResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to reverse the payment initiation. You can use the task API to check the status of the task and get the resulting payment ID.\n"
                },
                {
                  "name": "paymentInitiationReversalID",
                  "type": "string",
                  "description": "Related payment initiation reversal object ID created.\n"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListPaymentInitiationAdjustments"></a>

### GET /api/payments/v3/payment-initiations/{paymentInitiationID}/adjustments

List Payment Initiation Adjustments

List all adjustments made to a payment initiation.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/adjustments",
  "summary": "List Payment Initiation Adjustments",
  "description": "List all adjustments made to a payment initiation.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentInitiationAdjustmentsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentInitiationAdjustment",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListPaymentInitiationRelatedPayments"></a>

### GET /api/payments/v3/payment-initiations/{paymentInitiationID}/payments

List Related Payments

List all payments related to a payment initiation.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-initiations/{paymentInitiationID}/payments",
  "summary": "List Related Payments",
  "description": "List all payments related to a payment initiation.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Initiations",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentInitiationRelatedPaymentsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Payment",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreatePaymentServiceUser"></a>

### POST /api/payments/v3/payment-service-users

Create Payment Service User

Create a Payment Service User (PSU) for Open Banking flows.

**Request Body:**

```json
{
  "reference": "psu_001",
  "name": "John Doe",
  "email": "john@example.com",
  "contactDetails": {
    "phoneNumber": "+1234567890"
  },
  "metadata": {
    "customer_id": "cust_123"
  }
}
```

````json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users",
  "summary": "Create Payment Service User",
  "description": "Create a Payment Service User (PSU) for Open Banking flows.\n\n**Request Body:**\n```json\n{\n  \"reference\": \"psu_001\",\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"contactDetails\": {\n    \"phoneNumber\": \"+1234567890\"\n  },\n  \"metadata\": {\n    \"customer_id\": \"cust_123\"\n  }\n}\n```\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Service Users",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Payment service user details",
    "schema": {
      "type": "object",
      "ref": "V3CreatePaymentServiceUserRequest",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "contactDetails",
          "type": "V3ContactDetailsRequest"
        },
        {
          "name": "address",
          "type": "V3AddressRequest"
        },
        {
          "name": "bankAccountIDs",
          "type": "array of string"
        },
        {
          "name": "metadata",
          "type": "V3Metadata"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3CreatePaymentServiceUserResponse",
        "properties": [
          {
            "name": "data",
            "type": "string",
            "description": "The ID of the created payment service user",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListPaymentServiceUsers"></a>

### GET /api/payments/v3/payment-service-users

List Payment Service Users

List all payment service users.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users",
  "summary": "List Payment Service Users",
  "description": "List all payment service users.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Service Users",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUsersCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentServiceUser",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPaymentServiceUser"></a>

### GET /api/payments/v3/payment-service-users/{paymentServiceUserID}

Get Payment Service User

Retrieve details of a specific payment service user.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}",
  "summary": "Get Payment Service User",
  "description": "Retrieve details of a specific payment service user.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Service Users",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetPaymentServiceUserResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3PaymentServiceUser",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3DeletePaymentServiceUser"></a>

### DELETE /api/payments/v3/payment-service-users/{paymentServiceUserID}

Delete Payment Service User

Delete a payment service user.

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}",
  "summary": "Delete Payment Service User",
  "description": "Delete a payment service user.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Service Users",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserDeleteResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to delete the payment service user. You can use the task API to check the status of the task.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListPaymentServiceUserConnections"></a>

### GET /api/payments/v3/payment-service-users/{paymentServiceUserID}/connections

List all connections for a payment service user

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connections",
  "summary": "List all connections for a payment service user",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Payment Service Users",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserConnectionsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentServiceUserConnection",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3DeletePaymentServiceUserConnector"></a>

### DELETE /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}

Remove a payment service user from a connector, the PSU will still exist in Formance

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}",
  "summary": "Remove a payment service user from a connector, the PSU will still exist in Formance",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserDeleteConnectorResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to delete the payment service user on the connector. You can use the task API to check the status of the task.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ForwardPaymentServiceUserToProvider"></a>

### POST /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/forward

Register/forward a payment service user on/to a connector

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/forward",
  "summary": "Register/forward a payment service user on/to a connector",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreateLinkForPaymentServiceUser"></a>

### POST /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/create-link

Create an authentication link for a payment service user on a connector, for oauth flow

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/create-link",
  "summary": "Create an authentication link for a payment service user on a connector, for oauth flow",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3PaymentServiceUserCreateLinkRequest",
      "properties": [
        {
          "name": "applicationName",
          "type": "string",
          "description": "The name of the application to be displayed to the user when they click the link (depending on the open banking provider). Note that this field might be mandatory for some open banking providers."
        },
        {
          "name": "clientRedirectURL",
          "type": "string (url)",
          "description": "The URL to redirect the user to after the link flow is completed.",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserCreateLinkResponse",
        "properties": [
          {
            "name": "attemptID",
            "type": "string",
            "required": true
          },
          {
            "name": "link",
            "type": "string (url)",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListPaymentServiceUserConnectionsFromConnectorID"></a>

### GET /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections

List enabled connections for a payment service user on a connector (i.e. the various banks PSUser has enabled on the connector)

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections",
  "summary": "List enabled connections for a payment service user on a connector (i.e. the various banks PSUser has enabled on the connector)",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserConnectionsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentServiceUserConnection",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ListPaymentServiceUserLinkAttemptsFromConnectorID"></a>

### GET /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/link-attempts

List all link attempts for a payment service user on a connector.
Allows to check if users used the link and completed the oauth flow.


```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/link-attempts",
  "summary": "List all link attempts for a payment service user on a connector.\nAllows to check if users used the link and completed the oauth flow.\n",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserLinkAttemptsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "data",
                  "type": "array of V3PaymentServiceUserLinkAttempt",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPaymentServiceUserLinkAttemptFromConnectorID"></a>

### GET /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/link-attempts/{attemptID}

Get a link attempt for a payment service user on a connector

```json
{
  "method": "GET",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/link-attempts/{attemptID}",
  "summary": "Get a link attempt for a payment service user on a connector",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserLinkAttempt",
        "properties": [
          {
            "name": "id",
            "type": "string",
            "required": true
          },
          {
            "name": "psuID",
            "type": "string",
            "required": true
          },
          {
            "name": "connectorID",
            "type": "string",
            "required": true
          },
          {
            "name": "createdAt",
            "type": "string (date-time)",
            "required": true
          },
          {
            "name": "status",
            "type": "V3OpenBankingConnectionAttemptStatusEnum",
            "required": true
          },
          {
            "name": "clientRedirectURL",
            "type": "string (url)",
            "required": true
          },
          {
            "name": "error",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3DeletePaymentServiceUserConnectionFromConnectorID"></a>

### DELETE /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections/{connectionID}

Delete a connection for a payment service user on a connector

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections/{connectionID}",
  "summary": "Delete a connection for a payment service user on a connector",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserDeleteConnectionResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to delete the connection. You can use the task API to check the status of the task.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UpdateLinkForPaymentServiceUserOnConnector"></a>

### POST /api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections/{connectionID}/update-link

Update/Regenerate a link for a payment service user on a connector

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/connectors/{connectorID}/connections/{connectionID}/update-link",
  "summary": "Update/Regenerate a link for a payment service user on a connector",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Connectors",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3PaymentServiceUserUpdateLinkRequest",
      "properties": [
        {
          "name": "applicationName",
          "type": "string",
          "description": "The name of the application to be displayed to the user when they click the link (depending on the open banking provider). Note that this field might be mandatory for some open banking providers."
        },
        {
          "name": "clientRedirectURL",
          "type": "string (url)",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PaymentServiceUserUpdateLinkResponse",
        "properties": [
          {
            "name": "attemptID",
            "type": "string",
            "required": true
          },
          {
            "name": "link",
            "type": "string (url)",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3AddBankAccountToPaymentServiceUser"></a>

### POST /api/payments/v3/payment-service-users/{paymentServiceUserID}/bank-accounts/{bankAccountID}

Add a bank account to a payment service user

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/bank-accounts/{bankAccountID}",
  "summary": "Add a bank account to a payment service user",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3ForwardPaymentServiceUserBankAccount"></a>

### POST /api/payments/v3/payment-service-users/{paymentServiceUserID}/bank-accounts/{bankAccountID}/forward

Forward a payment service user's bank account to a connector

```json
{
  "method": "POST",
  "path": "/api/payments/v3/payment-service-users/{paymentServiceUserID}/bank-accounts/{bankAccountID}/forward",
  "summary": "Forward a payment service user's bank account to a connector",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Bank Accounts",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3ForwardPaymentServiceUserBankAccountRequest",
      "properties": [
        {
          "name": "connectorID",
          "type": "string (byte)",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "202",
      "description": "Accepted",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ForwardPaymentServiceUserBankAccountResponse",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "taskID",
                  "type": "string",
                  "description": "Since this call is asynchronous, the response will contain the ID of the task that was created to forward the bank account to the PSP. You can use the task API to check the status of the task and get the resulting bank account ID.\n",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3CreatePool"></a>

### POST /api/payments/v3/pools

Create Pool

Create a cash pool to aggregate balances from multiple accounts.

**Request Body:**

```json
{
  "name": "USD Treasury Pool",
  "accountIDs": [
    "acct_stripe_001",
    "acct_wise_001"
  ]
}
```

See [Cash Pools](https://docs.formance.com/v3.2/modules/payments/cash-pools) for more details.

````json
{
  "method": "POST",
  "path": "/api/payments/v3/pools",
  "summary": "Create Pool",
  "description": "Create a cash pool to aggregate balances from multiple accounts.\n\n**Request Body:**\n```json\n{\n  \"name\": \"USD Treasury Pool\",\n  \"accountIDs\": [\n    \"acct_stripe_001\",\n    \"acct_wise_001\"\n  ]\n}\n```\n\nSee [Cash Pools](/modules/payments/cash-pools) for more details.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "requestBody": {
    "mediaType": "application/json",
    "description": "Pool configuration",
    "schema": {
      "type": "object",
      "ref": "V3CreatePoolRequest",
      "description": "Query and dynamic pools are available from Connectivity v3.1",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "query",
          "type": "object",
          "description": "The same query than in ListAccount. Allowed properties are id, reference, connector_id, type, default_asset, name, psu_id, open_banking_connection_id and metadata."
        },
        {
          "name": "accountIDs",
          "type": "array of string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3CreatePoolResponse",
        "properties": [
          {
            "name": "data",
            "type": "string",
            "description": "The ID of the created pool",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="payments-v3ListPools"></a>

### GET /api/payments/v3/pools

List Pools

List all cash pools.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/pools",
  "summary": "List Pools",
  "description": "List all cash pools.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PoolsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V3Pool",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPool"></a>

### GET /api/payments/v3/pools/{poolID}

Get Pool

Retrieve details of a specific pool including its member accounts.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/pools/{poolID}",
  "summary": "Get Pool",
  "description": "Retrieve details of a specific pool including its member accounts.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetPoolResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Pool",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3DeletePool"></a>

### DELETE /api/payments/v3/pools/{poolID}

Delete Pool

Delete a cash pool.

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/pools/{poolID}",
  "summary": "Delete Pool",
  "description": "Delete a cash pool.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3UpdatePoolQuery"></a>

### PATCH /api/payments/v3/pools/{poolID}/query

Update the query of a pool

```json
{
  "method": "PATCH",
  "path": "/api/payments/v3/pools/{poolID}/query",
  "summary": "Update the query of a pool",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V3UpdatePoolQueryRequest",
      "properties": [
        {
          "name": "query",
          "type": "object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPoolBalances"></a>

### GET /api/payments/v3/pools/{poolID}/balances

Get Pool Balances

Get aggregated balances for a pool at a specific point in time.

Use the `at` query parameter for historical balances.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/pools/{poolID}/balances",
  "summary": "Get Pool Balances",
  "description": "Get aggregated balances for a pool at a specific point in time.\n\nUse the `at` query parameter for historical balances.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PoolBalancesResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3PoolBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetPoolBalancesLatest"></a>

### GET /api/payments/v3/pools/{poolID}/balances/latest

Get Pool Balances (Latest)

Get the most recent aggregated balances for a pool.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/pools/{poolID}/balances/latest",
  "summary": "Get Pool Balances (Latest)",
  "description": "Get the most recent aggregated balances for a pool.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Pools",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3PoolBalancesResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3PoolBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3AddAccountToPool"></a>

### POST /api/payments/v3/pools/{poolID}/accounts/{accountID}

Add an account to a pool

```json
{
  "method": "POST",
  "path": "/api/payments/v3/pools/{poolID}/accounts/{accountID}",
  "summary": "Add an account to a pool",
  "description": "",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3RemoveAccountFromPool"></a>

### DELETE /api/payments/v3/pools/{poolID}/accounts/{accountID}

Remove Account from Pool

Remove an account from a pool.

```json
{
  "method": "DELETE",
  "path": "/api/payments/v3/pools/{poolID}/accounts/{accountID}",
  "summary": "Remove Account from Pool",
  "description": "Remove an account from a pool.",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Accounts",
  "responses": [
    {
      "code": "204",
      "description": "No Content"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3ErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "V3ErrorsEnum",
            "required": true
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true,
            "example": "[VALIDATION] missing required config field: pollingPeriod"
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="payments-v3GetTask"></a>

### GET /api/payments/v3/tasks/{taskID}

Get Task

Get a background task and its result by ID.

Tasks are created for long-running operations like connector installation or reset.

```json
{
  "method": "GET",
  "path": "/api/payments/v3/tasks/{taskID}",
  "summary": "Get Task",
  "description": "Get a background task and its result by ID.\n\nTasks are created for long-running operations like connector installation or reset.\n",
  "tags": [
    "payments.v3"
  ],
  "module": "Payments",
  "resourceGroup": "Tasks",
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V3GetTaskResponse",
        "properties": [
          {
            "name": "data",
            "type": "V3Task",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="search-searchgetServerInfo"></a>

### GET /api/search/\_info

Get server info

```json
{
  "method": "GET",
  "path": "/api/search/_info",
  "summary": "Get server info",
  "description": "",
  "tags": [
    "search.v1"
  ],
  "module": "Search",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="search-search"></a>

### POST /api/search/

search.v1

Elasticsearch.v1 query engine

```json
{
  "method": "POST",
  "path": "/api/search/",
  "summary": "search.v1",
  "description": "Elasticsearch.v1 query engine",
  "tags": [
    "search.v1"
  ],
  "module": "Search",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "Query",
      "properties": [
        {
          "name": "ledgers",
          "type": "array of string"
        },
        {
          "name": "after",
          "type": "array of string"
        },
        {
          "name": "pageSize",
          "type": "integer (int64)"
        },
        {
          "name": "terms",
          "type": "array of string"
        },
        {
          "name": "sort",
          "type": "string",
          "example": "id:asc"
        },
        {
          "name": "policy",
          "type": "string",
          "example": "OR"
        },
        {
          "name": "target",
          "type": "string"
        },
        {
          "name": "cursor",
          "type": "string",
          "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
        },
        {
          "name": "raw",
          "type": "object",
          "example": {
            "query": {
              "match_all": {}
            }
          }
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Success",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "Response",
        "properties": [
          {
            "name": "data",
            "type": "object",
            "description": "The payload"
          },
          {
            "name": "cursor",
            "type": "object",
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)"
                },
                {
                  "name": "hasMore",
                  "type": "boolean"
                },
                {
                  "name": "total",
                  "type": "object",
                  "inlineSchema": {
                    "type": "object",
                    "properties": [
                      {
                        "name": "value",
                        "type": "integer (int64)",
                        "example": 1
                      },
                      {
                        "name": "relation",
                        "type": "string",
                        "example": "eq"
                      }
                    ]
                  }
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "data",
                  "type": "array"
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="webhooks-getManyConfigs"></a>

### GET /api/webhooks/configs

List Webhook Configs

Retrieve all webhook configurations, sorted by updated date descending.

Webhooks allow you to receive real-time notifications when events occur in your Formance stack.

**Example Response:**

```json
{
  "cursor": {
    "hasMore": false,
    "data": [
      {
        "id": "4997257d-dfb6-445b-929c-cbe2ab182818",
        "endpoint": "https://example.com/webhooks",
        "eventTypes": ["ledger.committed_transactions"],
        "active": true
      }
    ]
  }
}
```

See [Webhooks Documentation](https://docs.formance.com/manage/events/webhooks) for more details.

````json
{
  "method": "GET",
  "path": "/api/webhooks/configs",
  "summary": "List Webhook Configs",
  "description": "Retrieve all webhook configurations, sorted by updated date descending.\n\nWebhooks allow you to receive real-time notifications when events occur in your Formance stack.\n\n**Example Response:**\n```json\n{\n  \"cursor\": {\n    \"hasMore\": false,\n    \"data\": [\n      {\n        \"id\": \"4997257d-dfb6-445b-929c-cbe2ab182818\",\n        \"endpoint\": \"https://example.com/webhooks\",\n        \"eventTypes\": [\"ledger.committed_transactions\"],\n        \"active\": true\n      }\n    ]\n  }\n}\n```\n\nSee [Webhooks Documentation](/manage/events/webhooks) for more details.\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "queryParams": [
    {
      "name": "id",
      "description": "Filter by a specific Config ID (UUID format)",
      "required": false
    },
    {
      "name": "endpoint",
      "description": "Filter by endpoint URL",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="webhooks-insertConfig"></a>

### POST /api/webhooks/configs

Create Webhook Config

Create a new webhook configuration to receive event notifications.

**Endpoint Requirements:**

- Must be a valid HTTPS URL
- Must be unique across all configurations

**Secret Generation:**

- If not provided, a secret is automatically generated
- Format: 24 random bytes, base64 encoded

**Available Event Types:**

| Service  | Event                           |
| -------- | ------------------------------- |
| Ledger   | `ledger.committed_transactions` |
| Ledger   | `ledger.saved_metadata`         |
| Ledger   | `ledger.updated_mapping`        |
| Ledger   | `ledger.reverted_transaction`   |
| Payments | `payments.saved_payment`        |

**Request Body:**

```json
{
  "name": "payment-notifications",
  "endpoint": "https://example.com/webhooks",
  "eventTypes": ["ledger.committed_transactions", "payments.saved_payment"],
  "secret": "optional-custom-secret"
}
```

See [Webhooks Documentation](https://docs.formance.com/manage/events/webhooks) for more details.

````json
{
  "method": "POST",
  "path": "/api/webhooks/configs",
  "summary": "Create Webhook Config",
  "description": "Create a new webhook configuration to receive event notifications.\n\n**Endpoint Requirements:**\n- Must be a valid HTTPS URL\n- Must be unique across all configurations\n\n**Secret Generation:**\n- If not provided, a secret is automatically generated\n- Format: 24 random bytes, base64 encoded\n\n**Available Event Types:**\n\n| Service  | Event                           |\n|----------|---------------------------------|\n| Ledger   | `ledger.committed_transactions` |\n| Ledger   | `ledger.saved_metadata`         |\n| Ledger   | `ledger.updated_mapping`        |\n| Ledger   | `ledger.reverted_transaction`   |\n| Payments | `payments.saved_payment`        |\n\n**Request Body:**\n```json\n{\n  \"name\": \"payment-notifications\",\n  \"endpoint\": \"https://example.com/webhooks\",\n  \"eventTypes\": [\"ledger.committed_transactions\", \"payments.saved_payment\"],\n  \"secret\": \"optional-custom-secret\"\n}\n```\n\nSee [Webhooks Documentation](/manage/events/webhooks) for more details.\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ConfigUser",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "example": "customer_payment"
        },
        {
          "name": "endpoint",
          "type": "string",
          "required": true,
          "example": "https://example.com"
        },
        {
          "name": "secret",
          "type": "string",
          "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"
        },
        {
          "name": "eventTypes",
          "type": "array of string",
          "required": true,
          "example": [
            "TYPE1",
            "TYPE2"
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Config created successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "WebhooksConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="webhooks-deleteConfig"></a>

### DELETE /api/webhooks/configs/{id}

Delete Webhook Config

Delete a webhook configuration by ID.

After deletion, no more webhooks will be sent to this endpoint.

```json
{
  "method": "DELETE",
  "path": "/api/webhooks/configs/{id}",
  "summary": "Delete Webhook Config",
  "description": "Delete a webhook configuration by ID.\n\nAfter deletion, no more webhooks will be sent to this endpoint.\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Config successfully deleted"
    }
  ]
}
```

<a id="webhooks-updateConfig"></a>

### PUT /api/webhooks/configs/{id}

Update Webhook Config

Update an existing webhook configuration.

You can update:

- Endpoint URL
- Event types to listen for
- Configuration name

**Request Body:**

```json
{
  "name": "updated-webhook-name",
  "endpoint": "https://new-endpoint.com/webhooks",
  "eventTypes": ["ledger.committed_transactions"]
}
```

````json
{
  "method": "PUT",
  "path": "/api/webhooks/configs/{id}",
  "summary": "Update Webhook Config",
  "description": "Update an existing webhook configuration.\n\nYou can update:\n- Endpoint URL\n- Event types to listen for\n- Configuration name\n\n**Request Body:**\n```json\n{\n  \"name\": \"updated-webhook-name\",\n  \"endpoint\": \"https://new-endpoint.com/webhooks\",\n  \"eventTypes\": [\"ledger.committed_transactions\"]\n}\n```\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "schema": {
      "type": "object",
      "ref": "ConfigUser",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "example": "customer_payment"
        },
        {
          "name": "endpoint",
          "type": "string",
          "required": true,
          "example": "https://example.com"
        },
        {
          "name": "secret",
          "type": "string",
          "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"
        },
        {
          "name": "eventTypes",
          "type": "array of string",
          "required": true,
          "example": [
            "TYPE1",
            "TYPE2"
          ]
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Config successfully updated"
    }
  ]
}
````

<a id="webhooks-testConfig"></a>

### GET /api/webhooks/configs/{id}/test

Test Webhook Config

Send a test webhook to verify your endpoint is correctly configured.

This sends a sample payload to your endpoint and returns the response status.

**Response includes:**

- `statusCode`: HTTP status returned by your endpoint
- `status`: `success` or `failed`
- `payload`: The test payload that was sent

```json
{
  "method": "GET",
  "path": "/api/webhooks/configs/{id}/test",
  "summary": "Test Webhook Config",
  "description": "Send a test webhook to verify your endpoint is correctly configured.\n\nThis sends a sample payload to your endpoint and returns the response status.\n\n**Response includes:**\n- `statusCode`: HTTP status returned by your endpoint\n- `status`: `success` or `failed`\n- `payload`: The test payload that was sent\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "OK",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "AttemptResponse",
        "properties": [
          {
            "name": "data",
            "type": "Attempt",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="webhooks-activateConfig"></a>

### PUT /api/webhooks/configs/{id}/activate

Activate Webhook Config

Activate a webhook configuration to start receiving events.

Once activated, webhooks will be sent to the configured endpoint whenever matching events occur.

```json
{
  "method": "PUT",
  "path": "/api/webhooks/configs/{id}/activate",
  "summary": "Activate Webhook Config",
  "description": "Activate a webhook configuration to start receiving events.\n\nOnce activated, webhooks will be sent to the configured endpoint whenever matching events occur.\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Config successfully activated",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "WebhooksConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="webhooks-deactivateConfig"></a>

### PUT /api/webhooks/configs/{id}/deactivate

Deactivate Webhook Config

Deactivate a webhook configuration to stop receiving events.

The configuration is preserved but no webhooks will be sent until reactivated.

```json
{
  "method": "PUT",
  "path": "/api/webhooks/configs/{id}/deactivate",
  "summary": "Deactivate Webhook Config",
  "description": "Deactivate a webhook configuration to stop receiving events.\n\nThe configuration is preserved but no webhooks will be sent until reactivated.\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Config successfully deactivated",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "WebhooksConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="webhooks-changeConfigSecret"></a>

### PUT /api/webhooks/configs/{id}/secret/change

Change Webhook Secret

Change the signing secret used to verify webhook payloads.

**Secret Format:**

- If not provided, a new secret is automatically generated
- Format: 24 random bytes, base64 encoded

**Important:** After changing the secret, update your webhook handler to use the new secret for signature verification.

**Webhook Signature Verification:**
Each webhook request includes these headers for verification:

- `formance-webhook-id`: Unique ID for the webhook event
- `formance-webhook-timestamp`: Unix timestamp of when the webhook was sent
- `formance-webhook-signature`: HMAC signature to verify authenticity

**Request Body:**

```json
{
  "secret": "new-base64-encoded-secret"
}
```

````json
{
  "method": "PUT",
  "path": "/api/webhooks/configs/{id}/secret/change",
  "summary": "Change Webhook Secret",
  "description": "Change the signing secret used to verify webhook payloads.\n\n**Secret Format:**\n- If not provided, a new secret is automatically generated\n- Format: 24 random bytes, base64 encoded\n\n**Important:** After changing the secret, update your webhook handler to use the new secret for signature verification.\n\n**Webhook Signature Verification:**\nEach webhook request includes these headers for verification:\n- `formance-webhook-id`: Unique ID for the webhook event\n- `formance-webhook-timestamp`: Unix timestamp of when the webhook was sent\n- `formance-webhook-signature`: HMAC signature to verify authenticity\n\n**Request Body:**\n```json\n{\n  \"secret\": \"new-base64-encoded-secret\"\n}\n```\n",
  "tags": [
    "webhooks.v1"
  ],
  "module": "Webhooks",
  "resourceGroup": "Webhook Configs",
  "pathParams": [
    {
      "name": "id",
      "description": "The webhook config ID (UUID)"
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "ConfigChangeSecret",
      "properties": [
        {
          "name": "secret",
          "type": "string",
          "required": true,
          "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Secret successfully changed",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ConfigResponse",
        "properties": [
          {
            "name": "data",
            "type": "WebhooksConfig",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-walletsgetServerInfo"></a>

### GET /api/wallets/\_info

Get Server Info

Retrieve server version and status information for the Wallets service.

```json
{
  "method": "GET",
  "path": "/api/wallets/_info",
  "summary": "Get Server Info",
  "description": "Retrieve server version and status information for the Wallets service.",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-getTransactions"></a>

### GET /api/wallets/transactions

List Wallet Transactions

List all transactions associated with wallets.

Transactions represent the movement of funds into, out of, or between wallets. Each transaction contains **postings** that record the exact flow of funds.

**Transaction Types:**

- **Credit**: Funds added to a wallet
- **Debit**: Funds removed from a wallet
- **Hold Confirmation**: Funds moved from a pending hold

See [Basic Wallet Operations](https://docs.formance.com/modules/wallets/basic-operations) for more details.

```json
{
  "method": "GET",
  "path": "/api/wallets/transactions",
  "summary": "List Wallet Transactions",
  "description": "List all transactions associated with wallets.\n\nTransactions represent the movement of funds into, out of, or between wallets. Each transaction contains **postings** that record the exact flow of funds.\n\n**Transaction Types:**\n- **Credit**: Funds added to a wallet\n- **Debit**: Funds removed from a wallet\n- **Hold Confirmation**: Funds moved from a pending hold\n\nSee [Basic Wallet Operations](/modules/wallets/basic-operations) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Transactions",
  "queryParams": [
    {
      "name": "pageSize",
      "description": "The maximum number of transactions to return per page. Default is 15, maximum is 1000.\n",
      "required": false
    },
    {
      "name": "walletID",
      "description": "Filter transactions to only those involving a specific wallet.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response. Use the `next` value to fetch the next page.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of transactions",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetTransactionsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-listWallets"></a>

### GET /api/wallets/wallets

List Wallets

List all wallets in the system.

**What is a Wallet?**
A wallet is a container of assets related to one entity (user, merchant, etc.). It can store and manage any kind of assets—from money to points, vouchers, or any fungible items.

**Wallet Structure:**

- Each wallet has a unique ID and name
- Wallets contain **balances** (logical sub-containers for assets)
- Every wallet has a default `main` balance
- Additional balances can be created with expiration dates

**Use Cases:**

- Closed-loop economies on marketplaces
- Reducing processing fees by keeping transactions internal
- Refund-to-wallet flows

See [Wallets Introduction](https://docs.formance.com/modules/wallets) for more details.

```json
{
  "method": "GET",
  "path": "/api/wallets/wallets",
  "summary": "List Wallets",
  "description": "List all wallets in the system.\n\n**What is a Wallet?**\nA wallet is a container of assets related to one entity (user, merchant, etc.). It can store and manage any kind of assets—from money to points, vouchers, or any fungible items.\n\n**Wallet Structure:**\n- Each wallet has a unique ID and name\n- Wallets contain **balances** (logical sub-containers for assets)\n- Every wallet has a default `main` balance\n- Additional balances can be created with expiration dates\n\n**Use Cases:**\n- Closed-loop economies on marketplaces\n- Reducing processing fees by keeping transactions internal\n- Refund-to-wallet flows\n\nSee [Wallets Introduction](/modules/wallets) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "queryParams": [
    {
      "name": "name",
      "description": "Filter wallets by name. Supports exact matching.\n",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter wallets by metadata key-value pairs. Use dot notation for nested keys.\n",
      "required": false
    },
    {
      "name": "pageSize",
      "description": "The maximum number of wallets to return per page. Default is 15, maximum is 1000.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response.\n",
      "required": false
    },
    {
      "name": "expand",
      "description": "Comma-separated list of fields to expand. Use `balances` to include balance details in the response.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of wallets",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListWalletsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-createWallet"></a>

### POST /api/wallets/wallets

Create Wallet

Create a new wallet for a user, merchant, or other entity.

**Example: Creating a Game Character Wallet**

```json
{
  "name": "eryldor",
  "metadata": {
    "character_class": "mage",
    "level": "1"
  }
}
```

The wallet is created with a default `main` balance that can hold any assets.

**Idempotency:**
Use the `Idempotency-Key` header to safely retry wallet creation without creating duplicates.

See [Creating Wallets](https://docs.formance.com/modules/wallets/basic-operations#creating-eryldors-wallet) for more details.

````json
{
  "method": "POST",
  "path": "/api/wallets/wallets",
  "summary": "Create Wallet",
  "description": "Create a new wallet for a user, merchant, or other entity.\n\n**Example: Creating a Game Character Wallet**\n```json\n{\n  \"name\": \"eryldor\",\n  \"metadata\": {\n    \"character_class\": \"mage\",\n    \"level\": \"1\"\n  }\n}\n```\n\nThe wallet is created with a default `main` balance that can hold any assets.\n\n**Idempotency:**\nUse the `Idempotency-Key` header to safely retry wallet creation without creating duplicates.\n\nSee [Creating Wallets](/modules/wallets/basic-operations#creating-eryldors-wallet) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The wallet configuration including name and optional metadata.\n",
    "schema": {
      "type": "object",
      "ref": "CreateWalletRequest",
      "properties": [
        {
          "name": "metadata",
          "type": "object",
          "description": "Custom metadata to attach to this wallet.",
          "required": true
        },
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Wallet created successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateWalletResponse",
        "properties": [
          {
            "name": "data",
            "type": "Wallet",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-getWallet"></a>

### GET /api/wallets/wallets/{id}

Get Wallet

Retrieve details of a specific wallet including its current balances.

**Response includes:**

- Wallet ID and name
- Creation timestamp
- Custom metadata
- All balances with their current assets

See [Inspecting Wallets](https://docs.formance.com/modules/wallets/basic-operations#inspecting-eryldors-wallet) for more details.

```json
{
  "method": "GET",
  "path": "/api/wallets/wallets/{id}",
  "summary": "Get Wallet",
  "description": "Retrieve details of a specific wallet including its current balances.\n\n**Response includes:**\n- Wallet ID and name\n- Creation timestamp\n- Custom metadata\n- All balances with their current assets\n\nSee [Inspecting Wallets](/modules/wallets/basic-operations#inspecting-eryldors-wallet) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "responses": [
    {
      "code": "200",
      "description": "Wallet details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWalletResponse",
        "properties": [
          {
            "name": "data",
            "type": "WalletWithBalances",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-updateWallet"></a>

### PATCH /api/wallets/wallets/{id}

Update Wallet

Update the metadata of a wallet.

**Example: Update Character Level**

```json
{
  "metadata": {
    "level": "5",
    "guild": "Arcane Order"
  }
}
```

````json
{
  "method": "PATCH",
  "path": "/api/wallets/wallets/{id}",
  "summary": "Update Wallet",
  "description": "Update the metadata of a wallet.\n\n**Example: Update Character Level**\n```json\n{\n  \"metadata\": {\n    \"level\": \"5\",\n    \"guild\": \"Arcane Order\"\n  }\n}\n```\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The metadata to update. Existing keys not included will be preserved.\n",
    "schema": {
      "type": "object",
      "properties": [
        {
          "name": "metadata",
          "type": "object",
          "description": "Custom metadata to attach to this wallet.",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Wallet updated successfully"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "walletsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "INTERNAL_ERROR",
              "INSUFFICIENT_FUND",
              "HOLD_CLOSED"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-getWalletSummary"></a>

### GET /api/wallets/wallets/{id}/summary

Get Wallet Summary

Get a comprehensive summary of a wallet's financial state.

**Summary includes:**

- **availableFunds**: Immediately spendable balance (not held)
- **holdFunds**: Funds reserved by pending operations
- **expirableFunds**: Funds in balances with expiration dates
- **expiredFunds**: Funds that have expired
- **balances**: List of all balance buckets with their assets

Useful for displaying a wallet dashboard or checking if sufficient funds are available.

```json
{
  "method": "GET",
  "path": "/api/wallets/wallets/{id}/summary",
  "summary": "Get Wallet Summary",
  "description": "Get a comprehensive summary of a wallet's financial state.\n\n**Summary includes:**\n- **availableFunds**: Immediately spendable balance (not held)\n- **holdFunds**: Funds reserved by pending operations\n- **expirableFunds**: Funds in balances with expiration dates\n- **expiredFunds**: Funds that have expired\n- **balances**: List of all balance buckets with their assets\n\nUseful for displaying a wallet dashboard or checking if sufficient funds are available.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "responses": [
    {
      "code": "200",
      "description": "Wallet summary",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWalletSummaryResponse",
        "properties": [
          {
            "name": "data",
            "type": "WalletSummary",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-listBalances"></a>

### GET /api/wallets/wallets/{id}/balances

List Wallet Balances

List all balance buckets within a wallet.

**What are Balances?**
Balances are logical sub-containers that separate assets by nature, usage, or lifecycle.

**Example: RPG Game Wallet Structure**

- `main` balance: Coins and experience points (no expiration)
- `season-2024` balance: Tournament badges (expires end of season)

See [Creating Balances](https://docs.formance.com/modules/wallets/basic-operations#create-the-season-2024-balance) for more details.

```json
{
  "method": "GET",
  "path": "/api/wallets/wallets/{id}/balances",
  "summary": "List Wallet Balances",
  "description": "List all balance buckets within a wallet.\n\n**What are Balances?**\nBalances are logical sub-containers that separate assets by nature, usage, or lifecycle.\n\n**Example: RPG Game Wallet Structure**\n- `main` balance: Coins and experience points (no expiration)\n- `season-2024` balance: Tournament badges (expires end of season)\n\nSee [Creating Balances](/modules/wallets/basic-operations#create-the-season-2024-balance) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "responses": [
    {
      "code": "200",
      "description": "List of balances",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListBalancesResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-createBalance"></a>

### POST /api/wallets/wallets/{id}/balances

Create Balance

Create a new balance bucket within a wallet.

**Example: Create Expiring Promotional Balance**

```json
{
  "name": "season-2024",
  "expiresAt": "2025-01-01T00:00:00Z",
  "priority": 1
}
```

**Balance Properties:**

- **name**: Unique identifier within the wallet
- **expiresAt**: Optional expiration (funds become unusable after)
- **priority**: Order for debiting (lower = first)

See [Managing Balances](https://docs.formance.com/modules/wallets/basic-operations#create-the-season-2024-balance) for more details.

````json
{
  "method": "POST",
  "path": "/api/wallets/wallets/{id}/balances",
  "summary": "Create Balance",
  "description": "Create a new balance bucket within a wallet.\n\n**Example: Create Expiring Promotional Balance**\n```json\n{\n  \"name\": \"season-2024\",\n  \"expiresAt\": \"2025-01-01T00:00:00Z\",\n  \"priority\": 1\n}\n```\n\n**Balance Properties:**\n- **name**: Unique identifier within the wallet\n- **expiresAt**: Optional expiration (funds become unusable after)\n- **priority**: Order for debiting (lower = first)\n\nSee [Managing Balances](/modules/wallets/basic-operations#create-the-season-2024-balance) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The balance configuration.\n",
    "schema": {
      "type": "object",
      "ref": "CreateBalanceRequest",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        },
        {
          "name": "expiresAt",
          "type": "string (date-time)"
        },
        {
          "name": "priority",
          "type": "integer (bigint)"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Balance created successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateBalanceResponse",
        "properties": [
          {
            "name": "data",
            "type": "Balance",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-getBalance"></a>

### GET /api/wallets/wallets/{id}/balances/{balanceName}

Get Balance

Retrieve details of a specific balance bucket.

**Response includes:**

- Balance name
- Expiration date (if set)
- Priority level
- Current assets and amounts

```json
{
  "method": "GET",
  "path": "/api/wallets/wallets/{id}/balances/{balanceName}",
  "summary": "Get Balance",
  "description": "Retrieve details of a specific balance bucket.\n\n**Response includes:**\n- Balance name\n- Expiration date (if set)\n- Priority level\n- Current assets and amounts\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "pathParams": [
    {
      "name": "id",
      "description": ""
    },
    {
      "name": "balanceName",
      "description": ""
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Balance details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetBalanceResponse",
        "properties": [
          {
            "name": "data",
            "type": "BalanceWithAssets",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-debitWallet"></a>

### POST /api/wallets/wallets/{id}/debit

Debit Wallet

Remove funds from a wallet, either immediately or as a pending hold.

**Two Debit Modes:**

1. **Immediate Debit** (`pending: false`)
   Funds are moved immediately to the destination.

2. **Pending Hold** (`pending: true`)
   Funds are reserved but not moved. Can be confirmed or voided later.

**Use Cases for Holds:**

- **Auctions**: Reserve bid amount until auction ends
- **Pre-authorization**: Hold funds before order fulfillment
- **Deposits**: Reserve security deposit until checkout

See [Spending Funds](https://docs.formance.com/modules/wallets/managing-funds/spending-funds) and [Managing Holds](https://docs.formance.com/modules/wallets/getting-started/managing-holds) for more details.

```json
{
  "method": "POST",
  "path": "/api/wallets/wallets/{id}/debit",
  "summary": "Debit Wallet",
  "description": "Remove funds from a wallet, either immediately or as a pending hold.\n\n**Two Debit Modes:**\n\n1. **Immediate Debit** (`pending: false`)\n   Funds are moved immediately to the destination.\n\n2. **Pending Hold** (`pending: true`)\n   Funds are reserved but not moved. Can be confirmed or voided later.\n\n**Use Cases for Holds:**\n- **Auctions**: Reserve bid amount until auction ends\n- **Pre-authorization**: Hold funds before order fulfillment\n- **Deposits**: Reserve security deposit until checkout\n\nSee [Spending Funds](/modules/wallets/managing-funds/spending-funds) and [Managing Holds](/modules/wallets/getting-started/managing-holds) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The debit configuration including amount, destination, and whether to create a hold.\n",
    "schema": {
      "type": "object",
      "ref": "DebitWalletRequest",
      "properties": [
        {
          "name": "amount",
          "type": "Monetary",
          "required": true
        },
        {
          "name": "pending",
          "type": "boolean",
          "description": "Set to true to create a pending hold. If false, the wallet will be debited immediately."
        },
        {
          "name": "metadata",
          "type": "object",
          "description": "Metadata associated with the wallet.",
          "required": true
        },
        {
          "name": "description",
          "type": "string"
        },
        {
          "name": "destination",
          "type": "Subject"
        },
        {
          "name": "balances",
          "type": "array of string"
        },
        {
          "name": "timestamp",
          "type": "string (date-time)",
          "description": "cannot be used in conjunction with `pending` property"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Debit successful",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "DebitWalletResponse",
        "properties": [
          {
            "name": "data",
            "type": "Hold",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-creditWallet"></a>

### POST /api/wallets/wallets/{id}/credit

Credit Wallet

Add funds to a wallet from an external source or another wallet.

**Example: Credit 10 Coins from External Source**

```json
{
  "amount": {"asset": "COIN", "amount": 10},
  "sources": [{"type": "ACCOUNT", "identifier": "world"}],
  "metadata": {"reason": "quest_reward"}
}
```

**Source Types:**

- `ACCOUNT` with `identifier: "world"`: Mint new funds
- `ACCOUNT` with ledger address: Transfer from a ledger account
- `WALLET`: Transfer from another wallet

See [Adding Funds](https://docs.formance.com/modules/wallets/managing-funds/adding-funds) for more details.

````json
{
  "method": "POST",
  "path": "/api/wallets/wallets/{id}/credit",
  "summary": "Credit Wallet",
  "description": "Add funds to a wallet from an external source or another wallet.\n\n**Example: Credit 10 Coins from External Source**\n```json\n{\n  \"amount\": {\"asset\": \"COIN\", \"amount\": 10},\n  \"sources\": [{\"type\": \"ACCOUNT\", \"identifier\": \"world\"}],\n  \"metadata\": {\"reason\": \"quest_reward\"}\n}\n```\n\n**Source Types:**\n- `ACCOUNT` with `identifier: \"world\"`: Mint new funds\n- `ACCOUNT` with ledger address: Transfer from a ledger account\n- `WALLET`: Transfer from another wallet\n\nSee [Adding Funds](/modules/wallets/managing-funds/adding-funds) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Wallets",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The credit configuration including amount, sources, and optional balance.\n",
    "schema": {
      "type": "object",
      "ref": "CreditWalletRequest",
      "properties": [
        {
          "name": "amount",
          "type": "Monetary",
          "required": true
        },
        {
          "name": "metadata",
          "type": "object",
          "description": "Metadata associated with the wallet."
        },
        {
          "name": "reference",
          "type": "string"
        },
        {
          "name": "sources",
          "type": "array of Subject"
        },
        {
          "name": "balance",
          "type": "string",
          "description": "The balance to credit"
        },
        {
          "name": "timestamp",
          "type": "string (date-time)"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Credit successful"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "walletsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "INTERNAL_ERROR",
              "INSUFFICIENT_FUND",
              "HOLD_CLOSED"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-getHolds"></a>

### GET /api/wallets/holds

List Holds

List all pending holds across wallets.

**What is a Hold?**
A hold is a temporary reservation of funds. The funds are not available for spending until confirmed or voided.

**Hold Lifecycle:**

1. **Created**: Funds reserved via debit with `pending: true`
2. **Confirmed**: Funds transferred to destination
3. **Voided**: Funds released back to wallet

See [Managing Holds](https://docs.formance.com/modules/wallets/getting-started/managing-holds) for more details.

```json
{
  "method": "GET",
  "path": "/api/wallets/holds",
  "summary": "List Holds",
  "description": "List all pending holds across wallets.\n\n**What is a Hold?**\nA hold is a temporary reservation of funds. The funds are not available for spending until confirmed or voided.\n\n**Hold Lifecycle:**\n1. **Created**: Funds reserved via debit with `pending: true`\n2. **Confirmed**: Funds transferred to destination\n3. **Voided**: Funds released back to wallet\n\nSee [Managing Holds](/modules/wallets/getting-started/managing-holds) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Holds",
  "queryParams": [
    {
      "name": "pageSize",
      "description": "The maximum number of holds to return per page.\n",
      "required": false
    },
    {
      "name": "walletID",
      "description": "Filter holds to a specific wallet.\n",
      "required": false
    },
    {
      "name": "metadata",
      "description": "Filter holds by metadata key-value pairs.\n",
      "required": false
    },
    {
      "name": "cursor",
      "description": "Pagination cursor from a previous response.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of holds",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetHoldsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "any",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-getHold"></a>

### GET /api/wallets/holds/{holdID}

Get Hold

Retrieve details of a specific hold.

**Response includes:**

- Hold ID and wallet ID
- Asset type and original amount
- Remaining amount (if partially confirmed)
- Destination
- Custom metadata and description

```json
{
  "method": "GET",
  "path": "/api/wallets/holds/{holdID}",
  "summary": "Get Hold",
  "description": "Retrieve details of a specific hold.\n\n**Response includes:**\n- Hold ID and wallet ID\n- Asset type and original amount\n- Remaining amount (if partially confirmed)\n- Destination\n- Custom metadata and description\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Holds",
  "pathParams": [
    {
      "name": "holdID",
      "description": "The hold ID"
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "Hold details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetHoldResponse",
        "properties": [
          {
            "name": "data",
            "type": "ExpandedDebitHold",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="wallets-confirmHold"></a>

### POST /api/wallets/holds/{hold\_id}/confirm

Confirm Hold

Confirm a pending hold and transfer funds to the destination.

**Full Confirmation:**

```json
{
  "final": true
}
```

**Partial Confirmation:**

```json
{
  "amount": 75,
  "final": true
}
```

**The `final` flag:**

- `true`: Release any remaining funds back to the wallet
- `false`: Keep remaining amount on hold for more confirmations

See [Confirming Holds](https://docs.formance.com/modules/wallets/managing-funds/holding-and-confirm) for more details.

````json
{
  "method": "POST",
  "path": "/api/wallets/holds/{hold_id}/confirm",
  "summary": "Confirm Hold",
  "description": "Confirm a pending hold and transfer funds to the destination.\n\n**Full Confirmation:**\n```json\n{\n  \"final\": true\n}\n```\n\n**Partial Confirmation:**\n```json\n{\n  \"amount\": 75,\n  \"final\": true\n}\n```\n\n**The `final` flag:**\n- `true`: Release any remaining funds back to the wallet\n- `false`: Keep remaining amount on hold for more confirmations\n\nSee [Confirming Holds](/modules/wallets/managing-funds/holding-and-confirm) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Holds",
  "pathParams": [
    {
      "name": "hold_id",
      "description": ""
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "description": "The confirmation details including optional partial amount and final flag.\n",
    "schema": {
      "type": "object",
      "ref": "ConfirmHoldRequest",
      "properties": [
        {
          "name": "amount",
          "type": "integer (bigint)",
          "description": "Define the amount to transfer.",
          "example": 100
        },
        {
          "name": "final",
          "type": "boolean",
          "description": "Define a final confirmation. Remaining funds will be returned to the wallet.",
          "example": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Hold confirmed successfully"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "walletsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "INTERNAL_ERROR",
              "INSUFFICIENT_FUND",
              "HOLD_CLOSED"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="wallets-voidHold"></a>

### POST /api/wallets/holds/{hold\_id}/void

Void Hold

Cancel a pending hold and return all reserved funds to the wallet.

**Use Cases:**

- Customer cancels order
- Auction lost
- Authorization expired

The voided funds immediately become available in the wallet's balance.

See [Canceling Holds](https://docs.formance.com/modules/wallets/getting-started/managing-holds#canceling-the-hold) for more details.

```json
{
  "method": "POST",
  "path": "/api/wallets/holds/{hold_id}/void",
  "summary": "Void Hold",
  "description": "Cancel a pending hold and return all reserved funds to the wallet.\n\n**Use Cases:**\n- Customer cancels order\n- Auction lost\n- Authorization expired\n\nThe voided funds immediately become available in the wallet's balance.\n\nSee [Canceling Holds](/modules/wallets/getting-started/managing-holds#canceling-the-hold) for more details.\n",
  "tags": [
    "wallets.v1"
  ],
  "module": "Wallets",
  "resourceGroup": "Holds",
  "responses": [
    {
      "code": "204",
      "description": "Hold voided successfully"
    },
    {
      "code": "default",
      "description": "Error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "walletsErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "INTERNAL_ERROR",
              "INSUFFICIENT_FUND",
              "HOLD_CLOSED"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-orchestrationgetServerInfo"></a>

### GET /api/orchestration/\_info

Get server info

```json
{
  "method": "GET",
  "path": "/api/orchestration/_info",
  "summary": "Get server info",
  "description": "",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-listTriggers"></a>

### GET /api/orchestration/triggers

List triggers

List triggers

```json
{
  "method": "GET",
  "path": "/api/orchestration/triggers",
  "summary": "List triggers",
  "description": "List triggers",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "queryParams": [
    {
      "name": "name",
      "description": "search by name",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of triggers",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListTriggersResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of Trigger",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-createTrigger"></a>

### POST /api/orchestration/triggers

Create trigger

Create trigger

```json
{
  "method": "POST",
  "path": "/api/orchestration/triggers",
  "summary": "Create trigger",
  "description": "Create trigger",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "TriggerData",
      "properties": [
        {
          "name": "event",
          "type": "string",
          "required": true
        },
        {
          "name": "workflowID",
          "type": "string",
          "required": true
        },
        {
          "name": "version",
          "type": "string"
        },
        {
          "name": "filter",
          "type": "string"
        },
        {
          "name": "vars",
          "type": "object"
        },
        {
          "name": "name",
          "type": "string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created trigger",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateTriggerResponse",
        "properties": [
          {
            "name": "data",
            "type": "Trigger",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-readTrigger"></a>

### GET /api/orchestration/triggers/{triggerID}

Read trigger

Read trigger

```json
{
  "method": "GET",
  "path": "/api/orchestration/triggers/{triggerID}",
  "summary": "Read trigger",
  "description": "Read trigger",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "A specific trigger",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReadTriggerResponse",
        "properties": [
          {
            "name": "data",
            "type": "Trigger",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-deleteTrigger"></a>

### DELETE /api/orchestration/triggers/{triggerID}

Delete trigger

Read trigger

```json
{
  "method": "DELETE",
  "path": "/api/orchestration/triggers/{triggerID}",
  "summary": "Delete trigger",
  "description": "Read trigger",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "Trigger deleted"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-listTriggersOccurrences"></a>

### GET /api/orchestration/triggers/{triggerID}/occurrences

List triggers occurrences

List triggers occurrences

```json
{
  "method": "GET",
  "path": "/api/orchestration/triggers/{triggerID}/occurrences",
  "summary": "List triggers occurrences",
  "description": "List triggers occurrences",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "List of triggers occurrences",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListTriggersOccurrencesResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of TriggerOccurrence",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-listWorkflows"></a>

### GET /api/orchestration/workflows

List registered workflows

List registered workflows

```json
{
  "method": "GET",
  "path": "/api/orchestration/workflows",
  "summary": "List registered workflows",
  "description": "List registered workflows",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "List of workflows",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListWorkflowsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of Workflow",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-createWorkflow"></a>

### POST /api/orchestration/workflows

Create workflow

Create a workflow

```json
{
  "method": "POST",
  "path": "/api/orchestration/workflows",
  "summary": "Create workflow",
  "description": "Create a workflow",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "CreateWorkflowRequest",
      "properties": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "stages",
          "type": "array of object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created workflow",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "CreateWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "Workflow",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-getWorkflow"></a>

### GET /api/orchestration/workflows/{flowId}

Get a flow by id

Get a flow by id

```json
{
  "method": "GET",
  "path": "/api/orchestration/workflows/{flowId}",
  "summary": "Get a flow by id",
  "description": "Get a flow by id",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "The workflow",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "Workflow",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-deleteWorkflow"></a>

### DELETE /api/orchestration/workflows/{flowId}

Delete a flow by id

Delete a flow by id

```json
{
  "method": "DELETE",
  "path": "/api/orchestration/workflows/{flowId}",
  "summary": "Delete a flow by id",
  "description": "Delete a flow by id",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-runWorkflow"></a>

### POST /api/orchestration/workflows/{workflowID}/instances

Run workflow

Run workflow

```json
{
  "method": "POST",
  "path": "/api/orchestration/workflows/{workflowID}/instances",
  "summary": "Run workflow",
  "description": "Run workflow",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "queryParams": [
    {
      "name": "wait",
      "description": "Wait end of the workflow before return",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "RunWorkflowRequest"
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "The workflow instance",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "RunWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "WorkflowInstance",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-listInstances"></a>

### GET /api/orchestration/instances

List instances of a workflow

List instances of a workflow

```json
{
  "method": "GET",
  "path": "/api/orchestration/instances",
  "summary": "List instances of a workflow",
  "description": "List instances of a workflow",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "queryParams": [
    {
      "name": "workflowID",
      "description": "A workflow id",
      "required": false
    },
    {
      "name": "running",
      "description": "Filter running instances",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of workflow instances",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ListRunsResponse",
        "properties": [
          {
            "name": "data",
            "type": "array of WorkflowInstance",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-getInstance"></a>

### GET /api/orchestration/instances/{instanceID}

Get a workflow instance by id

Get a workflow instance by id

```json
{
  "method": "GET",
  "path": "/api/orchestration/instances/{instanceID}",
  "summary": "Get a workflow instance by id",
  "description": "Get a workflow instance by id",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "The workflow instance",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWorkflowInstanceResponse",
        "properties": [
          {
            "name": "data",
            "type": "WorkflowInstance",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-sendEvent"></a>

### POST /api/orchestration/instances/{instanceID}/events

Send an event to a running workflow

Send an event to a running workflow

```json
{
  "method": "POST",
  "path": "/api/orchestration/instances/{instanceID}/events",
  "summary": "Send an event to a running workflow",
  "description": "Send an event to a running workflow",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-cancelEvent"></a>

### PUT /api/orchestration/instances/{instanceID}/abort

Cancel a running workflow

Cancel a running workflow

```json
{
  "method": "PUT",
  "path": "/api/orchestration/instances/{instanceID}/abort",
  "summary": "Cancel a running workflow",
  "description": "Cancel a running workflow",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "204",
      "description": "No content"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-getInstanceHistory"></a>

### GET /api/orchestration/instances/{instanceID}/history

Get a workflow instance history by id

Get a workflow instance history by id

```json
{
  "method": "GET",
  "path": "/api/orchestration/instances/{instanceID}/history",
  "summary": "Get a workflow instance history by id",
  "description": "Get a workflow instance history by id",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "The workflow instance history",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWorkflowInstanceHistoryResponse",
        "properties": [
          {
            "name": "data",
            "type": "WorkflowInstanceHistoryList",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-getInstanceStageHistory"></a>

### GET /api/orchestration/instances/{instanceID}/stages/{number}/history

Get a workflow instance stage history

Get a workflow instance stage history

```json
{
  "method": "GET",
  "path": "/api/orchestration/instances/{instanceID}/stages/{number}/history",
  "summary": "Get a workflow instance stage history",
  "description": "Get a workflow instance stage history",
  "tags": [
    "orchestration.v1"
  ],
  "module": "Orchestration",
  "resourceGroup": "v1 (deprecated)",
  "responses": [
    {
      "code": "200",
      "description": "The workflow instance stage history",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "GetWorkflowInstanceHistoryStageResponse",
        "properties": [
          {
            "name": "data",
            "type": "WorkflowInstanceHistoryStageList",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2GetServerInfo"></a>

### GET /api/orchestration/v2/\_info

Get server info

Retrieve server version and status information.

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/_info",
  "summary": "Get server info",
  "description": "Retrieve server version and status information.",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2ListTriggers"></a>

### GET /api/orchestration/v2/triggers

List triggers

List all triggers configured in the system.

**What are Triggers?**
Triggers automatically start workflow instances when specific events occur in the Formance platform.

**Supported Events:**

- `ledger.committed_transactions`: New transaction in a ledger
- `payments.saved_payment`: Payment received from a PSP
- `wallets.credited`: Wallet credited with funds
- `wallets.debited`: Wallet debited

See [Workflows Introduction](https://docs.formance.com/modules/flows) for more details.

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/triggers",
  "summary": "List triggers",
  "description": "List all triggers configured in the system.\n\n**What are Triggers?**\nTriggers automatically start workflow instances when specific events occur in the Formance platform.\n\n**Supported Events:**\n- `ledger.committed_transactions`: New transaction in a ledger\n- `payments.saved_payment`: Payment received from a PSP\n- `wallets.credited`: Wallet credited with funds\n- `wallets.debited`: Wallet debited\n\nSee [Workflows Introduction](/modules/flows) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "queryParams": [
    {
      "name": "name",
      "description": "Filter triggers by name. Supports partial matching.\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of triggers",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ListTriggersResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V2Trigger",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2CreateTrigger"></a>

### POST /api/orchestration/v2/triggers

Create trigger

Create a new trigger to automatically start workflows on specific events.

**Example: Trigger on New Payment**

```json
{
  "name": "payment-to-wallet-trigger",
  "event": "payments.saved_payment",
  "workflowID": "wf_payment_processing",
  "filter": "payment.status == 'SUCCEEDED'",
  "vars": {
    "paymentAmount": "payment.amount",
    "paymentAsset": "payment.asset"
  }
}
```

**Trigger Configuration:**

- **event**: The Formance event type to listen for
- **workflowID**: The workflow to run when triggered
- **filter**: Optional CEL expression to match specific events
- **vars**: Variables to extract from the event payload

See [Workflows Definition](https://docs.formance.com/modules/flows/definition) for more details.

````json
{
  "method": "POST",
  "path": "/api/orchestration/v2/triggers",
  "summary": "Create trigger",
  "description": "Create a new trigger to automatically start workflows on specific events.\n\n**Example: Trigger on New Payment**\n```json\n{\n  \"name\": \"payment-to-wallet-trigger\",\n  \"event\": \"payments.saved_payment\",\n  \"workflowID\": \"wf_payment_processing\",\n  \"filter\": \"payment.status == 'SUCCEEDED'\",\n  \"vars\": {\n    \"paymentAmount\": \"payment.amount\",\n    \"paymentAsset\": \"payment.asset\"\n  }\n}\n```\n\n**Trigger Configuration:**\n- **event**: The Formance event type to listen for\n- **workflowID**: The workflow to run when triggered\n- **filter**: Optional CEL expression to match specific events\n- **vars**: Variables to extract from the event payload\n\nSee [Workflows Definition](/modules/flows/definition) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "V2TriggerData",
      "properties": [
        {
          "name": "event",
          "type": "string",
          "required": true
        },
        {
          "name": "workflowID",
          "type": "string",
          "required": true
        },
        {
          "name": "version",
          "type": "string"
        },
        {
          "name": "filter",
          "type": "string"
        },
        {
          "name": "vars",
          "type": "object"
        },
        {
          "name": "name",
          "type": "string"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created trigger",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2CreateTriggerResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Trigger",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="orchestration-v2ReadTrigger"></a>

### GET /api/orchestration/v2/triggers/{triggerID}

Read trigger

Retrieve details of a specific trigger including its event configuration, filter expression, and associated workflow.

**Response includes:**

- Trigger ID and name
- Event type being listened for
- Filter expression (if any)
- Variable mappings
- Associated workflow ID
- Creation timestamp

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/triggers/{triggerID}",
  "summary": "Read trigger",
  "description": "Retrieve details of a specific trigger including its event configuration, filter expression, and associated workflow.\n\n**Response includes:**\n- Trigger ID and name\n- Event type being listened for\n- Filter expression (if any)\n- Variable mappings\n- Associated workflow ID\n- Creation timestamp\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "responses": [
    {
      "code": "200",
      "description": "A specific trigger",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ReadTriggerResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Trigger",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2DeleteTrigger"></a>

### DELETE /api/orchestration/v2/triggers/{triggerID}

Delete trigger

Delete a trigger to stop it from firing on future events.

**Note:** Running workflow instances started by this trigger will continue to completion. Only future events will not start new instances.

```json
{
  "method": "DELETE",
  "path": "/api/orchestration/v2/triggers/{triggerID}",
  "summary": "Delete trigger",
  "description": "Delete a trigger to stop it from firing on future events.\n\n**Note:** Running workflow instances started by this trigger will continue to completion. Only future events will not start new instances.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "responses": [
    {
      "code": "204",
      "description": "Trigger deleted successfully"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-testTrigger"></a>

### POST /api/orchestration/v2/triggers/{triggerID}/test

Test trigger

Test a trigger with a sample event payload without starting a workflow.

**Example Test Payload:**

```json
{
  "payment": {
    "id": "pay_123",
    "amount": 5000,
    "status": "SUCCEEDED"
  }
}
```

Use this to validate your trigger configuration before deploying to production.

````json
{
  "method": "POST",
  "path": "/api/orchestration/v2/triggers/{triggerID}/test",
  "summary": "Test trigger",
  "description": "Test a trigger with a sample event payload without starting a workflow.\n\n**Example Test Payload:**\n```json\n{\n  \"payment\": {\n    \"id\": \"pay_123\",\n    \"amount\": 5000,\n    \"status\": \"SUCCEEDED\"\n  }\n}\n```\n\nUse this to validate your trigger configuration before deploying to production.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "requestBody": {
    "mediaType": "application/json",
    "description": "A sample event payload to test against the trigger's filter and variable expressions.\n",
    "schema": {
      "type": "object"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Test results showing whether the filter matched and extracted variables",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2TestTriggerResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2TriggerTest",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="orchestration-v2ListTriggersOccurrences"></a>

### GET /api/orchestration/v2/triggers/{triggerID}/occurrences

List trigger occurrences

List all times this trigger has fired.

**Response includes for each occurrence:**

- Timestamp when the trigger fired
- The event that triggered it
- The workflow instance started (if successful)
- Any errors that occurred

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/triggers/{triggerID}/occurrences",
  "summary": "List trigger occurrences",
  "description": "List all times this trigger has fired.\n\n**Response includes for each occurrence:**\n- Timestamp when the trigger fired\n- The event that triggered it\n- The workflow instance started (if successful)\n- Any errors that occurred\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Triggers",
  "responses": [
    {
      "code": "200",
      "description": "List of trigger occurrences",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ListTriggersOccurrencesResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V2TriggerOccurrence",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2ListWorkflows"></a>

### GET /api/orchestration/v2/workflows

List workflows

List all registered workflow definitions.

**What are Workflows?**
Workflows are reusable automation templates that define a sequence of stages to execute.

**Common Use Cases:**

- **Ledger to Ledger**: Move funds between accounts
- **Payment to Wallet**: Process incoming payments and credit user wallets
- **Ledger to Payout**: Initiate payouts to external bank accounts

See [Workflows Introduction](https://docs.formance.com/modules/flows) for more details.

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/workflows",
  "summary": "List workflows",
  "description": "List all registered workflow definitions.\n\n**What are Workflows?**\nWorkflows are reusable automation templates that define a sequence of stages to execute.\n\n**Common Use Cases:**\n- **Ledger to Ledger**: Move funds between accounts\n- **Payment to Wallet**: Process incoming payments and credit user wallets\n- **Ledger to Payout**: Initiate payouts to external bank accounts\n\nSee [Workflows Introduction](/modules/flows) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Workflows",
  "responses": [
    {
      "code": "200",
      "description": "List of workflows",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ListWorkflowsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V2Workflow",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2CreateWorkflow"></a>

### POST /api/orchestration/v2/workflows

Create workflow

Create a new workflow definition.

**Example: Simple Ledger Transfer**

```json
{
  "name": "ledger-transfer",
  "stages": [
    {
      "send": {
        "source": { "account": { "id": "${source}", "ledger": "default" } },
        "destination": { "account": { "id": "${dest}", "ledger": "default" } },
        "amount": { "asset": "${asset}", "amount": "${amount}" }
      }
    }
  ]
}
```

**Stage Types:**

1. **send**: Transfer funds between accounts/wallets
2. **delay**: Pause execution for a duration
3. **waitEvent**: Pause until an external event
4. **update**: Modify account metadata

See [Workflows Definition](https://docs.formance.com/modules/flows/definition) for more details.

````json
{
  "method": "POST",
  "path": "/api/orchestration/v2/workflows",
  "summary": "Create workflow",
  "description": "Create a new workflow definition.\n\n**Example: Simple Ledger Transfer**\n```json\n{\n  \"name\": \"ledger-transfer\",\n  \"stages\": [\n    {\n      \"send\": {\n        \"source\": { \"account\": { \"id\": \"${source}\", \"ledger\": \"default\" } },\n        \"destination\": { \"account\": { \"id\": \"${dest}\", \"ledger\": \"default\" } },\n        \"amount\": { \"asset\": \"${asset}\", \"amount\": \"${amount}\" }\n      }\n    }\n  ]\n}\n```\n\n**Stage Types:**\n1. **send**: Transfer funds between accounts/wallets\n2. **delay**: Pause execution for a duration\n3. **waitEvent**: Pause until an external event\n4. **update**: Modify account metadata\n\nSee [Workflows Definition](/modules/flows/definition) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Workflows",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The workflow definition including name and stages.\n",
    "schema": {
      "type": "object",
      "ref": "V2CreateWorkflowRequest",
      "properties": [
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "stages",
          "type": "array of object",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Created workflow",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2CreateWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Workflow",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="orchestration-v2GetWorkflow"></a>

### GET /api/orchestration/v2/workflows/{flowId}

Get workflow

Retrieve details of a specific workflow including its stage configuration.

**Response includes:**

- Workflow ID and name
- Stage definitions
- Creation and update timestamps

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/workflows/{flowId}",
  "summary": "Get workflow",
  "description": "Retrieve details of a specific workflow including its stage configuration.\n\n**Response includes:**\n- Workflow ID and name\n- Stage definitions\n- Creation and update timestamps\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Workflows",
  "responses": [
    {
      "code": "200",
      "description": "The workflow definition",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2Workflow",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2DeleteWorkflow"></a>

### DELETE /api/orchestration/v2/workflows/{flowId}

Delete workflow

Delete a workflow definition.

**Important:** Running instances continue to completion but no new instances can be started.

```json
{
  "method": "DELETE",
  "path": "/api/orchestration/v2/workflows/{flowId}",
  "summary": "Delete workflow",
  "description": "Delete a workflow definition.\n\n**Important:** Running instances continue to completion but no new instances can be started.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Workflows",
  "responses": [
    {
      "code": "204",
      "description": "Workflow deleted successfully"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2RunWorkflow"></a>

### POST /api/orchestration/v2/workflows/{workflowID}/instances

Run workflow

Start a new instance of a workflow with the provided variables.

**Example: Run a Transfer**

```json
{
  "source": "users:alice",
  "dest": "merchants:coffee_shop",
  "asset": "USD/2",
  "amount": 550
}
```

**Options:**

- **wait** (query param): Set to `true` to block until the workflow completes

See [Workflows Execution](https://docs.formance.com/modules/flows/execution) for more details.

````json
{
  "method": "POST",
  "path": "/api/orchestration/v2/workflows/{workflowID}/instances",
  "summary": "Run workflow",
  "description": "Start a new instance of a workflow with the provided variables.\n\n**Example: Run a Transfer**\n```json\n{\n  \"source\": \"users:alice\",\n  \"dest\": \"merchants:coffee_shop\",\n  \"asset\": \"USD/2\",\n  \"amount\": 550\n}\n```\n\n**Options:**\n- **wait** (query param): Set to `true` to block until the workflow completes\n\nSee [Workflows Execution](/modules/flows/execution) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Workflows",
  "queryParams": [
    {
      "name": "wait",
      "description": "If `true`, the request will block until the workflow completes and return the final state. Useful for synchronous operations.\n",
      "required": false
    }
  ],
  "requestBody": {
    "mediaType": "application/json",
    "description": "Variables to pass to the workflow. These are substituted into stage definitions using `${variable_name}` syntax.\n",
    "schema": {
      "type": "object",
      "ref": "V2RunWorkflowRequest"
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "The workflow instance",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2RunWorkflowResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2WorkflowInstance",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="orchestration-v2ListInstances"></a>

### GET /api/orchestration/v2/instances

List instances

List all workflow instances with their current status.

**Filter Options:**

- **workflowID**: Filter to instances of a specific workflow
- **running**: Set to `true` to only show executing instances

**Instance States:**

- **Running**: Currently executing stages
- **Completed**: All stages finished successfully
- **Failed**: A stage failed
- **Terminated**: Manually aborted

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/instances",
  "summary": "List instances",
  "description": "List all workflow instances with their current status.\n\n**Filter Options:**\n- **workflowID**: Filter to instances of a specific workflow\n- **running**: Set to `true` to only show executing instances\n\n**Instance States:**\n- **Running**: Currently executing stages\n- **Completed**: All stages finished successfully\n- **Failed**: A stage failed\n- **Terminated**: Manually aborted\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "queryParams": [
    {
      "name": "workflowID",
      "description": "Filter to only show instances of a specific workflow.\n",
      "required": false
    },
    {
      "name": "running",
      "description": "If `true`, only return currently running instances (not completed, failed, or terminated).\n",
      "required": false
    }
  ],
  "responses": [
    {
      "code": "200",
      "description": "List of workflow instances",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2ListRunsResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of V2WorkflowInstance",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2GetInstance"></a>

### GET /api/orchestration/v2/instances/{instanceID}

Get instance

Retrieve details of a specific workflow instance.

**Response includes:**

- Instance ID and associated workflow
- Current stage progress
- Input variables
- Termination status and any errors
- Creation and update timestamps

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/instances/{instanceID}",
  "summary": "Get instance",
  "description": "Retrieve details of a specific workflow instance.\n\n**Response includes:**\n- Instance ID and associated workflow\n- Current stage progress\n- Input variables\n- Termination status and any errors\n- Creation and update timestamps\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "responses": [
    {
      "code": "200",
      "description": "The workflow instance details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetWorkflowInstanceResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2WorkflowInstance",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2SendEvent"></a>

### POST /api/orchestration/v2/instances/{instanceID}/events

Send event

Send an event to a running workflow instance that is waiting at a `waitEvent` stage.

**Use Case: Manual Approval**

```json
{
  "name": "approval"
}
```

The workflow will resume from the `waitEvent` stage once the matching event is received.

See [Waiting for Events](https://docs.formance.com/modules/flows/stages/wait-event) for more details.

````json
{
  "method": "POST",
  "path": "/api/orchestration/v2/instances/{instanceID}/events",
  "summary": "Send event",
  "description": "Send an event to a running workflow instance that is waiting at a `waitEvent` stage.\n\n**Use Case: Manual Approval**\n```json\n{\n  \"name\": \"approval\"\n}\n```\n\nThe workflow will resume from the `waitEvent` stage once the matching event is received.\n\nSee [Waiting for Events](/modules/flows/stages/wait-event) for more details.\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "requestBody": {
    "mediaType": "application/json",
    "description": "The event to send. The `name` must match the event name expected by the `waitEvent` stage.\n",
    "schema": {
      "type": "object",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true
        }
      ]
    }
  },
  "responses": [
    {
      "code": "204",
      "description": "Event sent successfully"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="orchestration-v2CancelEvent"></a>

### PUT /api/orchestration/v2/instances/{instanceID}/abort

Abort workflow

Cancel a running workflow instance.

**Important:**

- Completed stages are **NOT** rolled back
- Transactions already created remain in the ledger
- Use with caution in production

```json
{
  "method": "PUT",
  "path": "/api/orchestration/v2/instances/{instanceID}/abort",
  "summary": "Abort workflow",
  "description": "Cancel a running workflow instance.\n\n**Important:**\n- Completed stages are **NOT** rolled back\n- Transactions already created remain in the ledger\n- Use with caution in production\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "responses": [
    {
      "code": "204",
      "description": "Workflow aborted successfully"
    },
    {
      "code": "default",
      "description": "General error",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2Error",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "enumValues": [
              "VALIDATION",
              "NOT_FOUND",
              "INTERNAL"
            ]
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2GetInstanceHistory"></a>

### GET /api/orchestration/v2/instances/{instanceID}/history

Get instance history

Retrieve the complete execution history of a workflow instance.

**History includes for each stage:**

- Stage name and type
- Input parameters and output
- Start and end timestamps
- Any errors or retries

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/instances/{instanceID}/history",
  "summary": "Get instance history",
  "description": "Retrieve the complete execution history of a workflow instance.\n\n**History includes for each stage:**\n- Stage name and type\n- Input parameters and output\n- Start and end timestamps\n- Any errors or retries\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "responses": [
    {
      "code": "200",
      "description": "The workflow instance execution history",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetWorkflowInstanceHistoryResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2WorkflowInstanceHistoryList",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="orchestration-v2GetInstanceStageHistory"></a>

### GET /api/orchestration/v2/instances/{instanceID}/stages/{number}/history

Get stage history

Retrieve detailed history for a specific stage including all retry attempts.

**Response includes:**

- Input and output for each attempt
- Error messages and stack traces
- Timestamps for each attempt

```json
{
  "method": "GET",
  "path": "/api/orchestration/v2/instances/{instanceID}/stages/{number}/history",
  "summary": "Get stage history",
  "description": "Retrieve detailed history for a specific stage including all retry attempts.\n\n**Response includes:**\n- Input and output for each attempt\n- Error messages and stack traces\n- Timestamps for each attempt\n",
  "tags": [
    "orchestration.v2"
  ],
  "module": "Orchestration",
  "resourceGroup": "Instances",
  "responses": [
    {
      "code": "200",
      "description": "The stage execution history",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "V2GetWorkflowInstanceHistoryStageResponse",
        "properties": [
          {
            "name": "data",
            "type": "V2WorkflowInstanceHistoryStageList",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-reconciliationgetServerInfo"></a>

### GET /api/reconciliation/\_info

Get server info

Retrieve server version and status information.

```json
{
  "method": "GET",
  "path": "/api/reconciliation/_info",
  "summary": "Get server info",
  "description": "Retrieve server version and status information.",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "responses": [
    {
      "code": "200",
      "description": "Server information",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ServerInfo",
        "properties": [
          {
            "name": "version",
            "type": "string",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-createPolicy"></a>

### POST /api/reconciliation/policies

Create a policy

Create a reconciliation policy that defines how to compare your internal ledger with external payment provider data.

**What is a Reconciliation Policy?**
A policy defines:

1. Which **ledger accounts** to include (via a query filter)
2. Which **payments pool** to compare against

**Example Policy:**

```json
{
  "name": "daily-stripe-reconciliation",
  "ledgerName": "main",
  "ledgerQuery": {
    "$match": { "address": "stripe::" }
  },
  "paymentsPoolID": "550e8400-e29b-41d4-a716-446655440000"
}
```

See [Reconciliation Introduction](https://docs.formance.com/v3.2/modules/reconciliation) for more details.

````json
{
  "method": "POST",
  "path": "/api/reconciliation/policies",
  "summary": "Create a policy",
  "description": "Create a reconciliation policy that defines how to compare your internal ledger with external payment provider data.\n\n**What is a Reconciliation Policy?**\nA policy defines:\n1. Which **ledger accounts** to include (via a query filter)\n2. Which **payments pool** to compare against\n\n**Example Policy:**\n```json\n{\n  \"name\": \"daily-stripe-reconciliation\",\n  \"ledgerName\": \"main\",\n  \"ledgerQuery\": {\n    \"$match\": { \"address\": \"stripe::\" }\n  },\n  \"paymentsPoolID\": \"550e8400-e29b-41d4-a716-446655440000\"\n}\n```\n\nSee [Reconciliation Introduction](/modules/reconciliation) for more details.\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Policies",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "The policy configuration including ledger query and payments pool.\n",
    "schema": {
      "type": "object",
      "ref": "PolicyRequest",
      "properties": [
        {
          "name": "name",
          "type": "string",
          "required": true,
          "example": "XXX"
        },
        {
          "name": "ledgerName",
          "type": "string",
          "required": true,
          "example": "default"
        },
        {
          "name": "ledgerQuery",
          "type": "object",
          "required": true
        },
        {
          "name": "paymentsPoolID",
          "type": "string",
          "required": true,
          "example": "XXX"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "201",
      "description": "Policy created successfully",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PolicyResponse",
        "properties": [
          {
            "name": "data",
            "type": "Policy",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="reconciliation-listPolicies"></a>

### GET /api/reconciliation/policies

List policies

List all reconciliation policies.

Policies are reusable configurations that can be executed multiple times to perform reconciliations on a schedule or on-demand.

**Use Cases:**

- View all configured reconciliation rules
- Audit existing policies before creating new ones

```json
{
  "method": "GET",
  "path": "/api/reconciliation/policies",
  "summary": "List policies",
  "description": "List all reconciliation policies.\n\nPolicies are reusable configurations that can be executed multiple times to perform reconciliations on a schedule or on-demand.\n\n**Use Cases:**\n- View all configured reconciliation rules\n- Audit existing policies before creating new ones\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Policies",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "List of policies",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PoliciesCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of Policy",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-deletePolicy"></a>

### DELETE /api/reconciliation/policies/{policyID}

Delete a policy

Delete a reconciliation policy by its ID.

**Note:** Historical reconciliation results are preserved. Only the policy definition is removed.

```json
{
  "method": "DELETE",
  "path": "/api/reconciliation/policies/{policyID}",
  "summary": "Delete a policy",
  "description": "Delete a reconciliation policy by its ID.\n\n**Note:** Historical reconciliation results are preserved. Only the policy definition is removed.\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Policies",
  "responses": [
    {
      "code": "204",
      "description": "Policy deleted successfully"
    },
    {
      "code": "default",
      "description": "Error response",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "reconciliationErrorResponse",
        "properties": [
          {
            "name": "errorCode",
            "type": "string",
            "required": true,
            "example": "VALIDATION"
          },
          {
            "name": "errorMessage",
            "type": "string",
            "required": true
          },
          {
            "name": "details",
            "type": "string"
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-getPolicy"></a>

### GET /api/reconciliation/policies/{policyID}

Get a policy

Retrieve details of a specific reconciliation policy.

**Response includes:**

- Policy ID and name
- Ledger name and query filter
- Payments pool ID
- Creation timestamp

```json
{
  "method": "GET",
  "path": "/api/reconciliation/policies/{policyID}",
  "summary": "Get a policy",
  "description": "Retrieve details of a specific reconciliation policy.\n\n**Response includes:**\n- Policy ID and name\n- Ledger name and query filter\n- Payments pool ID\n- Creation timestamp\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Policies",
  "responses": [
    {
      "code": "200",
      "description": "Policy details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "PolicyResponse",
        "properties": [
          {
            "name": "data",
            "type": "Policy",
            "required": true
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-reconcile"></a>

### POST /api/reconciliation/policies/{policyID}/reconciliation

Reconcile using a policy

Execute a reconciliation using the specified policy.

**How It Works:**

1. Query ledger balances at the specified timestamp
2. Query payment pool balances at the same timestamp
3. Compare and calculate any drift (discrepancy)
4. Return results with status

**Response Fields:**

- **ledgerBalances**: Total balances from the ledger (by asset)
- **paymentsBalances**: Total balances from the payment pool (by asset)
- **driftBalances**: Difference (should be zero if reconciled)
- **status**: `COMPLETED` if successful

**Example Response (Drift Detected):**

```json
{
  "data": {
    "status": "COMPLETED",
    "ledgerBalances": {"USD/2": 1000000},
    "paymentsBalances": {"USD/2": 995000},
    "driftBalances": {"USD/2": 5000}
  }
}
```

See [Getting Started](https://docs.formance.com/v3.2/modules/reconciliation/getting-started) for a complete walkthrough.

````json
{
  "method": "POST",
  "path": "/api/reconciliation/policies/{policyID}/reconciliation",
  "summary": "Reconcile using a policy",
  "description": "Execute a reconciliation using the specified policy.\n\n**How It Works:**\n1. Query ledger balances at the specified timestamp\n2. Query payment pool balances at the same timestamp\n3. Compare and calculate any drift (discrepancy)\n4. Return results with status\n\n**Response Fields:**\n- **ledgerBalances**: Total balances from the ledger (by asset)\n- **paymentsBalances**: Total balances from the payment pool (by asset)\n- **driftBalances**: Difference (should be zero if reconciled)\n- **status**: `COMPLETED` if successful\n\n**Example Response (Drift Detected):**\n```json\n{\n  \"data\": {\n    \"status\": \"COMPLETED\",\n    \"ledgerBalances\": {\"USD/2\": 1000000},\n    \"paymentsBalances\": {\"USD/2\": 995000},\n    \"driftBalances\": {\"USD/2\": 5000}\n  }\n}\n```\n\nSee [Getting Started](/modules/reconciliation/getting-started) for a complete walkthrough.\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Policies",
  "requestBody": {
    "mediaType": "application/json",
    "required": true,
    "description": "The point-in-time timestamps to compare ledger and payments data.\n",
    "schema": {
      "type": "object",
      "ref": "ReconciliationRequest",
      "properties": [
        {
          "name": "reconciledAtLedger",
          "type": "string (date-time)",
          "required": true,
          "example": "2021-01-01T00:00:00.000Z"
        },
        {
          "name": "reconciledAtPayments",
          "type": "string (date-time)",
          "required": true,
          "example": "2021-01-01T00:00:00.000Z"
        }
      ]
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "Reconciliation results",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReconciliationResponse",
        "properties": [
          {
            "name": "data",
            "type": "Reconciliation",
            "required": true
          }
        ]
      }
    }
  ]
}
````

<a id="reconciliation-listReconciliations"></a>

### GET /api/reconciliation/reconciliations

List reconciliations

List all reconciliation results.

**Response includes for each reconciliation:**

- Reconciliation ID and associated policy
- Timestamps of the compared data points
- Status (COMPLETED, FAILED)
- Balance breakdowns (ledger, payments, drift)

```json
{
  "method": "GET",
  "path": "/api/reconciliation/reconciliations",
  "summary": "List reconciliations",
  "description": "List all reconciliation results.\n\n**Response includes for each reconciliation:**\n- Reconciliation ID and associated policy\n- Timestamps of the compared data points\n- Status (COMPLETED, FAILED)\n- Balance breakdowns (ledger, payments, drift)\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Reconciliations",
  "requestBody": {
    "mediaType": "application/json",
    "schema": {
      "type": "object",
      "ref": "QueryBuilder"
    }
  },
  "responses": [
    {
      "code": "200",
      "description": "List of reconciliations",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReconciliationsCursorResponse",
        "properties": [
          {
            "name": "cursor",
            "type": "object",
            "required": true,
            "inlineSchema": {
              "type": "object",
              "properties": [
                {
                  "name": "pageSize",
                  "type": "integer (int64)",
                  "required": true,
                  "example": 15
                },
                {
                  "name": "hasMore",
                  "type": "boolean",
                  "required": true,
                  "example": false
                },
                {
                  "name": "previous",
                  "type": "string",
                  "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol="
                },
                {
                  "name": "next",
                  "type": "string",
                  "example": ""
                },
                {
                  "name": "data",
                  "type": "array of Reconciliation",
                  "required": true
                }
              ]
            }
          }
        ]
      }
    }
  ]
}
```

<a id="reconciliation-getReconciliation"></a>

### GET /api/reconciliation/reconciliations/{reconciliationID}

Get a reconciliation

Retrieve details of a specific reconciliation result.

**Response includes:**

- **id**: Unique reconciliation ID
- **policyID**: The policy used
- **status**: COMPLETED or FAILED
- **ledgerBalances**: Sum of ledger account balances by asset
- **paymentsBalances**: Sum of payment pool balances by asset
- **driftBalances**: Difference between ledger and payments

```json
{
  "method": "GET",
  "path": "/api/reconciliation/reconciliations/{reconciliationID}",
  "summary": "Get a reconciliation",
  "description": "Retrieve details of a specific reconciliation result.\n\n**Response includes:**\n- **id**: Unique reconciliation ID\n- **policyID**: The policy used\n- **status**: COMPLETED or FAILED\n- **ledgerBalances**: Sum of ledger account balances by asset\n- **paymentsBalances**: Sum of payment pool balances by asset\n- **driftBalances**: Difference between ledger and payments\n",
  "tags": [
    "reconciliation.v1"
  ],
  "module": "Reconciliation",
  "resourceGroup": "Reconciliations",
  "responses": [
    {
      "code": "200",
      "description": "Reconciliation details",
      "mediaType": "application/json",
      "schema": {
        "type": "object",
        "ref": "ReconciliationResponse",
        "properties": [
          {
            "name": "data",
            "type": "Reconciliation",
            "required": true
          }
        ]
      }
    }
  ]
}
```
