diff --git a/Earthfile b/Earthfile index 4d30ce854a..7c0fee7ce0 100644 --- a/Earthfile +++ b/Earthfile @@ -47,7 +47,7 @@ build-final-spec: SAVE ARTIFACT build/latest.json AS LOCAL releases/build/latest.json ELSE RUN sed -i 's/SDK_VERSION/'$version'/g' build/latest.json - SAVE ARTIFACT build/latest.json AS LOCAL releases/build/$version.json + SAVE ARTIFACT build/latest.json AS LOCAL releases/build/generate.json END SAVE ARTIFACT build/latest.json @@ -60,7 +60,7 @@ openapi: END FOR component IN $(cd ./ee && ls -d */) COPY (./ee/$component+openapi/src/ee/$component) /src/ee/$component - END + ENDle RUN toto SAVE ARTIFACT /src diff --git a/docs/openapi/v2.0.yaml b/docs/openapi/v2.0.yaml deleted file mode 100644 index b43b67ad5d..0000000000 --- a/docs/openapi/v2.0.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: stack.formance.com/v1beta3 -kind: Versions -metadata: - name: v2.0 -spec: - ledger: v2.0.0-beta.7 - search: v1.0.0 - stargate: v1.0.0 - auth: v1.0.0 - wallets: v1.0.0 - webhooks: v1.0.0 - gateway: v1.0.0 - payments: v1.0.0-rc.5 - orchestration: v0.3.0 - reconciliation: v0.1.1 diff --git a/docs/openapi/v2.json b/docs/openapi/v2.json index c47885d3fa..f8e242cee7 100644 --- a/docs/openapi/v2.json +++ b/docs/openapi/v2.json @@ -12,7 +12,7 @@ "url": "https://avatars.githubusercontent.com/u/84325077?s=200&v=4", "altText": "Formance" }, - "version": "v1.0.20231012" + "version": "v2.0.0-beta.6" }, "servers": [ { @@ -20,6 +20,11 @@ "description": "local server" } ], + "security": [ + { + "Authorization": [] + } + ], "paths": { "/versions": { "get": { @@ -39,6 +44,15 @@ } } }, + "/api/auth/.well-known/openid-configuration": { + "get": { + "responses": { + "200": { + "description": "OpenID provider configuration.\nSee https://swagger.io/docs/specification/authentication/openid-connect-discovery/ for details\n" + } + } + } + }, "/api/auth/_info": { "get": { "summary": "Get server info", @@ -285,297 +299,6 @@ } } }, - "/api/auth/clients/{clientId}/scopes/{scopeId}": { - "put": { - "summary": "Add scope to client", - "tags": [ - "Auth", - "Clients" - ], - "operationId": "addScopeToClient", - "parameters": [ - { - "description": "Client ID", - "in": "path", - "name": "clientId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Scope added to client" - } - } - }, - "delete": { - "summary": "Delete scope from client", - "tags": [ - "Auth", - "Clients" - ], - "operationId": "deleteScopeFromClient", - "parameters": [ - { - "description": "Client ID", - "in": "path", - "name": "clientId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Scope deleted from client" - } - } - } - }, - "/api/auth/scopes": { - "get": { - "summary": "List scopes", - "tags": [ - "Auth", - "Scopes" - ], - "description": "List Scopes", - "operationId": "listScopes", - "responses": { - "200": { - "description": "List of scopes", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListScopesResponse" - } - } - } - } - } - }, - "post": { - "summary": "Create scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Create scope", - "operationId": "createScope", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateScopeRequest" - } - } - } - }, - "responses": { - "201": { - "description": "Created scope", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateScopeResponse" - } - } - } - } - } - } - }, - "/api/auth/scopes/{scopeId}": { - "get": { - "summary": "Read scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Read scope", - "operationId": "readScope", - "parameters": [ - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieved scope", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReadScopeResponse" - } - } - } - } - } - }, - "put": { - "summary": "Update scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Update scope", - "operationId": "updateScope", - "parameters": [ - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateScopeRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Updated scope", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateScopeResponse" - } - } - } - } - } - }, - "delete": { - "summary": "Delete scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Delete scope", - "operationId": "deleteScope", - "parameters": [ - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Scope deleted" - } - } - } - }, - "/api/auth/scopes/{scopeId}/transient/{transientScopeId}": { - "put": { - "summary": "Add a transient scope to a scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Add a transient scope to a scope", - "operationId": "addTransientScope", - "parameters": [ - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Transient scope ID", - "in": "path", - "name": "transientScopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Scope added" - } - } - }, - "delete": { - "summary": "Delete a transient scope from a scope", - "tags": [ - "Auth", - "Scopes" - ], - "description": "Delete a transient scope from a scope", - "operationId": "deleteTransientScope", - "parameters": [ - { - "description": "Scope ID", - "in": "path", - "name": "scopeId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Transient scope ID", - "in": "path", - "name": "transientScopeId", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Transient scope deleted" - } - } - } - }, "/api/auth/users": { "get": { "summary": "List users", @@ -633,7 +356,7 @@ } } }, - "/api/ledger/v2/_info": { + "/api/ledger/_info": { "get": { "tags": [ "Ledger", @@ -665,7 +388,7 @@ } } }, - "/api/ledger/v2/{ledger}/_info": { + "/api/ledger/{ledger}/_info": { "get": { "summary": "Get information about a ledger", "operationId": "getLedgerInfo", @@ -708,7 +431,7 @@ } } }, - "/api/ledger/v2/{ledger}/accounts": { + "/api/ledger/{ledger}/accounts": { "head": { "summary": "Count the accounts from a ledger", "operationId": "countAccounts", @@ -728,27 +451,29 @@ } }, { - "name": "pit", + "name": "address", "in": "query", - "required": false, + "description": "Filter accounts by address pattern (regular expression placed between ^ and $).", "schema": { "type": "string", - "format": "date-time" + "example": "users:.+" } + }, + { + "name": "metadata", + "in": "query", + "description": "Filter accounts by metadata key value pairs. The filter can be used like this metadata[key]=value1&metadata[a.nested.key]=value2", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "additionalProperties": true + }, + "example": "metadata[key]=value1&metadata[a.nested.key]=value2" } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, "responses": { - "204": { + "200": { "description": "OK", "headers": { "Count": { @@ -800,48 +525,122 @@ "type": "integer", "format": "int64", "minimum": 1, - "maximum": 1000 + "maximum": 1000, + "default": 15 } }, { - "name": "cursor", + "name": "page_size", + "x-speakeasy-ignore": true, "in": "query", - "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", + "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "default": 15 + }, + "deprecated": true + }, + { + "name": "after", + "in": "query", + "description": "Pagination cursor, will return accounts after given address, in descending order.", "schema": { "type": "string", - "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + "example": "users:003" } }, { - "name": "expand", + "name": "address", "in": "query", + "description": "Filter accounts by address pattern (regular expression placed between ^ and $).", "schema": { "type": "string", - "items": { - "type": "string" - } + "example": "users:.+" } }, { - "name": "pit", + "name": "metadata", "in": "query", - "required": false, + "description": "Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "additionalProperties": true + }, + "example": "metadata[key]=value1&metadata[a.nested.key]=value2" + }, + { + "name": "balance", + "in": "query", + "description": "Filter accounts by their balance (default operator is gte)", + "schema": { + "type": "integer", + "format": "int64", + "example": 2400 + } + }, + { + "name": "balanceOperator", + "x-speakeasy-ignore": true, + "in": "query", + "description": "Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.\n", "schema": { "type": "string", - "format": "date-time" + "enum": [ + "gte", + "lte", + "gt", + "lt", + "e", + "ne" + ], + "example": "gte" } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - } + }, + { + "name": "balance_operator", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "enum": [ + "gte", + "lte", + "gt", + "lt", + "e", + "ne" + ], + "example": "gte" + }, + "deprecated": true + }, + { + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" } + }, + { + "name": "pagination_token", + "in": "query", + "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.\nDeprecated, please use `cursor` instead.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + }, + "deprecated": true } - }, + ], "responses": { "200": { "description": "OK", @@ -866,7 +665,7 @@ } } }, - "/api/ledger/v2/{ledger}/accounts/{address}": { + "/api/ledger/{ledger}/accounts/{address}": { "get": { "summary": "Get account by its address", "operationId": "getAccount", @@ -894,25 +693,6 @@ "type": "string", "example": "users:001" } - }, - { - "name": "expand", - "in": "query", - "schema": { - "type": "string", - "items": { - "type": "string" - } - } - }, - { - "name": "pit", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "date-time" - } } ], "responses": { @@ -939,7 +719,7 @@ } } }, - "/api/ledger/v2/{ledger}/accounts/{address}/metadata": { + "/api/ledger/{ledger}/accounts/{address}/metadata": { "post": { "summary": "Add metadata to an account", "operationId": "addMetadataToAccount", @@ -967,23 +747,6 @@ "type": "string", "example": "users:001" } - }, - { - "name": "dryRun", - "in": "query", - "description": "Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "Idempotency-Key", - "in": "header", - "description": "Use an idempotency key", - "schema": { - "type": "string" - } } ], "requestBody": { @@ -991,7 +754,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ledgerMetadata" + "$ref": "#/components/schemas/Metadata1" } } }, @@ -1002,6 +765,26 @@ "description": "No Content", "content": {} }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "default": { "description": "Error", "content": { @@ -1015,15 +798,14 @@ } } }, - "/api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}": { - "delete": { - "description": "Delete metadata by key", - "operationId": "deleteAccountMetadata", + "/api/ledger/{ledger}/mapping": { + "get": { "tags": [ "Ledger", - "Transactions" + "Mapping" ], - "summary": "Delete metadata by key", + "operationId": "getMapping", + "summary": "Get the mapping of a ledger", "parameters": [ { "name": "ledger", @@ -1034,49 +816,43 @@ "type": "string", "example": "ledger001" } - }, - { - "name": "address", - "in": "path", - "description": "Account address", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "key", - "in": "path", - "description": "The key to remove.", - "required": true, - "schema": { - "type": "string", - "example": "foo" - } } ], "responses": { - "2XX": { - "description": "Key deleted", - "content": {} + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MappingResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } - } - }, - "/api/ledger/v2/{ledger}/stats": { - "get": { + }, + "put": { "tags": [ "Ledger", - "Stats" + "Mapping" ], - "operationId": "readStats", - "summary": "Get statistics from a ledger", - "description": "Get statistics from a ledger. (aggregate metrics on accounts and transactions)\n", + "operationId": "updateMapping", + "summary": "Update the mapping of a ledger", "parameters": [ { "name": "ledger", "in": "path", - "description": "name of the ledger", + "description": "Name of the ledger.", "required": true, "schema": { "type": "string", @@ -1084,13 +860,23 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Mapping" + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StatsResponse" + "$ref": "#/components/schemas/MappingResponse" } } } @@ -1108,14 +894,16 @@ } } }, - "/api/ledger/v2/{ledger}/transactions": { - "head": { + "/api/ledger/{ledger}/script": { + "post": { + "deprecated": true, "tags": [ "Ledger", - "Transactions" + "Script" ], - "summary": "Count the transactions from a ledger", - "operationId": "countTransactions", + "operationId": "runScript", + "summary": "Execute a Numscript", + "description": "This route is deprecated, and has been merged into `POST /{ledger}/transactions`.\n", "parameters": [ { "name": "ledger", @@ -1128,127 +916,67 @@ } }, { - "name": "pit", + "name": "preview", "in": "query", - "required": false, + "description": "Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker.", "schema": { - "type": "string", - "format": "date-time" + "type": "boolean", + "example": true } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": true + "$ref": "#/components/schemas/Script" } } } }, "responses": { - "204": { - "description": "OK", - "headers": { - "Count": { - "schema": { - "type": "integer", - "format": "int64", - "minimum": 0 - } - } - } - }, - "default": { - "description": "Error", + "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 - `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", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/ScriptResponse" } } } } } - }, + } + }, + "/api/ledger/{ledger}/stats": { "get": { "tags": [ "Ledger", - "Transactions" + "Stats" ], - "summary": "List transactions from a ledger", - "description": "List transactions from a ledger, sorted by id in descending order.", - "operationId": "listTransactions", + "operationId": "readStats", + "summary": "Get statistics from a ledger", + "description": "Get statistics from a ledger. (aggregate metrics on accounts and transactions)\n", "parameters": [ { "name": "ledger", "in": "path", - "description": "Name of the ledger.", + "description": "name of the ledger", "required": true, "schema": { "type": "string", "example": "ledger001" } - }, - { - "name": "pageSize", - "in": "query", - "description": "The maximum number of results to return per page.\n", - "example": 100, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000 - } - }, - { - "name": "cursor", - "in": "query", - "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", - "schema": { - "type": "string", - "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" - } - }, - { - "name": "expand", - "in": "query", - "schema": { - "type": "string", - "items": { - "type": "string" - } - } - }, - { - "name": "pit", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "date-time" - } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TransactionsCursorResponse" + "$ref": "#/components/schemas/StatsResponse" } } } @@ -1264,14 +992,16 @@ } } } - }, - "post": { + } + }, + "/api/ledger/{ledger}/transactions": { + "head": { "tags": [ "Ledger", "Transactions" ], - "summary": "Create a new transaction to a ledger", - "operationId": "createTransaction", + "summary": "Count the transactions from a ledger", + "operationId": "countTransactions", "parameters": [ { "name": "ledger", @@ -1284,41 +1014,103 @@ } }, { - "name": "dryRun", + "name": "reference", "in": "query", - "description": "Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "description": "Filter transactions by reference field.", "schema": { - "type": "boolean", - "example": true + "type": "string", + "example": "ref:001" } }, { - "name": "Idempotency-Key", - "in": "header", - "description": "Use an idempotency key", + "name": "account", + "in": "query", + "description": "Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $).", "schema": { - "type": "string" + "type": "string", + "example": "users:001" } - } - ], - "requestBody": { - "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", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTransaction" - } + }, + { + "name": "source", + "in": "query", + "description": "Filter transactions with postings involving given account at source (regular expression placed between ^ and $).", + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "destination", + "in": "query", + "description": "Filter transactions with postings involving given account at destination (regular expression placed between ^ and $).", + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "startTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" } + }, + { + "name": "start_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + }, + "deprecated": true + }, + { + "name": "endTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + }, + "deprecated": true + }, + { + "name": "metadata", + "in": "query", + "description": "Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "properties": {} + }, + "example": "metadata[key]=value1&metadata[a.nested.key]=value2" } - }, + ], "responses": { "200": { "description": "OK", - "content": { - "application/json": { + "headers": { + "Count": { "schema": { - "$ref": "#/components/schemas/CreateTransactionResponse" + "type": "integer", + "format": "int64", + "minimum": 0 } } } @@ -1334,16 +1126,15 @@ } } } - } - }, - "/api/ledger/v2/{ledger}/transactions/{id}": { + }, "get": { "tags": [ "Ledger", "Transactions" ], - "summary": "Get transaction from a ledger by its ID", - "operationId": "getTransaction", + "summary": "List transactions from a ledger", + "description": "List transactions from a ledger, sorted by txid in descending order.", + "operationId": "listTransactions", "parameters": [ { "name": "ledger", @@ -1356,34 +1147,147 @@ } }, { - "name": "id", - "in": "path", - "description": "Transaction ID.", - "required": true, + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, "schema": { "type": "integer", "format": "int64", - "minimum": 0, + "minimum": 1, + "maximum": 1000, + "default": 15 + } + }, + { + "name": "page_size", + "x-speakeasy-ignore": true, + "in": "query", + "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "default": 15 + }, + "deprecated": true + }, + { + "name": "after", + "in": "query", + "description": "Pagination cursor, will return transactions after given txid (in descending order).", + "schema": { + "type": "string", "example": 1234 } }, { - "name": "expand", + "name": "reference", "in": "query", + "description": "Find transactions by reference field.", "schema": { "type": "string", - "items": { - "type": "string" - } + "example": "ref:001" } }, { - "name": "pit", + "name": "account", "in": "query", - "required": false, + "description": "Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $).", + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "source", + "in": "query", + "description": "Filter transactions with postings involving given account at source (regular expression placed between ^ and $).", + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "destination", + "in": "query", + "description": "Filter transactions with postings involving given account at destination (regular expression placed between ^ and $).", + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "startTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "start_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + }, + "deprecated": true + }, + { + "name": "endTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", "schema": { "type": "string", "format": "date-time" + }, + "deprecated": true + }, + { + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "pagination_token", + "x-speakeasy-ignore": true, + "in": "query", + "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.\nDeprecated, please use `cursor` instead.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + }, + "deprecated": true + }, + { + "name": "metadata", + "in": "query", + "description": "Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "additionalProperties": true } } ], @@ -1393,7 +1297,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetTransactionResponse" + "$ref": "#/components/schemas/TransactionsCursorResponse" } } } @@ -1409,16 +1313,14 @@ } } } - } - }, - "/api/ledger/v2/{ledger}/transactions/{id}/metadata": { + }, "post": { "tags": [ "Ledger", "Transactions" ], - "summary": "Set the metadata of a transaction by its ID", - "operationId": "addMetadataOnTransaction", + "summary": "Create a new transaction to a ledger", + "operationId": "createTransaction", "parameters": [ { "name": "ledger", @@ -1431,49 +1333,46 @@ } }, { - "name": "id", - "in": "path", - "description": "Transaction ID.", - "required": true, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 0, - "example": 1234 - } - }, - { - "name": "dryRun", + "name": "preview", "in": "query", - "description": "Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "description": "Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker.", "schema": { "type": "boolean", "example": true } - }, - { - "name": "Idempotency-Key", - "in": "header", - "description": "Use an idempotency key", - "schema": { - "type": "string" - } } ], "requestBody": { - "description": "metadata", + "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", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ledgerMetadata" + "$ref": "#/components/schemas/PostTransaction" } } } }, "responses": { - "204": { - "description": "No Content", - "content": {} + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionsResponse" + } + } + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } }, "default": { "description": "Error", @@ -1488,15 +1387,14 @@ } } }, - "/api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}": { - "delete": { - "description": "Delete metadata by key", - "operationId": "deleteTransactionMetadata", - "summary": "Delete metadata by key", + "/api/ledger/{ledger}/transactions/{txid}": { + "get": { "tags": [ "Ledger", "Transactions" ], + "summary": "Get transaction from a ledger by its ID", + "operationId": "getTransaction", "parameters": [ { "name": "ledger", @@ -1509,37 +1407,103 @@ } }, { - "name": "id", + "name": "txid", "in": "path", "description": "Transaction ID.", "required": true, "schema": { "type": "integer", - "format": "int64", + "format": "bigint", "minimum": 0, "example": 1234 } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionResponse" + } + } + } }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/ledger/{ledger}/transactions/{txid}/metadata": { + "post": { + "tags": [ + "Ledger", + "Transactions" + ], + "summary": "Set the metadata of a transaction by its ID", + "operationId": "addMetadataOnTransaction", + "parameters": [ { - "name": "key", + "name": "ledger", "in": "path", + "description": "Name of the ledger.", "required": true, - "description": "The key to remove.", "schema": { "type": "string", - "example": "foo" + "example": "ledger001" + } + }, + { + "name": "txid", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 } } ], + "requestBody": { + "description": "metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Metadata1" + } + } + } + }, "responses": { - "2XX": { - "description": "Key deleted", + "204": { + "description": "No Content", "content": {} + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } }, - "/api/ledger/v2/{ledger}/transactions/{id}/revert": { + "/api/ledger/{ledger}/transactions/{txid}/revert": { "post": { "tags": [ "Ledger", @@ -1559,25 +1523,34 @@ } }, { - "name": "id", + "name": "txid", "in": "path", "description": "Transaction ID.", "required": true, "schema": { "type": "integer", - "format": "int64", + "format": "bigint", "minimum": 0, "example": 1234 } + }, + { + "name": "disableChecks", + "in": "query", + "description": "Allow to disable balances checks", + "required": false, + "schema": { + "type": "boolean" + } } ], "responses": { - "201": { + "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RevertTransactionResponse" + "$ref": "#/components/schemas/TransactionResponse" } } } @@ -1595,14 +1568,14 @@ } } }, - "/api/ledger/v2/{ledger}/aggregate/balances": { - "get": { + "/api/ledger/{ledger}/transactions/batch": { + "post": { "tags": [ "Ledger", - "Balances" + "Transactions" ], - "summary": "Get the aggregated balances from selected accounts", - "operationId": "getBalancesAggregated", + "summary": "Create a new batch of transactions to a ledger", + "operationId": "CreateTransactions", "parameters": [ { "name": "ledger", @@ -1613,26 +1586,17 @@ "type": "string", "example": "ledger001" } - }, - { - "name": "pit", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "date-time" - } } ], "requestBody": { "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": true + "$ref": "#/components/schemas/Transactions" } } - } + }, + "required": true }, "responses": { "200": { @@ -1640,7 +1604,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AggregateBalancesResponse" + "$ref": "#/components/schemas/TransactionsResponse" } } } @@ -1658,15 +1622,14 @@ } } }, - "/api/ledger/v2/{ledger}/logs": { + "/api/ledger/{ledger}/balances": { "get": { "tags": [ "Ledger", - "Logs" + "Balances" ], - "summary": "List the logs from a ledger", - "description": "List the logs from a ledger, sorted by ID in descending order.", - "operationId": "listLogs", + "summary": "Get the balances from a ledger's account", + "operationId": "getBalances", "parameters": [ { "name": "ledger", @@ -1679,15 +1642,21 @@ } }, { - "name": "pageSize", + "name": "address", "in": "query", - "description": "The maximum number of results to return per page.\n", - "example": 100, + "description": "Filter balances involving given account, either as source or destination.", "schema": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000 + "type": "string", + "example": "users:001" + } + }, + { + "name": "after", + "in": "query", + "description": "Pagination cursor, will return accounts after given address, in descending order.", + "schema": { + "type": "string", + "example": "users:003" } }, { @@ -1700,32 +1669,24 @@ } }, { - "name": "pit", + "name": "pagination_token", + "x-speakeasy-ignore": true, "in": "query", - "required": false, + "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.", "schema": { "type": "string", - "format": "date-time" - } + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + }, + "deprecated": true } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - } - } - } - }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LogsCursorResponse" + "$ref": "#/components/schemas/BalancesCursorResponse" } } } @@ -1743,677 +1704,1064 @@ } } }, - "/api/payments/_info": { - "get": { - "summary": "Get server info", - "operationId": "paymentsgetServerInfo", - "tags": [ - "Payments" - ], - "responses": { - "200": { - "$ref": "#/components/responses/ServerInfo" - } - } - } - }, - "/api/payments/payments": { + "/api/ledger/{ledger}/aggregate/balances": { "get": { - "summary": "List payments", - "operationId": "listPayments", "tags": [ - "Payments" + "Ledger", + "Balances" ], + "summary": "Get the aggregated balances from selected accounts", + "operationId": "getBalancesAggregated", "parameters": [ { - "$ref": "#/components/parameters/PageSize" - }, - { - "$ref": "#/components/parameters/Cursor" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } }, { - "$ref": "#/components/parameters/Sort" + "name": "address", + "in": "query", + "description": "Filter balances involving given account, either as source or destination.", + "schema": { + "type": "string", + "example": "users:001" + } } ], "responses": { "200": { - "$ref": "#/components/responses/Payments" - } - } - } - }, - "/api/payments/payments/{paymentId}": { - "get": { - "summary": "Get a payment", - "tags": [ - "Payments" - ], - "operationId": "getPayment", - "parameters": [ - { - "$ref": "#/components/parameters/PaymentId" - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/Payment" - } - } - } - }, - "/api/payments/payments/{paymentId}/metadata": { - "patch": { - "summary": "Update metadata", - "tags": [ - "Payments" - ], - "operationId": "updateMetadata", - "parameters": [ - { - "$ref": "#/components/parameters/PaymentId" - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/UpdateMetadata" - }, - "responses": { - "204": { - "$ref": "#/components/responses/NoContent" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AggregateBalancesResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } } }, - "/api/payments/transfer-initiations": { + "/api/ledger/{ledger}/logs": { "get": { - "summary": "List Transfer Initiations", - "operationId": "listTransferInitiations", "tags": [ - "Payments" + "Ledger", + "Logs" ], + "summary": "List the logs from a ledger", + "description": "List the logs from a ledger, sorted by ID in descending order.", + "operationId": "listLogs", "parameters": [ { - "$ref": "#/components/parameters/PageSize" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } }, { - "$ref": "#/components/parameters/Cursor" + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "default": 15 + } }, { - "$ref": "#/components/parameters/Sort" + "name": "page_size", + "x-speakeasy-ignore": true, + "in": "query", + "description": "The maximum number of results to return per page.\nDeprecated, please use `pageSize` instead.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "default": 15 + }, + "deprecated": true }, { - "$ref": "#/components/parameters/Query" + "name": "after", + "in": "query", + "description": "Pagination cursor, will return the logs after a given ID. (in descending order).", + "schema": { + "type": "string", + "example": 1234 + } + }, + { + "name": "startTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "start_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + }, + "deprecated": true + }, + { + "name": "endTime", + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_time", + "x-speakeasy-ignore": true, + "in": "query", + "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", + "schema": { + "type": "string", + "format": "date-time" + }, + "deprecated": true + }, + { + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "pagination_token", + "x-speakeasy-ignore": true, + "in": "query", + "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.\nDeprecated, please use `cursor` instead.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + }, + "deprecated": true } ], "responses": { "200": { - "$ref": "#/components/responses/TransferInitiations" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LogsCursorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } } } - }, - "post": { - "summary": "Create a TransferInitiation", + } + }, + "/api/ledger/v2/_info": { + "get": { "tags": [ - "Payments" + "Ledger" ], - "operationId": "createTransferInitiation", - "description": "Create a transfer initiation", - "requestBody": { - "$ref": "#/components/requestBodies/TransferInitiation" - }, + "summary": "Show server information", + "operationId": "v2GetInfo", "responses": { "200": { - "$ref": "#/components/responses/TransferInitiation" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ConfigInfoResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/transfer-initiations/{transferId}": { + "/api/ledger/v2": { "get": { - "summary": "Get a transfer initiation", - "tags": [ - "Payments" - ], - "operationId": "getTransferInitiation", + "summary": "List ledgers", + "operationId": "v2ListLedgers", "parameters": [ { - "$ref": "#/components/parameters/TransferId" + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } } ], - "responses": { - "200": { - "$ref": "#/components/responses/TransferInitiation" - } - } - }, - "delete": { - "summary": "Delete a transfer initiation", - "operationId": "deleteTransferInitiation", "tags": [ - "Payments" - ], - "description": "Delete a transfer initiation by its id.", - "parameters": [ - { - "$ref": "#/components/parameters/TransferId" - } + "Ledger" ], "responses": { - "204": { - "$ref": "#/components/responses/NoContent" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2LedgerListResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/transfer-initiations/{transferId}/status": { - "post": { - "summary": "Update the status of a transfer initiation", - "tags": [ - "Payments" - ], - "operationId": "udpateTransferInitiationStatus", - "description": "Update a transfer initiation status", - "parameters": [ - { - "$ref": "#/components/parameters/TransferId" + "/api/ledger/v2/{ledger}": { + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" } + } + ], + "get": { + "summary": "Get a ledger", + "operationId": "v2GetLedger", + "tags": [ + "Ledger" ], - "requestBody": { - "$ref": "#/components/requestBodies/UpdateTransferInitiationStatus" - }, "responses": { - "204": { - "$ref": "#/components/responses/NoContent" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2Ledger" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } - } - }, - "/api/payments/transfer-initiations/{transferId}/retry": { + }, "post": { - "summary": "Retry a failed transfer initiation", + "summary": "Create a ledger", + "operationId": "v2CreateLedger", "tags": [ - "Payments" + "Ledger" ], - "operationId": "retryTransferInitiation", - "description": "Retry a failed transfer initiation", - "parameters": [ - { - "$ref": "#/components/parameters/TransferId" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2CreateLedgerRequest" + } + } } - ], + }, "responses": { "204": { - "$ref": "#/components/responses/NoContent" + "description": "OK" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/accounts": { + "/api/ledger/v2/{ledger}/_info": { "get": { - "summary": "List accounts", - "operationId": "paymentslistAccounts", + "summary": "Get information about a ledger", + "operationId": "v2GetLedgerInfo", "tags": [ - "Payments" + "Ledger" ], "parameters": [ { - "$ref": "#/components/parameters/PageSize" - }, - { - "$ref": "#/components/parameters/Cursor" - }, - { - "$ref": "#/components/parameters/Sort" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } } ], "responses": { "200": { - "$ref": "#/components/responses/Accounts" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2LedgerInfoResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/accounts/{accountId}": { - "get": { - "summary": "Get an account", + "/api/ledger/v2/{ledger}/_bulk": { + "post": { + "x-speakeasy-errors": { + "override": true, + "statusCodes": [ + "5XX" + ] + }, + "summary": "Bulk request", + "operationId": "v2CreateBulk", "tags": [ - "Payments" + "Ledger" ], - "operationId": "paymentsgetAccount", "parameters": [ { - "$ref": "#/components/parameters/AccountId" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2Bulk" + } + } + } + }, "responses": { "200": { - "$ref": "#/components/responses/Account" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2BulkResponse" + } + } + } + }, + "400": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2BulkResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/accounts/{accountId}/balances": { - "get": { - "summary": "Get account balances", - "operationId": "getAccountBalances", + "/api/ledger/v2/{ledger}/accounts": { + "head": { + "summary": "Count the accounts from a ledger", + "operationId": "v2CountAccounts", "tags": [ - "Payments" + "Ledger" ], "parameters": [ { - "$ref": "#/components/parameters/AccountId" - }, - { - "name": "limit", - "in": "query", - "description": "The maximum number of results to return per page.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "asset", - "in": "query", - "description": "Filter balances by currency.\nIf not specified, all account's balances will be returned.\n", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "from", - "in": "query", - "description": "Filter balances by date.\nIf not specified, all account's balances will be returned.\n", - "required": false, + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, "schema": { "type": "string", - "format": "date-time" + "example": "ledger001" } }, { - "name": "to", + "name": "pit", "in": "query", - "description": "Filter balances by date.\nIf not specified, default will be set to now.\n", "required": false, "schema": { "type": "string", "format": "date-time" } - }, - { - "$ref": "#/components/parameters/PageSize" - }, - { - "$ref": "#/components/parameters/Cursor" - }, - { - "$ref": "#/components/parameters/Sort" } ], - "responses": { - "200": { - "$ref": "#/components/responses/AccountBalances" - } - } - } - }, - "/api/payments/bank-accounts": { - "post": { - "summary": "Create a BankAccount in Payments and on the PSP", - "tags": [ - "Payments" - ], - "operationId": "createBankAccount", - "description": "Create a bank account in Payments and on the PSP.", "requestBody": { - "$ref": "#/components/requestBodies/BankAccount" + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } }, "responses": { - "200": { - "$ref": "#/components/responses/BankAccount" - } - } - }, - "get": { - "summary": "List bank accounts created by user on Formance", - "operationId": "listBankAccounts", + "204": { + "description": "OK", + "headers": { + "Count": { + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0 + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + } + } + }, + "get": { + "summary": "List accounts from a ledger", + "description": "List accounts from a ledger, sorted by address in descending order.", + "operationId": "v2ListAccounts", "tags": [ - "Payments" + "Ledger" ], "parameters": [ { - "$ref": "#/components/parameters/PageSize" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } }, { - "$ref": "#/components/parameters/Cursor" + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } }, { - "$ref": "#/components/parameters/Sort" + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], - "description": "List all bank accounts created by user on Formance.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, "responses": { "200": { - "$ref": "#/components/responses/BankAccounts" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2AccountsCursorResponse" + } + } + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/bank-accounts/{bankAccountId}": { + "/api/ledger/v2/{ledger}/accounts/{address}": { "get": { - "summary": "Get a bank account created by user on Formance", + "summary": "Get account by its address", + "operationId": "v2GetAccount", "tags": [ - "Payments" + "Ledger" ], - "operationId": "getBankAccount", "parameters": [ { - "$ref": "#/components/parameters/BankAccountId" - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/BankAccount" - } - } - } - }, - "/api/payments/connectors": { - "get": { - "summary": "List all installed connectors", - "operationId": "listAllConnectors", - "tags": [ - "Payments" - ], - "description": "List all installed connectors.", - "responses": { - "200": { - "$ref": "#/components/responses/Connectors" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n", + "required": true, + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } - } - } - }, - "/api/payments/connectors/configs": { - "get": { - "summary": "List the configs of each available connector", - "operationId": "listConfigsAvailableConnectors", - "tags": [ - "Payments" ], - "description": "List the configs of each available connector.", "responses": { "200": { - "$ref": "#/components/responses/ConnectorsConfigs" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2AccountResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/connectors/{connector}": { + "/api/ledger/v2/{ledger}/accounts/{address}/metadata": { "post": { - "summary": "Install a connector", + "summary": "Add metadata to an account", + "operationId": "v2AddMetadataToAccount", "tags": [ - "Payments" + "Ledger" ], - "operationId": "installConnector", - "description": "Install a connector by its name and config.", "parameters": [ { - "$ref": "#/components/parameters/Connector" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Exact address of the account. It must match the following regular expressions pattern:\n```\n^\\w+(:\\w+)*$\n```\n", + "required": true, + "schema": { + "type": "string", + "example": "users:001" + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" + } } ], "requestBody": { - "$ref": "#/components/requestBodies/ConnectorConfig" + "description": "metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2Metadata" + } + } + }, + "required": true }, "responses": { "204": { - "$ref": "#/components/responses/NoContent" + "description": "No Content", + "content": {} + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + }, + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } - }, + } + }, + "/api/ledger/v2/{ledger}/accounts/{address}/metadata/{key}": { "delete": { - "summary": "Uninstall a connector", - "operationId": "uninstallConnector", + "description": "Delete metadata by key", + "operationId": "v2DeleteAccountMetadata", "tags": [ - "Payments" + "Ledger" ], - "description": "Uninstall a connector by its name.", + "summary": "Delete metadata by key", "parameters": [ { - "$ref": "#/components/parameters/Connector" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "address", + "in": "path", + "description": "Account address", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "key", + "in": "path", + "description": "The key to remove.", + "required": true, + "schema": { + "type": "string", + "example": "foo" + } } ], "responses": { - "204": { - "$ref": "#/components/responses/NoContent" + "2XX": { + "description": "Key deleted", + "content": {} } } } }, - "/api/payments/connectors/{connector}/config": { + "/api/ledger/v2/{ledger}/stats": { "get": { - "summary": "Read the config of a connector", - "operationId": "readConnectorConfig", "tags": [ - "Payments" + "Ledger" ], - "description": "Read connector config", + "operationId": "v2ReadStats", + "summary": "Get statistics from a ledger", + "description": "Get statistics from a ledger. (aggregate metrics on accounts and transactions)\n", "parameters": [ { - "$ref": "#/components/parameters/Connector" + "name": "ledger", + "in": "path", + "description": "name of the ledger", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } } ], "responses": { "200": { - "$ref": "#/components/responses/ConnectorConfig" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2StatsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } } }, - "/api/payments/connectors/{connector}/reset": { - "post": { - "summary": "Reset a connector", - "operationId": "resetConnector", + "/api/ledger/v2/{ledger}/transactions": { + "head": { "tags": [ - "Payments" + "Ledger" ], - "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n", + "summary": "Count the transactions from a ledger", + "operationId": "v2CountTransactions", "parameters": [ { - "$ref": "#/components/parameters/Connector" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, "responses": { "204": { - "$ref": "#/components/responses/NoContent" + "description": "OK", + "headers": { + "Count": { + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } } } - } - }, - "/api/payments/connectors/{connector}/tasks": { + }, "get": { - "summary": "List tasks from a connector", "tags": [ - "Payments" + "Ledger" ], - "operationId": "listConnectorTasks", - "description": "List all tasks associated with this connector.", + "summary": "List transactions from a ledger", + "description": "List transactions from a ledger, sorted by id in descending order.", + "operationId": "v2ListTransactions", "parameters": [ { - "$ref": "#/components/parameters/Connector" + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } }, { - "$ref": "#/components/parameters/PageSize" + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } }, { - "$ref": "#/components/parameters/Cursor" - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/Tasks" - } - } - } - }, - "/api/payments/connectors/{connector}/tasks/{taskId}": { - "get": { - "summary": "Read a specific task of the connector", - "tags": [ - "Payments" - ], - "operationId": "getConnectorTask", - "description": "Get a specific task associated to the connector.", - "parameters": [ + "name": "cursor", + "in": "query", + "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", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + }, { - "$ref": "#/components/parameters/Connector" + "name": "expand", + "in": "query", + "schema": { + "type": "string", + "items": { + "type": "string" + } + } }, { - "$ref": "#/components/parameters/TaskId" + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, "responses": { "200": { - "$ref": "#/components/responses/Task" - } - } - } - }, - "/api/payments/connectors/{connector}/transfers": { - "post": { - "summary": "Transfer funds between Connector accounts", - "tags": [ - "Payments" - ], - "operationId": "connectorsTransfer", - "description": "Execute a transfer between two accounts.", - "parameters": [ - { - "$ref": "#/components/parameters/Connector" - } - ], - "requestBody": { - "$ref": "#/components/requestBodies/Transfer" - }, - "responses": { - "200": { - "$ref": "#/components/responses/Transfer" - } - } - }, - "get": { - "summary": "List transfers and their statuses", - "tags": [ - "Payments" - ], - "operationId": "listConnectorsTransfers", - "description": "List transfers", - "parameters": [ - { - "$ref": "#/components/parameters/Connector" - } - ], - "responses": { - "200": { - "$ref": "#/components/responses/Transfers" - } - } - } - }, - "/api/search/_info": { - "get": { - "summary": "Get server info", - "operationId": "searchgetServerInfo", - "tags": [ - "Search" - ], - "responses": { - "200": { - "description": "Server information", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServerInfo" + "$ref": "#/components/schemas/V2TransactionsCursorResponse" } } } - } - } - } - }, - "/api/search/": { - "post": { - "summary": "Search", - "tags": [ - "Search" - ], - "operationId": "search", - "description": "ElasticSearch query engine", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Query" - } - } - } - }, - "responses": { - "200": { - "description": "Success", + }, + "400": { + "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Response" + "$ref": "#/components/schemas/V2ErrorResponse" } } } }, - "default": { + "404": { "description": "Error", - "content": {} - } - } - } - }, - "/api/webhooks/configs": { - "get": { - "summary": "Get many configs", - "description": "Sorted by updated date descending", - "operationId": "getManyConfigs", - "tags": [ - "Webhooks" - ], - "parameters": [ - { - "name": "id", - "in": "query", - "description": "Optional filter by Config ID", - "required": false, - "schema": { - "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" - } - }, - { - "name": "endpoint", - "in": "query", - "description": "Optional filter by endpoint URL", - "required": false, - "schema": { - "type": "string", - "example": "https://example.com" - } - } - ], - "responses": { - "200": { - "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigsResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2423,7 +2771,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2431,76 +2779,78 @@ } }, "post": { - "summary": "Insert a new config", - "description": "Insert a new webhooks config.\n\nThe endpoint should be a valid https URL and be unique.\n\nThe secret is the endpoint's verification secret.\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n\nAll eventTypes are converted to lower-case when inserted.\n", - "operationId": "insertConfig", "tags": [ - "Webhooks" + "Ledger" + ], + "summary": "Create a new transaction to a ledger", + "operationId": "v2CreateTransaction", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" + } + } ], "requestBody": { + "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", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigUser" + "$ref": "#/components/schemas/V2PostTransaction" } } - }, - "required": true + } }, "responses": { "200": { - "description": "Config created successfully.", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigResponse" + "$ref": "#/components/schemas/V2CreateTransactionResponse" } } } }, - "default": { + "400": { "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } - } - } - } - }, - "/api/webhooks/configs/{id}": { - "delete": { - "summary": "Delete one config", - "description": "Delete a webhooks config by ID.", - "operationId": "deleteConfig", - "tags": [ - "Webhooks" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Config ID", - "required": true, - "schema": { - "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" - } - } - ], - "responses": { - "200": { - "description": "Config successfully deleted." }, "default": { "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2508,23 +2858,53 @@ } } }, - "/api/webhooks/configs/{id}/test": { + "/api/ledger/v2/{ledger}/transactions/{id}": { "get": { - "summary": "Test one config", - "description": "Test a config by sending a webhook to its endpoint.", - "operationId": "testConfig", "tags": [ - "Webhooks" + "Ledger" ], + "summary": "Get transaction from a ledger by its ID", + "operationId": "v2GetTransaction", "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, { "name": "id", "in": "path", - "description": "Config ID", + "description": "Transaction ID.", "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "expand", + "in": "query", "schema": { "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + "items": { + "type": "string" + } + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" } } ], @@ -2534,7 +2914,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AttemptResponse" + "$ref": "#/components/schemas/V2GetTransactionResponse" + } + } + } + }, + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2544,7 +2934,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2552,33 +2942,85 @@ } } }, - "/api/webhooks/configs/{id}/activate": { - "put": { - "summary": "Activate one config", - "description": "Activate a webhooks config by ID, to start receiving webhooks to its endpoint.", - "operationId": "activateConfig", + "/api/ledger/v2/{ledger}/transactions/{id}/metadata": { + "post": { "tags": [ - "Webhooks" + "Ledger" ], + "summary": "Set the metadata of a transaction by its ID", + "operationId": "v2AddMetadataOnTransaction", "parameters": [ { - "name": "id", + "name": "ledger", "in": "path", - "description": "Config ID", + "description": "Name of the ledger.", "required": true, "schema": { "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "dryRun", + "in": "query", + "description": "Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker.", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "Idempotency-Key", + "in": "header", + "description": "Use an idempotency key", + "schema": { + "type": "string" } } ], + "requestBody": { + "description": "metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2Metadata" + } + } + } + }, "responses": { - "200": { - "description": "Config successfully activated.", + "204": { + "description": "No Content", + "content": {} + }, + "400": { + "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigResponse" + "$ref": "#/components/schemas/V2ErrorResponse" + } + } + } + }, + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2588,7 +3030,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2596,43 +3038,69 @@ } } }, - "/api/webhooks/configs/{id}/deactivate": { - "put": { - "summary": "Deactivate one config", - "description": "Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.", - "operationId": "deactivateConfig", + "/api/ledger/v2/{ledger}/transactions/{id}/metadata/{key}": { + "delete": { + "description": "Delete metadata by key", + "operationId": "v2DeleteTransactionMetadata", + "summary": "Delete metadata by key", "tags": [ - "Webhooks" + "Ledger" ], "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, { "name": "id", "in": "path", - "description": "Config ID", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "key", + "in": "path", "required": true, + "description": "The key to remove.", "schema": { "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + "example": "foo" } } ], "responses": { - "200": { - "description": "Config successfully deactivated.", + "400": { + "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } }, + "2XX": { + "description": "Key deleted", + "content": {} + }, "default": { "description": "Error", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2640,42 +3108,63 @@ } } }, - "/api/webhooks/configs/{id}/secret/change": { - "put": { - "summary": "Change the signing secret of a config", - "description": "Change the signing secret of the endpoint of a webhooks config.\n\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n", - "operationId": "changeConfigSecret", + "/api/ledger/v2/{ledger}/transactions/{id}/revert": { + "post": { "tags": [ - "Webhooks" + "Ledger" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfigChangeSecret" - } - } - } - }, + "operationId": "v2RevertTransaction", + "summary": "Revert a ledger transaction by its ID", "parameters": [ { - "name": "id", + "name": "ledger", "in": "path", - "description": "Config ID", + "description": "Name of the ledger.", "required": true, "schema": { "type": "string", - "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + "example": "ledger001" + } + }, + { + "name": "id", + "in": "path", + "description": "Transaction ID.", + "required": true, + "schema": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + } + }, + { + "name": "force", + "in": "query", + "description": "Force revert", + "required": false, + "schema": { + "type": "boolean" } } ], "responses": { - "200": { - "description": "Secret successfully changed.", + "201": { + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ConfigResponse" + "$ref": "#/components/schemas/V2RevertTransactionResponse" + } + } + } + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2685,7 +3174,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2693,20 +3182,51 @@ } } }, - "/api/wallets/_info": { + "/api/ledger/v2/{ledger}/aggregate/balances": { "get": { - "summary": "Get server info", - "operationId": "walletsgetServerInfo", "tags": [ - "Wallets" + "Ledger" + ], + "summary": "Get the aggregated balances from selected accounts", + "operationId": "v2GetBalancesAggregated", + "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, + { + "name": "pit", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, "responses": { "200": { - "description": "Server information", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServerInfo" + "$ref": "#/components/schemas/V2AggregateBalancesResponse" } } } @@ -2716,7 +3236,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2724,51 +3244,73 @@ } } }, - "/api/wallets/transactions": { + "/api/ledger/v2/{ledger}/logs": { "get": { - "operationId": "getTransactions", + "tags": [ + "Ledger" + ], + "summary": "List the logs from a ledger", + "description": "List the logs from a ledger, sorted by ID in descending order.", + "operationId": "v2ListLogs", "parameters": [ + { + "name": "ledger", + "in": "path", + "description": "Name of the ledger.", + "required": true, + "schema": { + "type": "string", + "example": "ledger001" + } + }, { "name": "pageSize", "in": "query", - "description": "The maximum number of results to return per page", + "description": "The maximum number of results to return per page.\n", "example": 100, "schema": { "type": "integer", - "maximum": 1000, + "format": "int64", "minimum": 1, - "default": 15 + "maximum": 1000 } }, { - "name": "walletID", + "name": "cursor", "in": "query", - "description": "A wallet ID to filter on", - "example": "wallet1", + "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", "schema": { - "type": "string" + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" } }, { - "name": "cursor", + "name": "pit", "in": "query", - "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.\nNo other parameters can be set when the cursor is set.\n", + "required": false, "schema": { "type": "string", - "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + "format": "date-time" } } ], - "tags": [ - "Wallets" - ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetTransactionsResponse" + "$ref": "#/components/schemas/V2LogsCursorResponse" } } } @@ -2778,7 +3320,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" + "$ref": "#/components/schemas/V2ErrorResponse" } } } @@ -2786,2097 +3328,8694 @@ } } }, - "/api/wallets/wallets": { + "/api/payments/_info": { "get": { - "summary": "List all wallets", - "operationId": "listWallets", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "Filter on wallet name", - "example": "wallet1", - "schema": { - "type": "string" - } - }, - { - "name": "metadata", - "in": "query", - "description": "Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below.", - "style": "deepObject", - "explode": true, - "schema": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "string" - } - }, - "example": { - "admin": "true" - } - }, - { - "name": "pageSize", - "in": "query", - "description": "The maximum number of results to return per page", - "example": 100, - "schema": { - "type": "integer", - "maximum": 1000, - "minimum": 1, - "default": 15 - } - }, - { - "name": "cursor", - "in": "query", - "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.\nNo other parameters can be set when the pagination token is set.\n", - "schema": { - "type": "string", - "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" - } - } - ], + "summary": "Get server info", + "operationId": "paymentsgetServerInfo", "tags": [ - "Wallets" + "Payments" ], "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListWalletsResponse" - } - } - } + "$ref": "#/components/responses/ServerInfo" } } - }, + } + }, + "/api/payments/payments": { "post": { - "summary": "Create a new wallet", - "operationId": "createWallet", + "summary": "Create a payment", "tags": [ - "Wallets" + "Payments" ], + "operationId": "createPayment", + "description": "Create a payment", "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWalletRequest" - } - } - } + "$ref": "#/components/requestBodies/Payment" }, "responses": { - "201": { - "description": "Wallet created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWalletResponse" - } - } - } + "200": { + "$ref": "#/components/responses/Payment" + } + } + }, + "get": { + "summary": "List payments", + "operationId": "listPayments", + "tags": [ + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Payments" } } } }, - "/api/wallets/wallets/{id}": { - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "/api/payments/payments/{paymentId}": { "get": { - "summary": "Get a wallet", - "operationId": "getWallet", + "summary": "Get a payment", "tags": [ - "Wallets" + "Payments" + ], + "operationId": "getPayment", + "parameters": [ + { + "$ref": "#/components/parameters/PaymentId" + } ], "responses": { "200": { - "description": "Wallet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWalletResponse" - } - } - } - }, - "404": { - "description": "Wallet not found" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/Payment" } } - }, + } + }, + "/api/payments/payments/{paymentId}/metadata": { "patch": { - "summary": "Update a wallet", - "operationId": "updateWallet", + "summary": "Update metadata", "tags": [ - "Wallets" + "Payments" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "metadata" - ], - "properties": { - "metadata": { - "type": "object", - "description": "Custom metadata to attach to this wallet.", - "additionalProperties": { - "type": "string" - } - } - } - } - } + "operationId": "updateMetadata", + "parameters": [ + { + "$ref": "#/components/parameters/PaymentId" } + ], + "requestBody": { + "$ref": "#/components/requestBodies/UpdateMetadata" }, "responses": { "204": { - "description": "Wallet successfully updated" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/wallets/{id}/summary": { - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "/api/payments/transfer-initiations": { "get": { - "summary": "Get wallet summary", - "operationId": "getWalletSummary", + "summary": "List Transfer Initiations", + "operationId": "listTransferInitiations", "tags": [ - "Wallets" + "Payments" ], - "responses": { - "200": { - "description": "Wallet summary", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWalletSummaryResponse" - } - } - } + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" }, - "404": { - "description": "Wallet not found" + { + "$ref": "#/components/parameters/Cursor" }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } - } - } - } - }, - "/api/wallets/wallets/{id}/balances": { - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + { + "$ref": "#/components/parameters/Sort" + }, + { + "$ref": "#/components/parameters/Query" } - } - ], - "get": { - "summary": "List balances of a wallet", - "operationId": "listBalances", - "tags": [ - "Wallets" ], "responses": { "200": { - "description": "Balances list", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBalancesResponse" - } - } - } + "$ref": "#/components/responses/TransferInitiations" } } }, "post": { - "summary": "Create a balance", - "operationId": "createBalance", + "summary": "Create a TransferInitiation", "tags": [ - "Wallets" + "Payments" ], + "operationId": "createTransferInitiation", + "description": "Create a transfer initiation", "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateBalanceRequest" - } - } - } + "$ref": "#/components/requestBodies/TransferInitiation" }, "responses": { - "201": { - "description": "Created balance", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateBalanceResponse" - } - } - } - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "200": { + "$ref": "#/components/responses/TransferInitiation" } } } }, - "/api/wallets/wallets/{id}/balances/{balanceName}": { + "/api/payments/transfer-initiations/{transferId}": { "get": { + "summary": "Get a transfer initiation", + "tags": [ + "Payments" + ], + "operationId": "getTransferInitiation", "parameters": [ { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "balanceName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/TransferId" } ], - "summary": "Get detailed balance", - "operationId": "getBalance", + "responses": { + "200": { + "$ref": "#/components/responses/TransferInitiation" + } + } + }, + "delete": { + "summary": "Delete a transfer initiation", + "operationId": "deleteTransferInitiation", "tags": [ - "Wallets" + "Payments" + ], + "description": "Delete a transfer initiation by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" + } ], "responses": { - "200": { - "description": "Balance summary", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetBalanceResponse" - } - } - } - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "204": { + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/wallets/{id}/debit": { - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "/api/payments/transfer-initiations/{transferId}/status": { "post": { - "summary": "Debit a wallet", - "operationId": "debitWallet", + "summary": "Update the status of a transfer initiation", "tags": [ - "Wallets" + "Payments" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DebitWalletRequest" - } - } + "operationId": "udpateTransferInitiationStatus", + "description": "Update a transfer initiation status", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" } + ], + "requestBody": { + "$ref": "#/components/requestBodies/UpdateTransferInitiationStatus" }, "responses": { - "201": { - "description": "Wallet successfully debited as a pending hold", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DebitWalletResponse" - } - } - } - }, "204": { - "description": "Wallet successfully debited" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/wallets/{id}/credit": { - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "/api/payments/transfer-initiations/{transferId}/retry": { "post": { - "summary": "Credit a wallet", - "operationId": "creditWallet", + "summary": "Retry a failed transfer initiation", "tags": [ - "Wallets" + "Payments" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreditWalletRequest" - } - } + "operationId": "retryTransferInitiation", + "description": "Retry a failed transfer initiation", + "parameters": [ + { + "$ref": "#/components/parameters/TransferId" } - }, + ], "responses": { "204": { - "description": "Wallet successfully credited" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/holds": { + "/api/payments/pools": { "get": { - "summary": "Get all holds for a wallet", + "summary": "List Pools", + "operationId": "listPools", "tags": [ - "Wallets" + "Payments" ], - "operationId": "getHolds", "parameters": [ { - "name": "pageSize", - "in": "query", - "description": "The maximum number of results to return per page", - "example": 100, - "schema": { - "type": "integer", - "maximum": 1000, - "minimum": 1, - "default": 15 - } + "$ref": "#/components/parameters/PageSize" }, { - "name": "walletID", - "in": "query", - "description": "The wallet to filter on", - "example": "wallet1", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/Cursor" }, { - "name": "metadata", - "in": "query", - "description": "Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below.", - "style": "deepObject", - "schema": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "string" - } - }, - "example": { - "admin": "true" - } + "$ref": "#/components/parameters/Sort" }, { - "name": "cursor", - "in": "query", - "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.\nNo other parameters can be set when the pagination token is set.\n", - "schema": { - "type": "string", - "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" - } + "$ref": "#/components/parameters/Query" } ], "responses": { "200": { - "description": "Holds", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetHoldsResponse" - } - } - } - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/Pools" + } + } + }, + "post": { + "summary": "Create a Pool", + "tags": [ + "Payments" + ], + "operationId": "createPool", + "description": "Create a Pool", + "requestBody": { + "$ref": "#/components/requestBodies/Pool" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Pool" } } } }, - "/api/wallets/holds/{holdID}": { + "/api/payments/pools/{poolId}": { "get": { - "summary": "Get a hold", + "summary": "Get a Pool", "tags": [ - "Wallets" + "Payments" ], - "operationId": "getHold", + "operationId": "getPool", "parameters": [ { - "name": "holdID", - "in": "path", - "schema": { - "type": "string" - }, - "required": true, - "description": "The hold ID" + "$ref": "#/components/parameters/PoolId" } ], "responses": { "200": { - "description": "Holds", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetHoldResponse" - } - } - } - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/Pool" + } + } + }, + "delete": { + "summary": "Delete a Pool", + "operationId": "deletePool", + "tags": [ + "Payments" + ], + "description": "Delete a pool by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/holds/{hold_id}/confirm": { + "/api/payments/pools/{poolId}/accounts": { "post": { + "summary": "Add an account to a pool", + "tags": [ + "Payments" + ], + "operationId": "addAccountToPool", + "description": "Add an account to a pool", "parameters": [ { - "name": "hold_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/PoolId" } ], "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmHoldRequest" - } - } - } + "$ref": "#/components/requestBodies/AddAccountToPool" }, - "summary": "Confirm a hold", - "tags": [ - "Wallets" - ], - "operationId": "confirmHold", "responses": { "204": { - "description": "Hold successfully confirmed, funds moved back to initial destination" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/NoContent" } } } }, - "/api/wallets/holds/{hold_id}/void": { - "parameters": [ - { - "name": "hold_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "post": { - "summary": "Cancel a hold", - "operationId": "voidHold", + "/api/payments/pools/{poolId}/accounts/{accountId}": { + "delete": { + "summary": "Remove an account from a pool", + "operationId": "removeAccountFromPool", "tags": [ - "Wallets" + "Payments" + ], + "description": "Remove an account from a pool by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + }, + { + "$ref": "#/components/parameters/AccountId" + } ], "responses": { "204": { - "description": "Hold successfully cancelled, funds returned to wallet" - }, - "default": { - "description": "Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/walletsErrorResponse" - } - } - } + "$ref": "#/components/responses/NoContent" } } } }, - "/api/orchestration/_info": { + "/api/payments/pools/{poolId}/balances": { "get": { - "summary": "Get server info", - "operationId": "orchestrationgetServerInfo", + "summary": "Get pool balances", + "operationId": "getPoolBalances", "tags": [ - "Orchestration" + "Payments" + ], + "parameters": [ + { + "$ref": "#/components/parameters/PoolId" + }, + { + "name": "at", + "in": "query", + "description": "Filter balances by date.\n", + "required": true, + "schema": { + "type": "string", + "format": "date-time" + } + } ], "responses": { "200": { - "description": "Server information", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServerInfo" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/PoolBalances" } } } }, - "/api/orchestration/workflows": { + "/api/payments/accounts": { "get": { - "summary": "List registered workflows", - "operationId": "listWorkflows", - "description": "List registered workflows", + "summary": "List accounts", + "operationId": "paymentslistAccounts", "tags": [ - "Orchestration" + "Payments" ], - "responses": { - "200": { - "description": "List of workflows", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListWorkflowsResponse" - } - } - } + "parameters": [ + { + "$ref": "#/components/parameters/PageSize" }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" } - } - }, - "post": { - "summary": "Create workflow", - "operationId": "createWorkflow", - "description": "Create a workflow", - "tags": [ - "Orchestration" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWorkflowRequest" - } - } - } - }, "responses": { - "201": { - "description": "Created workflow", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWorkflowResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "200": { + "$ref": "#/components/responses/Accounts" } } } }, - "/api/orchestration/workflows/{flowId}": { - "parameters": [ - { - "in": "path", - "description": "The flow id", - "name": "flowId", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true - } - ], + "/api/payments/accounts/{accountId}": { "get": { - "summary": "Get a flow by id", + "summary": "Get an account", "tags": [ - "Orchestration" + "Payments" ], - "description": "Get a flow by id", - "operationId": "getWorkflow", - "responses": { - "200": { - "description": "The workflow", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWorkflowResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "operationId": "paymentsgetAccount", + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" } - } - }, - "delete": { - "summary": "Delete a flow by id", - "tags": [ - "Orchestration" ], - "description": "Delete a flow by id", - "operationId": "deleteWorkflow", "responses": { - "204": { - "description": "No content" - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "200": { + "$ref": "#/components/responses/Account" } } } }, - "/api/orchestration/workflows/{workflowID}/instances": { - "parameters": [ - { - "in": "path", - "description": "The flow id", - "name": "workflowID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true - } - ], - "post": { - "description": "Run workflow", - "summary": "Run workflow", - "operationId": "runWorkflow", + "/api/payments/accounts/{accountId}/balances": { + "get": { + "summary": "Get account balances", + "operationId": "getAccountBalances", + "tags": [ + "Payments" + ], "parameters": [ { + "$ref": "#/components/parameters/AccountId" + }, + { + "name": "limit", "in": "query", - "name": "wait", + "description": "The maximum number of results to return per page.", "required": false, - "description": "Wait end of the workflow before return", "schema": { - "type": "boolean" + "type": "integer", + "format": "int64" + } + }, + { + "name": "asset", + "in": "query", + "description": "Filter balances by currency.\nIf not specified, all account's balances will be returned.\n", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "from", + "in": "query", + "description": "Filter balances by date.\nIf not specified, all account's balances will be returned.\n", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "description": "Filter balances by date.\nIf not specified, default will be set to now.\n", + "required": false, + "schema": { + "type": "string", + "format": "date-time" } + }, + { + "$ref": "#/components/parameters/PageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" } ], + "responses": { + "200": { + "$ref": "#/components/responses/AccountBalances" + } + } + } + }, + "/api/payments/bank-accounts": { + "post": { + "summary": "Create a BankAccount in Payments and on the PSP", "tags": [ - "Orchestration" + "Payments" ], + "operationId": "createBankAccount", + "description": "Create a bank account in Payments and on the PSP.", "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunWorkflowRequest" - } - } - } + "$ref": "#/components/requestBodies/BankAccount" }, "responses": { - "201": { - "description": "The workflow instance", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunWorkflowResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "200": { + "$ref": "#/components/responses/BankAccount" } } - } - }, - "/api/orchestration/instances": { + }, "get": { - "description": "List instances of a workflow", - "summary": "List instances of a workflow", - "operationId": "listInstances", + "summary": "List bank accounts created by user on Formance", + "operationId": "listBankAccounts", + "tags": [ + "Payments" + ], "parameters": [ { - "in": "query", - "description": "A workflow id", - "name": "workflowID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": false + "$ref": "#/components/parameters/PageSize" }, { - "in": "query", - "description": "Filter running instances", - "name": "running", - "schema": { - "type": "boolean" - }, - "example": true, - "required": false + "$ref": "#/components/parameters/Cursor" + }, + { + "$ref": "#/components/parameters/Sort" } ], - "tags": [ - "Orchestration" - ], + "description": "List all bank accounts created by user on Formance.", "responses": { "200": { - "description": "List of workflow instances", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListRunsResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/BankAccounts" } } } }, - "/api/orchestration/instances/{instanceID}": { - "parameters": [ - { - "in": "path", - "description": "The instance id", - "name": "instanceID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true - } - ], + "/api/payments/bank-accounts/{bankAccountId}": { "get": { - "summary": "Get a workflow instance by id", - "description": "Get a workflow instance by id", - "operationId": "getInstance", + "summary": "Get a bank account created by user on Formance", "tags": [ - "Orchestration" + "Payments" + ], + "operationId": "getBankAccount", + "parameters": [ + { + "$ref": "#/components/parameters/BankAccountId" + } ], "responses": { "200": { - "description": "The workflow instance", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWorkflowInstanceResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/BankAccount" } } } }, - "/api/orchestration/instances/{instanceID}/events": { - "parameters": [ - { - "in": "path", - "description": "The instance id", - "name": "instanceID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true + "/api/payments/connectors": { + "get": { + "summary": "List all installed connectors", + "operationId": "listAllConnectors", + "tags": [ + "Payments" + ], + "description": "List all installed connectors.", + "responses": { + "200": { + "$ref": "#/components/responses/Connectors" + } } - ], + } + }, + "/api/payments/connectors/configs": { + "get": { + "summary": "List the configs of each available connector", + "operationId": "listConfigsAvailableConnectors", + "tags": [ + "Payments" + ], + "description": "List the configs of each available connector.", + "responses": { + "200": { + "$ref": "#/components/responses/ConnectorsConfigs" + } + } + } + }, + "/api/payments/connectors/{connector}": { "post": { - "summary": "Send an event to a running workflow", - "description": "Send an event to a running workflow", - "operationId": "sendEvent", + "summary": "Install a connector", "tags": [ - "Orchestration" + "Payments" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - } + "operationId": "installConnector", + "description": "Install a connector by its name and config.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" } + ], + "requestBody": { + "$ref": "#/components/requestBodies/ConnectorConfig" }, + "responses": { + "201": { + "$ref": "#/components/responses/ConnectorInstalled" + } + } + }, + "delete": { + "summary": "Uninstall a connector", + "deprecated": true, + "operationId": "uninstallConnector", + "tags": [ + "Payments" + ], + "description": "Uninstall a connector by its name.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } + ], "responses": { "204": { - "description": "No content" - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/NoContent" } } } }, - "/api/orchestration/instances/{instanceID}/abort": { - "parameters": [ - { - "in": "path", - "description": "The instance id", - "name": "instanceID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true - } - ], - "put": { - "summary": "Cancel a running workflow", - "description": "Cancel a running workflow", - "operationId": "cancelEvent", + "/api/payments/connectors/{connector}/{connectorId}": { + "delete": { + "summary": "Uninstall a connector", + "operationId": "uninstallConnectorV1", "tags": [ - "Orchestration" + "Payments" + ], + "description": "Uninstall a connector by its name.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + } ], "responses": { "204": { - "description": "No content" - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/NoContent" } } } }, - "/api/orchestration/instances/{instanceID}/history": { - "parameters": [ - { - "in": "path", - "description": "The instance id", - "name": "instanceID", - "schema": { - "type": "string" - }, - "example": "xxx", - "required": true - } - ], + "/api/payments/connectors/{connector}/config": { "get": { - "summary": "Get a workflow instance history by id", - "description": "Get a workflow instance history by id", - "operationId": "getInstanceHistory", + "summary": "Read the config of a connector", + "deprecated": true, + "operationId": "readConnectorConfig", "tags": [ - "Orchestration" + "Payments" + ], + "description": "Read connector config", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + } ], "responses": { "200": { - "description": "The workflow instance history", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWorkflowInstanceHistoryResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/ConnectorConfig" } } } }, - "/api/orchestration/instances/{instanceID}/stages/{number}/history": { - "parameters": [ - { - "in": "path", - "description": "The instance id", - "name": "instanceID", - "schema": { - "type": "string" + "/api/payments/connectors/{connector}/{connectorId}/config": { + "post": { + "summary": "Update the config of a connector", + "operationId": "updateConnectorConfigV1", + "tags": [ + "Payments" + ], + "description": "Update connector config", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" }, - "example": "xxx", - "required": true + { + "$ref": "#/components/parameters/ConnectorID" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/ConnectorConfig" }, - { - "in": "path", - "description": "The stage number", - "name": "number", - "schema": { - "type": "integer" - }, - "example": 0, - "required": true + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } } - ], + }, "get": { - "summary": "Get a workflow instance stage history", - "description": "Get a workflow instance stage history", - "operationId": "getInstanceStageHistory", + "summary": "Read the config of a connector", + "operationId": "readConnectorConfigV1", "tags": [ - "Orchestration" + "Payments" + ], + "description": "Read connector config", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" + }, + { + "$ref": "#/components/parameters/ConnectorID" + } ], "responses": { "200": { - "description": "The workflow instance stage history", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetWorkflowInstanceHistoryStageResponse" - } - } - } - }, - "default": { - "$ref": "#/components/responses/ErrorResponse" + "$ref": "#/components/responses/ConnectorConfig" } } } - } - }, - "components": { - "schemas": { - "Version": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "health": { - "type": "boolean" + }, + "/api/payments/connectors/{connector}/reset": { + "post": { + "summary": "Reset a connector", + "deprecated": true, + "operationId": "resetConnector", + "tags": [ + "Payments" + ], + "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" } - }, - "required": [ - "name", - "version", - "health" - ] - }, - "GetVersionsResponse": { - "type": "object", - "properties": { - "region": { - "type": "string" - }, - "env": { - "type": "string" - }, - "versions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Version" - } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" } - }, - "required": [ - "region", - "env", - "versions" - ] - }, - "Metadata": { - "type": "object", - "additionalProperties": {} - }, - "ClientOptions": { - "type": "object", - "properties": { - "public": { - "type": "boolean" - }, - "redirectUris": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "name": { - "type": "string" + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/reset": { + "post": { + "summary": "Reset a connector", + "operationId": "resetConnectorV1", + "tags": [ + "Payments" + ], + "description": "Reset a connector by its name.\nIt will remove the connector and ALL PAYMENTS generated with it.\n", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" }, - "trusted": { - "type": "boolean" + { + "$ref": "#/components/parameters/ConnectorID" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + } + } + } + }, + "/api/payments/connectors/{connector}/tasks": { + "get": { + "summary": "List tasks from a connector", + "deprecated": true, + "tags": [ + "Payments" + ], + "operationId": "listConnectorTasks", + "description": "List all tasks associated with this connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" }, - "postLogoutRedirectUris": { - "type": "array", - "items": { - "type": "string" - } + { + "$ref": "#/components/parameters/PageSize" }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + { + "$ref": "#/components/parameters/Cursor" } - }, - "required": [ - "name" - ] - }, - "ClientSecret": { - "type": "object", - "properties": { - "lastDigits": { - "type": "string" - }, - "name": { - "type": "string" + ], + "responses": { + "200": { + "$ref": "#/components/responses/Tasks" + } + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/tasks": { + "get": { + "summary": "List tasks from a connector", + "tags": [ + "Payments" + ], + "operationId": "listConnectorTasksV1", + "description": "List all tasks associated with this connector.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" }, - "id": { - "type": "string" + { + "$ref": "#/components/parameters/ConnectorID" }, - "metadata": { - "$ref": "#/components/schemas/Metadata" - } - }, - "required": [ - "id", - "lastDigits", - "name" - ] - }, - "Client": { - "allOf": [ { - "$ref": "#/components/schemas/ClientOptions" + "$ref": "#/components/parameters/PageSize" }, { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "scopes": { - "type": "array", - "items": { - "type": "string" - } - }, - "secrets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ClientSecret" - } - } - }, - "required": [ - "id" - ] + "$ref": "#/components/parameters/Cursor" } - ] - }, - "ScopeOptions": { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + ], + "responses": { + "200": { + "$ref": "#/components/responses/Tasks" } - }, - "required": [ - "label" - ] - }, - "Scope": { - "allOf": [ + } + } + }, + "/api/payments/connectors/{connector}/tasks/{taskId}": { + "get": { + "summary": "Read a specific task of the connector", + "deprecated": true, + "tags": [ + "Payments" + ], + "operationId": "getConnectorTask", + "description": "Get a specific task associated to the connector.", + "parameters": [ { - "$ref": "#/components/schemas/ScopeOptions" + "$ref": "#/components/parameters/Connector" }, { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "transient": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "id" - ] + "$ref": "#/components/parameters/TaskId" } - ] - }, - "SecretOptions": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + ], + "responses": { + "200": { + "$ref": "#/components/responses/Task" } - }, - "required": [ - "name" - ] - }, - "Secret": { - "allOf": [ + } + } + }, + "/api/payments/connectors/{connector}/{connectorId}/tasks/{taskId}": { + "get": { + "summary": "Read a specific task of the connector", + "tags": [ + "Payments" + ], + "operationId": "getConnectorTaskV1", + "description": "Get a specific task associated to the connector.", + "parameters": [ { - "$ref": "#/components/schemas/SecretOptions" + "$ref": "#/components/parameters/Connector" }, { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "lastDigits": { - "type": "string" - }, - "clear": { - "type": "string" - } - }, - "required": [ - "id", - "lastDigits", - "clear" - ] - } - ] - }, - "User": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "3bb03708-312f-48a0-821a-e765837dc2c4" - }, - "subject": { - "type": "string", - "example": "Jane Doe" + "$ref": "#/components/parameters/ConnectorID" }, - "email": { - "type": "string", - "example": "user1@orga1.com" + { + "$ref": "#/components/parameters/TaskId" } - } - }, - "CreateClientRequest": { - "$ref": "#/components/schemas/ClientOptions" - }, - "CreateClientResponse": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Client" + ], + "responses": { + "200": { + "$ref": "#/components/responses/Task" } } - }, - "ListClientsResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Client" - } + } + }, + "/api/payments/connectors/{connector}/transfers": { + "post": { + "summary": "Transfer funds between Connector accounts", + "tags": [ + "Payments" + ], + "operationId": "connectorsTransfer", + "description": "Execute a transfer between two accounts.", + "parameters": [ + { + "$ref": "#/components/parameters/Connector" } - } - }, - "UpdateClientRequest": { - "$ref": "#/components/schemas/ClientOptions" - }, - "UpdateClientResponse": { - "$ref": "#/components/schemas/CreateClientResponse" - }, - "ReadClientResponse": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Client" + ], + "requestBody": { + "$ref": "#/components/requestBodies/Transfer" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Transfer" } } - }, - "ListScopesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Scope" + } + }, + "/api/search/_info": { + "get": { + "summary": "Get server info", + "operationId": "searchgetServerInfo", + "tags": [ + "Search" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } } } } - }, - "CreateScopeRequest": { - "$ref": "#/components/schemas/ScopeOptions" - }, - "CreateScopeResponse": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Scope" - } - } - }, - "ReadScopeResponse": { - "$ref": "#/components/schemas/CreateScopeResponse" - }, - "UpdateScopeRequest": { - "$ref": "#/components/schemas/ScopeOptions" - }, - "UpdateScopeResponse": { - "$ref": "#/components/schemas/CreateScopeResponse" - }, - "CreateSecretRequest": { - "$ref": "#/components/schemas/SecretOptions" - }, - "CreateSecretResponse": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/Secret" + } + }, + "/api/search/": { + "post": { + "summary": "Search", + "tags": [ + "Search" + ], + "operationId": "search", + "description": "ElasticSearch query engine", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Query" + } + } } - } - }, - "ReadUserResponse": { - "type": "object", - "properties": { - "data": { - "$ref": "#/components/schemas/User" + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Response" + } + } + } + }, + "default": { + "description": "Error", + "content": {} } } - }, - "ListUsersResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" + } + }, + "/api/webhooks/configs": { + "get": { + "summary": "Get many configs", + "description": "Sorted by updated date descending", + "operationId": "getManyConfigs", + "tags": [ + "Webhooks" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "Optional filter by Config ID", + "required": false, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + }, + { + "name": "endpoint", + "in": "query", + "description": "Optional filter by endpoint URL", + "required": false, + "schema": { + "type": "string", + "example": "https://example.com" } } - } - }, - "ServerInfo": { - "type": "object", - "required": [ - "version" ], - "properties": { - "version": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } } } }, - "AccountsCursorResponse": { - "type": "object", - "required": [ - "cursor" + "post": { + "summary": "Insert a new config", + "description": "Insert a new webhooks config.\n\nThe endpoint should be a valid https URL and be unique.\n\nThe secret is the endpoint's verification secret.\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n\nAll eventTypes are converted to lower-case when inserted.\n", + "operationId": "insertConfig", + "tags": [ + "Webhooks" ], - "properties": { - "cursor": { - "type": "object", - "required": [ - "pageSize", - "hasMore", - "data" - ], - "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 - }, - "hasMore": { - "type": "boolean", - "example": false - }, - "previous": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "next": { - "type": "string", - "example": "" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Account" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigUser" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Config created successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" } } } - } - } - }, - "BalancesCursorResponse": { - "type": "object", - "required": [ - "cursor" - ], - "properties": { - "cursor": { - "type": "object", - "required": [ - "pageSize", - "hasMore", - "data" - ], - "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 - }, - "hasMore": { - "type": "boolean", - "example": false - }, - "previous": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "next": { - "type": "string", - "example": "" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountsBalances" + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" } } } - } - } - }, - "TransactionsCursorResponse": { - "type": "object", - "required": [ - "cursor" - ], - "properties": { - "cursor": { - "type": "object", - "required": [ - "pageSize", - "hasMore", - "data" - ], - "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 - }, - "hasMore": { - "type": "boolean", - "example": false - }, - "previous": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "next": { - "type": "string", - "example": "" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExpandedTransaction" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" } } } } } - }, - "LogsCursorResponse": { - "type": "object", - "required": [ - "cursor" + } + }, + "/api/webhooks/configs/{id}": { + "delete": { + "summary": "Delete one config", + "description": "Delete a webhooks config by ID.", + "operationId": "deleteConfig", + "tags": [ + "Webhooks" ], - "properties": { - "cursor": { - "type": "object", - "required": [ - "pageSize", - "hasMore", - "data" - ], - "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 - }, - "hasMore": { - "type": "boolean", - "example": false - }, - "previous": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "next": { - "type": "string", - "example": "" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Log" + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully deleted." + }, + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + }, + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" } } } } } - }, - "AccountResponse": { - "type": "object", - "required": [ - "data" + } + }, + "/api/webhooks/configs/{id}/test": { + "get": { + "summary": "Test one config", + "description": "Test a config by sending a webhook to its endpoint.", + "operationId": "testConfig", + "tags": [ + "Webhooks" ], - "properties": { - "data": { - "$ref": "#/components/schemas/AccountWithVolumesAndBalances" + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } } - } - }, - "AggregateBalancesResponse": { - "type": "object", - "required": [ - "data" ], - "properties": { - "data": { - "$ref": "#/components/schemas/AssetsBalances" - } - } - }, - "Config": { - "type": "object", - "properties": { - "storage": { - "$ref": "#/components/schemas/LedgerStorage" - } - }, - "required": [ - "storage" - ] - }, - "LedgerStorage": { - "type": "object", - "properties": { - "driver": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttemptResponse" + } + } + } }, - "ledgers": { - "type": "array", - "items": { - "type": "string" + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } } - } - }, - "required": [ - "driver", - "ledgers" - ] - }, - "ledgerMetadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "example": { - "admin": "true" - } - }, - "ConfigInfo": { - "type": "object", - "properties": { - "config": { - "$ref": "#/components/schemas/Config" }, - "server": { - "type": "string" + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } }, - "version": { - "type": "string" + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } } - }, - "required": [ - "config", - "server", - "version" - ] - }, - "Account": { - "type": "object", - "required": [ - "address", - "metadata" + } + } + }, + "/api/webhooks/configs/{id}/activate": { + "put": { + "summary": "Activate one config", + "description": "Activate a webhooks config by ID, to start receiving webhooks to its endpoint.", + "operationId": "activateConfig", + "tags": [ + "Webhooks" ], - "properties": { - "address": { - "type": "string", - "example": "users:001" + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully activated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } + } }, - "metadata": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "string" - }, - "example": { - "admin": "true" + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } } } } - }, - "AccountWithVolumesAndBalances": { - "type": "object", - "required": [ - "address", - "metadata" + } + }, + "/api/webhooks/configs/{id}/deactivate": { + "put": { + "summary": "Deactivate one config", + "description": "Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.", + "operationId": "deactivateConfig", + "tags": [ + "Webhooks" ], - "properties": { - "address": { - "type": "string", - "example": "users:001" - }, - "type": { - "type": "string", - "example": "virtual" - }, - "metadata": { - "type": "object", - "properties": {}, - "additionalProperties": { - "type": "string" - }, - "example": { - "admin": "true" + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } + } + ], + "responses": { + "200": { + "description": "Config successfully deactivated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } } }, - "volumes": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint", - "minimum": 0 + "404": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } } - }, - "example": { - "COIN": { - "input": 100, - "output": 0 + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } } } } } - }, - "AccountsBalances": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/AssetsBalances" - }, - "example": { - "account1": { - "USD": 100, - "EUR": 23 - }, - "account2": { - "CAD": 20, - "JPY": 21 + } + }, + "/api/webhooks/configs/{id}/secret/change": { + "put": { + "summary": "Change the signing secret of a config", + "description": "Change the signing secret of the endpoint of a webhooks config.\n\nIf not passed or empty, a secret is automatically generated.\nThe format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)\n", + "operationId": "changeConfigSecret", + "tags": [ + "Webhooks" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigChangeSecret" + } + } } - } - }, - "AssetsBalances": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" }, - "example": { - "USD": 100, - "EUR": 12 - } - }, - "Posting": { - "type": "object", - "properties": { - "amount": { - "type": "integer", - "format": "bigint", - "minimum": 0, - "example": 100 - }, - "asset": { - "type": "string", - "example": "COIN" - }, - "destination": { - "type": "string", - "example": "users:002" - }, - "source": { - "type": "string", - "example": "users:001" + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Config ID", + "required": true, + "schema": { + "type": "string", + "example": "4997257d-dfb6-445b-929c-cbe2ab182818" + } } - }, - "required": [ - "amount", - "asset", - "destination", - "source" - ] - }, - "Script": { - "type": "object", - "properties": { - "plain": { - "type": "string", - "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" - }, - "vars": { - "type": "object", - "properties": {}, - "additionalProperties": true, - "example": { - "user": "users:042" + ], + "responses": { + "200": { + "description": "Secret successfully changed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigResponse" + } + } } }, - "reference": { - "type": "string", - "example": "order_1234", - "description": "Reference to attach to the generated transaction" + "400": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } }, - "metadata": { - "$ref": "#/components/schemas/ledgerMetadata" + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhooksErrorResponse" + } + } + } } - }, - "required": [ - "plain" - ] - }, - "Transaction": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "date-time" - }, - "postings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Posting" + } + } + }, + "/api/wallets/_info": { + "get": { + "summary": "Get server info", + "operationId": "walletsgetServerInfo", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } } }, - "reference": { - "type": "string", - "example": "ref:001" - }, - "metadata": { - "$ref": "#/components/schemas/ledgerMetadata" - }, - "id": { - "type": "integer", - "format": "int64", - "minimum": 0 - }, - "reverted": { - "type": "boolean" + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } } - }, - "required": [ - "postings", - "timestamp", - "id", - "metadata", - "reverted" - ] - }, - "ExpandedTransaction": { - "allOf": [ + } + } + }, + "/api/wallets/transactions": { + "get": { + "operationId": "getTransactions", + "parameters": [ { - "$ref": "#/components/schemas/Transaction" + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } }, { - "type": "object", - "properties": { - "preCommitVolumes": { - "$ref": "#/components/schemas/AggregatedVolumes" - }, - "postCommitVolumes": { - "$ref": "#/components/schemas/AggregatedVolumes" - } + "name": "walletID", + "in": "query", + "description": "A wallet ID to filter on", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "cursor", + "in": "query", + "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.\nNo other parameters can be set when the cursor is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" } } - ] - }, - "PostTransaction": { - "type": "object", - "required": [ - "metadata" ], - "properties": { - "timestamp": { - "type": "string", - "format": "date-time" - }, - "postings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Posting" + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTransactionsResponse" + } + } } }, - "script": { - "type": "object", - "properties": { - "plain": { - "type": "string", - "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" - }, - "vars": { - "type": "object", - "properties": {}, - "additionalProperties": true, - "example": { - "user": "users:042" + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" } } - }, - "required": [ - "plain" - ] - }, - "reference": { - "type": "string", - "example": "ref:001" - }, - "metadata": { - "$ref": "#/components/schemas/ledgerMetadata" + } } } - }, - "Stats": { - "type": "object", - "properties": { - "accounts": { - "type": "integer", - "format": "int64", - "minimum": 0 - }, - "transactions": { - "type": "integer", - "format": "int64", - "minimum": 0 - } + } + }, + "/api/wallets/wallets": { + "get": { + "summary": "List all wallets", + "operationId": "listWallets", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "Filter on wallet name", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "metadata", + "in": "query", + "description": "Filter wallets by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + } + }, + "example": { + "admin": "true" + } + }, + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } + }, + { + "name": "cursor", + "in": "query", + "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.\nNo other parameters can be set when the pagination token is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWalletsResponse" + } + } + } + }, + "default": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create a new wallet", + "operationId": "createWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWalletRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Wallet created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWalletResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get a wallet", + "operationId": "getWallet", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Wallet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWalletResponse" + } + } + } + }, + "404": { + "description": "Wallet not found" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + }, + "patch": { + "summary": "Update a wallet", + "operationId": "updateWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "description": "Custom metadata to attach to this wallet.", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + }, + "responses": { + "204": { + "description": "Wallet successfully updated" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/summary": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "Get wallet summary", + "operationId": "getWalletSummary", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Wallet summary", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWalletSummaryResponse" + } + } + } + }, + "404": { + "description": "Wallet not found" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/balances": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "summary": "List balances of a wallet", + "operationId": "listBalances", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Balances list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBalancesResponse" + } + } + } + } + } + }, + "post": { + "summary": "Create a balance", + "operationId": "createBalance", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBalanceRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created balance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateBalanceResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/balances/{balanceName}": { + "get": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "balanceName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "summary": "Get detailed balance", + "operationId": "getBalance", + "tags": [ + "Wallets" + ], + "responses": { + "200": { + "description": "Balance summary", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBalanceResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/debit": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Debit a wallet", + "operationId": "debitWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebitWalletRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Wallet successfully debited as a pending hold", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DebitWalletResponse" + } + } + } + }, + "204": { + "description": "Wallet successfully debited" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/wallets/{id}/credit": { + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Credit a wallet", + "operationId": "creditWallet", + "tags": [ + "Wallets" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreditWalletRequest" + } + } + } + }, + "responses": { + "204": { + "description": "Wallet successfully credited" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds": { + "get": { + "summary": "Get all holds for a wallet", + "tags": [ + "Wallets" + ], + "operationId": "getHolds", + "parameters": [ + { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page", + "example": 100, + "schema": { + "type": "integer", + "maximum": 1000, + "minimum": 1, + "default": 15 + } + }, + { + "name": "walletID", + "in": "query", + "description": "The wallet to filter on", + "example": "wallet1", + "schema": { + "type": "string" + } + }, + { + "name": "metadata", + "in": "query", + "description": "Filter holds by metadata key value pairs. Nested objects can be used as seen in the example below.", + "style": "deepObject", + "schema": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + } + }, + "example": { + "admin": "true" + } + }, + { + "name": "cursor", + "in": "query", + "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.\nNo other parameters can be set when the pagination token is set.\n", + "schema": { + "type": "string", + "example": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==" + } + } + ], + "responses": { + "200": { + "description": "Holds", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetHoldsResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{holdID}": { + "get": { + "summary": "Get a hold", + "tags": [ + "Wallets" + ], + "operationId": "getHold", + "parameters": [ + { + "name": "holdID", + "in": "path", + "schema": { + "type": "string" + }, + "required": true, + "description": "The hold ID" + } + ], + "responses": { + "200": { + "description": "Holds", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetHoldResponse" + } + } + } + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{hold_id}/confirm": { + "post": { + "parameters": [ + { + "name": "hold_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfirmHoldRequest" + } + } + } + }, + "summary": "Confirm a hold", + "tags": [ + "Wallets" + ], + "operationId": "confirmHold", + "responses": { + "204": { + "description": "Hold successfully confirmed, funds moved back to initial destination" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/wallets/holds/{hold_id}/void": { + "parameters": [ + { + "name": "hold_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "summary": "Cancel a hold", + "operationId": "voidHold", + "tags": [ + "Wallets" + ], + "responses": { + "204": { + "description": "Hold successfully cancelled, funds returned to wallet" + }, + "default": { + "description": "Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/walletsErrorResponse" + } + } + } + } + } + } + }, + "/api/orchestration/_info": { + "get": { + "summary": "Get server info", + "operationId": "orchestrationgetServerInfo", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServerInfo" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers": { + "get": { + "summary": "List triggers", + "operationId": "listTriggers", + "description": "List triggers", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTriggersResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "post": { + "summary": "Create trigger", + "operationId": "createTrigger", + "description": "Create trigger", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerData" + } + } + } + }, + "responses": { + "201": { + "description": "Created trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers/{triggerID}": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "Read trigger", + "operationId": "readTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "A specific trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReadTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete trigger", + "operationId": "deleteTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "Trigger deleted" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/triggers/{triggerID}/occurrences": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "List triggers occurrences", + "operationId": "listTriggersOccurrences", + "description": "List triggers occurrences", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers occurrences", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListTriggersOccurrencesResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows": { + "get": { + "summary": "List registered workflows", + "operationId": "listWorkflows", + "description": "List registered workflows", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflows", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWorkflowsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "post": { + "summary": "Create workflow", + "operationId": "createWorkflow", + "description": "Create a workflow", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows/{flowId}": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "flowId", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Get a flow by id", + "operationId": "getWorkflow", + "responses": { + "200": { + "description": "The workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Delete a flow by id", + "operationId": "deleteWorkflow", + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/workflows/{workflowID}/instances": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "description": "Run workflow", + "summary": "Run workflow", + "operationId": "runWorkflow", + "parameters": [ + { + "in": "query", + "name": "wait", + "required": false, + "description": "Wait end of the workflow before return", + "schema": { + "type": "boolean" + } + } + ], + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances": { + "get": { + "description": "List instances of a workflow", + "summary": "List instances of a workflow", + "operationId": "listInstances", + "parameters": [ + { + "in": "query", + "description": "A workflow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": false + }, + { + "in": "query", + "description": "Filter running instances", + "name": "running", + "schema": { + "type": "boolean" + }, + "example": true, + "required": false + } + ], + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflow instances", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRunsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance by id", + "description": "Get a workflow instance by id", + "operationId": "getInstance", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/events": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "summary": "Send an event to a running workflow", + "description": "Send an event to a running workflow", + "operationId": "sendEvent", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/abort": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "put": { + "summary": "Cancel a running workflow", + "description": "Cancel a running workflow", + "operationId": "cancelEvent", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance history by id", + "description": "Get a workflow instance history by id", + "operationId": "getInstanceHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceHistoryResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/instances/{instanceID}/stages/{number}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + }, + { + "in": "path", + "description": "The stage number", + "name": "number", + "schema": { + "type": "integer" + }, + "example": 0, + "required": true + } + ], + "get": { + "summary": "Get a workflow instance stage history", + "description": "Get a workflow instance stage history", + "operationId": "getInstanceStageHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance stage history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkflowInstanceHistoryStageResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/_info": { + "get": { + "summary": "Get server info", + "operationId": "v2GetServerInfo", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "Server information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ServerInfo" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/triggers": { + "get": { + "summary": "List triggers", + "operationId": "v2ListTriggers", + "description": "List triggers", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ListTriggersResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + }, + "post": { + "summary": "Create trigger", + "operationId": "v2CreateTrigger", + "description": "Create trigger", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2TriggerData" + } + } + } + }, + "responses": { + "201": { + "description": "Created trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2CreateTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/triggers/{triggerID}": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "Read trigger", + "operationId": "v2ReadTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "A specific trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ReadTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete trigger", + "operationId": "v2DeleteTrigger", + "description": "Read trigger", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "Trigger deleted" + }, + "404": { + "$ref": "#/components/responses/V2ErrorResponse" + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/triggers/{triggerID}/test": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "post": { + "summary": "Test trigger", + "operationId": "testTrigger", + "description": "Test trigger", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "responses": { + "200": { + "description": "Test a trigger", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2TestTriggerResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/triggers/{triggerID}/occurrences": { + "parameters": [ + { + "name": "triggerID", + "description": "The trigger id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "get": { + "summary": "List triggers occurrences", + "operationId": "v2ListTriggersOccurrences", + "description": "List triggers occurrences", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of triggers occurrences", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ListTriggersOccurrencesResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/workflows": { + "get": { + "summary": "List registered workflows", + "operationId": "v2ListWorkflows", + "description": "List registered workflows", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflows", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ListWorkflowsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + }, + "post": { + "summary": "Create workflow", + "operationId": "v2CreateWorkflow", + "description": "Create a workflow", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2CreateWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "Created workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2CreateWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/workflows/{flowId}": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "flowId", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Get a flow by id", + "operationId": "v2GetWorkflow", + "responses": { + "200": { + "description": "The workflow", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2GetWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + }, + "delete": { + "summary": "Delete a flow by id", + "tags": [ + "Orchestration" + ], + "description": "Delete a flow by id", + "operationId": "v2DeleteWorkflow", + "responses": { + "204": { + "description": "No content" + }, + "400": { + "$ref": "#/components/responses/V2ErrorResponse" + }, + "404": { + "$ref": "#/components/responses/V2ErrorResponse" + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/workflows/{workflowID}/instances": { + "parameters": [ + { + "in": "path", + "description": "The flow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "description": "Run workflow", + "summary": "Run workflow", + "operationId": "v2RunWorkflow", + "parameters": [ + { + "in": "query", + "name": "wait", + "required": false, + "description": "Wait end of the workflow before return", + "schema": { + "type": "boolean" + } + } + ], + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2RunWorkflowRequest" + } + } + } + }, + "responses": { + "201": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2RunWorkflowResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances": { + "get": { + "description": "List instances of a workflow", + "summary": "List instances of a workflow", + "operationId": "v2ListInstances", + "parameters": [ + { + "in": "query", + "description": "A workflow id", + "name": "workflowID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": false + }, + { + "in": "query", + "description": "Filter running instances", + "name": "running", + "schema": { + "type": "boolean" + }, + "example": true, + "required": false + } + ], + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "List of workflow instances", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2ListRunsResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances/{instanceID}": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance by id", + "description": "Get a workflow instance by id", + "operationId": "v2GetInstance", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2GetWorkflowInstanceResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances/{instanceID}/events": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "post": { + "summary": "Send an event to a running workflow", + "description": "Send an event to a running workflow", + "operationId": "v2SendEvent", + "tags": [ + "Orchestration" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances/{instanceID}/abort": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "put": { + "summary": "Cancel a running workflow", + "description": "Cancel a running workflow", + "operationId": "v2CancelEvent", + "tags": [ + "Orchestration" + ], + "responses": { + "204": { + "description": "No content" + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances/{instanceID}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + } + ], + "get": { + "summary": "Get a workflow instance history by id", + "description": "Get a workflow instance history by id", + "operationId": "v2GetInstanceHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2GetWorkflowInstanceHistoryResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/orchestration/v2/instances/{instanceID}/stages/{number}/history": { + "parameters": [ + { + "in": "path", + "description": "The instance id", + "name": "instanceID", + "schema": { + "type": "string" + }, + "example": "xxx", + "required": true + }, + { + "in": "path", + "description": "The stage number", + "name": "number", + "schema": { + "type": "integer" + }, + "example": 0, + "required": true + } + ], + "get": { + "summary": "Get a workflow instance stage history", + "description": "Get a workflow instance stage history", + "operationId": "v2GetInstanceStageHistory", + "tags": [ + "Orchestration" + ], + "responses": { + "200": { + "description": "The workflow instance stage history", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2GetWorkflowInstanceHistoryStageResponse" + } + } + } + }, + "default": { + "$ref": "#/components/responses/V2ErrorResponse" + } + } + } + }, + "/api/reconciliation/_info": { + "get": { + "summary": "Get server info", + "operationId": "reconciliationgetServerInfo", + "tags": [ + "Reconciliation" + ], + "responses": { + "200": { + "$ref": "#/components/responses/ServerInfo" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies": { + "post": { + "summary": "Create a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "createPolicy", + "description": "Create a policy", + "requestBody": { + "$ref": "#/components/requestBodies/Policy" + }, + "responses": { + "201": { + "$ref": "#/components/responses/Policy" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + }, + "get": { + "summary": "List policies", + "operationId": "listPolicies", + "tags": [ + "Reconciliation" + ], + "parameters": [ + { + "$ref": "#/components/parameters/reconciliationPageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Policies" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies/{policyID}": { + "delete": { + "summary": "Delete a policy", + "operationId": "deletePolicy", + "tags": [ + "Reconciliation" + ], + "description": "Delete a policy by its id.", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/NoContent" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + }, + "get": { + "summary": "Get a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "getPolicy", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Policy" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/policies/{policyID}/reconciliation": { + "post": { + "summary": "Reconcile using a policy", + "tags": [ + "Reconciliation" + ], + "operationId": "reconcile", + "description": "Reconcile using a policy", + "parameters": [ + { + "$ref": "#/components/parameters/PolicyID" + } + ], + "requestBody": { + "$ref": "#/components/requestBodies/Reconciliation" + }, + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliation" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/reconciliations": { + "get": { + "summary": "List reconciliations", + "operationId": "listReconciliations", + "tags": [ + "Reconciliation" + ], + "parameters": [ + { + "$ref": "#/components/parameters/reconciliationPageSize" + }, + { + "$ref": "#/components/parameters/Cursor" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliations" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "/api/reconciliation/reconciliations/{reconciliationID}": { + "get": { + "summary": "Get a reconciliation", + "tags": [ + "Reconciliation" + ], + "operationId": "getReconciliation", + "parameters": [ + { + "$ref": "#/components/parameters/ReconciliationID" + } + ], + "responses": { + "200": { + "$ref": "#/components/responses/Reconciliation" + }, + "default": { + "$ref": "#/components/responses/reconciliationErrorResponse" + } + } + } + }, + "x-speakeasy-errors": { + "statusCodes": [ + "4XX", + "5XX" + ] + } + }, + "components": { + "schemas": { + "Version": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "health": { + "type": "boolean" + } + }, + "required": [ + "name", + "version", + "health" + ] + }, + "GetVersionsResponse": { + "type": "object", + "properties": { + "region": { + "type": "string" + }, + "env": { + "type": "string" + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Version" + } + } + }, + "required": [ + "region", + "env", + "versions" + ] + }, + "Metadata": { + "type": "object", + "additionalProperties": {} + }, + "ClientOptions": { + "type": "object", + "properties": { + "public": { + "type": "boolean" + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "trusted": { + "type": "boolean" + }, + "postLogoutRedirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name" + ] + }, + "ClientSecret": { + "type": "object", + "properties": { + "lastDigits": { + "type": "string" + }, + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "id", + "lastDigits", + "name" + ] + }, + "Client": { + "allOf": [ + { + "$ref": "#/components/schemas/ClientOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "secrets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ClientSecret" + } + } + }, + "required": [ + "id" + ] + } + ] + }, + "ScopeOptions": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "label" + ] + }, + "Scope": { + "allOf": [ + { + "$ref": "#/components/schemas/ScopeOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "transient": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + } + ] + }, + "SecretOptions": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + } + }, + "required": [ + "name" + ] + }, + "Secret": { + "allOf": [ + { + "$ref": "#/components/schemas/SecretOptions" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "lastDigits": { + "type": "string" + }, + "clear": { + "type": "string" + } + }, + "required": [ + "id", + "lastDigits", + "clear" + ] + } + ] + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "3bb03708-312f-48a0-821a-e765837dc2c4" + }, + "subject": { + "type": "string", + "example": "Jane Doe" + }, + "email": { + "type": "string", + "example": "user1@orga1.com" + } + } + }, + "CreateClientRequest": { + "$ref": "#/components/schemas/ClientOptions" + }, + "CreateClientResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Client" + } + } + }, + "ListClientsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Client" + } + } + } + }, + "UpdateClientRequest": { + "$ref": "#/components/schemas/ClientOptions" + }, + "UpdateClientResponse": { + "$ref": "#/components/schemas/CreateClientResponse" + }, + "ReadClientResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Client" + } + } + }, + "ListScopesResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Scope" + } + } + } + }, + "CreateScopeRequest": { + "$ref": "#/components/schemas/ScopeOptions" + }, + "CreateScopeResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Scope" + } + } + }, + "ReadScopeResponse": { + "$ref": "#/components/schemas/CreateScopeResponse" + }, + "UpdateScopeRequest": { + "$ref": "#/components/schemas/ScopeOptions" + }, + "UpdateScopeResponse": { + "$ref": "#/components/schemas/CreateScopeResponse" + }, + "CreateSecretRequest": { + "$ref": "#/components/schemas/SecretOptions" + }, + "CreateSecretResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Secret" + } + } + }, + "ReadUserResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + } + } + }, + "ListUsersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "ServerInfo": { + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "string" + } + } + }, + "AccountsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + } + } + } + } + }, + "BalancesCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountsBalances" + } + } + } + } + } + }, + "TransactionsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + } + } + } + } + } + }, + "LogsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Log" + } + } + } + } + } + }, + "AccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/AccountWithVolumesAndBalances" + } + } + }, + "AggregateBalancesResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/AssetsBalances" + } + } + }, + "Config": { + "type": "object", + "properties": { + "storage": { + "$ref": "#/components/schemas/LedgerStorage" + } + }, + "required": [ + "storage" + ] + }, + "LedgerStorage": { + "type": "object", + "properties": { + "driver": { + "type": "string" + }, + "ledgers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "driver", + "ledgers" + ] + }, + "Metadata1": { + "type": "object", + "nullable": true, + "additionalProperties": {} + }, + "ConfigInfo": { + "type": "object", + "properties": { + "config": { + "$ref": "#/components/schemas/Config" + }, + "server": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "config", + "server", + "version" + ] + }, + "ScriptResponse": { + "type": "object", + "properties": { + "errorCode": { + "$ref": "#/components/schemas/ErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "account had insufficient funds" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + }, + "transaction": { + "$ref": "#/components/schemas/Transaction" + } + } + }, + "Account": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string", + "example": "users:001" + }, + "type": { + "type": "string", + "example": "virtual" + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "example": { + "admin": true, + "a": { + "nested": { + "key": "value" + } + } + } + } + } + }, + "AccountWithVolumesAndBalances": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string", + "example": "users:001" + }, + "type": { + "type": "string", + "example": "virtual" + }, + "metadata": { + "type": "object", + "additionalProperties": true, + "example": { + "admin": true, + "a": { + "nested": { + "key": "value" + } + } + } + }, + "volumes": { + "$ref": "#/components/schemas/Volumes" + }, + "balances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + }, + "example": { + "COIN": 100 + } + } + } + }, + "AccountsBalances": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/AssetsBalances" + }, + "example": { + "account1": { + "USD": 100, + "EUR": 23 + }, + "account2": { + "CAD": 20, + "JPY": 21 + } + } + }, + "AssetsBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int64" + }, + "example": { + "USD": 100, + "EUR": 12 + } + }, + "Contract": { + "type": "object", + "properties": { + "account": { + "type": "string", + "example": "users:001" + }, + "expr": { + "type": "object" + } + }, + "required": [ + "accounts", + "expr" + ] + }, + "Mapping": { + "type": "object", + "nullable": true, + "required": [ + "contracts" + ], + "properties": { + "contracts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contract" + } + } + } + }, + "Posting": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "COIN" + }, + "destination": { + "type": "string", + "example": "users:002" + }, + "source": { + "type": "string", + "example": "users:001" + } + }, + "required": [ + "amount", + "asset", + "destination", + "source" + ] + }, + "Script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "additionalProperties": true, + "example": { + "user": "users:042" + } + }, + "reference": { + "type": "string", + "example": "order_1234", + "description": "Reference to attach to the generated transaction" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata1" + } + }, + "required": [ + "plain" + ] + }, + "Transaction": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata1" + }, + "txid": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "preCommitVolumes": { + "$ref": "#/components/schemas/AggregatedVolumes" + }, + "postCommitVolumes": { + "$ref": "#/components/schemas/AggregatedVolumes" + } + }, + "required": [ + "postings", + "timestamp", + "txid" + ] + }, + "TransactionData": { + "type": "object", + "required": [ + "postings" + ], + "properties": { + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata1" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + } + }, + "Transactions": { + "required": [ + "transactions" + ], + "type": "object", + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransactionData" + } + } + } + }, + "PostTransaction": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "additionalProperties": true, + "example": { + "user": "users:042" + } + } + }, + "required": [ + "plain" + ] + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata1" + } + } + }, + "Stats": { + "type": "object", + "properties": { + "accounts": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "transactions": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + }, + "required": [ + "accounts", + "transactions" + ] + }, + "Log": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 1234 + }, + "type": { + "type": "string", + "enum": [ + "NEW_TRANSACTION", + "SET_METADATA" + ] + }, + "data": { + "type": "object", + "additionalProperties": true + }, + "hash": { + "type": "string", + "example": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e" + }, + "date": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "type", + "data", + "hash", + "date" + ] + }, + "TransactionsResponse": { + "type": "object", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Transaction" + }, + "type": "array" + } + }, + "required": [ + "data" + ] + }, + "TransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Transaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "StatsResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Stats" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "MappingResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/Mapping" + } + }, + "type": "object" + }, + "ConfigInfoResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ConfigInfo" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "Volume": { + "type": "object", + "properties": { + "input": { + "type": "integer", + "format": "bigint" + }, + "output": { + "type": "integer", + "format": "bigint" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + }, + "required": [ + "input", + "output" + ], + "example": { + "input": 100, + "output": 20, + "balance": 80 + } + }, + "Volumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Volume" + }, + "example": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "AggregatedVolumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/Volumes" + }, + "example": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "$ref": "#/components/schemas/ErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "[INSUFFICIENT_FUND] account had insufficient funds" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + } + } + }, + "ErrorsEnum": { + "type": "string", + "enum": [ + "INTERNAL", + "INSUFFICIENT_FUND", + "VALIDATION", + "CONFLICT", + "NO_SCRIPT", + "COMPILATION_FAILED", + "METADATA_OVERRIDE" + ], + "example": "INSUFFICIENT_FUND" + }, + "LedgerInfoResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/LedgerInfo" + } + } + }, + "LedgerInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "ledger001" + }, + "storage": { + "type": "object", + "properties": { + "migrations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MigrationInfo" + } + } + } + } + } + }, + "MigrationInfo": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 11 + }, + "name": { + "type": "string", + "example": "migrations:001" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string", + "enum": [ + "to do", + "done" + ] + } + } + }, + "V2AccountsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Account" + } + } + } + } + } + }, + "V2BalancesCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2AccountsBalances" + } + } + } + } + } + }, + "V2TransactionsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2ExpandedTransaction" + } + } + } + } + } + }, + "V2LogsCursorResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Log" + } + } + } + } + } + }, + "V2AccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/V2Account" + } + } + }, + "V2AggregateBalancesResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/V2AssetsBalances" + } + } + }, + "V2Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "V2ConfigInfo": { + "type": "object", + "properties": { + "server": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "config", + "server", + "version" + ] + }, + "V2Account": { + "type": "object", + "required": [ + "address", + "metadata" + ], + "properties": { + "address": { + "type": "string", + "example": "users:001" + }, + "metadata": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "volumes": { + "$ref": "#/components/schemas/V2Volumes" + }, + "effectiveVolumes": { + "$ref": "#/components/schemas/V2Volumes" + } + } + }, + "V2AccountsBalances": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/V2AssetsBalances" + }, + "example": { + "account1": { + "USD": 100, + "EUR": 23 + }, + "account2": { + "CAD": 20, + "JPY": 21 + } + } + }, + "V2AssetsBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + }, + "example": { + "USD": 100, + "EUR": 12 + } + }, + "V2Posting": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "COIN" + }, + "destination": { + "type": "string", + "example": "users:002" + }, + "source": { + "type": "string", + "example": "users:001" + } + }, + "required": [ + "amount", + "asset", + "destination", + "source" + ] + }, + "V2Script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "properties": {}, + "additionalProperties": true, + "example": { + "user": "users:042" + } + }, + "reference": { + "type": "string", + "example": "order_1234", + "description": "Reference to attach to the generated transaction" + }, + "metadata": { + "$ref": "#/components/schemas/V2Metadata" + } + }, + "required": [ + "plain" + ] + }, + "V2Transaction": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/V2Metadata" + }, + "id": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "reverted": { + "type": "boolean" + } + }, + "required": [ + "postings", + "timestamp", + "id", + "metadata", + "reverted" + ] + }, + "V2ExpandedTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/V2Transaction" + }, + { + "type": "object", + "properties": { + "preCommitVolumes": { + "$ref": "#/components/schemas/V2AggregatedVolumes" + }, + "postCommitVolumes": { + "$ref": "#/components/schemas/V2AggregatedVolumes" + } + } + } + ] + }, + "V2PostTransaction": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Posting" + } + }, + "script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "properties": {}, + "additionalProperties": true, + "example": { + "user": "users:042" + } + } + }, + "required": [ + "plain" + ] + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/V2Metadata" + } + } + }, + "V2Stats": { + "type": "object", + "properties": { + "accounts": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "transactions": { + "type": "integer", + "format": "bigint", + "minimum": 0 + } + }, + "required": [ + "accounts", + "transactions" + ] + }, + "V2Log": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 1234 + }, + "type": { + "type": "string", + "enum": [ + "NEW_TRANSACTION", + "SET_METADATA", + "REVERTED_TRANSACTION" + ] + }, + "data": { + "type": "object", + "properties": {}, + "additionalProperties": true + }, + "hash": { + "type": "string", + "example": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e" + }, + "date": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "type", + "data", + "hash", + "date" + ] + }, + "V2CreateTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/V2Transaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "V2RevertTransactionResponse": { + "$ref": "#/components/schemas/V2CreateTransactionResponse" + }, + "V2GetTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/V2ExpandedTransaction" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "V2StatsResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/V2Stats" + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "V2ConfigInfoResponse": { + "$ref": "#/components/schemas/V2ConfigInfo" + }, + "V2Volume": { + "type": "object", + "properties": { + "input": { + "type": "integer", + "format": "bigint" + }, + "output": { + "type": "integer", + "format": "bigint" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + }, + "required": [ + "input", + "output" + ], + "example": { + "input": 100, + "output": 20, + "balance": 80 + } + }, + "V2Volumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/V2Volume" + }, + "example": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "V2AggregatedVolumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/V2Volumes" + }, + "example": { + "orders:1": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + }, + "orders:2": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + } + } + } + }, + "V2ErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "$ref": "#/components/schemas/V2ErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "[VALIDATION] invalid 'cursor' query param" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + } + } + }, + "V2ErrorsEnum": { + "type": "string", + "enum": [ + "INTERNAL", + "INSUFFICIENT_FUND", + "VALIDATION", + "CONFLICT", + "COMPILATION_FAILED", + "METADATA_OVERRIDE", + "NOT_FOUND", + "REVERT_OCCURRING", + "ALREADY_REVERT", + "NO_POSTINGS" + ], + "example": "VALIDATION" + }, + "V2LedgerInfoResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/V2LedgerInfo" + } + } + }, + "V2LedgerInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "ledger001" + }, + "storage": { + "type": "object", + "properties": { + "migrations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2MigrationInfo" + } + } + } + } + } + }, + "V2MigrationInfo": { + "type": "object", + "properties": { + "version": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 11 + }, + "name": { + "type": "string", + "example": "migrations:001" + }, + "date": { + "type": "string", + "format": "date-time" + }, + "state": { + "type": "string", + "enum": [ + "to do", + "done" + ] + } + } + }, + "V2Bulk": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2BulkElement" + } + }, + "V2BaseBulkElement": { + "type": "object", + "required": [ + "action" + ], + "properties": { + "action": { + "type": "string" + }, + "ik": { + "type": "string" + } + } + }, + "V2BulkElement": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/V2BulkElementCreateTransaction" + }, + { + "$ref": "#/components/schemas/V2BulkElementAddMetadata" + }, + { + "$ref": "#/components/schemas/V2BulkElementRevertTransaction" + }, + { + "$ref": "#/components/schemas/V2BulkElementDeleteMetadata" + } + ], + "discriminator": { + "propertyName": "action", + "mapping": { + "CREATE_TRANSACTION": "#/components/schemas/V2BulkElementCreateTransaction", + "ADD_METADATA": "#/components/schemas/V2BulkElementAddMetadata", + "REVERT_TRANSACTION": "#/components/schemas/V2BulkElementRevertTransaction", + "DELETE_METADATA": "#/components/schemas/V2BulkElementDeleteMetadata" + } + } + }, + "V2BulkElementCreateTransaction": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/V2PostTransaction" + } + } + } + ] + }, + "V2TargetId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "bigint" + } + ] + }, + "V2TargetType": { + "type": "string", + "enum": [ + "TRANSACTION", + "ACCOUNT" + ] + }, + "V2BulkElementAddMetadata": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "targetId": { + "$ref": "#/components/schemas/V2TargetId" + }, + "targetType": { + "$ref": "#/components/schemas/V2TargetType" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "targetId", + "targetType", + "metadata" + ] + } + } + } + ] + }, + "V2BulkElementRevertTransaction": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "properties": { + "id": { + "type": "integer", + "format": "bigint" + }, + "force": { + "type": "boolean" + } + }, + "required": [ + "id" + ] + } + } + } + ] + }, + "V2BulkElementDeleteMetadata": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElement" + }, + { + "type": "object", + "properties": { + "data": { + "properties": { + "targetId": { + "$ref": "#/components/schemas/V2TargetId" + }, + "targetType": { + "$ref": "#/components/schemas/V2TargetType" + }, + "key": { + "type": "string" + } + }, + "required": [ + "targetId", + "targetType", + "key" + ] + } + } + } + ] + }, + "V2BulkResponse": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2BulkElementResult" + } + } + }, + "type": "object", + "required": [ + "data" + ] + }, + "V2BulkElementResult": { + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/V2BulkElementResultCreateTransaction" + }, + { + "$ref": "#/components/schemas/V2BulkElementResultAddMetadata" + }, + { + "$ref": "#/components/schemas/V2BulkElementResultRevertTransaction" + }, + { + "$ref": "#/components/schemas/V2BulkElementResultDeleteMetadata" + }, + { + "$ref": "#/components/schemas/V2BulkElementResultError" + } + ], + "discriminator": { + "propertyName": "responseType", + "mapping": { + "CREATE_TRANSACTION": "#/components/schemas/V2BulkElementResultCreateTransaction", + "ADD_METADATA": "#/components/schemas/V2BulkElementResultAddMetadata", + "REVERT_TRANSACTION": "#/components/schemas/V2BulkElementResultRevertTransaction", + "DELETE_METADATA": "#/components/schemas/V2BulkElementResultDeleteMetadata", + "ERROR": "#/components/schemas/V2BulkElementResultError" + } + } + }, + "V2BaseBulkElementResult": { + "type": "object", + "properties": { + "responseType": { + "type": "string" + } + }, + "required": [ + "responseType" + ] + }, + "V2BulkElementResultCreateTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/V2Transaction" + } + }, + "required": [ + "data" + ] + } + ] + }, + "V2BulkElementResultAddMetadata": { + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElementResult" + } + ] + }, + "V2BulkElementResultRevertTransaction": { + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/V2Transaction" + } + }, + "required": [ + "data" + ] + } + ] + }, + "V2BulkElementResultDeleteMetadata": { + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElementResult" + } + ] + }, + "V2BulkElementResultError": { + "allOf": [ + { + "$ref": "#/components/schemas/V2BaseBulkElementResult" + }, + { + "type": "object", + "properties": { + "errorCode": { + "type": "string" + }, + "errorDescription": { + "type": "string" + }, + "errorDetails": { + "type": "string" + } + }, + "required": [ + "errorCode", + "errorDescription" + ] + } + ] + }, + "V2CreateLedgerRequest": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + } + } + }, + "V2Ledger": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "addedAt": { + "type": "string", + "format": "date-time" + }, + "bucket": { + "type": "string" + } + }, + "required": [ + "name", + "addedAt", + "bucket" + ] + }, + "V2LedgerListResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Ledger" + } + } + } + } + } + }, + "CursorBase": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + } + } + }, + "PaymentsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + } + } + } + } + ] + } + } + }, + "PoolsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pool" + } + } + } + } + ] + } + } + }, + "TransferInitiationsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferInitiation" + } + } + } + } + ] + } + } + }, + "BankAccountsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BankAccount" + } + } + } + } + ] + } + } + }, + "AccountsCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/paymentsAccount" + } + } + } + } + ] + } + } + }, + "BalancesCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountBalance" + } + } + } + } + ] + } + } + }, + "TasksCursor": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/CursorBase" + }, + { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TaskStripe" + }, + { + "$ref": "#/components/schemas/TaskWise" + }, + { + "$ref": "#/components/schemas/TaskCurrencyCloud" + }, + { + "$ref": "#/components/schemas/TaskDummyPay" + }, + { + "$ref": "#/components/schemas/TaskModulr" + }, + { + "$ref": "#/components/schemas/TaskBankingCircle" + }, + { + "$ref": "#/components/schemas/TaskMangoPay" + }, + { + "$ref": "#/components/schemas/TaskMoneycorp" + } + ] + } + } + } + } + ] + } + } + }, + "ConnectorConfigResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ConnectorConfig" + } + } + }, + "PaymentResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Payment" + } + } + }, + "PoolBalancesResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/PoolBalances" + } + } + }, + "PoolResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Pool" + } + } + }, + "TransferInitiationResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/TransferInitiation" + } + } + }, + "paymentsAccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/paymentsAccount" + } + } + }, + "ConnectorResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "connectorID" + ], + "properties": { + "connectorID": { + "type": "string" + } + } + } + } + }, + "ConnectorsResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "required": [ + "provider", + "name", + "connectorID" + ], + "properties": { + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "name": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + } + } + } + } + }, + "BankAccountResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/BankAccount" + } + } + }, + "ConnectorsConfigsResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "connector" + ], + "properties": { + "connector": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": { + "type": "object", + "required": [ + "dataType", + "required" + ], + "properties": { + "dataType": { + "type": "string" + }, + "required": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "TaskResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "oneOf": [ + { + "$ref": "#/components/schemas/TaskStripe" + }, + { + "$ref": "#/components/schemas/TaskWise" + }, + { + "$ref": "#/components/schemas/TaskCurrencyCloud" + }, + { + "$ref": "#/components/schemas/TaskDummyPay" + }, + { + "$ref": "#/components/schemas/TaskModulr" + }, + { + "$ref": "#/components/schemas/TaskBankingCircle" + }, + { + "$ref": "#/components/schemas/TaskMangoPay" + }, + { + "$ref": "#/components/schemas/TaskMoneycorp" + } + ] + } + } + }, + "TransferResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "TransfersResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "asset": { + "type": "string" + }, + "destination": { + "type": "string" + }, + "source": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "status": { + "type": "string" + }, + "error": { + "type": "string" + } + } + } + } + } + }, + "Connector": { + "type": "string", + "enum": [ + "STRIPE", + "DUMMY-PAY", + "WISE", + "MODULR", + "CURRENCY-CLOUD", + "BANKING-CIRCLE", + "MANGOPAY", + "MONEYCORP", + "ATLAR", + "ADYEN" + ] + }, + "TransferInitiationStatus": { + "type": "string", + "enum": [ + "WAITING_FOR_VALIDATION", + "PROCESSING", + "PROCESSED", + "FAILED", + "REJECTED", + "VALIDATED" + ] + }, + "ConnectorConfig": { + "anyOf": [ + { + "$ref": "#/components/schemas/StripeConfig" + }, + { + "$ref": "#/components/schemas/DummyPayConfig" + }, + { + "$ref": "#/components/schemas/WiseConfig" + }, + { + "$ref": "#/components/schemas/ModulrConfig" + }, + { + "$ref": "#/components/schemas/CurrencyCloudConfig" + }, + { + "$ref": "#/components/schemas/BankingCircleConfig" + }, + { + "$ref": "#/components/schemas/MangoPayConfig" + }, + { + "$ref": "#/components/schemas/MoneycorpConfig" + }, + { + "$ref": "#/components/schemas/AtlarConfig" + }, + { + "$ref": "#/components/schemas/AdyenConfig" + } + ] + }, + "StripeConfig": { + "type": "object", + "required": [ + "name", + "apiKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Stripe Account" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.\n", + "default": "120s" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "Number of BalanceTransaction to fetch at each polling interval.\n", + "default": 10, + "example": 50 + } + } + }, + "DummyPayConfig": { + "type": "object", + "required": [ + "name", + "directory" + ], + "properties": { + "name": { + "type": "string", + "example": "My DummyPay Account" + }, + "filePollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new payment objects from the directory", + "default": "10s" + }, + "directory": { + "type": "string", + "example": "/tmp/dummypay" + }, + "prefixFileToIngest": { + "type": "string" + }, + "numberOfAccountsPreGenerated": { + "type": "integer", + "format": "int64" + }, + "numberOfPaymentsPreGenerated": { + "type": "integer", + "format": "int64" + } + } + }, + "WiseConfig": { + "type": "object", + "required": [ + "name", + "apiKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Wise Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Wise API.\n", + "default": "120s" + } + } + }, + "ModulrConfig": { + "type": "object", + "required": [ + "name", + "apiKey", + "apiSecret" + ], + "properties": { + "name": { + "type": "string", + "example": "My Modulr Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "apiSecret": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Modulr API.\n", + "default": "120s" + } + } + }, + "BankingCircleConfig": { + "type": "object", + "required": [ + "name", + "username", + "password", + "endpoint", + "authorizationEndpoint", + "userCertificate", + "userCertificateKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Banking Circle Account" + }, + "username": { + "type": "string", + "example": "XXX" + }, + "password": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "authorizationEndpoint": { + "type": "string", + "example": "XXX" + }, + "userCertificate": { + "type": "string", + "example": "XXX" + }, + "userCertificateKey": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Banking Circle API.\n", + "default": "120s" + } + } + }, + "MangoPayConfig": { + "type": "object", + "required": [ + "name", + "clientID", + "apiKey", + "endpoint" + ], + "properties": { + "name": { + "type": "string", + "example": "My MangoPay Account" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MangoPay API.\n", + "default": "120s" + }, + "clientID": { + "type": "string", + "example": "XXX" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + } + } + }, + "MoneycorpConfig": { + "type": "object", + "required": [ + "name", + "clientID", + "apiKey", + "endpoint" + ], + "properties": { + "name": { + "type": "string", + "example": "My Moneycorp Account" + }, + "clientID": { + "type": "string", + "example": "XXX" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "endpoint": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MoneyCorp API.\n", + "default": "120s" + } + } + }, + "CurrencyCloudConfig": { + "type": "object", + "required": [ + "name", + "apiKey", + "loginID" + ], + "properties": { + "name": { + "type": "string", + "example": "My CurrencyCloud Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "loginID": { + "type": "string", + "example": "XXX", + "description": "Username of the API Key holder" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will fetch transactions", + "default": "120s" + }, + "endpoint": { + "type": "string", + "example": "XXX", + "description": "The endpoint to use for the API. Defaults to https://devapi.currencycloud.com" + } + } + }, + "AdyenConfig": { + "type": "object", + "required": [ + "name", + "apiKey", + "hmacKey" + ], + "properties": { + "name": { + "type": "string", + "example": "My Adyen Account" + }, + "apiKey": { + "type": "string", + "example": "XXX" + }, + "hmacKey": { + "type": "string", + "example": "XXX" + }, + "liveEndpointPrefix": { + "type": "string", + "example": "XXX" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Adyen API.\n", + "default": "120s" + } + } + }, + "AtlarConfig": { + "type": "object", + "required": [ + "name", + "accessKey", + "secret" + ], + "properties": { + "name": { + "type": "string", + "example": "My Atlar Account" + }, + "baseUrl": { + "type": "string", + "example": "https://api.example.com", + "default": "https://api.atlar.com", + "description": "The base URL the client uses for making requests towards the Atlar API.\n" + }, + "pollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector tries to fetch new Transaction objects from the Atlar API.\n", + "default": "120s" + }, + "transferInitiationStatusPollingPeriod": { + "type": "string", + "example": "60s", + "description": "The frequency at which the connector tries to fetch the status of payment initiations from the Atlar API.\n", + "default": "120s" + }, + "accessKey": { + "type": "string", + "example": "XXX", + "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" + }, + "secret": { + "type": "string", + "example": "XXX", + "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" + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "Number of items to fetch when querying paginated APIs.\n", + "default": 25, + "example": 50 + } + } + }, + "TransferInitiation": { + "type": "object", + "required": [ + "id", + "reference", + "createdAt", + "updatedAt", + "scheduledAt", + "description", + "sourceAccountID", + "destinationAccountID", + "connectorID", + "type", + "amount", + "asset", + "status", + "error" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "reference": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "scheduledAt": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "TRANSFER", + "PAYOUT" + ] + }, + "amount": { + "type": "integer", + "format": "bigint" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "status": { + "$ref": "#/components/schemas/TransferInitiationStatus" + }, + "error": { + "type": "string" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "relatedPayments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferInitiationPayments" + } + } + } + }, + "TransferInitiationPayments": { + "type": "object", + "required": [ + "paymentID", + "createdAt", + "status", + "error" + ], + "properties": { + "paymentID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/components/schemas/TransferInitiationStatus" + }, + "error": { + "type": "string" + } + } + }, + "BankAccount": { + "type": "object", + "required": [ + "id", + "createdAt", + "country", + "connectorID" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "country": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "accountID": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "iban": { + "type": "string" + }, + "accountNumber": { + "type": "string" + }, + "swiftBicCode": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BankAccountMetadata" + } + } + }, + "BankAccountMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "Payment": { + "type": "object", + "required": [ + "id", + "reference", + "connectorID", + "sourceAccountID", + "destinationAccountID", + "type", + "status", + "initialAmount", + "amount", + "scheme", + "asset", + "createdAt", + "raw", + "adjustments", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "reference": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "type": { + "$ref": "#/components/schemas/PaymentType" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "initialAmount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "scheme": { + "$ref": "#/components/schemas/PaymentScheme" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object", + "nullable": true + }, + "adjustments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PaymentAdjustment" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaymentMetadata" + } + } + }, + "PaymentAdjustment": { + "type": "object", + "required": [ + "status", + "amount", + "date", + "raw", + "absolute" + ], + "properties": { + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "date": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object" + }, + "absolute": { + "type": "boolean" + } + } + }, + "PaymentMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "AccountMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "Pool": { + "type": "object", + "required": [ + "id", + "name", + "accounts" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "accounts": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PoolBalances": { + "type": "object", + "required": [ + "balances" + ], + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PoolBalance" + } + } + } + }, + "PoolBalance": { + "type": "object", + "required": [ + "amount", + "asset" + ], + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "USD" + } + } + }, + "paymentsAccount": { + "type": "object", + "required": [ + "id", + "createdAt", + "reference", + "connectorID", + "defaultCurrency", + "defaultAsset", + "accountName", + "type", + "metadata", + "raw" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "reference": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "defaultCurrency": { + "type": "string", + "deprecated": true + }, + "defaultAsset": { + "type": "string" + }, + "accountName": { + "type": "string" + }, + "type": { + "type": "string" + }, + "pools": { + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "$ref": "#/components/schemas/AccountMetadata" + }, + "raw": { + "type": "object", + "nullable": true + } + } + }, + "AccountBalance": { + "type": "object", + "required": [ + "accountId", + "createdAt", + "lastUpdatedAt", + "currency", + "asset", + "balance" + ], + "properties": { + "accountId": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "lastUpdatedAt": { + "type": "string", + "format": "date-time" + }, + "currency": { + "type": "string", + "deprecated": true + }, + "asset": { + "type": "string" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + } + }, + "TaskBase": { + "type": "object", + "required": [ + "id", + "connectorID", + "createdAt", + "updatedAt", + "descriptor", + "status", + "state" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "connectorID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "state": { + "type": "object" + }, + "error": { + "type": "string" + } + } + }, + "TaskStripe": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "required": [ + "name", + "account" + ], + "properties": { + "name": { + "type": "string" + }, + "main": { + "type": "boolean" + }, + "account": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskWise": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "profileID": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + } + } + } + } + ] + }, + "TaskModulr": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "accountID": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskDummyPay": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "fileName": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskCurrencyCloud": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskBankingCircle": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskMangoPay": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "userID": { + "type": "string" + } + } + } + } + } + ] + }, + "TaskMoneycorp": { + "allOf": [ + { + "$ref": "#/components/schemas/TaskBase" + }, + { + "type": "object", + "required": [ + "descriptor" + ], + "properties": { + "descriptor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + }, + "accountID": { + "type": "string" + } + } + } + } + } + ] + }, + "TransferRequest": { + "type": "object", + "required": [ + "asset", + "amount", + "destination" + ], + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "asset": { + "type": "string", + "example": "USD" + }, + "destination": { + "type": "string", + "example": "acct_1Gqj58KZcSIg2N2q" + }, + "source": { + "type": "string", + "example": "acct_1Gqj58KZcSIg2N2q" + } + } + }, + "BankAccountRequest": { + "type": "object", + "required": [ + "country", + "connectorID", + "name" + ], + "properties": { + "country": { + "type": "string", + "example": "GB" + }, + "connectorID": { + "type": "string" + }, + "name": { + "type": "string", + "example": "My account" + }, + "accountNumber": { + "type": "string" + }, + "iban": { + "type": "string" + }, + "swiftBicCode": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/BankAccountMetadata" + } + } + }, + "AddAccountToPoolRequest": { + "type": "object", + "required": [ + "accountID" + ], + "properties": { + "accountID": { + "type": "string" + } + } + }, + "PoolRequest": { + "type": "object", + "required": [ + "name", + "accountIDs" + ], + "properties": { + "name": { + "type": "string" + }, + "accountIDs": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "PaymentRequest": { + "type": "object", + "required": [ + "reference", + "connectorID", + "createdAt", + "amount", + "type", + "status", + "scheme", + "asset" + ], + "properties": { + "reference": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "type": { + "$ref": "#/components/schemas/PaymentType" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + }, + "scheme": { + "$ref": "#/components/schemas/PaymentScheme" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + } + } + }, + "TransferInitiationRequest": { + "type": "object", + "required": [ + "reference", + "scheduledAt", + "description", + "sourceAccountID", + "destinationAccountID", + "type", + "amount", + "asset", + "validated" + ], + "properties": { + "reference": { + "type": "string", + "example": "XXX" + }, + "scheduledAt": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/Connector" + }, + "type": { + "type": "string", + "enum": [ + "TRANSFER", + "PAYOUT" + ] + }, + "amount": { + "type": "integer", + "format": "bigint" + }, + "asset": { + "type": "string", + "example": "USD" + }, + "validated": { + "type": "boolean" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + } + } + }, + "UpdateTransferInitiationStatusRequest": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "WAITING_FOR_VALIDATION", + "PROCESSING", + "PROCESSED", + "FAILED", + "REJECTED", + "VALIDATED" + ] + } + } + }, + "PaymentType": { + "type": "string", + "enum": [ + "PAY-IN", + "PAYOUT", + "TRANSFER", + "OTHER" + ] + }, + "PaymentScheme": { + "type": "string", + "enum": [ + "unknown", + "other", + "visa", + "mastercard", + "amex", + "diners", + "discover", + "jcb", + "unionpay", + "alipay", + "cup", + "sepa debit", + "sepa credit", + "sepa", + "apple pay", + "google pay", + "doku", + "dragonpay", + "maestro", + "molpay", + "a2a", + "ach debit", + "ach", + "rtp" + ] + }, + "PaymentStatus": { + "type": "string", + "enum": [ + "PENDING", + "SUCCEEDED", + "CANCELLED", + "FAILED", + "EXPIRED", + "REFUNDED", + "OTHER" + ] + }, + "Query": { + "type": "object", + "properties": { + "ledgers": { + "type": "array", + "items": { + "type": "string", + "example": "quickstart" + } + }, + "after": { + "type": "array", + "items": { + "type": "string", + "example": "users:002" + } + }, + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "terms": { + "type": "array", + "items": { + "type": "string", + "example": "destination=central_bank1" + } + }, + "sort": { + "type": "string", + "example": "id:asc" + }, + "policy": { + "type": "string", + "example": "OR" + }, + "target": { + "type": "string" + }, + "cursor": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "raw": { + "type": "object", + "example": { + "query": { + "match_all": {} + } + } + } + } + }, + "Response": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "The payload", + "additionalProperties": true + }, + "cursor": { + "title": "cursor", + "type": "object", + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "hasMore": { + "type": "boolean" + }, + "total": { + "title": "total", + "type": "object", + "properties": { + "value": { + "type": "integer", + "format": "int64", + "minimum": 0, + "example": 1 + }, + "relation": { + "type": "string", + "example": "eq" + } + } + }, + "next": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "data": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "additionalProperties": true + } + ] + } + } + } + } + } + }, + "ConfigUser": { + "type": "object", + "required": [ + "endpoint", + "eventTypes" + ], + "properties": { + "endpoint": { + "type": "string", + "example": "https://example.com" + }, + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + }, + "eventTypes": { + "type": "array", + "items": { + "type": "string", + "example": "TYPE1" + }, + "example": [ + "TYPE1", + "TYPE2" + ] + } + } + }, + "ConfigsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/Cursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/WebhooksConfig" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "Cursor": { + "type": "object", + "required": [ + "hasMore", + "data" + ], + "properties": { + "hasMore": { + "type": "boolean", + "example": false + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WebhooksConfig" + } + } + } + }, + "ConfigResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WebhooksConfig" + } + } + }, + "WebhooksConfig": { + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "endpoint": { + "type": "string", + "example": "https://example.com" + }, + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + }, + "eventTypes": { + "type": "array", + "items": { + "type": "string", + "example": "TYPE1" + }, + "example": [ + "TYPE1", + "TYPE2" + ] + }, + "active": { + "type": "boolean", + "example": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "endpoint", + "secret", + "eventTypes", + "active", + "createdAt", + "updatedAt" + ] + }, + "ConfigChangeSecret": { + "type": "object", + "properties": { + "secret": { + "type": "string", + "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + } + }, + "required": [ + "secret" + ] + }, + "AttemptResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Attempt" + } + } + }, + "Attempt": { + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "webhookID": { + "type": "string", + "format": "uuid" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "config": { + "$ref": "#/components/schemas/WebhooksConfig" + }, + "payload": { + "type": "string", + "example": "{\"data\":\"test\"}" + }, + "statusCode": { + "type": "integer", + "example": 200 + }, + "retryAttempt": { + "type": "integer", + "example": 1 + }, + "status": { + "type": "string", + "example": "success" + }, + "nextRetryAfter": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "webhookID", + "createdAt", + "updatedAt", + "config", + "payload", + "statusCode", + "retryAttempt", + "status" + ] + }, + "webhooksErrorResponse": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { + "$ref": "#/components/schemas/webhooksErrorsEnum" + }, + "errorMessage": { + "type": "string", + "example": "[VALIDATION] invalid 'cursor' query param" + }, + "details": { + "type": "string", + "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + } + } + }, + "webhooksErrorsEnum": { + "type": "string", + "enum": [ + "INTERNAL", + "VALIDATION", + "NOT_FOUND" + ], + "example": "VALIDATION" + }, + "Monetary": { + "type": "object", + "required": [ + "asset", + "amount" + ], + "properties": { + "asset": { + "type": "string", + "description": "The asset of the monetary value." + }, + "amount": { + "type": "integer", + "format": "bigint", + "description": "The amount of the monetary value." + } + } + }, + "Wallet": { + "type": "object", + "required": [ + "name", + "id", + "metadata", + "createdAt", + "ledger" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "name": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "ledger": { + "type": "string" + } + } + }, + "WalletWithBalances": { + "type": "object", + "required": [ + "name", + "id", + "metadata", + "createdAt", + "balances", + "ledger" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." + }, + "metadata": { + "type": "object", + "description": "Metadata associated with the wallet.", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "balances": { + "type": "object", + "required": [ + "main" + ], + "properties": { + "main": { + "$ref": "#/components/schemas/AssetHolder" + } + } + }, + "ledger": { + "type": "string" + } + } + }, + "Hold": { + "type": "object", + "required": [ + "id", + "walletID", + "metadata", + "description" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the hold." + }, + "walletID": { + "type": "string", + "description": "The ID of the wallet the hold is associated with." + }, + "metadata": { + "type": "object", + "description": "Metadata associated with the hold.", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "destination": { + "$ref": "#/components/schemas/Subject" + } + } + }, + "ExpandedDebitHold": { + "allOf": [ + { + "$ref": "#/components/schemas/Hold" + }, + { + "type": "object", + "required": [ + "remaining", + "originalAmount" + ], + "properties": { + "remaining": { + "type": "integer", + "description": "Remaining amount on hold", + "example": 10, + "format": "bigint" + }, + "originalAmount": { + "type": "integer", + "description": "Original amount on hold", + "example": 100, + "format": "bigint" + } + } + } + ] + }, + "ListWalletsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Wallet" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "CreateWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Wallet" + } + } + }, + "GetWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WalletWithBalances" + } + } + }, + "DebitWalletResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Hold" + } + } + }, + "walletsAggregatedVolumes": { + "type": "object", + "x-go-type": { + "type": "AggregatedVolumes" + }, + "additionalProperties": { + "$ref": "#/components/schemas/walletsVolumes" + } + }, + "walletsTransaction": { + "type": "object", + "properties": { + "ledger": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "id": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "preCommitVolumes": { + "$ref": "#/components/schemas/walletsAggregatedVolumes" + }, + "postCommitVolumes": { + "$ref": "#/components/schemas/walletsAggregatedVolumes" + } + }, + "required": [ + "postings", + "timestamp", + "id", + "metadata" + ] + }, + "walletsCursor": { + "type": "object", + "required": [ + "pageSize" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + } + } + }, + "GetTransactionsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/walletsTransaction" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetHoldsResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Hold" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetHoldResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/ExpandedDebitHold" + } + } + }, + "CreateWalletRequest": { + "type": "object", + "required": [ + "name", + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "description": "Custom metadata to attach to this wallet.", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, + "walletsVolume": { + "type": "object", + "properties": { + "input": { + "type": "integer", + "format": "bigint" + }, + "output": { + "type": "integer", + "format": "bigint" + }, + "balance": { + "type": "integer", + "format": "bigint" + } + }, + "required": [ + "input", + "output", + "balance" + ], + "example": { + "input": 100, + "output": 20, + "balance": 80 + } + }, + "walletsVolumes": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/walletsVolume" + }, + "example": { + "USD": { + "input": 100, + "output": 10, + "balance": 90 + }, + "EUR": { + "input": 100, + "output": 10, + "balance": 90 + } + } + }, + "ConfirmHoldRequest": { + "type": "object", + "properties": { + "amount": { + "type": "integer", + "format": "bigint", + "example": 100, + "description": "Define the amount to transfer." + }, + "final": { + "type": "boolean", + "example": true, + "description": "Define a final confirmation. Remaining funds will be returned to the wallet." + } + } + }, + "LedgerAccountSubject": { + "type": "object", + "required": [ + "type", + "identifier" + ], + "properties": { + "type": { + "type": "string" + }, + "identifier": { + "type": "string" + } + } + }, + "WalletSubject": { + "type": "object", + "required": [ + "type", + "identifier" + ], + "properties": { + "type": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "balance": { + "type": "string" + } + } + }, + "Subject": { + "discriminator": { + "propertyName": "type", + "mapping": { + "ACCOUNT": "#/components/schemas/LedgerAccountSubject", + "WALLET": "#/components/schemas/WalletSubject" + } }, - "required": [ - "accounts", - "transactions" + "oneOf": [ + { + "$ref": "#/components/schemas/LedgerAccountSubject" + }, + { + "$ref": "#/components/schemas/WalletSubject" + } ] }, - "Log": { + "CreditWalletRequest": { "type": "object", + "required": [ + "amount", + "sources", + "metadata" + ], "properties": { - "id": { - "type": "integer", - "format": "int64", - "minimum": 0, - "example": 1234 - }, - "type": { - "type": "string", - "enum": [ - "NEW_TRANSACTION", - "SET_METADATA", - "REVERTED_TRANSACTION" - ] + "amount": { + "$ref": "#/components/schemas/Monetary" }, - "data": { + "metadata": { "type": "object", - "properties": {}, - "additionalProperties": true + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." }, - "hash": { - "type": "string", - "example": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e" + "reference": { + "type": "string" }, - "date": { + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Subject" + } + }, + "balance": { "type": "string", - "format": "date-time" + "description": "The balance to credit" } }, - "required": [ - "id", - "type", - "data", - "hash", - "date" - ] + "example": { + "amount": { + "asset": "USD/2", + "amount": 100 + }, + "metadata": { + "key": "" + }, + "sources": [] + } }, - "CreateTransactionResponse": { + "DebitWalletRequest": { + "type": "object", + "required": [ + "amount", + "metadata" + ], "properties": { - "data": { - "$ref": "#/components/schemas/Transaction" + "amount": { + "$ref": "#/components/schemas/Monetary" + }, + "pending": { + "type": "boolean", + "description": "Set to true to create a pending hold. If false, the wallet will be debited immediately." + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "description": { + "type": "string" + }, + "destination": { + "$ref": "#/components/schemas/Subject" + }, + "balances": { + "type": "array", + "items": { + "type": "string", + "description": "A targeted balance (use '*' for all)" + } } }, + "example": { + "amount": { + "asset": "USD/2", + "amount": 100 + }, + "metadata": { + "key": "" + }, + "pending": true + } + }, + "AssetHolder": { "type": "object", "required": [ - "data" - ] - }, - "RevertTransactionResponse": { - "$ref": "#/components/schemas/CreateTransactionResponse" - }, - "GetTransactionResponse": { + "assets" + ], "properties": { - "data": { - "$ref": "#/components/schemas/ExpandedTransaction" + "assets": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } } - }, + } + }, + "Balance": { "type": "object", "required": [ - "data" + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "format": "date-time" + }, + "priority": { + "type": "integer", + "format": "bigint" + } + } + }, + "BalanceWithAssets": { + "allOf": [ + { + "$ref": "#/components/schemas/Balance" + }, + { + "$ref": "#/components/schemas/AssetHolder" + } ] }, - "StatsResponse": { + "GetWalletSummaryResponse": { + "type": "object", + "required": [ + "balances", + "availableFunds", + "expiredFunds", + "expirableFunds", + "holdFunds" + ], "properties": { - "data": { - "$ref": "#/components/schemas/Stats" + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BalanceWithAssets" + } + }, + "availableFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "expiredFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "expirableFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } + }, + "holdFunds": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } } - }, + } + }, + "ListBalancesResponse": { + "type": "object", + "required": [ + "cursor" + ], + "properties": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/walletsCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Balance" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "GetBalanceResponse": { "type": "object", "required": [ "data" - ] - }, - "ConfigInfoResponse": { - "$ref": "#/components/schemas/ConfigInfo" - }, - "Volume": { - "type": "object", + ], "properties": { - "input": { - "type": "integer", - "format": "bigint" - }, - "output": { - "type": "integer", - "format": "bigint" - }, - "balance": { - "type": "integer", - "format": "bigint" + "data": { + "$ref": "#/components/schemas/BalanceWithAssets" } - }, - "required": [ - "input", - "output" - ], - "example": { - "input": 100, - "output": 20, - "balance": 80 } }, - "Volumes": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Volume" - }, - "example": { - "USD": { - "input": 100, - "output": 10, - "balance": 90 - }, - "EUR": { - "input": 100, - "output": 10, - "balance": 90 - } - } + "CreateBalanceRequest": { + "$ref": "#/components/schemas/Balance" }, - "AggregatedVolumes": { + "CreateBalanceResponse": { "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/Volumes" - }, - "example": { - "orders:1": { - "USD": { - "input": 100, - "output": 10, - "balance": 90 - } - }, - "orders:2": { - "USD": { - "input": 100, - "output": 10, - "balance": 90 - } + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Balance" } } }, - "ErrorResponse": { + "walletsErrorResponse": { "type": "object", "required": [ "errorCode", @@ -4884,2211 +12023,1994 @@ ], "properties": { "errorCode": { - "$ref": "#/components/schemas/ErrorsEnum" - }, - "errorMessage": { "type": "string", - "example": "[VALIDATION] invalid 'cursor' query param" + "enum": [ + "VALIDATION", + "INTERNAL_ERROR", + "INSUFFICIENT_FUND", + "HOLD_CLOSED" + ] }, - "details": { - "type": "string", - "example": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" + "errorMessage": { + "type": "string" } } }, - "ErrorsEnum": { - "type": "string", - "enum": [ - "INTERNAL", - "INSUFFICIENT_FUND", - "VALIDATION", - "CONFLICT", - "NO_SCRIPT", - "COMPILATION_FAILED", - "METADATA_OVERRIDE", - "NOT_FOUND", - "CONTEXT_CANCELLED", - "STORE" + "Error": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" ], - "example": "VALIDATION" - }, - "LedgerInfoResponse": { "properties": { - "data": { - "$ref": "#/components/schemas/LedgerInfo" + "errorCode": { + "type": "string", + "enum": [ + "VALIDATION", + "NOT_FOUND", + "INTERNAL" + ] + }, + "errorMessage": { + "type": "string" } } }, - "LedgerInfo": { + "WorkflowConfig": { "type": "object", + "required": [ + "stages" + ], "properties": { "name": { - "type": "string", - "example": "ledger001" + "type": "string" }, - "storage": { - "type": "object", - "properties": { - "migrations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MigrationInfo" - } - } + "stages": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} } } } }, - "MigrationInfo": { + "Workflow": { "type": "object", + "required": [ + "config", + "createdAt", + "updatedAt", + "id" + ], "properties": { - "version": { - "type": "integer", - "format": "int64", - "minimum": 0, - "example": 11 + "config": { + "$ref": "#/components/schemas/WorkflowConfig" }, - "name": { + "createdAt": { "type": "string", - "example": "migrations:001" + "format": "date-time" }, - "date": { + "updatedAt": { "type": "string", "format": "date-time" }, - "state": { - "type": "string", - "enum": [ - "to do", - "done" - ] + "id": { + "type": "string" } } }, - "CursorBase": { + "StageStatus": { "type": "object", "required": [ - "pageSize", - "hasMore", - "data" + "stage", + "instanceID", + "startedAt" ], "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 + "stage": { + "type": "number" }, - "hasMore": { - "type": "boolean", - "example": false + "instanceID": { + "type": "string" }, - "previous": { + "startedAt": { "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + "format": "date-time" }, - "next": { + "terminatedAt": { "type": "string", - "example": "" + "format": "date-time" + }, + "error": { + "type": "string" } } }, - "PaymentsCursor": { + "WorkflowInstance": { "type": "object", "required": [ - "cursor" + "workflowID", + "id", + "createdAt", + "updatedAt", + "terminated" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Payment" - } - } - } - } - ] + "workflowID": { + "type": "string" + }, + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StageStatus" + } + }, + "terminated": { + "type": "boolean" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" } } }, - "TransferInitiationsCursor": { + "WorkflowInstanceHistoryStage": { "type": "object", "required": [ - "cursor" + "name", + "input", + "startedAt", + "terminated", + "attempt" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferInitiation" - } - } - } - } - ] + "name": { + "type": "string" + }, + "input": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageInput" + }, + "output": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageOutput" + }, + "error": { + "type": "string" + }, + "terminated": { + "type": "boolean" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "lastFailure": { + "type": "string" + }, + "attempt": { + "type": "integer" + }, + "nextExecution": { + "type": "string", + "format": "date-time" } } }, - "BankAccountsCursor": { + "WorkflowInstanceHistory": { "type": "object", "required": [ - "cursor" + "name", + "input", + "terminated", + "startedAt" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BankAccount" - } - } - } - } - ] + "name": { + "type": "string" + }, + "input": { + "$ref": "#/components/schemas/Stage" + }, + "error": { + "type": "string" + }, + "terminated": { + "type": "boolean" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" } } }, - "AccountsCursor": { - "type": "object", - "required": [ - "cursor" - ], - "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/paymentsAccount" - } - } - } - } - ] - } + "WorkflowInstanceHistoryList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowInstanceHistory" } }, - "BalancesCursor": { + "WorkflowInstanceHistoryStageList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStage" + } + }, + "ListWorkflowsResponse": { "type": "object", - "required": [ - "cursor" - ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountBalance" - } - } - } - } - ] + "data": { + "items": { + "$ref": "#/components/schemas/Workflow" + }, + "type": "array" } - } + }, + "required": [ + "data" + ] }, - "TasksCursor": { + "TriggerData": { "type": "object", "required": [ - "cursor" + "event", + "workflowID" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/CursorBase" - }, - { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TaskStripe" - }, - { - "$ref": "#/components/schemas/TaskWise" - }, - { - "$ref": "#/components/schemas/TaskCurrencyCloud" - }, - { - "$ref": "#/components/schemas/TaskDummyPay" - }, - { - "$ref": "#/components/schemas/TaskModulr" - }, - { - "$ref": "#/components/schemas/TaskBankingCircle" - }, - { - "$ref": "#/components/schemas/TaskMangoPay" - }, - { - "$ref": "#/components/schemas/TaskMoneycorp" - } - ] - } - } - } - } - ] + "event": { + "type": "string" + }, + "workflowID": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "vars": { + "type": "object", + "additionalProperties": true } } }, - "ConnectorConfigResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/ConnectorConfig" + "Trigger": { + "allOf": [ + { + "$ref": "#/components/schemas/TriggerData" + }, + { + "type": "object", + "required": [ + "id", + "createdAt" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } } - } + ] }, - "PaymentResponse": { + "TriggerOccurrence": { "type": "object", "required": [ - "data" + "triggerID", + "workflowInstanceID", + "workflowInstance", + "date", + "event" ], "properties": { - "data": { - "$ref": "#/components/schemas/Payment" + "date": { + "type": "string", + "format": "date-time" + }, + "workflowInstanceID": { + "type": "string" + }, + "workflowInstance": { + "$ref": "#/components/schemas/WorkflowInstance" + }, + "triggerID": { + "type": "string" + }, + "event": { + "type": "object", + "additionalProperties": true } } }, - "TransferInitiationResponse": { + "ListTriggersOccurrencesResponse": { "type": "object", - "required": [ - "data" - ], "properties": { "data": { - "$ref": "#/components/schemas/TransferInitiation" + "items": { + "$ref": "#/components/schemas/TriggerOccurrence" + }, + "type": "array" } - } - }, - "paymentsAccountResponse": { - "type": "object", + }, "required": [ "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/paymentsAccount" - } - } + ] }, - "ConnectorsResponse": { + "ListTriggersResponse": { "type": "object", - "required": [ - "data" - ], "properties": { "data": { - "type": "array", "items": { - "type": "object", - "properties": { - "provider": { - "$ref": "#/components/schemas/Connector" - }, - "enabled": { - "type": "boolean", - "example": true - } - } - } + "$ref": "#/components/schemas/Trigger" + }, + "type": "array" } - } + }, + "required": [ + "data" + ] }, - "BankAccountResponse": { + "ReadWorkflowResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/BankAccount" + "$ref": "#/components/schemas/Workflow" } } }, - "ConnectorsConfigsResponse": { + "CreateWorkflowRequest": { + "$ref": "#/components/schemas/WorkflowConfig" + }, + "CreateWorkflowResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "type": "object", - "required": [ - "connector" - ], - "properties": { - "connector": { - "type": "object", - "required": [ - "key" - ], - "properties": { - "key": { - "type": "object", - "required": [ - "dataType", - "required" - ], - "properties": { - "dataType": { - "type": "string" - }, - "required": { - "type": "boolean" - } - } - } - } - } - } + "$ref": "#/components/schemas/Workflow" } } }, - "TaskResponse": { + "CreateTriggerResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "oneOf": [ - { - "$ref": "#/components/schemas/TaskStripe" - }, - { - "$ref": "#/components/schemas/TaskWise" - }, - { - "$ref": "#/components/schemas/TaskCurrencyCloud" - }, - { - "$ref": "#/components/schemas/TaskDummyPay" - }, - { - "$ref": "#/components/schemas/TaskModulr" - }, - { - "$ref": "#/components/schemas/TaskBankingCircle" - }, - { - "$ref": "#/components/schemas/TaskMangoPay" - }, - { - "$ref": "#/components/schemas/TaskMoneycorp" - } - ] + "$ref": "#/components/schemas/Trigger" } } }, - "TransferResponse": { + "RunWorkflowRequest": { "type": "object", - "properties": { - "id": { - "type": "string" - } + "additionalProperties": { + "type": "string" } }, - "TransfersResponse": { + "RunWorkflowResponse": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "amount": { - "type": "integer", - "format": "bigint", - "minimum": 0 - }, - "asset": { - "type": "string" - }, - "destination": { - "type": "string" - }, - "source": { - "type": "string" - }, - "currency": { - "type": "string" - }, - "status": { - "type": "string" - }, - "error": { - "type": "string" - } - } - } + "$ref": "#/components/schemas/WorkflowInstance" } } }, - "Connector": { - "type": "string", - "enum": [ - "STRIPE", - "DUMMY-PAY", - "WISE", - "MODULR", - "CURRENCY-CLOUD", - "BANKING-CIRCLE", - "MANGOPAY", - "MONEYCORP" - ] - }, - "TransferInitiationStatus": { - "type": "string", - "enum": [ - "WAITING_FOR_VALIDATION", - "PROCESSING", - "PROCESSED", - "FAILED", - "REJECTED", - "VALIDATED" - ] - }, - "ConnectorConfig": { - "anyOf": [ - { - "$ref": "#/components/schemas/StripeConfig" - }, - { - "$ref": "#/components/schemas/DummyPayConfig" - }, - { - "$ref": "#/components/schemas/WiseConfig" - }, - { - "$ref": "#/components/schemas/ModulrConfig" - }, - { - "$ref": "#/components/schemas/CurrencyCloudConfig" - }, - { - "$ref": "#/components/schemas/BankingCircleConfig" - }, - { - "$ref": "#/components/schemas/MangoPayConfig" - }, - { - "$ref": "#/components/schemas/MoneycorpConfig" - } - ] - }, - "StripeConfig": { - "type": "object", + "ListRunsResponse": { "required": [ - "apiKey" - ], - "properties": { - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API.\n", - "default": "120s" - }, - "apiKey": { - "type": "string", - "example": "XXX" - }, - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 0, - "description": "Number of BalanceTransaction to fetch at each polling interval.\n", - "default": 10, - "example": 50 + "data" + ], + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/WorkflowInstance" + }, + "type": "array" } } }, - "DummyPayConfig": { + "GetWorkflowResponse": { "type": "object", "required": [ - "directory" + "data" ], "properties": { - "filePollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new payment objects from the directory", - "default": "10s" - }, - "fileGenerationPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will create new payment objects in the directory", - "default": "10s" - }, - "directory": { - "type": "string", - "example": "/tmp/dummypay" + "data": { + "$ref": "#/components/schemas/Workflow" } } }, - "WiseConfig": { + "GetWorkflowInstanceResponse": { "type": "object", "required": [ - "apiKey" + "data" ], "properties": { - "apiKey": { - "type": "string", - "example": "XXX" - }, - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Wise API.\n", - "default": "120s" + "data": { + "$ref": "#/components/schemas/WorkflowInstance" } } }, - "ModulrConfig": { + "GetWorkflowInstanceHistoryResponse": { "type": "object", "required": [ - "apiKey", - "apiSecret" + "data" ], "properties": { - "apiKey": { - "type": "string", - "example": "XXX" - }, - "apiSecret": { - "type": "string", - "example": "XXX" - }, - "endpoint": { - "type": "string", - "example": "XXX" - }, - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Modulr API.\n", - "default": "120s" + "data": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryList" } } }, - "BankingCircleConfig": { + "GetWorkflowInstanceHistoryStageResponse": { "type": "object", "required": [ - "username", - "password", - "endpoint", - "authorizationEndpoint", - "userCertificate", - "userCertificateKey" + "data" ], "properties": { - "username": { - "type": "string", - "example": "XXX" - }, - "password": { - "type": "string", - "example": "XXX" - }, - "endpoint": { - "type": "string", - "example": "XXX" - }, - "authorizationEndpoint": { - "type": "string", - "example": "XXX" - }, - "userCertificate": { - "type": "string", - "example": "XXX" - }, - "userCertificateKey": { - "type": "string", - "example": "XXX" - }, - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from Banking Circle API.\n", - "default": "120s" + "data": { + "$ref": "#/components/schemas/WorkflowInstanceHistoryStageList" } } }, - "MangoPayConfig": { + "StageSendSourceWallet": { "type": "object", "required": [ - "clientID", - "apiKey", - "endpoint" + "id" ], "properties": { - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MangoPay API.\n", - "default": "120s" - }, - "clientID": { - "type": "string", - "example": "XXX" - }, - "apiKey": { - "type": "string", - "example": "XXX" + "id": { + "type": "string" }, - "endpoint": { - "type": "string", - "example": "XXX" + "balance": { + "type": "string" } } }, - "MoneycorpConfig": { + "StageSendDestinationWallet": { + "$ref": "#/components/schemas/StageSendSourceWallet" + }, + "StageSendSourceAccount": { "type": "object", "required": [ - "clientID", - "apiKey", - "endpoint" + "id" ], "properties": { - "clientID": { - "type": "string", - "example": "XXX" - }, - "apiKey": { - "type": "string", - "example": "XXX" - }, - "endpoint": { - "type": "string", - "example": "XXX" + "id": { + "type": "string" }, - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will try to fetch new BalanceTransaction objects from MoneyCorp API.\n", - "default": "120s" + "ledger": { + "type": "string" } } }, - "CurrencyCloudConfig": { + "StageSendDestinationAccount": { + "$ref": "#/components/schemas/StageSendSourceAccount" + }, + "StageSendSourcePayment": { "type": "object", "required": [ - "apiKey", - "loginID" + "id" ], "properties": { - "apiKey": { - "type": "string", - "example": "XXX" - }, - "loginID": { - "type": "string", - "example": "XXX", - "description": "Username of the API Key holder" - }, - "pollingPeriod": { - "type": "string", - "example": "60s", - "description": "The frequency at which the connector will fetch transactions", - "default": "120s" - }, - "endpoint": { - "type": "string", - "example": "XXX", - "description": "The endpoint to use for the API. Defaults to https://devapi.currencycloud.com" + "id": { + "type": "string" } } }, - "TransferInitiation": { + "StageSendDestinationPayment": { "type": "object", "required": [ - "id", - "createdAt", - "updatedAt", - "scheduledAt", - "description", - "sourceAccountID", - "destinationAccountID", - "provider", - "type", - "amount", - "asset", - "status", - "error" + "psp" ], "properties": { - "id": { - "type": "string", - "example": "XXX" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "scheduledAt": { - "type": "string", - "format": "date-time" - }, - "description": { - "type": "string" - }, - "sourceAccountID": { - "type": "string" - }, - "destinationAccountID": { + "psp": { "type": "string" + } + } + }, + "StageSendSource": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/components/schemas/StageSendSourceWallet" }, - "provider": { - "$ref": "#/components/schemas/Connector" - }, - "type": { - "type": "string", - "enum": [ - "TRANSFER", - "PAYOUT" - ] - }, - "amount": { - "type": "integer", - "format": "bigint" - }, - "asset": { - "type": "string", - "example": "USD" + "account": { + "$ref": "#/components/schemas/StageSendSourceAccount" }, - "status": { - "$ref": "#/components/schemas/TransferInitiationStatus" + "payment": { + "$ref": "#/components/schemas/StageSendSourcePayment" + } + } + }, + "StageSendDestination": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/components/schemas/StageSendDestinationWallet" }, - "error": { - "type": "string" + "account": { + "$ref": "#/components/schemas/StageSendDestinationAccount" }, - "relatedPayments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferInitiationPayments" - } + "payment": { + "$ref": "#/components/schemas/StageSendDestinationPayment" } } }, - "TransferInitiationPayments": { + "StageSend": { "type": "object", - "required": [ - "paymentID", - "createdAt", - "status", - "error" - ], "properties": { - "paymentID": { - "type": "string" + "amount": { + "$ref": "#/components/schemas/Monetary" }, - "createdAt": { - "type": "string", - "format": "date-time" + "destination": { + "$ref": "#/components/schemas/StageSendDestination" }, - "status": { - "$ref": "#/components/schemas/PaymentStatus" + "source": { + "$ref": "#/components/schemas/StageSendSource" }, - "error": { - "type": "string" + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } } } }, - "BankAccount": { + "StageDelay": { "type": "object", - "required": [ - "id", - "createdAt", - "country", - "provider" - ], "properties": { - "id": { - "type": "string" - }, - "createdAt": { + "until": { "type": "string", "format": "date-time" }, - "country": { - "type": "string" - }, - "provider": { - "$ref": "#/components/schemas/Connector" - }, - "iban": { - "type": "string" - }, - "accountNumber": { - "type": "string" - }, - "swiftBicCode": { + "duration": { "type": "string" } } }, - "Payment": { + "StageWaitEvent": { "type": "object", "required": [ - "id", - "reference", - "sourceAccountID", - "destinationAccountID", - "type", - "provider", - "status", - "initialAmount", - "scheme", - "asset", - "createdAt", - "raw", - "adjustments", - "metadata" + "event" ], "properties": { - "id": { - "type": "string", - "example": "XXX" - }, - "reference": { + "event": { "type": "string" + } + } + }, + "Stage": { + "anyOf": [ + { + "$ref": "#/components/schemas/StageSend" }, - "sourceAccountID": { - "type": "string" + { + "$ref": "#/components/schemas/StageDelay" }, - "destinationAccountID": { + { + "$ref": "#/components/schemas/StageWaitEvent" + } + ] + }, + "StripeTransferRequest": { + "type": "object", + "properties": { + "connectorID": { "type": "string" }, - "type": { - "type": "string", - "enum": [ - "PAY-IN", - "PAYOUT", - "TRANSFER", - "OTHER" - ] - }, - "provider": { - "$ref": "#/components/schemas/Connector" - }, - "status": { - "$ref": "#/components/schemas/PaymentStatus" - }, - "initialAmount": { + "amount": { "type": "integer", "format": "bigint", "minimum": 0, "example": 100 }, - "scheme": { - "type": "string", - "enum": [ - "visa", - "mastercard", - "amex", - "diners", - "discover", - "jcb", - "unionpay", - "sepa debit", - "sepa credit", - "sepa", - "apple pay", - "google pay", - "a2a", - "ach debit", - "ach", - "rtp", - "unknown", - "other" - ] - }, "asset": { "type": "string", "example": "USD" }, - "createdAt": { + "destination": { "type": "string", - "format": "date-time" - }, - "raw": { - "type": "object", - "nullable": true + "example": "acct_1Gqj58KZcSIg2N2q" }, - "adjustments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentAdjustment" - } + "waitingValidation": { + "type": "boolean", + "example": false, + "default": false }, "metadata": { - "$ref": "#/components/schemas/PaymentMetadata" + "type": "object", + "description": "A set of key/value pairs that you can attach to a transfer object.\nIt can be useful for storing additional information about the transfer in a structured format.\n", + "example": { + "order_id": "6735" + } } } }, - "PaymentAdjustment": { + "ActivityStripeTransfer": { + "$ref": "#/components/schemas/StripeTransferRequest" + }, + "ActivityListWallets": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + }, + "ActivityListWalletsOutput": { + "$ref": "#/components/schemas/orchestrationListWalletsResponse" + }, + "orchestrationListWalletsResponse": { "type": "object", "required": [ - "status", - "amount", - "date", - "raw", - "absolute" + "cursor" ], "properties": { - "status": { - "$ref": "#/components/schemas/PaymentStatus" - }, - "amount": { + "cursor": { + "allOf": [ + { + "$ref": "#/components/schemas/orchestrationCursor" + }, + { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Wallet" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "data" + ] + } + ] + } + } + }, + "orchestrationCursor": { + "type": "object", + "required": [ + "pageSize" + ], + "properties": { + "pageSize": { "type": "integer", - "format": "bigint", - "minimum": 0, - "example": 100 + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 }, - "date": { + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { "type": "string", - "format": "date-time" + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" }, - "raw": { - "type": "object" + "next": { + "type": "string", + "example": "" + } + } + }, + "ActivityGetAccount": { + "type": "object", + "required": [ + "id", + "ledger" + ], + "properties": { + "id": { + "type": "string" }, - "absolute": { - "type": "boolean" + "ledger": { + "type": "string" } } }, - "PaymentMetadata": { + "ActivityCreateTransaction": { "type": "object", "properties": { - "key": { + "ledger": { "type": "string" + }, + "data": { + "$ref": "#/components/schemas/orchestrationPostTransaction" } - }, - "nullable": true + } }, - "paymentsAccount": { + "ActivityRevertTransaction": { "type": "object", "required": [ "id", - "createdAt", - "provider", - "reference", - "defaultCurrency", - "defaultAsset", - "accountName", - "type", - "raw" + "ledger" ], "properties": { - "id": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "provider": { - "$ref": "#/components/schemas/Connector" - }, - "reference": { - "type": "string" - }, - "defaultCurrency": { - "type": "string", - "deprecated": true - }, - "defaultAsset": { - "type": "string" - }, - "accountName": { + "ledger": { "type": "string" }, - "type": { + "id": { "type": "string" - }, - "raw": { - "type": "object", - "nullable": true } } }, - "AccountBalance": { + "ActivityGetPayment": { "type": "object", "required": [ - "accountId", - "createdAt", - "lastUpdatedAt", - "currency", - "asset", - "balance" + "id" ], "properties": { - "accountId": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "lastUpdatedAt": { - "type": "string", - "format": "date-time" - }, - "currency": { - "type": "string", - "deprecated": true - }, - "asset": { + "id": { "type": "string" - }, - "balance": { - "type": "integer", - "format": "bigint" } } }, - "TaskBase": { + "ActivityConfirmHold": { "type": "object", "required": [ - "id", - "connectorId", - "createdAt", - "updatedAt", - "descriptor", - "status", - "state" + "id" ], "properties": { "id": { - "type": "string", - "format": "uuid" - }, - "connectorId": { - "type": "string", - "format": "uuid" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "status": { - "$ref": "#/components/schemas/PaymentStatus" - }, - "state": { - "type": "object" - }, - "error": { "type": "string" } } }, - "TaskStripe": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" + "ActivityCreditWallet": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "required": [ - "name", - "account" - ], - "properties": { - "name": { - "type": "string" - }, - "main": { - "type": "boolean" - }, - "account": { - "type": "string" - } - } - } - } + "data": { + "$ref": "#/components/schemas/CreditWalletRequest" } - ] + } }, - "TaskWise": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" + "ActivityDebitWallet": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - }, - "profileID": { - "type": "integer", - "format": "int64", - "minimum": 0 - } - } - } - } + "data": { + "$ref": "#/components/schemas/DebitWalletRequest" } - ] + } }, - "TaskModulr": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" - }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - }, - "accountID": { - "type": "string" - } - } - } - } + "ActivityGetWallet": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" } - ] + } }, - "TaskDummyPay": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" - }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - }, - "fileName": { - "type": "string" - } - } - } - } + "ActivityVoidHold": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" } - ] + } }, - "TaskCurrencyCloud": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" - }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - } - } + "ActivityGetAccountOutput": { + "$ref": "#/components/schemas/orchestrationAccountResponse" + }, + "ActivityCreateTransactionOutput": { + "$ref": "#/components/schemas/CreateTransactionResponse" + }, + "CreateTransactionResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/orchestrationTransaction" } + }, + "type": "object", + "required": [ + "data" ] }, - "TaskBankingCircle": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" + "orchestrationTransaction": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time" }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - } - } - } + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" } + }, + "reference": { + "type": "string", + "example": "ref:001" + }, + "metadata": { + "$ref": "#/components/schemas/orchestrationMetadata" + }, + "id": { + "type": "integer", + "format": "bigint", + "minimum": 0 + }, + "reverted": { + "type": "boolean" } + }, + "required": [ + "postings", + "timestamp", + "id", + "metadata", + "reverted" ] }, - "TaskMangoPay": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" - }, - { - "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - }, - "userID": { - "type": "string" - } - } - } - } + "ActivityRevertTransactionOutput": { + "$ref": "#/components/schemas/RevertTransactionResponse" + }, + "RevertTransactionResponse": { + "$ref": "#/components/schemas/CreateTransactionResponse" + }, + "ActivityGetPaymentOutput": { + "$ref": "#/components/schemas/orchestrationPaymentResponse" + }, + "orchestrationPaymentResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/orchestrationPayment" } - ] + } }, - "TaskMoneycorp": { - "allOf": [ - { - "$ref": "#/components/schemas/TaskBase" + "orchestrationPayment": { + "type": "object", + "required": [ + "id", + "reference", + "connectorID", + "sourceAccountID", + "destinationAccountID", + "type", + "status", + "initialAmount", + "scheme", + "asset", + "createdAt", + "raw", + "adjustments", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" }, - { + "reference": { + "type": "string" + }, + "sourceAccountID": { + "type": "string" + }, + "destinationAccountID": { + "type": "string" + }, + "connectorID": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/orchestrationConnector" + }, + "type": { + "type": "string", + "enum": [ + "PAY-IN", + "PAYOUT", + "TRANSFER", + "OTHER" + ] + }, + "status": { + "$ref": "#/components/schemas/orchestrationPaymentStatus" + }, + "initialAmount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "scheme": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "diners", + "discover", + "jcb", + "unionpay", + "sepa debit", + "sepa credit", + "sepa", + "apple pay", + "google pay", + "a2a", + "ach debit", + "ach", + "rtp", + "unknown", + "other" + ] + }, + "asset": { + "type": "string", + "example": "USD" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "raw": { "type": "object", - "required": [ - "descriptor" - ], - "properties": { - "descriptor": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - }, - "accountID": { - "type": "string" - } - } - } + "nullable": true + }, + "adjustments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/orchestrationPaymentAdjustment" } + }, + "metadata": { + "$ref": "#/components/schemas/orchestrationPaymentMetadata" } + } + }, + "orchestrationConnector": { + "type": "string", + "enum": [ + "STRIPE", + "DUMMY-PAY", + "WISE", + "MODULR", + "CURRENCY-CLOUD", + "BANKING-CIRCLE", + "MANGOPAY", + "MONEYCORP" ] }, - "TransferRequest": { + "orchestrationPaymentAdjustment": { "type": "object", "required": [ - "asset", + "status", "amount", - "destination" + "date", + "raw", + "absolute" ], "properties": { + "status": { + "$ref": "#/components/schemas/orchestrationPaymentStatus" + }, "amount": { "type": "integer", "format": "bigint", "minimum": 0, "example": 100 }, - "asset": { + "date": { "type": "string", - "example": "USD" + "format": "date-time" }, - "destination": { - "type": "string", - "example": "acct_1Gqj58KZcSIg2N2q" + "raw": { + "type": "object" }, - "source": { - "type": "string", - "example": "acct_1Gqj58KZcSIg2N2q" + "absolute": { + "type": "boolean" } } }, - "BankAccountRequest": { + "orchestrationPaymentStatus": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "TERMINATED", + "FAILED", + "SUCCEEDED", + "CANCELLED" + ] + }, + "orchestrationPaymentMetadata": { "type": "object", - "required": [ - "country", - "provider", - "name" - ], "properties": { - "country": { - "type": "string", - "example": "GB" + "key": { + "type": "string" + } + }, + "nullable": true + }, + "ActivityDebitWalletOutput": { + "$ref": "#/components/schemas/DebitWalletResponse" + }, + "ActivityGetWalletOutput": { + "$ref": "#/components/schemas/GetWalletResponse" + }, + "WorkflowInstanceHistoryStageInput": { + "type": "object", + "properties": { + "GetAccount": { + "$ref": "#/components/schemas/ActivityGetAccount" }, - "provider": { - "$ref": "#/components/schemas/Connector" + "CreateTransaction": { + "$ref": "#/components/schemas/ActivityCreateTransaction" }, - "name": { - "type": "string", - "example": "My account" + "RevertTransaction": { + "$ref": "#/components/schemas/ActivityRevertTransaction" }, - "accountNumber": { - "type": "string" + "StripeTransfer": { + "$ref": "#/components/schemas/ActivityStripeTransfer" }, - "iban": { - "type": "string" + "GetPayment": { + "$ref": "#/components/schemas/ActivityGetPayment" }, - "swiftBicCode": { - "type": "string" + "ConfirmHold": { + "$ref": "#/components/schemas/ActivityConfirmHold" + }, + "CreditWallet": { + "$ref": "#/components/schemas/ActivityCreditWallet" + }, + "DebitWallet": { + "$ref": "#/components/schemas/ActivityDebitWallet" + }, + "GetWallet": { + "$ref": "#/components/schemas/ActivityGetWallet" + }, + "VoidHold": { + "$ref": "#/components/schemas/ActivityVoidHold" + }, + "ListWallets": { + "$ref": "#/components/schemas/ActivityListWallets" } } }, - "TransferInitiationRequest": { + "WorkflowInstanceHistoryStageOutput": { "type": "object", - "required": [ - "reference", - "scheduledAt", - "description", - "sourceAccountID", - "destinationAccountID", - "provider", - "type", - "amount", - "asset", - "validated" - ], "properties": { - "reference": { - "type": "string", - "example": "XXX" + "GetAccount": { + "$ref": "#/components/schemas/ActivityGetAccountOutput" }, - "scheduledAt": { - "type": "string", - "format": "date-time" + "CreateTransaction": { + "$ref": "#/components/schemas/ActivityCreateTransactionOutput" }, - "description": { - "type": "string" + "RevertTransaction": { + "$ref": "#/components/schemas/ActivityRevertTransactionOutput" }, - "sourceAccountID": { - "type": "string" + "GetPayment": { + "$ref": "#/components/schemas/ActivityGetPaymentOutput" }, - "destinationAccountID": { - "type": "string" + "DebitWallet": { + "$ref": "#/components/schemas/ActivityDebitWalletOutput" }, - "provider": { - "$ref": "#/components/schemas/Connector" + "GetWallet": { + "$ref": "#/components/schemas/ActivityGetWalletOutput" }, - "type": { + "ListWallets": { + "$ref": "#/components/schemas/orchestrationListWalletsResponse" + } + } + }, + "orchestrationPostTransaction": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "timestamp": { "type": "string", - "enum": [ - "TRANSFER", - "PAYOUT" - ] + "format": "date-time" }, - "amount": { - "type": "integer", - "format": "bigint" + "postings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Posting" + } }, - "asset": { + "script": { + "type": "object", + "properties": { + "plain": { + "type": "string", + "example": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n" + }, + "vars": { + "type": "object", + "properties": {}, + "additionalProperties": true, + "example": { + "user": "users:042" + } + } + }, + "required": [ + "plain" + ] + }, + "reference": { "type": "string", - "example": "USD" + "example": "ref:001" }, - "validated": { - "type": "boolean" + "metadata": { + "$ref": "#/components/schemas/orchestrationMetadata" } } }, - "UpdateTransferInitiationStatusRequest": { + "orchestrationMetadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" + } + }, + "orchestrationAccountResponse": { "type": "object", "required": [ - "status" + "data" ], "properties": { - "status": { - "type": "string", - "enum": [ - "WAITING_FOR_VALIDATION", - "PROCESSING", - "PROCESSED", - "FAILED", - "REJECTED", - "VALIDATED" - ] + "data": { + "$ref": "#/components/schemas/orchestrationAccount" } } }, - "PaymentStatus": { - "type": "string", - "enum": [ - "PENDING", - "ACTIVE", - "TERMINATED", - "FAILED", - "SUCCEEDED", - "CANCELLED" - ] + "ReadTriggerResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Trigger" + } + } }, - "Query": { + "orchestrationAccount": { "type": "object", + "required": [ + "address", + "metadata" + ], "properties": { - "ledgers": { - "type": "array", - "items": { - "type": "string", - "example": "quickstart" - } - }, - "after": { - "type": "array", - "items": { - "type": "string", - "example": "users:002" - } - }, - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 0 + "address": { + "type": "string", + "example": "users:001" }, - "terms": { - "type": "array", - "items": { - "type": "string", - "example": "destination=central_bank1" + "metadata": { + "type": "object", + "properties": {}, + "additionalProperties": { + "type": "string" + }, + "example": { + "admin": "true" } }, - "sort": { - "type": "string", - "example": "id:asc" - }, - "policy": { - "type": "string", - "example": "OR" + "volumes": { + "$ref": "#/components/schemas/Volumes" }, - "target": { + "effectiveVolumes": { + "$ref": "#/components/schemas/Volumes" + } + } + }, + "V2ServerInfo": { + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { "type": "string" - }, - "cursor": { + } + } + }, + "V2Error": { + "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], + "properties": { + "errorCode": { "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + "enum": [ + "VALIDATION", + "NOT_FOUND", + "INTERNAL" + ] }, - "raw": { - "type": "object", - "example": { - "query": { - "match_all": {} - } - } + "errorMessage": { + "type": "string" } } }, - "Response": { + "V2WorkflowConfig": { "type": "object", + "required": [ + "stages" + ], "properties": { - "data": { - "type": "object", - "description": "The payload", - "additionalProperties": true + "name": { + "type": "string" }, - "cursor": { - "title": "cursor", - "type": "object", - "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 0 - }, - "hasMore": { - "type": "boolean" - }, - "total": { - "title": "total", - "type": "object", - "properties": { - "value": { - "type": "integer", - "format": "int64", - "minimum": 0, - "example": 1 - }, - "relation": { - "type": "string", - "example": "eq" - } - } - }, - "next": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "previous": { - "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" - }, - "data": { - "type": "array", - "items": { - "allOf": [ - { - "type": "object", - "additionalProperties": true - } - ] - } - } + "stages": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} } } } }, - "ConfigUser": { + "V2Workflow": { "type": "object", "required": [ - "endpoint", - "eventTypes" + "config", + "createdAt", + "updatedAt", + "id" ], "properties": { - "endpoint": { + "config": { + "$ref": "#/components/schemas/V2WorkflowConfig" + }, + "createdAt": { "type": "string", - "example": "https://example.com" + "format": "date-time" }, - "secret": { + "updatedAt": { "type": "string", - "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + "format": "date-time" }, - "eventTypes": { - "type": "array", - "items": { - "type": "string", - "example": "TYPE1" - }, - "example": [ - "TYPE1", - "TYPE2" - ] + "id": { + "type": "string" } } }, - "ConfigsResponse": { + "V2StageStatus": { "type": "object", "required": [ - "cursor" + "stage", + "instanceID", + "startedAt" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/Cursor" - }, - { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/webhooksConfig" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "data" - ] - } - ] + "stage": { + "type": "number" + }, + "instanceID": { + "type": "string" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" } } }, - "Cursor": { + "V2WorkflowInstance": { "type": "object", "required": [ - "hasMore", - "data" + "workflowID", + "id", + "createdAt", + "updatedAt", + "terminated" ], "properties": { - "hasMore": { - "type": "boolean", - "example": false + "workflowID": { + "type": "string" }, - "data": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "status": { "type": "array", "items": { - "$ref": "#/components/schemas/webhooksConfig" + "$ref": "#/components/schemas/V2StageStatus" } + }, + "terminated": { + "type": "boolean" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "error": { + "type": "string" } } }, - "ConfigResponse": { + "V2WorkflowInstanceHistoryStage": { "type": "object", "required": [ - "data" + "name", + "input", + "startedAt", + "terminated", + "attempt" ], "properties": { - "data": { - "$ref": "#/components/schemas/webhooksConfig" + "name": { + "type": "string" + }, + "input": { + "$ref": "#/components/schemas/V2WorkflowInstanceHistoryStageInput" + }, + "output": { + "$ref": "#/components/schemas/V2WorkflowInstanceHistoryStageOutput" + }, + "error": { + "type": "string" + }, + "terminated": { + "type": "boolean" + }, + "startedAt": { + "type": "string", + "format": "date-time" + }, + "terminatedAt": { + "type": "string", + "format": "date-time" + }, + "lastFailure": { + "type": "string" + }, + "attempt": { + "type": "integer" + }, + "nextExecution": { + "type": "string", + "format": "date-time" } } }, - "webhooksConfig": { + "V2WorkflowInstanceHistory": { + "type": "object", + "required": [ + "name", + "input", + "terminated", + "startedAt" + ], "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "endpoint": { - "type": "string", - "example": "https://example.com" + "name": { + "type": "string" }, - "secret": { - "type": "string", - "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + "input": { + "$ref": "#/components/schemas/V2Stage" }, - "eventTypes": { - "type": "array", - "items": { - "type": "string", - "example": "TYPE1" - }, - "example": [ - "TYPE1", - "TYPE2" - ] + "error": { + "type": "string" }, - "active": { - "type": "boolean", - "example": true + "terminated": { + "type": "boolean" }, - "createdAt": { + "startedAt": { "type": "string", "format": "date-time" }, - "updatedAt": { + "terminatedAt": { "type": "string", "format": "date-time" } - }, - "required": [ - "id", - "endpoint", - "secret", - "eventTypes", - "active", - "createdAt", - "updatedAt" - ] + } }, - "ConfigChangeSecret": { + "V2WorkflowInstanceHistoryList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2WorkflowInstanceHistory" + } + }, + "V2WorkflowInstanceHistoryStageList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2WorkflowInstanceHistoryStage" + } + }, + "V2ListWorkflowsResponse": { "type": "object", "properties": { - "secret": { - "type": "string", - "example": "V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3" + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Workflow" + } + } + } } }, "required": [ - "secret" + "cursor" ] }, - "AttemptResponse": { + "V2TriggerData": { "type": "object", "required": [ - "data" + "event", + "workflowID" ], "properties": { - "data": { - "$ref": "#/components/schemas/Attempt" + "event": { + "type": "string" + }, + "workflowID": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "vars": { + "type": "object", + "additionalProperties": true } } }, - "Attempt": { - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "webhookID": { - "type": "string", - "format": "uuid" - }, - "createdAt": { - "type": "string", - "format": "date-time" + "V2Trigger": { + "allOf": [ + { + "$ref": "#/components/schemas/V2TriggerData" }, - "updatedAt": { + { + "type": "object", + "required": [ + "id", + "createdAt" + ], + "properties": { + "id": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + } + ] + }, + "V2TriggerOccurrence": { + "type": "object", + "required": [ + "triggerID", + "workflowInstanceID", + "workflowInstance", + "date", + "event" + ], + "properties": { + "date": { "type": "string", "format": "date-time" }, - "config": { - "$ref": "#/components/schemas/webhooksConfig" - }, - "payload": { - "type": "string", - "example": "{\"data\":\"test\"}" - }, - "statusCode": { - "type": "integer", - "example": 200 + "workflowInstanceID": { + "type": "string" }, - "retryAttempt": { - "type": "integer", - "example": 1 + "workflowInstance": { + "$ref": "#/components/schemas/V2WorkflowInstance" }, - "status": { - "type": "string", - "example": "success" + "triggerID": { + "type": "string" }, - "nextRetryAfter": { - "type": "string", - "format": "date-time" + "event": { + "type": "object", + "additionalProperties": true + } + } + }, + "V2ListTriggersOccurrencesResponse": { + "type": "object", + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2TriggerOccurrence" + } + } + } } }, "required": [ - "id", - "webhookID", - "createdAt", - "updatedAt", - "config", - "payload", - "statusCode", - "retryAttempt", - "status" + "cursor" + ] + }, + "V2ListTriggersResponse": { + "type": "object", + "properties": { + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2Trigger" + } + } + } + } + }, + "required": [ + "cursor" ] }, - "Monetary": { + "V2ReadWorkflowResponse": { "type": "object", "required": [ - "asset", - "amount" + "data" ], "properties": { - "asset": { - "type": "string", - "description": "The asset of the monetary value." - }, - "amount": { - "type": "integer", - "format": "bigint", - "description": "The amount of the monetary value." + "data": { + "$ref": "#/components/schemas/V2Workflow" } } }, - "Wallet": { + "V2CreateWorkflowRequest": { + "$ref": "#/components/schemas/V2WorkflowConfig" + }, + "V2CreateWorkflowResponse": { "type": "object", "required": [ - "name", - "id", - "metadata", - "createdAt", - "ledger" + "data" ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the wallet." - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Metadata associated with the wallet." - }, - "name": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "ledger": { - "type": "string" + "data": { + "$ref": "#/components/schemas/V2Workflow" } } }, - "WalletWithBalances": { + "V2CreateTriggerResponse": { "type": "object", "required": [ - "name", - "id", - "metadata", - "createdAt", - "balances", - "ledger" + "data" ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the wallet." - }, - "metadata": { - "type": "object", - "description": "Metadata associated with the wallet.", - "additionalProperties": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "balances": { - "type": "object", - "required": [ - "main" - ], - "properties": { - "main": { - "$ref": "#/components/schemas/AssetHolder" - } - } - }, - "ledger": { - "type": "string" + "data": { + "$ref": "#/components/schemas/V2Trigger" } } }, - "Hold": { + "V2RunWorkflowRequest": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "V2RunWorkflowResponse": { "type": "object", "required": [ - "id", - "walletID", - "metadata", - "description" + "data" ], "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "The unique ID of the hold." - }, - "walletID": { - "type": "string", - "description": "The ID of the wallet the hold is associated with." - }, - "metadata": { - "type": "object", - "description": "Metadata associated with the hold.", - "additionalProperties": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "destination": { - "$ref": "#/components/schemas/Subject" + "data": { + "$ref": "#/components/schemas/V2WorkflowInstance" } } }, - "ExpandedDebitHold": { - "allOf": [ - { - "$ref": "#/components/schemas/Hold" - }, - { + "V2ListRunsResponse": { + "type": "object", + "properties": { + "cursor": { "type": "object", "required": [ - "remaining", - "originalAmount" + "pageSize", + "hasMore", + "data" ], "properties": { - "remaining": { + "pageSize": { "type": "integer", - "description": "Remaining amount on hold", - "example": 10, - "format": "bigint" + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 }, - "originalAmount": { - "type": "integer", - "description": "Original amount on hold", - "example": 100, - "format": "bigint" + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/V2WorkflowInstance" + } } } } + }, + "required": [ + "cursor" ] }, - "ListWalletsResponse": { + "V2GetWorkflowResponse": { "type": "object", "required": [ - "cursor" + "data" ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/walletsCursor" - }, - { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Wallet" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "data" - ] - } - ] + "data": { + "$ref": "#/components/schemas/V2Workflow" } } }, - "CreateWalletResponse": { + "V2GetWorkflowInstanceResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/Wallet" + "$ref": "#/components/schemas/V2WorkflowInstance" } } }, - "GetWalletResponse": { + "V2GetWorkflowInstanceHistoryResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/WalletWithBalances" + "$ref": "#/components/schemas/V2WorkflowInstanceHistoryList" } } }, - "DebitWalletResponse": { + "V2GetWorkflowInstanceHistoryStageResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/Hold" + "$ref": "#/components/schemas/V2WorkflowInstanceHistoryStageList" } } }, - "walletsAggregatedVolumes": { + "V2StageSendSourceWallet": { "type": "object", - "x-go-type": { - "type": "AggregatedVolumes" - }, - "additionalProperties": { - "$ref": "#/components/schemas/walletsVolumes" + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "balance": { + "type": "string" + } + } + }, + "V2StageSendDestinationWallet": { + "$ref": "#/components/schemas/V2StageSendSourceWallet" + }, + "V2StageSendSourceAccount": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + }, + "ledger": { + "type": "string" + } + } + }, + "V2StageSendDestinationAccount": { + "$ref": "#/components/schemas/V2StageSendSourceAccount" + }, + "V2StageSendSourcePayment": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "V2StageSendDestinationPayment": { + "type": "object", + "required": [ + "psp" + ], + "properties": { + "psp": { + "type": "string" + } + } + }, + "V2StageSendSource": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/components/schemas/V2StageSendSourceWallet" + }, + "account": { + "$ref": "#/components/schemas/V2StageSendSourceAccount" + }, + "payment": { + "$ref": "#/components/schemas/V2StageSendSourcePayment" + } } }, - "walletsTransaction": { + "V2StageSendDestination": { "type": "object", "properties": { - "ledger": { - "type": "string" + "wallet": { + "$ref": "#/components/schemas/V2StageSendDestinationWallet" }, - "timestamp": { - "type": "string", - "format": "date-time" + "account": { + "$ref": "#/components/schemas/V2StageSendDestinationAccount" }, - "postings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Posting" - } + "payment": { + "$ref": "#/components/schemas/V2StageSendDestinationPayment" + } + } + }, + "V2StageSend": { + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/V2Monetary" }, - "reference": { - "type": "string", - "example": "ref:001" + "destination": { + "$ref": "#/components/schemas/V2StageSendDestination" + }, + "source": { + "$ref": "#/components/schemas/V2StageSendSource" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" - }, - "description": "Metadata associated with the wallet." + } + } + } + }, + "V2StageDelay": { + "type": "object", + "properties": { + "until": { + "type": "string", + "format": "date-time" }, - "id": { - "type": "integer", - "format": "int64", - "minimum": 0 + "duration": { + "type": "string" + } + } + }, + "V2StageWaitEvent": { + "type": "object", + "required": [ + "event" + ], + "properties": { + "event": { + "type": "string" + } + } + }, + "V2Stage": { + "anyOf": [ + { + "$ref": "#/components/schemas/V2StageSend" }, - "preCommitVolumes": { - "$ref": "#/components/schemas/walletsAggregatedVolumes" + { + "$ref": "#/components/schemas/V2StageDelay" }, - "postCommitVolumes": { - "$ref": "#/components/schemas/walletsAggregatedVolumes" + { + "$ref": "#/components/schemas/V2StageWaitEvent" } - }, - "required": [ - "postings", - "timestamp", - "ix", - "metadata" ] }, - "walletsCursor": { + "V2StripeTransferRequest": { "type": "object", - "required": [ - "pageSize" - ], "properties": { - "pageSize": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 1000, - "example": 15 + "connectorID": { + "type": "string" }, - "hasMore": { - "type": "boolean", - "example": false + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 }, - "previous": { + "asset": { "type": "string", - "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + "example": "USD" }, - "next": { + "destination": { "type": "string", - "example": "" + "example": "acct_1Gqj58KZcSIg2N2q" + }, + "waitingValidation": { + "type": "boolean", + "example": false, + "default": false + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a transfer object.\nIt can be useful for storing additional information about the transfer in a structured format.\n", + "example": { + "order_id": "6735" + } } } }, - "GetTransactionsResponse": { + "V2ActivityStripeTransfer": { + "$ref": "#/components/schemas/V2StripeTransferRequest" + }, + "V2ActivityListWallets": { "type": "object", - "required": [ - "cursor" - ], "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/walletsCursor" - }, - { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/walletsTransaction" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "data" - ] - } - ] + "name": { + "type": "string" } } }, - "GetHoldsResponse": { + "V2ActivityListWalletsOutput": { + "$ref": "#/components/schemas/V2ListWalletsResponse" + }, + "V2ListWalletsResponse": { "type": "object", "required": [ "cursor" @@ -7097,13 +14019,13 @@ "cursor": { "allOf": [ { - "$ref": "#/components/schemas/walletsCursor" + "$ref": "#/components/schemas/V2Cursor" }, { "properties": { "data": { "items": { - "$ref": "#/components/schemas/Hold" + "$ref": "#/components/schemas/V2Wallet" }, "type": "array" } @@ -7117,148 +14039,127 @@ } } }, - "GetHoldResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/ExpandedDebitHold" - } - } - }, - "CreateWalletRequest": { + "V2Wallet": { "type": "object", "required": [ "name", - "metadata" + "id", + "metadata", + "createdAt", + "ledger" ], "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." + }, "metadata": { "type": "object", - "description": "Custom metadata to attach to this wallet.", "additionalProperties": { "type": "string" - } + }, + "description": "Metadata associated with the wallet." }, "name": { "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "ledger": { + "type": "string" } } }, - "walletsVolume": { + "V2Cursor": { "type": "object", + "required": [ + "pageSize" + ], "properties": { - "input": { + "pageSize": { "type": "integer", - "format": "bigint" + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 }, - "output": { - "type": "integer", - "format": "bigint" + "hasMore": { + "type": "boolean", + "example": false }, - "balance": { - "type": "integer", - "format": "bigint" + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" } - }, - "required": [ - "input", - "output", - "balance" - ], - "example": { - "input": 100, - "output": 20, - "balance": 80 } }, - "walletsVolumes": { + "V2ActivityGetAccount": { "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/walletsVolume" - }, - "example": { - "USD": { - "input": 100, - "output": 10, - "balance": 90 + "required": [ + "id", + "ledger" + ], + "properties": { + "id": { + "type": "string" }, - "EUR": { - "input": 100, - "output": 10, - "balance": 90 + "ledger": { + "type": "string" } } }, - "ConfirmHoldRequest": { + "V2ActivityCreateTransaction": { "type": "object", "properties": { - "amount": { - "type": "integer", - "format": "bigint", - "example": 100, - "description": "Define the amount to transfer." + "ledger": { + "type": "string" }, - "final": { - "type": "boolean", - "example": true, - "description": "Define a final confirmation. Remaining funds will be returned to the wallet." + "data": { + "$ref": "#/components/schemas/V2PostTransaction" } } }, - "LedgerAccountSubject": { + "V2ActivityGetPayment": { "type": "object", "required": [ - "type", - "identifier" + "id" ], "properties": { - "type": { - "type": "string" - }, - "identifier": { + "id": { "type": "string" } } }, - "WalletSubject": { + "V2ActivityConfirmHold": { "type": "object", "required": [ - "type", - "identifier" + "id" ], "properties": { - "type": { - "type": "string" - }, - "identifier": { - "type": "string" - }, - "balance": { + "id": { "type": "string" } } }, - "Subject": { - "discriminator": { - "propertyName": "type", - "mapping": { - "ACCOUNT": "#/components/schemas/LedgerAccountSubject", - "WALLET": "#/components/schemas/WalletSubject" - } - }, - "oneOf": [ - { - "$ref": "#/components/schemas/LedgerAccountSubject" + "V2ActivityCreditWallet": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - { - "$ref": "#/components/schemas/WalletSubject" + "data": { + "$ref": "#/components/schemas/V2CreditWalletRequest" } - ] + } }, - "CreditWalletRequest": { + "V2CreditWalletRequest": { "type": "object", "required": [ "amount", @@ -7267,7 +14168,7 @@ ], "properties": { "amount": { - "$ref": "#/components/schemas/Monetary" + "$ref": "#/components/schemas/V2Monetary" }, "metadata": { "type": "object", @@ -7282,7 +14183,7 @@ "sources": { "type": "array", "items": { - "$ref": "#/components/schemas/Subject" + "$ref": "#/components/schemas/V2Subject" } }, "balance": { @@ -7301,892 +14202,893 @@ "sources": [] } }, - "DebitWalletRequest": { + "V2LedgerAccountSubject": { "type": "object", "required": [ - "amount", - "metadata" + "type", + "identifier" ], "properties": { - "amount": { - "$ref": "#/components/schemas/Monetary" - }, - "pending": { - "type": "boolean", - "description": "Set to true to create a pending hold. If false, the wallet will be debited immediately." - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Metadata associated with the wallet." - }, - "description": { + "type": { "type": "string" }, - "destination": { - "$ref": "#/components/schemas/Subject" - }, - "balances": { - "type": "array", - "items": { - "type": "string", - "description": "A targeted balance (use '*' for all)" - } - } - }, - "example": { - "amount": { - "asset": "USD/2", - "amount": 100 - }, - "metadata": { - "key": "" - }, - "pending": true - } - }, - "AssetHolder": { - "type": "object", - "required": [ - "assets" - ], - "properties": { - "assets": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" - } + "identifier": { + "type": "string" } } }, - "Balance": { + "V2WalletSubject": { "type": "object", "required": [ - "name" + "type", + "identifier" ], "properties": { - "name": { + "type": { "type": "string" }, - "expiresAt": { - "type": "string", - "format": "date-time" + "identifier": { + "type": "string" }, - "priority": { - "type": "integer", - "format": "bigint" + "balance": { + "type": "string" } } }, - "BalanceWithAssets": { - "allOf": [ + "V2Subject": { + "discriminator": { + "propertyName": "type", + "mapping": { + "ACCOUNT": "#/components/schemas/V2LedgerAccountSubject", + "WALLET": "#/components/schemas/V2WalletSubject" + } + }, + "oneOf": [ { - "$ref": "#/components/schemas/Balance" + "$ref": "#/components/schemas/V2LedgerAccountSubject" }, { - "$ref": "#/components/schemas/AssetHolder" + "$ref": "#/components/schemas/V2WalletSubject" } ] }, - "GetWalletSummaryResponse": { + "V2ActivityDebitWallet": { "type": "object", - "required": [ - "balances", - "availableFunds", - "expiredFunds", - "expirableFunds", - "holdFunds" - ], "properties": { - "balances": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BalanceWithAssets" - } - }, - "availableFunds": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" - } - }, - "expiredFunds": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" - } - }, - "expirableFunds": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" - } + "id": { + "type": "string" }, - "holdFunds": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "bigint" - } - } - } - }, - "ListBalancesResponse": { - "type": "object", - "required": [ - "cursor" - ], - "properties": { - "cursor": { - "allOf": [ - { - "$ref": "#/components/schemas/walletsCursor" - }, - { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Balance" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "data" - ] - } - ] - } - } - }, - "GetBalanceResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/BalanceWithAssets" - } - } - }, - "CreateBalanceRequest": { - "$ref": "#/components/schemas/Balance" - }, - "CreateBalanceResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { "data": { - "$ref": "#/components/schemas/Balance" + "$ref": "#/components/schemas/V2DebitWalletRequest" } } }, - "walletsErrorResponse": { + "V2DebitWalletRequest": { "type": "object", "required": [ - "errorCode", - "errorMessage" + "amount", + "metadata" ], "properties": { - "errorCode": { - "type": "string", - "enum": [ - "VALIDATION", - "INTERNAL_ERROR", - "INSUFFICIENT_FUND", - "HOLD_CLOSED" - ] + "amount": { + "$ref": "#/components/schemas/V2Monetary" }, - "errorMessage": { - "type": "string" - } - } - }, - "Error": { - "type": "object", - "required": [ - "errorCode", - "errorMessage" - ], - "properties": { - "errorCode": { - "type": "string", - "enum": [ - "VALIDATION", - "NOT_FOUND" - ] + "pending": { + "type": "boolean", + "description": "Set to true to create a pending hold. If false, the wallet will be debited immediately." }, - "errorMessage": { - "type": "string" - } - } - }, - "WorkflowConfig": { - "type": "object", - "required": [ - "stages" - ], - "properties": { - "name": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Metadata associated with the wallet." + }, + "description": { "type": "string" }, - "stages": { + "destination": { + "$ref": "#/components/schemas/V2Subject" + }, + "balances": { "type": "array", "items": { - "type": "object", - "additionalProperties": {} + "type": "string", + "description": "A targeted balance (use '*' for all)" } } + }, + "example": { + "amount": { + "asset": "USD/2", + "amount": 100 + }, + "metadata": { + "key": "" + }, + "pending": true } }, - "Workflow": { + "V2ActivityGetWallet": { "type": "object", "required": [ - "config", - "createdAt", - "updatedAt", "id" ], "properties": { - "config": { - "$ref": "#/components/schemas/WorkflowConfig" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, "id": { "type": "string" } } }, - "StageStatus": { + "V2ActivityVoidHold": { "type": "object", "required": [ - "stage", - "instanceID", - "startedAt" + "id" ], "properties": { - "stage": { - "type": "number" - }, - "instanceID": { - "type": "string" - }, - "startedAt": { - "type": "string", - "format": "date-time" - }, - "terminatedAt": { - "type": "string", - "format": "date-time" - }, - "error": { + "id": { "type": "string" } } }, - "WorkflowInstance": { + "V2ActivityGetAccountOutput": { + "$ref": "#/components/schemas/V2AccountResponse" + }, + "V2ActivityCreateTransactionOutput": { + "$ref": "#/components/schemas/orchestrationV2CreateTransactionResponse" + }, + "orchestrationV2CreateTransactionResponse": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/orchestrationV2Transaction" + } + } + }, "type": "object", "required": [ - "workflowID", - "id", - "createdAt", - "updatedAt", - "terminated" - ], + "data" + ] + }, + "orchestrationV2Transaction": { + "type": "object", "properties": { - "workflowID": { - "type": "string" - }, - "id": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { + "timestamp": { "type": "string", "format": "date-time" }, - "status": { + "postings": { "type": "array", "items": { - "$ref": "#/components/schemas/StageStatus" + "$ref": "#/components/schemas/V2Posting" } }, - "terminated": { - "type": "boolean" - }, - "terminatedAt": { + "reference": { "type": "string", - "format": "date-time" + "example": "ref:001" }, - "error": { - "type": "string" + "metadata": { + "$ref": "#/components/schemas/V2Metadata" + }, + "txid": { + "type": "integer", + "format": "bigint", + "minimum": 0 + } + }, + "required": [ + "postings", + "timestamp", + "txid", + "metadata" + ] + }, + "V2ActivityGetPaymentOutput": { + "$ref": "#/components/schemas/V2PaymentResponse" + }, + "V2PaymentResponse": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/V2Payment" } } }, - "WorkflowInstanceHistoryStage": { + "V2Payment": { "type": "object", "required": [ - "name", - "input", - "startedAt", - "terminated", - "attempt" + "id", + "reference", + "connectorID", + "sourceAccountID", + "destinationAccountID", + "type", + "status", + "initialAmount", + "scheme", + "asset", + "createdAt", + "raw", + "adjustments", + "metadata" ], "properties": { - "name": { - "type": "string" - }, - "input": { - "$ref": "#/components/schemas/WorkflowInstanceHistoryStageInput" - }, - "output": { - "$ref": "#/components/schemas/WorkflowInstanceHistoryStageOutput" + "id": { + "type": "string", + "example": "XXX" }, - "error": { + "reference": { "type": "string" }, - "terminated": { - "type": "boolean" - }, - "startedAt": { - "type": "string", - "format": "date-time" + "sourceAccountID": { + "type": "string" }, - "terminatedAt": { - "type": "string", - "format": "date-time" + "destinationAccountID": { + "type": "string" }, - "lastFailure": { + "connectorID": { "type": "string" }, - "attempt": { - "type": "integer" + "provider": { + "$ref": "#/components/schemas/V2Connector" }, - "nextExecution": { + "type": { "type": "string", - "format": "date-time" - } - } - }, - "WorkflowInstanceHistory": { - "type": "object", - "required": [ - "name", - "input", - "terminated", - "startedAt" - ], - "properties": { - "name": { - "type": "string" + "enum": [ + "PAY-IN", + "PAYOUT", + "TRANSFER", + "OTHER" + ] }, - "input": { - "$ref": "#/components/schemas/Stage" + "status": { + "$ref": "#/components/schemas/V2PaymentStatus" }, - "error": { - "type": "string" + "initialAmount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 }, - "terminated": { - "type": "boolean" + "scheme": { + "type": "string", + "enum": [ + "visa", + "mastercard", + "amex", + "diners", + "discover", + "jcb", + "unionpay", + "sepa debit", + "sepa credit", + "sepa", + "apple pay", + "google pay", + "a2a", + "ach debit", + "ach", + "rtp", + "unknown", + "other" + ] }, - "startedAt": { + "asset": { "type": "string", - "format": "date-time" + "example": "USD" }, - "terminatedAt": { + "createdAt": { "type": "string", "format": "date-time" - } - } - }, - "WorkflowInstanceHistoryList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WorkflowInstanceHistory" - } - }, - "WorkflowInstanceHistoryStageList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WorkflowInstanceHistoryStage" - } - }, - "ListWorkflowsResponse": { - "type": "object", - "properties": { - "data": { + }, + "raw": { + "type": "object", + "nullable": true + }, + "adjustments": { + "type": "array", "items": { - "$ref": "#/components/schemas/Workflow" - }, - "type": "array" - } - }, - "required": [ - "data" - ] - }, - "ReadWorkflowResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/V2PaymentAdjustment" + } + }, + "metadata": { + "$ref": "#/components/schemas/V2PaymentMetadata" } } }, - "CreateWorkflowRequest": { - "$ref": "#/components/schemas/WorkflowConfig" + "V2Connector": { + "type": "string", + "enum": [ + "STRIPE", + "DUMMY-PAY", + "WISE", + "MODULR", + "CURRENCY-CLOUD", + "BANKING-CIRCLE", + "MANGOPAY", + "MONEYCORP" + ] }, - "CreateWorkflowResponse": { + "V2PaymentAdjustment": { "type": "object", "required": [ - "data" + "status", + "amount", + "date", + "raw", + "absolute" ], "properties": { - "data": { - "$ref": "#/components/schemas/Workflow" + "status": { + "$ref": "#/components/schemas/V2PaymentStatus" + }, + "amount": { + "type": "integer", + "format": "bigint", + "minimum": 0, + "example": 100 + }, + "date": { + "type": "string", + "format": "date-time" + }, + "raw": { + "type": "object" + }, + "absolute": { + "type": "boolean" } } }, - "RunWorkflowRequest": { - "type": "object", - "additionalProperties": { - "type": "string" - } + "V2PaymentStatus": { + "type": "string", + "enum": [ + "PENDING", + "ACTIVE", + "TERMINATED", + "FAILED", + "SUCCEEDED", + "CANCELLED" + ] }, - "RunWorkflowResponse": { + "V2PaymentMetadata": { "type": "object", - "required": [ - "data" - ], "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowInstance" + "key": { + "type": "string" } - } + }, + "nullable": true }, - "ListRunsResponse": { - "required": [ - "data" - ], - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/WorkflowInstance" - }, - "type": "array" - } - } + "V2ActivityDebitWalletOutput": { + "$ref": "#/components/schemas/V2DebitWalletResponse" }, - "GetWorkflowResponse": { + "V2DebitWalletResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/V2Hold" } } }, - "GetWorkflowInstanceResponse": { + "V2Hold": { "type": "object", "required": [ - "data" + "id", + "walletID", + "metadata", + "description" ], "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowInstance" + "id": { + "type": "string", + "format": "uuid", + "description": "The unique ID of the hold." + }, + "walletID": { + "type": "string", + "description": "The ID of the wallet the hold is associated with." + }, + "metadata": { + "type": "object", + "description": "Metadata associated with the hold.", + "additionalProperties": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "destination": { + "$ref": "#/components/schemas/V2Subject" } } }, - "GetWorkflowInstanceHistoryResponse": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/WorkflowInstanceHistoryList" - } - } + "V2ActivityGetWalletOutput": { + "$ref": "#/components/schemas/V2GetWalletResponse" }, - "GetWorkflowInstanceHistoryStageResponse": { + "V2GetWalletResponse": { "type": "object", "required": [ "data" ], "properties": { "data": { - "$ref": "#/components/schemas/WorkflowInstanceHistoryStageList" + "$ref": "#/components/schemas/V2WalletWithBalances" } } }, - "StageSendSourceWallet": { + "V2WalletWithBalances": { "type": "object", "required": [ - "id" + "name", + "id", + "metadata", + "createdAt", + "balances", + "ledger" ], "properties": { "id": { - "type": "string" + "type": "string", + "format": "uuid", + "description": "The unique ID of the wallet." }, - "balance": { - "type": "string" - } - } - }, - "StageSendDestinationWallet": { - "$ref": "#/components/schemas/StageSendSourceWallet" - }, - "StageSendSourceAccount": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { + "metadata": { + "type": "object", + "description": "Metadata associated with the wallet.", + "additionalProperties": { + "type": "string" + } + }, + "name": { "type": "string" }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "balances": { + "type": "object", + "required": [ + "main" + ], + "properties": { + "main": { + "$ref": "#/components/schemas/V2AssetHolder" + } + } + }, "ledger": { "type": "string" } } }, - "StageSendDestinationAccount": { - "$ref": "#/components/schemas/StageSendSourceAccount" - }, - "StageSendSourcePayment": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - } - } - }, - "StageSendDestinationPayment": { + "V2AssetHolder": { "type": "object", "required": [ - "psp" + "assets" ], "properties": { - "psp": { - "type": "string" + "assets": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } } } }, - "StageSendSource": { + "V2WorkflowInstanceHistoryStageInput": { "type": "object", "properties": { - "wallet": { - "$ref": "#/components/schemas/StageSendSourceWallet" + "GetAccount": { + "$ref": "#/components/schemas/V2ActivityGetAccount" }, - "account": { - "$ref": "#/components/schemas/StageSendSourceAccount" + "CreateTransaction": { + "$ref": "#/components/schemas/V2ActivityCreateTransaction" }, - "payment": { - "$ref": "#/components/schemas/StageSendSourcePayment" - } - } - }, - "StageSendDestination": { - "type": "object", - "properties": { - "wallet": { - "$ref": "#/components/schemas/StageSendDestinationWallet" + "StripeTransfer": { + "$ref": "#/components/schemas/V2ActivityStripeTransfer" }, - "account": { - "$ref": "#/components/schemas/StageSendDestinationAccount" + "GetPayment": { + "$ref": "#/components/schemas/V2ActivityGetPayment" }, - "payment": { - "$ref": "#/components/schemas/StageSendDestinationPayment" - } - } - }, - "StageSend": { - "type": "object", - "properties": { - "amount": { - "$ref": "#/components/schemas/Monetary" + "ConfirmHold": { + "$ref": "#/components/schemas/V2ActivityConfirmHold" + }, + "CreditWallet": { + "$ref": "#/components/schemas/V2ActivityCreditWallet" + }, + "DebitWallet": { + "$ref": "#/components/schemas/V2ActivityDebitWallet" + }, + "GetWallet": { + "$ref": "#/components/schemas/V2ActivityGetWallet" }, - "destination": { - "$ref": "#/components/schemas/StageSendDestination" + "VoidHold": { + "$ref": "#/components/schemas/V2ActivityVoidHold" }, - "source": { - "$ref": "#/components/schemas/StageSendSource" + "ListWallets": { + "$ref": "#/components/schemas/V2ActivityListWallets" } } }, - "StageDelay": { + "V2WorkflowInstanceHistoryStageOutput": { "type": "object", "properties": { - "until": { - "type": "string", - "format": "date-time" + "GetAccount": { + "$ref": "#/components/schemas/V2ActivityGetAccountOutput" }, - "duration": { - "type": "string" + "CreateTransaction": { + "$ref": "#/components/schemas/V2ActivityCreateTransactionOutput" + }, + "GetPayment": { + "$ref": "#/components/schemas/V2ActivityGetPaymentOutput" + }, + "DebitWallet": { + "$ref": "#/components/schemas/V2ActivityDebitWalletOutput" + }, + "GetWallet": { + "$ref": "#/components/schemas/V2ActivityGetWalletOutput" + }, + "ListWallets": { + "$ref": "#/components/schemas/V2ListWalletsResponse" } } }, - "StageWaitEvent": { + "V2Monetary": { "type": "object", "required": [ - "event" + "asset", + "amount" ], "properties": { - "event": { - "type": "string" - } - } - }, - "Stage": { - "anyOf": [ - { - "$ref": "#/components/schemas/StageSend" - }, - { - "$ref": "#/components/schemas/StageDelay" + "asset": { + "type": "string", + "description": "The asset of the monetary value." }, - { - "$ref": "#/components/schemas/StageWaitEvent" - } - ] - }, - "StripeTransferRequest": { - "type": "object", - "properties": { "amount": { "type": "integer", "format": "bigint", - "minimum": 0, - "example": 100 - }, - "asset": { - "type": "string", - "example": "USD" - }, - "destination": { - "type": "string", - "example": "acct_1Gqj58KZcSIg2N2q" - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can attach to a transfer object.\nIt can be useful for storing additional information about the transfer in a structured format.\n", - "example": { - "order_id": "6735" - } + "description": "The amount of the monetary value." } } }, - "ActivityStripeTransfer": { - "$ref": "#/components/schemas/StripeTransferRequest" - }, - "ActivityGetAccount": { + "V2ReadTriggerResponse": { "type": "object", "required": [ - "id", - "ledger" + "data" ], "properties": { - "id": { - "type": "string" - }, - "ledger": { - "type": "string" + "data": { + "$ref": "#/components/schemas/V2Trigger" } } }, - "ActivityCreateTransaction": { + "V2TestTriggerResponse": { "type": "object", + "required": [ + "data" + ], "properties": { - "ledger": { - "type": "string" - }, "data": { - "$ref": "#/components/schemas/PostTransaction" + "$ref": "#/components/schemas/V2TriggerTest" } } }, - "ActivityRevertTransaction": { + "V2TriggerTest": { "type": "object", - "required": [ - "id", - "ledger" - ], "properties": { - "ledger": { - "type": "string" + "filter": { + "type": "object", + "properties": { + "match": { + "type": "boolean" + }, + "error": { + "type": "string" + } + } }, - "id": { - "type": "string" + "variables": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "error": { + "type": "string" + } + } + } } } }, - "ActivityGetPayment": { + "PoliciesCursorResponse": { "type": "object", "required": [ - "id" + "cursor" ], "properties": { - "id": { - "type": "string" + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } } } }, - "ActivityConfirmHold": { + "ReconciliationsCursorResponse": { "type": "object", "required": [ - "id" + "cursor" ], "properties": { - "id": { - "type": "string" + "cursor": { + "type": "object", + "required": [ + "pageSize", + "hasMore", + "data" + ], + "properties": { + "pageSize": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000, + "example": 15 + }, + "hasMore": { + "type": "boolean", + "example": false + }, + "previous": { + "type": "string", + "example": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=" + }, + "next": { + "type": "string", + "example": "" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Reconciliation" + } + } + } } } }, - "ActivityCreditWallet": { + "PolicyRequest": { "type": "object", + "required": [ + "name", + "ledgerName", + "ledgerQuery", + "paymentsPoolID" + ], "properties": { - "id": { - "type": "string" + "name": { + "type": "string", + "example": "XXX" }, - "data": { - "$ref": "#/components/schemas/CreditWalletRequest" + "ledgerName": { + "type": "string", + "example": "default" + }, + "ledgerQuery": { + "type": "object", + "additionalProperties": true + }, + "paymentsPoolID": { + "type": "string", + "example": "XXX" } } }, - "ActivityDebitWallet": { + "PolicyResponse": { "type": "object", + "required": [ + "data" + ], "properties": { - "id": { - "type": "string" - }, "data": { - "$ref": "#/components/schemas/DebitWalletRequest" + "$ref": "#/components/schemas/Policy" } } }, - "ActivityGetWallet": { + "ReconciliationRequest": { "type": "object", "required": [ - "id" + "reconciledAtLedger", + "reconciledAtPayments" ], "properties": { - "id": { - "type": "string" + "reconciledAtLedger": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "reconciledAtPayments": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" } } }, - "ActivityVoidHold": { + "ReconciliationResponse": { "type": "object", "required": [ - "id" + "data" ], "properties": { - "id": { - "type": "string" + "data": { + "$ref": "#/components/schemas/Reconciliation" } } }, - "ActivityGetAccountOutput": { - "$ref": "#/components/schemas/AccountResponse" - }, - "ActivityCreateTransactionOutput": { - "$ref": "#/components/schemas/CreateTransactionResponse" - }, - "ActivityRevertTransactionOutput": { - "$ref": "#/components/schemas/RevertTransactionResponse" - }, - "ActivityGetPaymentOutput": { - "$ref": "#/components/schemas/PaymentResponse" - }, - "ActivityDebitWalletOutput": { - "$ref": "#/components/schemas/DebitWalletResponse" - }, - "ActivityGetWalletOutput": { - "$ref": "#/components/schemas/GetWalletResponse" + "Policy": { + "type": "object", + "required": [ + "id", + "name", + "createdAt", + "ledgerName", + "ledgerQuery", + "paymentsPoolID" + ], + "properties": { + "id": { + "type": "string", + "example": "XXX" + }, + "name": { + "type": "string", + "example": "XXX" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" + }, + "ledgerName": { + "type": "string", + "example": "default" + }, + "ledgerQuery": { + "type": "object", + "additionalProperties": true + }, + "paymentsPoolID": { + "type": "string", + "example": "XXX" + } + } }, - "WorkflowInstanceHistoryStageInput": { + "Reconciliation": { "type": "object", + "required": [ + "id", + "policyID", + "createdAt", + "reconciledAtLedger", + "reconciledAtPayments", + "status", + "paymentsBalances", + "ledgerBalances", + "driftBalances" + ], "properties": { - "GetAccount": { - "$ref": "#/components/schemas/ActivityGetAccount" + "id": { + "type": "string", + "example": "XXX" }, - "CreateTransaction": { - "$ref": "#/components/schemas/ActivityCreateTransaction" + "policyID": { + "type": "string", + "example": "XXX" }, - "RevertTransaction": { - "$ref": "#/components/schemas/ActivityRevertTransaction" + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" }, - "StripeTransfer": { - "$ref": "#/components/schemas/ActivityStripeTransfer" + "reconciledAtLedger": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" }, - "GetPayment": { - "$ref": "#/components/schemas/ActivityGetPayment" + "reconciledAtPayments": { + "type": "string", + "format": "date-time", + "example": "2021-01-01T00:00:00.000Z" }, - "ConfirmHold": { - "$ref": "#/components/schemas/ActivityConfirmHold" + "status": { + "type": "string", + "example": "COMPLETED" }, - "CreditWallet": { - "$ref": "#/components/schemas/ActivityCreditWallet" + "paymentsBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } }, - "DebitWallet": { - "$ref": "#/components/schemas/ActivityDebitWallet" + "ledgerBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } }, - "GetWallet": { - "$ref": "#/components/schemas/ActivityGetWallet" + "driftBalances": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "bigint" + } }, - "VoidHold": { - "$ref": "#/components/schemas/ActivityVoidHold" + "error": { + "type": "string" } } }, - "WorkflowInstanceHistoryStageOutput": { + "reconciliationErrorResponse": { "type": "object", + "required": [ + "errorCode", + "errorMessage" + ], "properties": { - "GetAccount": { - "$ref": "#/components/schemas/ActivityGetAccountOutput" - }, - "CreateTransaction": { - "$ref": "#/components/schemas/ActivityCreateTransactionOutput" - }, - "RevertTransaction": { - "$ref": "#/components/schemas/ActivityRevertTransactionOutput" - }, - "GetPayment": { - "$ref": "#/components/schemas/ActivityGetPaymentOutput" + "errorCode": { + "type": "string", + "example": "VALIDATION" }, - "DebitWallet": { - "$ref": "#/components/schemas/ActivityDebitWalletOutput" + "errorMessage": { + "type": "string" }, - "GetWallet": { - "$ref": "#/components/schemas/ActivityGetWalletOutput" + "details": { + "type": "string" } } } @@ -8237,6 +15139,36 @@ } } }, + "Pools": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolsCursor" + } + } + } + }, + "Pool": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolResponse" + } + } + } + }, + "PoolBalances": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolBalancesResponse" + } + } + } + }, "TransferInitiations": { "description": "OK", "content": { @@ -8287,6 +15219,16 @@ } } }, + "ConnectorInstalled": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConnectorResponse" + } + } + } + }, "Connectors": { "description": "OK", "content": { @@ -8386,6 +15328,66 @@ } } } + }, + "V2ErrorResponse": { + "description": "General error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/V2Error" + } + } + } + }, + "Policies": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoliciesCursorResponse" + } + } + } + }, + "Policy": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResponse" + } + } + } + }, + "Reconciliations": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationsCursorResponse" + } + } + } + }, + "Reconciliation": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationResponse" + } + } + } + }, + "reconciliationErrorResponse": { + "description": "Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/reconciliationErrorResponse" + } + } + } } }, "parameters": { @@ -8455,6 +15457,26 @@ "example": "XXX", "required": true }, + "ConnectorID": { + "name": "connectorId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The connector ID.", + "example": "XXX", + "required": true + }, + "PoolId": { + "name": "poolId", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The pool ID.", + "example": "XXX", + "required": true + }, "TransferId": { "name": "transferId", "in": "path", @@ -8493,6 +15515,38 @@ "type": "string" }, "required": true + }, + "reconciliationPageSize": { + "name": "pageSize", + "in": "query", + "description": "The maximum number of results to return per page.\n", + "example": 100, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 1000 + } + }, + "PolicyID": { + "name": "policyID", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The policy ID.", + "example": "XXX", + "required": true + }, + "ReconciliationID": { + "name": "reconciliationID", + "in": "path", + "schema": { + "type": "string" + }, + "description": "The reconciliation ID.", + "example": "XXX", + "required": true } }, "requestBodies": { @@ -8516,6 +15570,36 @@ } } }, + "Payment": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentRequest" + } + } + } + }, + "Pool": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PoolRequest" + } + } + } + }, + "AddAccountToPool": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddAccountToPoolRequest" + } + } + } + }, "TransferInitiation": { "required": true, "content": { @@ -8555,6 +15639,26 @@ } } } + }, + "Policy": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyRequest" + } + } + } + }, + "Reconciliation": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReconciliationRequest" + } + } + } } } }, @@ -8617,6 +15721,12 @@ "tags": [ "Orchestration" ] + }, + { + "name": "Reconciliation", + "tags": [ + "Reconciliation" + ] } ] }