API Reference
Formance Stack API (v1.0.20230710)
Download OpenAPI specification:Download
Open, modular foundation for unique payments flows
Formance Stack offers one forms of authentication:
- OAuth2 OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.
Response samples
- 200
{- "data": [
- {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
]
}
Create client
Authorizations:
Request Body schema: application/json
public | boolean |
redirectUris | Array of strings |
description | string |
name required | string |
trusted | boolean |
postLogoutRedirectUris | Array of strings |
object (Metadata) |
Responses
Request samples
- Payload
{- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 201
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Response samples
- 200
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Update client
Authorizations:
path Parameters
clientId required | string Client ID |
Request Body schema: application/json
public | boolean |
redirectUris | Array of strings |
description | string |
name required | string |
trusted | boolean |
postLogoutRedirectUris | Array of strings |
object (Metadata) |
Responses
Request samples
- Payload
{- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Add a secret to a client
Authorizations:
path Parameters
clientId required | string Client ID |
Request Body schema: application/json
name required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "name": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "name": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "lastDigits": "string",
- "clear": "string"
}
}
Create scope
Create scope
Authorizations:
Request Body schema: application/json
label required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 201
{- "data": {
- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "transient": [
- "string"
]
}
}
Update scope
Update scope
Authorizations:
path Parameters
scopeId required | string Scope ID |
Request Body schema: application/json
label required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "transient": [
- "string"
]
}
}
Response samples
- 200
{- "data": [
- {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
]
}
Create client
Authorizations:
Request Body schema: application/json
public | boolean |
redirectUris | Array of strings |
description | string |
name required | string |
trusted | boolean |
postLogoutRedirectUris | Array of strings |
object (Metadata) |
Responses
Request samples
- Payload
{- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 201
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Response samples
- 200
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Update client
Authorizations:
path Parameters
clientId required | string Client ID |
Request Body schema: application/json
public | boolean |
redirectUris | Array of strings |
description | string |
name required | string |
trusted | boolean |
postLogoutRedirectUris | Array of strings |
object (Metadata) |
Responses
Request samples
- Payload
{- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "public": true,
- "redirectUris": [
- "string"
], - "description": "string",
- "name": "string",
- "trusted": true,
- "postLogoutRedirectUris": [
- "string"
], - "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "scopes": [
- "string"
], - "secrets": [
- {
- "lastDigits": "string",
- "name": "string",
- "id": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
]
}
}
Add a secret to a client
Authorizations:
path Parameters
clientId required | string Client ID |
Request Body schema: application/json
name required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "name": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "name": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "lastDigits": "string",
- "clear": "string"
}
}
Create scope
Create scope
Authorizations:
Request Body schema: application/json
label required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 201
{- "data": {
- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "transient": [
- "string"
]
}
}
Update scope
Update scope
Authorizations:
path Parameters
scopeId required | string Scope ID |
Request Body schema: application/json
label required | string |
object (Metadata) |
Responses
Request samples
- Payload
{- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}
}
Response samples
- 200
{- "data": {
- "label": "string",
- "metadata": {
- "property1": null,
- "property2": null
}, - "id": "string",
- "transient": [
- "string"
]
}
}
Get information about a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
Responses
Response samples
- 200
- default
{- "data": {
- "name": "ledger001",
- "storage": {
- "migrations": [
- {
- "version": 11,
- "name": "migrations:001",
- "date": "2019-08-24T14:15:22Z",
- "state": "to do"
}
]
}
}
}
Count the accounts from a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:.+ Filter accounts by address pattern (regular expression placed between ^ and $). |
metadata | object Example: Filter accounts by metadata key value pairs. The filter can be used like this metadata[key]=value1&metadata[a.nested.key]=value2 |
Responses
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
List accounts from a ledger
List accounts from a ledger, sorted by address in descending order.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
page_size | integer <int64> [ 1 .. 1000 ] Deprecated Default: 15 Example: page_size=100 The maximum number of results to return per page.
Deprecated, please use |
after | string Example: after=users:003 Pagination cursor, will return accounts after given address, in descending order. |
address | string Example: address=users:.+ Filter accounts by address pattern (regular expression placed between ^ and $). |
metadata | object Example: Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. |
balance | integer <int64> Example: balance=2400 Filter accounts by their balance (default operator is gte) |
balanceOperator | string Enum: "gte" "lte" "gt" "lt" "e" "ne" Example: balanceOperator=gte Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. |
balance_operator | string Deprecated Enum: "gte" "lte" "gt" "lt" "e" "ne" Example: balance_operator=gte Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.
Deprecated, please use |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "address": "users:001",
- "type": "virtual",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
]
}
}
Get account by its address
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
address required | string Example: users:001 Exact address of the account. It must match the following regular expressions pattern:
|
Responses
Response samples
- 200
- default
{- "data": {
- "address": "users:001",
- "type": "virtual",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "volumes": {
- "COIN": {
- "input": 100,
- "output": 0
}
}, - "balances": {
- "COIN": 100
}
}
}
Add metadata to an account
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
address required | string Example: users:001 Exact address of the account. It must match the following regular expressions pattern:
|
Request Body schema: application/jsonrequired
metadata
property name* additional property | any |
Responses
Request samples
- Payload
{- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
Update the mapping of a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
Request Body schema: application/jsonrequired
required | Array of objects (Contract) | ||||
Array
|
Responses
Request samples
- Payload
{- "contracts": [
- {
- "account": "users:001",
- "expr": { }
}
]
}
Response samples
- 200
- default
{- "data": {
- "contracts": [
- {
- "account": "users:001",
- "expr": { }
}
]
}
}
Execute a Numscript Deprecated
This route is deprecated, and has been merged into POST /{ledger}/transactions
.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
preview | boolean Example: preview=true Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. |
Request Body schema: application/jsonrequired
plain required | string |
vars | object |
reference | string Reference to attach to the generated transaction |
object or null (ledgerMetadata) |
Responses
Request samples
- Payload
{- "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
- "vars": {
- "user": "users:042"
}, - "reference": "order_1234",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
Response samples
- 200
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "account had insufficient funds",
- "transaction": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Get statistics from a ledger
Get statistics from a ledger. (aggregate metrics on accounts and transactions)
Authorizations:
path Parameters
ledger required | string Example: ledger001 name of the ledger |
Responses
Response samples
- 200
- default
{- "data": {
- "accounts": 0,
- "transactions": 0
}
}
Count the transactions from a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
reference | string Example: reference=ref:001 Filter transactions by reference field. |
account | string Example: account=users:001 Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). |
source | string Example: source=users:001 Filter transactions with postings involving given account at source (regular expression placed between ^ and $). |
destination | string Example: destination=users:001 Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). |
startTime | string <date-time> Filter transactions that occurred after this timestamp. The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). |
start_time | string <date-time> Deprecated Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use |
endTime | string <date-time> Filter transactions that occurred before this timestamp. The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). |
end_time | string <date-time> Deprecated Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use |
metadata | object Example: Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. |
Responses
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
List transactions from a ledger
List transactions from a ledger, sorted by txid in descending order.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
page_size | integer <int64> [ 1 .. 1000 ] Deprecated Default: 15 Example: page_size=100 The maximum number of results to return per page.
Deprecated, please use |
after | string Example: after=1234 Pagination cursor, will return transactions after given txid (in descending order). |
reference | string Example: reference=ref:001 Find transactions by reference field. |
account | string Example: account=users:001 Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). |
source | string Example: source=users:001 Filter transactions with postings involving given account at source (regular expression placed between ^ and $). |
destination | string Example: destination=users:001 Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). |
startTime | string <date-time> Filter transactions that occurred after this timestamp. The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). |
start_time | string <date-time> Deprecated Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use |
endTime | string <date-time> Filter transactions that occurred before this timestamp. The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). |
end_time | string <date-time> Deprecated Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use |
metadata | object Example: Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
}
Create a new transaction to a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
preview | boolean Example: preview=true Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. |
Request Body schema: application/jsonrequired
The request body must contain at least one of the following objects:
postings
: suitable for simple transactionsscript
: enabling more complex transactions with Numscript
timestamp | string <date-time> |
Array of objects (Posting) | |
object | |
reference | string |
object or null (ledgerMetadata) |
Responses
Request samples
- Payload
{- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "script": {
- "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
- "vars": {
- "user": "users:042"
}
}, - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
Response samples
- 200
- default
{- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
Get transaction from a ledger by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Responses
Response samples
- 200
- default
{- "data": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Set the metadata of a transaction by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Request Body schema: application/json
metadata
property name* additional property | any |
Responses
Request samples
- Payload
{- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
Revert a ledger transaction by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Responses
Response samples
- 200
- default
{- "data": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Create a new batch of transactions to a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
Request Body schema: application/jsonrequired
required | Array of objects (TransactionData) | ||||||||
Array
|
Responses
Request samples
- Payload
{- "transactions": [
- {
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "timestamp": "2019-08-24T14:15:22Z"
}
]
}
Response samples
- 200
- default
{- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
Get the balances from a ledger's account
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:001 Filter balances involving given account, either as source or destination. |
after | string Example: after=users:003 Pagination cursor, will return accounts after given address, in descending order. |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
Deprecated, please use |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "account1": {
- "USD": 100,
- "EUR": 23
}, - "account2": {
- "CAD": 20,
- "JPY": 21
}
}
]
}
}
Get the aggregated balances from selected accounts
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:001 Filter balances involving given account, either as source or destination. |
Responses
Response samples
- 200
- default
{- "data": {
- "USD": 100,
- "EUR": 12
}
}
List the logs from a ledger
List the logs from a ledger, sorted by ID in descending order.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
page_size | integer <int64> [ 1 .. 1000 ] Deprecated Default: 15 Example: page_size=100 The maximum number of results to return per page.
Deprecated, please use |
after | string Example: after=1234 Pagination cursor, will return the logs after a given ID. (in descending order). |
startTime | string <date-time> Filter transactions that occurred after this timestamp. The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). |
start_time | string <date-time> Deprecated Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use |
endTime | string <date-time> Filter transactions that occurred before this timestamp. The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). |
end_time | string <date-time> Deprecated Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "id": 1234,
- "type": "NEW_TRANSACTION",
- "data": { },
- "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
- "date": "2019-08-24T14:15:22Z"
}
]
}
}
Count the accounts from a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:.+ Filter accounts by address pattern (regular expression placed between ^ and $). |
metadata | object Example: Filter accounts by metadata key value pairs. The filter can be used like this metadata[key]=value1&metadata[a.nested.key]=value2 |
Responses
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
List accounts from a ledger
List accounts from a ledger, sorted by address in descending order.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
page_size | integer <int64> [ 1 .. 1000 ] Deprecated Default: 15 Example: page_size=100 The maximum number of results to return per page.
Deprecated, please use |
after | string Example: after=users:003 Pagination cursor, will return accounts after given address, in descending order. |
address | string Example: address=users:.+ Filter accounts by address pattern (regular expression placed between ^ and $). |
metadata | object Example: Filter accounts by metadata key value pairs. Nested objects can be used as seen in the example below. |
balance | integer <int64> Example: balance=2400 Filter accounts by their balance (default operator is gte) |
balanceOperator | string Enum: "gte" "lte" "gt" "lt" "e" "ne" Example: balanceOperator=gte Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not. |
balance_operator | string Deprecated Enum: "gte" "lte" "gt" "lt" "e" "ne" Example: balance_operator=gte Operator used for the filtering of balances can be greater than/equal, less than/equal, greater than, less than, equal or not.
Deprecated, please use |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "address": "users:001",
- "type": "virtual",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
]
}
}
Get account by its address
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
address required | string Example: users:001 Exact address of the account. It must match the following regular expressions pattern:
|
Responses
Response samples
- 200
- default
{- "data": {
- "address": "users:001",
- "type": "virtual",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "volumes": {
- "COIN": {
- "input": 100,
- "output": 0
}
}, - "balances": {
- "COIN": 100
}
}
}
Add metadata to an account
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
address required | string Example: users:001 Exact address of the account. It must match the following regular expressions pattern:
|
Request Body schema: application/jsonrequired
metadata
property name* additional property | any |
Responses
Request samples
- Payload
{- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
Update the mapping of a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
Request Body schema: application/jsonrequired
required | Array of objects (Contract) | ||||
Array
|
Responses
Request samples
- Payload
{- "contracts": [
- {
- "account": "users:001",
- "expr": { }
}
]
}
Response samples
- 200
- default
{- "data": {
- "contracts": [
- {
- "account": "users:001",
- "expr": { }
}
]
}
}
Execute a Numscript Deprecated
This route is deprecated, and has been merged into POST /{ledger}/transactions
.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
preview | boolean Example: preview=true Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. |
Request Body schema: application/jsonrequired
plain required | string |
vars | object |
reference | string Reference to attach to the generated transaction |
object or null (ledgerMetadata) |
Responses
Request samples
- Payload
{- "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
- "vars": {
- "user": "users:042"
}, - "reference": "order_1234",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
Response samples
- 200
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "account had insufficient funds",
- "transaction": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Get statistics from a ledger
Get statistics from a ledger. (aggregate metrics on accounts and transactions)
Authorizations:
path Parameters
ledger required | string Example: ledger001 name of the ledger |
Responses
Response samples
- 200
- default
{- "data": {
- "accounts": 0,
- "transactions": 0
}
}
Count the transactions from a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
reference | string Example: reference=ref:001 Filter transactions by reference field. |
account | string Example: account=users:001 Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). |
source | string Example: source=users:001 Filter transactions with postings involving given account at source (regular expression placed between ^ and $). |
destination | string Example: destination=users:001 Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). |
startTime | string <date-time> Filter transactions that occurred after this timestamp. The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). |
start_time | string <date-time> Deprecated Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use |
endTime | string <date-time> Filter transactions that occurred before this timestamp. The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). |
end_time | string <date-time> Deprecated Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use |
metadata | object Example: Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. |
Responses
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
List transactions from a ledger
List transactions from a ledger, sorted by txid in descending order.
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
page_size | integer <int64> [ 1 .. 1000 ] Deprecated Default: 15 Example: page_size=100 The maximum number of results to return per page.
Deprecated, please use |
after | string Example: after=1234 Pagination cursor, will return transactions after given txid (in descending order). |
reference | string Example: reference=ref:001 Find transactions by reference field. |
account | string Example: account=users:001 Filter transactions with postings involving given account, either as source or destination (regular expression placed between ^ and $). |
source | string Example: source=users:001 Filter transactions with postings involving given account at source (regular expression placed between ^ and $). |
destination | string Example: destination=users:001 Filter transactions with postings involving given account at destination (regular expression placed between ^ and $). |
startTime | string <date-time> Filter transactions that occurred after this timestamp. The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute). |
start_time | string <date-time> Deprecated Filter transactions that occurred after this timestamp.
The format is RFC3339 and is inclusive (for example, "2023-01-02T15:04:01Z" includes the first second of 4th minute).
Deprecated, please use |
endTime | string <date-time> Filter transactions that occurred before this timestamp. The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute). |
end_time | string <date-time> Deprecated Filter transactions that occurred before this timestamp.
The format is RFC3339 and is exclusive (for example, "2023-01-02T15:04:01Z" excludes the first second of 4th minute).
Deprecated, please use |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
Deprecated, please use |
metadata | object Example: Filter transactions by metadata key value pairs. Nested objects can be used as seen in the example below. |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
}
Create a new transaction to a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
preview | boolean Example: preview=true Set the preview mode. Preview mode doesn't add the logs to the database or publish a message to the message broker. |
Request Body schema: application/jsonrequired
The request body must contain at least one of the following objects:
postings
: suitable for simple transactionsscript
: enabling more complex transactions with Numscript
timestamp | string <date-time> |
Array of objects (Posting) | |
object | |
reference | string |
object or null (ledgerMetadata) |
Responses
Request samples
- Payload
{- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "script": {
- "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
- "vars": {
- "user": "users:042"
}
}, - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
}
Response samples
- 200
- default
{- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
Get transaction from a ledger by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Responses
Response samples
- 200
- default
{- "data": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Set the metadata of a transaction by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Request Body schema: application/json
metadata
property name* additional property | any |
Responses
Request samples
- Payload
{- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}
Response samples
- default
{- "errorCode": "INSUFFICIENT_FUND",
- "errorMessage": "[INSUFFICIENT_FUND] account had insufficient funds",
}
Revert a ledger transaction by its ID
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
txid required | integer <int64> >= 0 Example: 1234 Transaction ID. |
Responses
Response samples
- 200
- default
{- "data": {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
}
Create a new batch of transactions to a ledger
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
Request Body schema: application/jsonrequired
required | Array of objects (TransactionData) | ||||||||
Array
|
Responses
Request samples
- Payload
{- "transactions": [
- {
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "timestamp": "2019-08-24T14:15:22Z"
}
]
}
Response samples
- 200
- default
{- "data": [
- {
- "timestamp": "2019-08-24T14:15:22Z",
- "postings": [
- {
- "amount": 100,
- "asset": "COIN",
- "destination": "users:002",
- "source": "users:001"
}
], - "reference": "ref:001",
- "metadata": {
- "admin": true,
- "a": {
- "nested": {
- "key": "value"
}
}
}, - "txid": 0,
- "preCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}, - "postCommitVolumes": {
- "orders:1": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}, - "orders:2": {
- "USD": {
- "input": 100,
- "output": 10,
- "balance": 90
}
}
}
}
]
}
Get the balances from a ledger's account
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:001 Filter balances involving given account, either as source or destination. |
after | string Example: after=users:003 Pagination cursor, will return accounts after given address, in descending order. |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
pagination_token | string Deprecated Example: pagination_token=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
Deprecated, please use |
Responses
Response samples
- 200
- default
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "account1": {
- "USD": 100,
- "EUR": 23
}, - "account2": {
- "CAD": 20,
- "JPY": 21
}
}
]
}
}
Get the aggregated balances from selected accounts
Authorizations:
path Parameters
ledger required | string Example: ledger001 Name of the ledger. |
query Parameters
address | string Example: address=users:001 Filter balances involving given account, either as source or destination. |
Responses
Response samples
- 200
- default
{- "data": {
- "USD": 100,
- "EUR": 12
}
}
List payments
Authorizations:
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
sort | Array of strings Example: sort=date:asc&sort=status:desc Fields used to sort payments (default is date:desc). |
Responses
Response samples
- 200
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "id": "XXX",
- "reference": "string",
- "accountID": "string",
- "type": "PAY-IN",
- "provider": "STRIPE",
- "status": "PENDING",
- "initialAmount": 100,
- "scheme": "visa",
- "asset": "USD",
- "createdAt": "2019-08-24T14:15:22Z",
- "raw": { },
- "adjustments": [
- {
- "status": "PENDING",
- "amount": 100,
- "date": "2019-08-24T14:15:22Z",
- "raw": { },
- "absolute": true
}
], - "metadata": {
- "key": "string"
}
}
]
}
}
Get a payment
Authorizations:
path Parameters
paymentId required | string Example: XXX The payment ID. |
Responses
Response samples
- 200
{- "data": {
- "id": "XXX",
- "reference": "string",
- "accountID": "string",
- "type": "PAY-IN",
- "provider": "STRIPE",
- "status": "PENDING",
- "initialAmount": 100,
- "scheme": "visa",
- "asset": "USD",
- "createdAt": "2019-08-24T14:15:22Z",
- "raw": { },
- "adjustments": [
- {
- "status": "PENDING",
- "amount": 100,
- "date": "2019-08-24T14:15:22Z",
- "raw": { },
- "absolute": true
}
], - "metadata": {
- "key": "string"
}
}
}
List accounts
Authorizations:
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
sort | Array of strings Example: sort=date:asc&sort=status:desc Fields used to sort payments (default is date:desc). |
Responses
Response samples
- 200
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "provider": "STRIPE",
- "reference": "string",
- "type": "TARGET"
}
]
}
}
Install a connector
Install a connector by its name and config.
Authorizations:
path Parameters
connector required | string (Connector) Enum: "STRIPE" "DUMMY-PAY" "WISE" "MODULR" "CURRENCY-CLOUD" "BANKING-CIRCLE" The name of the connector. |
Request Body schema: application/jsonrequired
pollingPeriod | string Default: "120s" The frequency at which the connector will try to fetch new BalanceTransaction objects from Stripe API. |
apiKey required | string |
pageSize | integer <int64> >= 0 Default: 10 Number of BalanceTransaction to fetch at each polling interval. |
Responses
Request samples
- Payload
{- "pollingPeriod": "60s",
- "apiKey": "XXX",
- "pageSize": 50
}
Read the config of a connector
Read connector config
Authorizations:
path Parameters
connector required | string (Connector) Enum: "STRIPE" "DUMMY-PAY" "WISE" "MODULR" "CURRENCY-CLOUD" "BANKING-CIRCLE" The name of the connector. |
Responses
Response samples
- 200
{- "data": {
- "pollingPeriod": "60s",
- "apiKey": "XXX",
- "pageSize": 50
}
}
Reset a connector
Reset a connector by its name. It will remove the connector and ALL PAYMENTS generated with it.
Authorizations:
path Parameters
connector required | string (Connector) Enum: "STRIPE" "DUMMY-PAY" "WISE" "MODULR" "CURRENCY-CLOUD" "BANKING-CIRCLE" The name of the connector. |
Responses
List tasks from a connector
List all tasks associated with this connector.
Authorizations:
path Parameters
connector required | string (Connector) Enum: "STRIPE" "DUMMY-PAY" "WISE" "MODULR" "CURRENCY-CLOUD" "BANKING-CIRCLE" The name of the connector. |
query Parameters
pageSize | integer <int64> [ 1 .. 1000 ] Default: 15 Example: pageSize=100 The maximum number of results to return per page. |
cursor | string Example: cursor=aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ== Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. |
Responses
Response samples
- 200
{- "cursor": {
- "pageSize": 15,
- "hasMore": false,
- "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
- "next": "",
- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connectorId": "7200b21f-cb26-4f4f-9504-421d49021e96",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "PENDING",
- "state": { },
- "error": "string",
- "descriptor": {
- "name": "string",
- "main": true,
- "account": "string"
}
}
]
}
}
Read a specific task of the connector
Get a specific task associated to the connector.
Authorizations:
path Parameters
connector required | string (Connector) Enum: "STRIPE" "DUMMY-PAY" "WISE" "MODULR" "CURRENCY-CLOUD" "BANKING-CIRCLE" The name of the connector. |
taskId required | string Example: task1 The task ID. |
Responses
Response samples
- 200
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connectorId": "7200b21f-cb26-4f4f-9504-421d49021e96",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "PENDING",
- "state": { },
- "error": "string",
- "descriptor":