Authentication
June 9, 2026 · View on GitHub
Ledger API v2
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Authentication
-
oAuth2 authentication.
-
Flow: clientCredentials
-
Token URL = /oauth/token
-
| Scope | Scope Description |
|---|
ledger
Show server information
Code samples
GET http://localhost:8080/_/info HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /_/info
Example responses
200 Response
{
"server": "string",
"version": "string",
"experimentalFeatures": [
"string"
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2ConfigInfo |
| default | Default | Error | V2ErrorResponse |
| 5XX | Unknown | Error | V2ErrorResponse |
Read in memory metrics
Code samples
GET http://localhost:8080/_/metrics HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /_/metrics
Example responses
200 Response
{
"property1": null,
"property2": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » additionalProperties | any | false | none | none |
ledger.v2
List ledgers
Code samples
GET http://localhost:8080/v2 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| includeDeleted | query | boolean | false | If true, include deleted ledgers in the results. By default, deleted ledgers are excluded. |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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.
includeDeleted: If true, include deleted ledgers in the results. By default, deleted ledgers are excluded.
sort: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Example responses
200 Response
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"name": "string",
"addedAt": "2019-08-24T14:15:22Z",
"bucket": "string",
"deletedAt": "2019-08-24T14:15:22Z",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
},
"id": 0
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2LedgerListResponse |
| default | Default | Error | V2ErrorResponse |
Get a ledger
Code samples
GET http://localhost:8080/v2/{ledger} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
Example responses
200 Response
{
"data": {
"name": "string",
"addedAt": "2019-08-24T14:15:22Z",
"bucket": "string",
"deletedAt": "2019-08-24T14:15:22Z",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
},
"id": 0
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2GetLedgerResponse |
| default | Default | Error | V2ErrorResponse |
Create a ledger
Code samples
POST http://localhost:8080/v2/{ledger} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
POST /v2/{ledger}
Body parameter
{
"bucket": "string",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | V2CreateLedgerRequest | true | none |
| ledger | path | string | true | Name of the ledger. |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | OK | None |
| default | Default | Error | V2ErrorResponse |
Insert a schema for a ledger
Code samples
POST http://localhost:8080/v2/{ledger}/schemas/{version} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string
POST /v2/{ledger}/schemas/{version}
Body parameter
{
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Idempotency-Key | header | string | false | Use an idempotency key |
| body | body | V2SchemaData | true | none |
| ledger | path | string | true | Name of the ledger. |
| version | path | string | true | Schema version. |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Schema inserted successfully | None |
| default | Default | Error | V2ErrorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Get a schema for a ledger by version
Code samples
GET http://localhost:8080/v2/{ledger}/schemas/{version} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/schemas/{version}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| version | path | string | true | Schema version. |
Example responses
200 Response
{
"data": {
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Schema retrieved successfully | V2SchemaResponse |
| default | Default | Error | V2ErrorResponse |
List all schemas for a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/schemas HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/schemas
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| cursor | query | string | false | The pagination cursor value |
| pageSize | query | integer | false | The maximum number of results to return per page |
| sort | query | string | false | The field to sort by |
| order | query | string | false | The sort order |
| ledger | path | string | true | Name of the ledger. |
Enumerated Values
| Parameter | Value |
|---|---|
| sort | created_at |
| order | asc |
| order | desc |
Example responses
200 Response
{
"cursor": {
"data": [
{
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
],
"hasMore": true,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"pageSize": 0
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Schemas retrieved successfully | V2SchemasCursorResponse |
| default | Default | Error | V2ErrorResponse |
Update ledger metadata
Code samples
PUT http://localhost:8080/v2/{ledger}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
PUT /v2/{ledger}/metadata
Body parameter
{
"admin": "true"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | V2Metadata | true | none |
| ledger | path | string | true | Name of the ledger. |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | OK | None |
| default | Default | Error | V2ErrorResponse |
| 5XX | Unknown | Error | V2ErrorResponse |
Delete ledger metadata by key
Code samples
DELETE http://localhost:8080/v2/{ledger}/metadata/{key} HTTP/1.1
Host: localhost:8080
Accept: application/json
DELETE /v2/{ledger}/metadata/{key}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| key | path | string | true | Key to remove. |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | OK | None |
| default | Default | Error | V2ErrorResponse |
Get information about a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/_info HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/_info
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
Example responses
200 Response
{
"data": {
"name": "ledger001",
"storage": {
"migrations": [
{
"version": 11,
"name": "migrations:001",
"date": "2019-08-24T14:15:22Z",
"state": "TO DO"
}
]
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2LedgerInfoResponse |
| default | Default | Error | V2ErrorResponse |
Bulk request
Code samples
POST http://localhost:8080/v2/{ledger}/_bulk HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
POST /v2/{ledger}/_bulk
Body parameter
[
{
"action": "string",
"ik": "string",
"data": {
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
}
]
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| continueOnFailure | query | boolean | false | Continue on failure |
| atomic | query | boolean | false | Make bulk atomic |
| parallel | query | boolean | false | Process bulk elements in parallel |
| schemaVersion | query | string | false | Default schema version to use for validation (can be overridden per element) |
| body | body | V2Bulk | true | none |
Example responses
200 Response
{
"data": [
{
"responseType": "string",
"logID": 0,
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
],
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2BulkResponse |
| 400 | Bad Request | OK | V2BulkResponse |
| default | Default | Error | V2ErrorResponse |
Count the accounts from a ledger
Code samples
HEAD http://localhost:8080/v2/{ledger}/accounts HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
HEAD /v2/{ledger}/accounts
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pit | query | string(date-time) | false | none |
| body | body | object | true | none |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | OK | None |
| default | Default | Error | V2ErrorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Count | integer | bigint | none |
List accounts from a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/accounts HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2/{ledger}/accounts
List accounts from a ledger, sorted by address in descending order.
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| expand | query | string | false | none |
| pit | query | string(date-time) | false | none |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Example responses
200 Response
{
"resource": "accounts",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"address": "users:001",
"metadata": {
"admin": "true"
},
"insertionDate": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"firstUsage": "2023-01-01T00:00:00Z",
"volumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
},
"effectiveVolumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2AccountsCursorResponse |
| default | Default | Error | V2ErrorResponse |
Get account by its address
Code samples
GET http://localhost:8080/v2/{ledger}/accounts/{address} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/accounts/{address}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| address | path | string | true | Exact address of the account. It must match the following regular expressions pattern: |
| expand | query | string | false | none |
| pit | query | string(date-time) | false | none |
Detailed descriptions
address: Exact address of the account. It must match the following regular expressions pattern:
^\w+(:\w+)*$
Example responses
200 Response
{
"data": {
"address": "users:001",
"metadata": {
"admin": "true"
},
"insertionDate": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"firstUsage": "2023-01-01T00:00:00Z",
"volumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
},
"effectiveVolumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2AccountResponse |
| default | Default | Error | V2ErrorResponse |
Add metadata to an account
Code samples
POST http://localhost:8080/v2/{ledger}/accounts/{address}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string
POST /v2/{ledger}/accounts/{address}/metadata
Body parameter
{
"admin": "true"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| address | path | string | true | Exact address of the account. It must match the following regular expressions pattern: |
| dryRun | query | boolean | false | Set the dry run mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. |
| Idempotency-Key | header | string | false | Use an idempotency key |
| schemaVersion | query | string | false | Schema version to use for validation |
| body | body | V2Metadata | true | metadata |
Detailed descriptions
address: Exact address of the account. It must match the following regular expressions pattern:
^\w+(:\w+)*$
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | No Content | None |
| default | Default | Error | V2ErrorResponse |
Response Schema
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Delete metadata by key
Code samples
DELETE http://localhost:8080/v2/{ledger}/transactions/{id}/metadata/{key} HTTP/1.1
Host: localhost:8080
Accept: application/json
Idempotency-Key: string
DELETE /v2/{ledger}/transactions/{id}/metadata/{key}
Delete metadata by key
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| id | path | integer(bigint) | true | Transaction ID. |
| key | path | string | true | The key to remove. |
| Idempotency-Key | header | string | false | Use an idempotency key |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Key deleted | None |
| default | Default | Error | V2ErrorResponse |
Response Schema
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Get statistics from a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/stats HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/stats
Get statistics from a ledger. (aggregate metrics on accounts and transactions)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | name of the ledger |
Example responses
200 Response
{
"data": {
"accounts": 0,
"transactions": 0
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2StatsResponse |
| default | Default | Error | V2ErrorResponse |
Count the transactions from a ledger
Code samples
HEAD http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
HEAD /v2/{ledger}/transactions
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pit | query | string(date-time) | false | none |
| body | body | object | true | none |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | OK | None |
| default | Default | Error | V2ErrorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Count | integer | int64 | none |
List transactions from a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2/{ledger}/transactions
List transactions from a ledger, sorted by id in descending order.
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| expand | query | string | false | none |
| pit | query | string(date-time) | false | none |
| order | query | string | false | Deprecated: Use sort param |
| reverse | query | boolean | false | none |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Enumerated Values
| Parameter | Value |
|---|---|
| order | effective |
Example responses
200 Response
{
"resource": "transactions",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2TransactionsCursorResponse |
| default | Default | Error | V2ErrorResponse |
Create a new transaction to a ledger
Code samples
POST http://localhost:8080/v2/{ledger}/transactions HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string
POST /v2/{ledger}/transactions
Body parameter
{
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| dryRun | query | boolean | false | Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker. |
| Idempotency-Key | header | string | false | Use an idempotency key |
| force | query | boolean | false | Disable balance checks when passing postings |
| schemaVersion | query | string | false | Schema version to use for validation |
| body | body | V2PostTransaction | true | The request body must contain at least one of the following objects: |
Detailed descriptions
body: The request body must contain at least one of the following objects:
postings: suitable for simple transactionsscript: enabling more complex transactions with Numscript
Example responses
200 Response
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2CreateTransactionResponse |
| default | Default | Error | V2ErrorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Get transaction from a ledger by its ID
Code samples
GET http://localhost:8080/v2/{ledger}/transactions/{id} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/transactions/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| id | path | integer(bigint) | true | Transaction ID. |
| expand | query | string | false | none |
| pit | query | string(date-time) | false | none |
Example responses
200 Response
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2GetTransactionResponse |
| default | Default | Error | V2ErrorResponse |
Set the metadata of a transaction by its ID
Code samples
POST http://localhost:8080/v2/{ledger}/transactions/{id}/metadata HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string
POST /v2/{ledger}/transactions/{id}/metadata
Body parameter
{
"admin": "true"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| id | path | integer(bigint) | true | Transaction ID. |
| dryRun | query | boolean | false | Set the dryRun mode. Dry run mode doesn't add the logs to the database or publish a message to the message broker. |
| Idempotency-Key | header | string | false | Use an idempotency key |
| schemaVersion | query | string | false | Schema version to use for validation |
| body | body | V2Metadata | true | metadata |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | No Content | None |
| default | Default | Error | V2ErrorResponse |
Response Schema
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 204 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Revert a ledger transaction by its ID
Code samples
POST http://localhost:8080/v2/{ledger}/transactions/{id}/revert HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
Idempotency-Key: string
POST /v2/{ledger}/transactions/{id}/revert
Body parameter
{
"metadata": {
"property1": "string",
"property2": "string"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| id | path | integer(bigint) | true | Transaction ID. |
| force | query | boolean | false | Force revert |
| atEffectiveDate | query | boolean | false | Revert transaction at effective date of the original tx |
| dryRun | query | boolean | false | Set the dryRun mode. dry run mode doesn't add the logs to the database or publish a message to the message broker. |
| schemaVersion | query | string | false | Schema version to use for validation |
| Idempotency-Key | header | string | false | Use an idempotency key |
| body | body | V2RevertTransactionRequest | false | none |
Example responses
201 Response
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | OK | V2CreateTransactionResponse |
| default | Default | Error | V2ErrorResponse |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 201 | Idempotency-Hit | string | Indicates that the request was processed using an idempotency key that was already used |
Get the aggregated balances from selected accounts
Code samples
GET http://localhost:8080/v2/{ledger}/aggregate/balances HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2/{ledger}/aggregate/balances
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pit | query | string(date-time) | false | none |
| useInsertionDate | query | boolean | false | Use insertion date instead of effective date |
| body | body | object | true | none |
Example responses
200 Response
{
"data": {
"USD": 100,
"EUR": 12
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2AggregateBalancesResponse |
| default | Default | Error | V2ErrorResponse |
Get list of volumes with balances for (account/asset)
Code samples
GET http://localhost:8080/v2/{ledger}/volumes HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2/{ledger}/volumes
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| ledger | path | string | true | Name of the ledger. |
| endTime | query | string(date-time) | false | none |
| startTime | query | string(date-time) | false | none |
| insertionDate | query | boolean | false | Use insertion date instead of effective date |
| groupBy | query | integer(int64) | false | Group volumes and balance by the level of the segment of the address |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Example responses
200 Response
{
"resource": "volumes",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"account": "string",
"asset": "string",
"input": 0,
"output": 0,
"balance": 0
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2VolumesWithBalanceCursorResponse |
| default | Default | Error | V2ErrorResponse |
List the logs from a ledger
Code samples
GET http://localhost:8080/v2/{ledger}/logs HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
GET /v2/{ledger}/logs
List the logs from a ledger, sorted by ID in descending order.
Body parameter
{}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| pit | query | string(date-time) | false | none |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Example responses
200 Response
{
"resource": "logs",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"id": 1234,
"type": "NEW_TRANSACTION",
"data": {
"transaction": {
"id": 1234,
"postings": [
{
"source": "world",
"destination": "users:001",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z",
"insertedAt": "2024-01-15T10:30:00Z",
"reverted": false
},
"accountMetadata": {
"users:001": {
"created_by": "system"
}
}
},
"hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
"date": "2019-08-24T14:15:22Z",
"schemaVersion": "v1.0.0"
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | V2LogsCursorResponse |
| default | Default | Error | V2ErrorResponse |
v2ImportLogs
Code samples
POST http://localhost:8080/v2/{ledger}/logs/import HTTP/1.1
Host: localhost:8080
Content-Type: application/octet-stream
Accept: application/json
POST /v2/{ledger}/logs/import
Body parameter
file: string
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| body | body | V2ImportLogsRequest | true | none |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Import OK | None |
| default | Default | Error | V2ErrorResponse |
Export logs
Code samples
POST http://localhost:8080/v2/{ledger}/logs/export HTTP/1.1
Host: localhost:8080
Accept: application/octet-stream
POST /v2/{ledger}/logs/export
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
Example responses
200 Response
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Export OK | string |
| default | Default | Error | V2ErrorResponse |
Run a query template
Code samples
POST http://localhost:8080/v2/{ledger}/queries/{id}/run?schemaVersion=v1.0.0 HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
POST /v2/{ledger}/queries/{id}/run
Run a query template on a ledger
Body parameter
{
"cursor": "string",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": "string",
"property2": "string"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| schemaVersion | query | string | true | Schema version to use for validation |
| id | path | string | true | Query template ID. |
| pageSize | query | integer(int64) | false | The maximum number of results to return per page. |
| cursor | query | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| expand | query | string | false | none |
| pit | query | string(date-time) | false | none |
| order | query | string | false | Deprecated: Use sort param |
| reverse | query | boolean | false | none |
| sort | query | string | false | Sort results using a field name and order (ascending or descending). |
| body | body | object | true | none |
| » cursor | body | string | false | none |
| » params | body | V2QueryParams | false | none |
| »» pageSize | body | integer(int64) | false | The maximum number of results to return per page. |
| »» cursor | body | string | false | Parameter used in pagination requests. Maximum page size is set to 15. |
| »» expand | body | string | false | none |
| »» pit | body | string(date-time) | false | none |
| »» sort | body | string | false | Sort results using a field name and order (ascending or descending). |
| »» anonymous | body | object | false | none |
| »»» resource | body | string | true | none |
| »» anonymous | body | object | false | none |
| »»» resource | body | string | true | none |
| »» anonymous | body | object | false | none |
| »»» resource | body | string | true | none |
| »» anonymous | body | object | false | none |
| »»» resource | body | string | true | none |
| »»» insertionDate | body | boolean | false | none |
| »»» groupBy | body | integer | false | none |
| » vars | body | object | false | none |
| »» additionalProperties | body | string | false | none |
Detailed descriptions
pageSize: The maximum number of results to return per page.
cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
»» cursor: 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: Sort results using a field name and order (ascending or descending).
Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.
Enumerated Values
| Parameter | Value |
|---|---|
| order | effective |
| »»» resource | accounts |
| »»» resource | transactions |
| »»» resource | logs |
| »»» resource | volumes |
Example responses
200 Response
{
"resource": "transactions",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Enumerated Values
| Property | Value |
|---|---|
| resource | transactions |
| resource | accounts |
| resource | logs |
| type | NEW_TRANSACTION |
| type | SET_METADATA |
| type | REVERTED_TRANSACTION |
| type | DELETE_METADATA |
| type | INSERTED_SCHEMA |
| targetType | ACCOUNT |
| targetType | TRANSACTION |
| targetType | ACCOUNT |
| targetType | TRANSACTION |
| runtime | experimental-interpreter |
| runtime | machine |
| resource | transactions |
| resource | accounts |
| resource | logs |
| resource | volumes |
| resource | accounts |
| resource | transactions |
| resource | logs |
| resource | volumes |
| resource | volumes |
List exporters
Code samples
GET http://localhost:8080/v2/_/exporters HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/_/exporters
Example responses
200 Response
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"driver": "string",
"config": {},
"id": "string",
"createdAt": "2019-08-24T14:15:22Z"
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Exporters list | V2ExportersCursorResponse |
| default | Default | Error | V2ErrorResponse |
Create exporter
Code samples
POST http://localhost:8080/v2/_/exporters HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
POST /v2/_/exporters
Body parameter
{
"driver": "string",
"config": {}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | V2ExporterConfiguration | true | none |
Example responses
201 Response
{
"data": {
"driver": "string",
"config": {},
"id": "string",
"createdAt": "2019-08-24T14:15:22Z"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Created exporter | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Status Code 201
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » data | V2Exporter | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | V2ExporterConfiguration | false | none | none |
| »»» driver | string | true | none | none |
| »»» config | object | true | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» id | string | true | none | none |
| »»» createdAt | string(date-time) | true | none | none |
Get exporter state
Code samples
GET http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/_/exporters/{exporterID}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exporterID | path | string | true | The exporter id |
Example responses
200 Response
{
"data": {
"driver": "string",
"config": {},
"id": "string",
"createdAt": "2019-08-24T14:15:22Z"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Exporter information | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » data | V2Exporter | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | V2ExporterConfiguration | false | none | none |
| »»» driver | string | true | none | none |
| »»» config | object | true | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» id | string | true | none | none |
| »»» createdAt | string(date-time) | true | none | none |
Update exporter
Code samples
PUT http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
PUT /v2/_/exporters/{exporterID}
Body parameter
{
"driver": "string",
"config": {}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | V2ExporterConfiguration | true | none |
| exporterID | path | string | true | The exporter id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Exporter updated | None |
| default | Default | Error | V2ErrorResponse |
Delete exporter
Code samples
DELETE http://localhost:8080/v2/_/exporters/{exporterID} HTTP/1.1
Host: localhost:8080
Accept: application/json
DELETE /v2/_/exporters/{exporterID}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exporterID | path | string | true | The exporter id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Exporter deleted | None |
| default | Default | Error | V2ErrorResponse |
Delete bucket
Code samples
DELETE http://localhost:8080/v2/_/buckets/{bucket} HTTP/1.1
Host: localhost:8080
Accept: application/json
DELETE /v2/_/buckets/{bucket}
Delete a bucket by marking all ledgers in the bucket as deleted (soft delete). All ledgers in the bucket will have their deleted_at field set to the current timestamp.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| bucket | path | string | true | The bucket name |
Example responses
404 Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Bucket deleted | None |
| 404 | Not Found | Bucket not found | V2ErrorResponse |
| default | Default | Error | V2ErrorResponse |
Restore bucket
Code samples
POST http://localhost:8080/v2/_/buckets/{bucket}/restore HTTP/1.1
Host: localhost:8080
Accept: application/json
POST /v2/_/buckets/{bucket}/restore
Restore a deleted bucket by unmarking all ledgers in the bucket as deleted. All ledgers in the bucket will have their deleted_at field set to NULL.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| bucket | path | string | true | The bucket name |
Example responses
404 Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Bucket restored | None |
| 404 | Not Found | Bucket not found | V2ErrorResponse |
| default | Default | Error | V2ErrorResponse |
List pipelines
Code samples
GET http://localhost:8080/v2/{ledger}/pipelines HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/pipelines
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
Example responses
200 Response
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"id": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastLogID": 0,
"enabled": true
}
]
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Pipelines list | V2PipelinesCursorResponse |
| default | Default | Error | V2ErrorResponse |
Create pipeline
Code samples
POST http://localhost:8080/v2/{ledger}/pipelines HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: application/json
POST /v2/{ledger}/pipelines
Body parameter
{
"exporterID": "string"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | V2CreatePipelineRequest | false | none |
| ledger | path | string | true | Name of the ledger. |
Example responses
201 Response
{
"data": {
"id": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastLogID": 0,
"enabled": true
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Created ipeline | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Status Code 201
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » data | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» ledger | string | true | none | none |
| »»» exporterID | string | true | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» id | string | true | none | none |
| »»» createdAt | string(date-time) | true | none | none |
| »»» lastLogID | integer | false | none | none |
| »»» enabled | boolean | false | none | none |
Get pipeline state
Code samples
GET http://localhost:8080/v2/{ledger}/pipelines/{pipelineID} HTTP/1.1
Host: localhost:8080
Accept: application/json
GET /v2/{ledger}/pipelines/{pipelineID}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pipelineID | path | string | true | The pipeline id |
Example responses
200 Response
{
"data": {
"id": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastLogID": 0,
"enabled": true
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Pipeline information | Inline |
| default | Default | Error | V2ErrorResponse |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » data | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» ledger | string | true | none | none |
| »»» exporterID | string | true | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| »» anonymous | object | false | none | none |
| »»» id | string | true | none | none |
| »»» createdAt | string(date-time) | true | none | none |
| »»» lastLogID | integer | false | none | none |
| »»» enabled | boolean | false | none | none |
Delete pipeline
Code samples
DELETE http://localhost:8080/v2/{ledger}/pipelines/{pipelineID} HTTP/1.1
Host: localhost:8080
Accept: application/json
DELETE /v2/{ledger}/pipelines/{pipelineID}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pipelineID | path | string | true | The pipeline id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Pipeline deleted | None |
| default | Default | Error | V2ErrorResponse |
Reset pipeline
Code samples
POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/reset HTTP/1.1
Host: localhost:8080
Accept: application/json
POST /v2/{ledger}/pipelines/{pipelineID}/reset
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pipelineID | path | string | true | The pipeline id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 202 | Accepted | Pipeline reset | None |
| default | Default | Error | V2ErrorResponse |
Start pipeline
Code samples
POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/start HTTP/1.1
Host: localhost:8080
Accept: application/json
POST /v2/{ledger}/pipelines/{pipelineID}/start
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pipelineID | path | string | true | The pipeline id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 202 | Accepted | Pipeline started | None |
| default | Default | Error | V2ErrorResponse |
Stop pipeline
Code samples
POST http://localhost:8080/v2/{ledger}/pipelines/{pipelineID}/stop HTTP/1.1
Host: localhost:8080
Accept: application/json
POST /v2/{ledger}/pipelines/{pipelineID}/stop
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| ledger | path | string | true | Name of the ledger. |
| pipelineID | path | string | true | The pipeline id |
Example responses
default Response
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 202 | Accepted | Pipeline stopped | None |
| default | Default | Error | V2ErrorResponse |
Schemas
V2ExportersCursorResponse
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"driver": "string",
"config": {},
"id": "string",
"createdAt": "2019-08-24T14:15:22Z"
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Exporter] | true | none | none |
V2PipelinesCursorResponse
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"id": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastLogID": 0,
"enabled": true
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Pipeline] | true | none | none |
V2AccountsCursorResponse
{
"resource": "accounts",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"address": "users:001",
"metadata": {
"admin": "true"
},
"insertionDate": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"firstUsage": "2023-01-01T00:00:00Z",
"volumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
},
"effectiveVolumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resource | string | false | none | none |
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Account] | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| resource | accounts |
V2TransactionsCursorResponse
{
"resource": "transactions",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resource | string | false | none | none |
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Transaction] | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| resource | transactions |
V2LogsCursorResponse
{
"resource": "logs",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"id": 1234,
"type": "NEW_TRANSACTION",
"data": {
"transaction": {
"id": 1234,
"postings": [
{
"source": "world",
"destination": "users:001",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z",
"insertedAt": "2024-01-15T10:30:00Z",
"reverted": false
},
"accountMetadata": {
"users:001": {
"created_by": "system"
}
}
},
"hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
"date": "2019-08-24T14:15:22Z",
"schemaVersion": "v1.0.0"
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resource | string | false | none | none |
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Log] | true | none | [Represents an immutable log entry in the ledger. Each log captures an atomic operation with its full payload, enabling audit trails and event sourcing patterns. The data field structure depends on the log type. ] |
Enumerated Values
| Property | Value |
|---|---|
| resource | logs |
V2AccountResponse
{
"data": {
"address": "users:001",
"metadata": {
"admin": "true"
},
"insertionDate": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"firstUsage": "2023-01-01T00:00:00Z",
"volumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
},
"effectiveVolumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Account | true | none | none |
V2AggregateBalancesResponse
{
"data": {
"USD": 100,
"EUR": 12
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2AssetsBalances | true | none | none |
V2VolumesWithBalanceCursorResponse
{
"resource": "volumes",
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"account": "string",
"asset": "string",
"input": 0,
"output": 0,
"balance": 0
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| resource | string | false | none | none |
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2VolumesWithBalance] | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| resource | volumes |
V2VolumesWithBalance
{
"account": "string",
"asset": "string",
"input": 0,
"output": 0,
"balance": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| account | string | true | none | none |
| asset | string | true | none | none |
| input | integer(bigint) | true | none | none |
| output | integer(bigint) | true | none | none |
| balance | integer(bigint) | true | none | none |
V2Metadata
{
"admin": "true"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | string | false | none | none |
V2ConfigInfo
{
"server": "string",
"version": "string",
"experimentalFeatures": [
"string"
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| server | string | true | none | none |
| version | string | true | none | none |
| experimentalFeatures | [string] | false | none | none |
V2Account
{
"address": "users:001",
"metadata": {
"admin": "true"
},
"insertionDate": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"firstUsage": "2023-01-01T00:00:00Z",
"volumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
},
"effectiveVolumes": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| address | string | true | none | none |
| metadata | object | true | none | none |
| » additionalProperties | string | false | none | none |
| insertionDate | string(date-time) | false | none | none |
| updatedAt | string(date-time) | false | none | none |
| firstUsage | string(date-time) | false | none | none |
| volumes | V2Volumes | false | none | none |
| effectiveVolumes | V2Volumes | false | none | none |
V2AssetsBalances
{
"USD": 100,
"EUR": 12
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | integer(bigint) | false | none | none |
V2Posting
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| amount | integer(bigint) | true | none | none |
| asset | string | true | none | none |
| destination | string | true | none | none |
| source | string | true | none | none |
V2Transaction
{
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| insertedAt | string(date-time) | false | none | none |
| updatedAt | string(date-time) | false | none | none |
| timestamp | string(date-time) | true | none | none |
| postings | [V2Posting] | true | none | none |
| reference | string | false | none | none |
| metadata | V2Metadata | true | none | none |
| id | integer(bigint) | true | none | none |
| reverted | boolean | true | none | none |
| revertedAt | string(date-time) | false | none | none |
| preCommitVolumes | V2AggregatedVolumes | false | none | none |
| postCommitVolumes | V2AggregatedVolumes | false | none | none |
| preCommitEffectiveVolumes | V2AggregatedVolumes | false | none | none |
| postCommitEffectiveVolumes | V2AggregatedVolumes | false | none | none |
| template | string | false | none | none |
V2PostTransaction
{
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | string(date-time) | false | none | none |
| postings | [V2Posting] | false | none | none |
| script | object | false | none | none |
| » template | string | false | none | none |
| » plain | string | false | none | none |
| » vars | object | false | none | none |
| »» additionalProperties | string | false | none | none |
| runtime | Runtime | false | none | The numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed. |
| reference | string | false | none | none |
| metadata | V2Metadata | true | none | none |
| accountMetadata | object | false | none | none |
| » additionalProperties | V2Metadata | false | none | none |
| force | boolean | false | none | none |
V2Stats
{
"accounts": 0,
"transactions": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| accounts | integer(int64) | true | none | none |
| transactions | integer(bigint) | true | none | none |
V2Log
{
"id": 1234,
"type": "NEW_TRANSACTION",
"data": {
"transaction": {
"id": 1234,
"postings": [
{
"source": "world",
"destination": "users:001",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z",
"insertedAt": "2024-01-15T10:30:00Z",
"reverted": false
},
"accountMetadata": {
"users:001": {
"created_by": "system"
}
}
},
"hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e",
"date": "2019-08-24T14:15:22Z",
"schemaVersion": "v1.0.0"
}
Represents an immutable log entry in the ledger. Each log captures an atomic operation with its full payload, enabling audit trails and event sourcing patterns. The data field structure depends on the log type.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | integer(bigint) | true | none | Unique sequential identifier for this log entry within the ledger |
| type | string | true | none | The type of operation this log represents |
| data | any | true | none | The payload of the log entry. Structure depends on the log type: - NEW_TRANSACTION: V2LogDataNewTransaction - SET_METADATA: V2LogDataSetMetadata - REVERTED_TRANSACTION: V2LogDataRevertedTransaction - DELETE_METADATA: V2LogDataDeleteMetadata - INSERTED_SCHEMA: V2LogDataInsertedSchema |
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | V2LogDataNewTransaction | false | none | Payload for NEW_TRANSACTION log entries. Contains the created transaction and any account metadata set during creation. |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | V2LogDataSetMetadata | false | none | Payload for SET_METADATA log entries. Contains the target entity and the metadata that was set. |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | V2LogDataRevertedTransaction | false | none | Payload for REVERTED_TRANSACTION log entries. Contains both the original reverted transaction and the new reverting transaction. |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | V2LogDataDeleteMetadata | false | none | Payload for DELETE_METADATA log entries. Contains the target entity and the metadata key that was deleted. |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | V2LogDataInsertedSchema | false | none | Payload for INSERTED_SCHEMA log entries. Contains the schema that was inserted into the ledger. |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| hash | string | true | none | SHA256 hash of the log entry, chained from the previous log for integrity verification |
| date | string(date-time) | true | none | Timestamp when the operation was recorded |
| schemaVersion | string | false | none | Schema version used for validation when the log was created |
Enumerated Values
| Property | Value |
|---|---|
| type | NEW_TRANSACTION |
| type | SET_METADATA |
| type | REVERTED_TRANSACTION |
| type | DELETE_METADATA |
| type | INSERTED_SCHEMA |
V2LogTransaction
{
"id": 0,
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"metadata": {
"admin": "true"
},
"timestamp": "2019-08-24T14:15:22Z",
"reference": "string",
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"revertedAt": "2019-08-24T14:15:22Z",
"reverted": true,
"template": "string",
"postCommitVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"preCommitVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
}
Transaction structure as it appears in log payloads
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | integer(bigint) | true | none | none |
| postings | [V2Posting] | true | none | none |
| metadata | V2Metadata | true | none | none |
| timestamp | string(date-time) | true | none | none |
| reference | string | false | none | none |
| insertedAt | string(date-time) | false | none | none |
| updatedAt | string(date-time) | false | none | none |
| revertedAt | string(date-time) | false | none | none |
| reverted | boolean | true | none | Indicates if the transaction has been reverted |
| template | string | false | none | Transaction template used |
| postCommitVolumes | V2AggregatedVolumes | false | none | none |
| postCommitEffectiveVolumes | V2AggregatedVolumes | false | none | none |
| preCommitVolumes | V2AggregatedVolumes | false | none | none |
| preCommitEffectiveVolumes | V2AggregatedVolumes | false | none | none |
V2LogDataNewTransaction
{
"transaction": {
"id": 1234,
"postings": [
{
"source": "world",
"destination": "users:001",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z",
"insertedAt": "2024-01-15T10:30:00Z",
"reverted": false
},
"accountMetadata": {
"users:001": {
"created_by": "system"
}
}
}
Payload for NEW_TRANSACTION log entries. Contains the created transaction and any account metadata set during creation.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| transaction | V2LogTransaction | true | none | Transaction structure as it appears in log payloads |
| accountMetadata | object | true | none | Metadata applied to accounts involved in the transaction |
| » additionalProperties | V2Metadata | false | none | none |
V2LogDataSetMetadata
{
"targetType": "ACCOUNT",
"targetId": "users:001",
"metadata": {
"status": "active",
"tier": "premium"
}
}
Payload for SET_METADATA log entries. Contains the target entity and the metadata that was set.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| targetType | string | true | none | Type of the target entity |
| targetId | any | true | none | none |
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | Account address (when targetType is ACCOUNT) |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer(bigint) | false | none | Transaction ID (when targetType is TRANSACTION) |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| metadata | V2Metadata | true | none | none |
Enumerated Values
| Property | Value |
|---|---|
| targetType | ACCOUNT |
| targetType | TRANSACTION |
V2LogDataRevertedTransaction
{
"revertedTransaction": {
"id": 1234,
"postings": [
{
"source": "world",
"destination": "users:001",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {},
"timestamp": "2024-01-15T10:30:00Z",
"reverted": true
},
"transaction": {
"id": 1235,
"postings": [
{
"source": "users:001",
"destination": "world",
"amount": 100,
"asset": "USD/2"
}
],
"metadata": {
"revert": "1234"
},
"timestamp": "2024-01-15T11:00:00Z",
"reverted": false
}
}
Payload for REVERTED_TRANSACTION log entries. Contains both the original reverted transaction and the new reverting transaction.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| revertedTransaction | V2LogTransaction | true | none | The original transaction that was reverted |
| transaction | V2LogTransaction | true | none | The new reverting transaction created to cancel the original |
V2LogDataDeleteMetadata
{
"targetType": "ACCOUNT",
"targetId": "users:001",
"key": "temporary_flag"
}
Payload for DELETE_METADATA log entries. Contains the target entity and the metadata key that was deleted.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| targetType | string | true | none | Type of the target entity |
| targetId | any | true | none | none |
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | Account address (when targetType is ACCOUNT) |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer(bigint) | false | none | Transaction ID (when targetType is TRANSACTION) |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| key | string | true | none | The metadata key that was deleted |
Enumerated Values
| Property | Value |
|---|---|
| targetType | ACCOUNT |
| targetType | TRANSACTION |
V2LogDataInsertedSchema
{
"schema": {
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
}
Payload for INSERTED_SCHEMA log entries. Contains the schema that was inserted into the ledger.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| schema | V2Schema | true | none | Complete schema structure with metadata |
V2CreateTransactionResponse
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Transaction | true | none | none |
V2RevertTransactionResponse
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
None
V2GetTransactionResponse
{
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Transaction | true | none | none |
V2StatsResponse
{
"data": {
"accounts": 0,
"transactions": 0
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Stats | true | none | none |
V2ConfigInfoResponse
{
"server": "string",
"version": "string",
"experimentalFeatures": [
"string"
]
}
Properties
None
V2Volume
{
"input": 100,
"output": 20,
"balance": 80
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| input | integer(bigint) | true | none | none |
| output | integer(bigint) | true | none | none |
| balance | integer(bigint) | false | none | none |
V2Volumes
{
"USD": {
"input": 100,
"output": 10,
"balance": 90
},
"EUR": {
"input": 100,
"output": 10,
"balance": 90
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2Volume | false | none | none |
V2AggregatedVolumes
{
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2Volumes | false | none | none |
V2ErrorResponse
{
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param",
"details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| errorCode | V2ErrorsEnum | true | none | none |
| errorMessage | string | true | none | none |
| details | string | false | none | none |
V2ErrorsEnum
"VALIDATION"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | INTERNAL |
| anonymous | INSUFFICIENT_FUND |
| anonymous | VALIDATION |
| anonymous | CONFLICT |
| anonymous | COMPILATION_FAILED |
| anonymous | METADATA_OVERRIDE |
| anonymous | NOT_FOUND |
| anonymous | REVERT_OCCURRING |
| anonymous | ALREADY_REVERT |
| anonymous | NO_POSTINGS |
| anonymous | LEDGER_NOT_FOUND |
| anonymous | IMPORT |
| anonymous | TIMEOUT |
| anonymous | BULK_SIZE_EXCEEDED |
| anonymous | INTERPRETER_PARSE |
| anonymous | INTERPRETER_RUNTIME |
| anonymous | LEDGER_ALREADY_EXISTS |
| anonymous | SCHEMA_ALREADY_EXISTS |
| anonymous | SCHEMA_NOT_SPECIFIED |
| anonymous | OUTDATED_SCHEMA |
V2LedgerInfoResponse
{
"data": {
"name": "ledger001",
"storage": {
"migrations": [
{
"version": 11,
"name": "migrations:001",
"date": "2019-08-24T14:15:22Z",
"state": "TO DO"
}
]
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2LedgerInfo | false | none | none |
V2LedgerInfo
{
"name": "ledger001",
"storage": {
"migrations": [
{
"version": 11,
"name": "migrations:001",
"date": "2019-08-24T14:15:22Z",
"state": "TO DO"
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | none |
| storage | object | false | none | none |
| » migrations | [V2MigrationInfo] | false | none | none |
V2MigrationInfo
{
"version": 11,
"name": "migrations:001",
"date": "2019-08-24T14:15:22Z",
"state": "TO DO"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| version | string | false | none | none |
| name | string | false | none | none |
| date | string(date-time) | false | none | none |
| state | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| state | TO DO |
| state | DONE |
| state | PROGRESS |
V2Bulk
[
{
"action": "string",
"ik": "string",
"data": {
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [V2BulkElement] | false | none | none |
V2BaseBulkElement
{
"action": "string",
"ik": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| action | string | true | none | none |
| ik | string | false | none | none |
V2BulkElement
{
"action": "string",
"ik": "string",
"data": {
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementCreateTransaction | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementAddMetadata | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementRevertTransaction | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementDeleteMetadata | false | none | none |
V2BulkElementCreateTransaction
{
"action": "string",
"ik": "string",
"data": {
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"script": {
"template": "CUSTOMER_DEPOSIT",
"plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n",
"vars": {
"user": "users:042"
}
},
"runtime": "experimental-interpreter",
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"accountMetadata": {
"property1": {
"admin": "true"
},
"property2": {
"admin": "true"
}
},
"force": true
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElement | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | V2PostTransaction | false | none | none |
V2TargetId
"string"
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | integer(bigint) | false | none | none |
V2TargetType
"TRANSACTION"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | TRANSACTION |
| anonymous | ACCOUNT |
V2BulkElementAddMetadata
{
"action": "string",
"ik": "string",
"data": {
"targetId": "string",
"targetType": "TRANSACTION",
"metadata": {
"property1": "string",
"property2": "string"
}
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElement | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | object | false | none | none |
| »» targetId | V2TargetId | true | none | none |
| »» targetType | V2TargetType | true | none | none |
| »» metadata | object | true | none | none |
| »»» additionalProperties | string | false | none | none |
V2BulkElementRevertTransaction
{
"action": "string",
"ik": "string",
"data": {
"id": 0,
"force": true,
"atEffectiveDate": true,
"metadata": {
"admin": "true"
}
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElement | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | object | false | none | none |
| »» id | integer(bigint) | true | none | none |
| »» force | boolean | false | none | none |
| »» atEffectiveDate | boolean | false | none | none |
| »» metadata | V2Metadata | false | none | none |
V2BulkElementDeleteMetadata
{
"action": "string",
"ik": "string",
"data": {
"targetId": "string",
"targetType": "TRANSACTION",
"key": "string"
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElement | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | object | false | none | none |
| »» targetId | V2TargetId | true | none | none |
| »» targetType | V2TargetType | true | none | none |
| »» key | string | true | none | none |
V2BulkResponse
{
"data": [
{
"responseType": "string",
"logID": 0,
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
],
"errorCode": "VALIDATION",
"errorMessage": "[VALIDATION] invalid 'cursor' query param"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | [V2BulkElementResult] | false | none | none |
| errorCode | V2ErrorsEnum | false | none | none |
| errorMessage | string | false | none | none |
V2BulkElementResult
{
"responseType": "string",
"logID": 0,
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementResultCreateTransaction | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementResultAddMetadata | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementResultRevertTransaction | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementResultDeleteMetadata | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BulkElementResultError | false | none | none |
V2BaseBulkElementResult
{
"responseType": "string",
"logID": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| responseType | string | true | none | none |
| logID | integer | true | none | none |
V2BulkElementResultCreateTransaction
{
"responseType": "string",
"logID": 0,
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElementResult | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | V2Transaction | true | none | none |
V2BulkElementResultAddMetadata
{
"responseType": "string",
"logID": 0
}
Properties
None
V2BulkElementResultRevertTransaction
{
"responseType": "string",
"logID": 0,
"data": {
"insertedAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"timestamp": "2019-08-24T14:15:22Z",
"postings": [
{
"amount": 100,
"asset": "COIN",
"destination": "users:002",
"source": "users:001"
}
],
"reference": "ref:001",
"metadata": {
"admin": "true"
},
"id": 0,
"reverted": true,
"revertedAt": "2019-08-24T14:15:22Z",
"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
}
}
},
"preCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"postCommitEffectiveVolumes": {
"orders:1": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
},
"orders:2": {
"USD": {
"input": 100,
"output": 10,
"balance": 90
}
}
},
"template": "string"
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElementResult | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » data | V2Transaction | true | none | none |
V2BulkElementResultDeleteMetadata
{
"responseType": "string",
"logID": 0
}
Properties
None
V2BulkElementResultError
{
"responseType": "string",
"logID": 0,
"errorCode": "string",
"errorDescription": "string",
"errorDetails": "string"
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2BaseBulkElementResult | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » errorCode | string | true | none | none |
| » errorDescription | string | true | none | none |
| » errorDetails | string | false | none | none |
V2ChartAccountRules
{}
Properties
None
V2ChartAccountMetadata
{
"default": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| default | string | false | none | none |
V2ChartSegment
{
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
}
Segment within a chart of accounts
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2ChartSegment | false | none | Segment within a chart of accounts |
| .self | object | false | none | none |
| .pattern | string | false | none | none |
| .rules | V2ChartAccountRules | false | none | none |
| .metadata | object | false | none | none |
| » additionalProperties | V2ChartAccountMetadata | false | none | none |
V2ChartOfAccounts
{
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
}
Chart of account
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2ChartSegment | false | none | Segment within a chart of accounts |
Runtime
"experimental-interpreter"
The numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | experimental-interpreter |
| anonymous | machine |
V2TransactionTemplate
{
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | string | false | none | none |
| script | string | true | none | none |
| runtime | Runtime | false | none | The numscript runtime used to execute the script. Uses "machine" by default, unless the "--experimental-numscript-interpreter" feature flag is passed. |
V2TransactionTemplates
{
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
}
Transaction templates
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2TransactionTemplate | false | none | none |
V2QueryTemplateVar
{
"type": "string",
"default": null
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| type | string | true | none | none |
| default | any | false | none | none |
V2QueryResource
"transactions"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | transactions |
| anonymous | accounts |
| anonymous | logs |
| anonymous | volumes |
V2QueryParams
{
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| pageSize | integer(int64) | false | none | The maximum number of results to return per page. |
| cursor | string | false | none | 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. |
| expand | string | false | none | none |
| pit | string(date-time) | false | none | none |
| sort | string | false | none | Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc. |
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » resource | string | true | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » resource | string | true | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » resource | string | true | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » resource | string | true | none | none |
| » insertionDate | boolean | false | none | none |
| » groupBy | integer | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| resource | accounts |
| resource | transactions |
| resource | logs |
| resource | volumes |
V2QueryTemplate
{
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | string | false | none | none |
| resource | V2QueryResource | false | none | none |
| params | V2QueryParams | false | none | none |
| vars | object | false | none | none |
| » additionalProperties | V2QueryTemplateVar | false | none | none |
| body | object | false | none | none |
V2QueryTemplates
{
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
Query templates
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| additionalProperties | V2QueryTemplate | false | none | none |
V2SchemaData
{
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
Schema data structure for ledger schemas
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| chart | V2ChartOfAccounts | true | none | Chart of account |
| transactions | V2TransactionTemplates | false | none | Transaction templates |
| queries | V2QueryTemplates | false | none | Query templates |
V2Schema
{
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
Complete schema structure with metadata
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » version | string | true | none | Schema version |
| » createdAt | string(date-time) | true | none | Schema creation timestamp |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2SchemaData | false | none | Schema data structure for ledger schemas |
V2SchemaResponse
{
"data": {
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Schema | true | none | Complete schema structure with metadata |
V2SchemasCursorResponse
{
"cursor": {
"data": [
{
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
],
"hasMore": true,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"pageSize": 0
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| cursor | V2SchemasCursor | true | none | none |
V2SchemasCursor
{
"data": [
{
"version": "v1.0.0",
"createdAt": "2023-01-01T00:00:00Z",
"chart": {
"users": {
"$userID": {
".pattern": "^[0-9]{16}$"
}
}
},
"transactions": {
"property1": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
},
"property2": {
"description": "string",
"script": "string",
"runtime": "experimental-interpreter"
}
},
"queries": {
"property1": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
},
"property2": {
"description": "string",
"resource": "transactions",
"params": {
"pageSize": 100,
"cursor": "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
"expand": "string",
"pit": "2019-08-24T14:15:22Z",
"sort": "id:desc",
"resource": "accounts"
},
"vars": {
"property1": {
"type": "string",
"default": null
},
"property2": {
"type": "string",
"default": null
}
},
"body": {}
}
}
}
],
"hasMore": true,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"pageSize": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | [V2Schema] | true | none | [Complete schema structure with metadata] |
| hasMore | boolean | true | none | none |
| previous | string | false | none | none |
| next | string | false | none | none |
| pageSize | integer | true | none | none |
V2CreateLedgerRequest
{
"bucket": "string",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| bucket | string | false | none | none |
| metadata | V2Metadata | false | none | none |
| features | object | false | none | none |
| » additionalProperties | string | false | none | none |
V2Ledger
{
"name": "string",
"addedAt": "2019-08-24T14:15:22Z",
"bucket": "string",
"deletedAt": "2019-08-24T14:15:22Z",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
},
"id": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | true | none | none |
| addedAt | string(date-time) | true | none | none |
| bucket | string | true | none | none |
| deletedAt | string(date-time)¦null | false | none | none |
| metadata | V2Metadata | false | none | none |
| features | object | false | none | none |
| » additionalProperties | string | false | none | none |
| id | integer | false | none | none |
V2LedgerListResponse
{
"cursor": {
"pageSize": 15,
"hasMore": false,
"previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
"next": "aW0gdmVuaWFtLCBxdWlzIG5vc3RydWQ=",
"data": [
{
"name": "string",
"addedAt": "2019-08-24T14:15:22Z",
"bucket": "string",
"deletedAt": "2019-08-24T14:15:22Z",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
},
"id": 0
}
]
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| cursor | object | true | none | none |
| » pageSize | integer(int64) | true | none | none |
| » hasMore | boolean | true | none | none |
| » previous | string | false | none | none |
| » next | string | false | none | none |
| » data | [V2Ledger] | true | none | none |
V2UpdateLedgerMetadataRequest
{
"admin": "true"
}
Properties
None
V2GetLedgerResponse
{
"data": {
"name": "string",
"addedAt": "2019-08-24T14:15:22Z",
"bucket": "string",
"deletedAt": "2019-08-24T14:15:22Z",
"metadata": {
"admin": "true"
},
"features": {
"property1": "string",
"property2": "string"
},
"id": 0
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | V2Ledger | true | none | none |
V2ImportLogsRequest
{
"file": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| file | string(binary) | true | none | none |
V2RevertTransactionRequest
{
"metadata": {
"property1": "string",
"property2": "string"
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| metadata | object | false | none | none |
| » additionalProperties | string | false | none | none |
V2CreatePipelineRequest
{
"exporterID": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| exporterID | string | true | none | none |
V2CreateExporterRequest
{
"driver": "string",
"config": {}
}
Properties
None
V2UpdateExporterRequest
{
"driver": "string",
"config": {}
}
Properties
None
V2PipelineConfiguration
{
"ledger": "string",
"exporterID": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ledger | string | true | none | none |
| exporterID | string | true | none | none |
V2ExporterConfiguration
{
"driver": "string",
"config": {}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| driver | string | true | none | none |
| config | object | true | none | none |
V2Exporter
{
"driver": "string",
"config": {},
"id": "string",
"createdAt": "2019-08-24T14:15:22Z"
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2ExporterConfiguration | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | true | none | none |
| » createdAt | string(date-time) | true | none | none |
V2Pipeline
{
"id": "string",
"createdAt": "2019-08-24T14:15:22Z",
"lastLogID": 0,
"enabled": true
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | V2PipelineConfiguration | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | true | none | none |
| » createdAt | string(date-time) | true | none | none |
| » lastLogID | integer | false | none | none |
| » enabled | boolean | false | none | none |