Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

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.

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" }

Responses

Status Meaning Description Schema
200 OK OK V2ConfigInfo
default Default Error V2ErrorResponse
5XX Unknown Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

ledger.v2

List ledgers

Code samples

GET http://localhost:8080/v2 HTTP/1.1 Host: localhost:8080 Accept: application/json 

GET /v2

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.

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.

Example responses

200 Response

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "name": "string", "addedAt": "2019-08-24T14:15:22Z", "bucket": "string", "metadata": { "admin": "true" } } ] } }

Responses

Status Meaning Description Schema
200 OK OK V2LedgerListResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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", "metadata": { "admin": "true" } } }

Responses

Status Meaning Description Schema
200 OK OK V2GetLedgerResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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 false 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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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 false 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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } } } ]

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
body body V2Bulk false none

Example responses

200 Response

{ "data": [ { "responseType": "string", "logID": 0, "data": { "insertedAt": "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 } } } } } ], "errorCode": "VALIDATION", "errorMessage": "[VALIDATION] invalid 'cursor' query param", "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" }

Responses

Status Meaning Description Schema
200 OK OK V2BulkResponse
400 Bad Request OK V2BulkResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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 false 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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
body body object 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.

Example responses

200 Response

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "address": "users:001", "metadata": { "admin": "true" }, "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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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" }, "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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
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

To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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 

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.

Example responses

default Response

{ "errorCode": "VALIDATION", "errorMessage": "[VALIDATION] invalid 'cursor' query param", "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" }

Responses

Status Meaning Description Schema
2XX Unknown Key deleted None
default Default Error V2ErrorResponse

Response Schema

To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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 false 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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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 none
reverse query boolean false none
body body object 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.

Enumerated Values

Parameter Value
order effective

Example responses

200 Response

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "insertedAt": "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 } } } } ] } }

Responses

Status Meaning Description Schema
200 OK OK V2TransactionsCursorResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } }

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
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 transactions
  • script: enabling more complex transactions with Numscript

Example responses

200 Response

{ "data": { "insertedAt": "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 } } } } }

Responses

Status Meaning Description Schema
200 OK OK V2CreateTransactionResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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", "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 } } } } }

Responses

Status Meaning Description Schema
200 OK OK V2GetTransactionResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
body body V2Metadata false 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

To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

Revert a ledger transaction by its ID

Code samples

POST http://localhost:8080/v2/{ledger}/transactions/{id}/revert HTTP/1.1 Host: localhost:8080 Accept: application/json 

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

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.

Example responses

201 Response

{ "data": { "insertedAt": "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 } } } } }

Responses

Status Meaning Description Schema
201 Created OK V2CreateTransactionResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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 false none

Example responses

200 Response

{ "data": { "USD": 100, "EUR": 12 } }

Responses

Status Meaning Description Schema
200 OK OK V2AggregateBalancesResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
body body object 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.

Example responses

200 Response

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "account": "string", "asset": "string", "input": 0, "output": 0, "balance": 0 } ] } }

Responses

Status Meaning Description Schema
200 OK OK V2VolumesWithBalanceCursorResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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
body body object 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.

Example responses

200 Response

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "id": 1234, "type": "NEW_TRANSACTION", "data": {}, "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", "date": "2019-08-24T14:15:22Z" } ] } }

Responses

Status Meaning Description Schema
200 OK OK V2LogsCursorResponse
default Default Error V2ErrorResponse
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:read )

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

string 

Parameters

Name In Type Required Description
ledger path string true Name of the ledger.
body body string false 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
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

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

default Response

Responses

Status Meaning Description Schema
200 OK Import OK None
default Default Error string
To perform this operation, you must be authenticated by means of one of the following methods: Authorization ( Scopes: ledger:write )

Schemas

V2AccountsCursorResponse

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "address": "users:001", "metadata": { "admin": "true" }, "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
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

V2TransactionsCursorResponse

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "insertedAt": "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 } } } } ] } } 

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 [V2Transaction] true none none

V2LogsCursorResponse

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "id": 1234, "type": "NEW_TRANSACTION", "data": {}, "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", "date": "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 [V2Log] true none none

V2AccountResponse

{ "data": { "address": "users:001", "metadata": { "admin": "true" }, "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

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "account": "string", "asset": "string", "input": 0, "output": 0, "balance": 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 [V2VolumesWithBalance] true none none

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" } 

Properties

Name Type Required Restrictions Description
server string true none none
version string true none none

V2Account

{ "address": "users:001", "metadata": { "admin": "true" }, "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
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", "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 } } } } 

Properties

Name Type Required Restrictions Description
insertedAt 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

V2PostTransaction

{ "timestamp": "2019-08-24T14:15:22Z", "postings": [ { "amount": 100, "asset": "COIN", "destination": "users:002", "source": "users:001" } ], "script": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } } 

Properties

Name Type Required Restrictions Description
timestamp string(date-time) false none none
postings [V2Posting] false none none
script object false none none
» plain string true none none
» vars object false none none
»» additionalProperties string false none none
reference string false none none
metadata V2Metadata true 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": {}, "hash": "9ee060170400f556b7e1575cb13f9db004f150a08355c7431c62bc639166431e", "date": "2019-08-24T14:15:22Z" } 

Properties

Name Type Required Restrictions Description
id integer(bigint) true none none
type string true none none
data object true none none
hash string true none none
date string(date-time) true none none

Enumerated Values

Property Value
type NEW_TRANSACTION
type SET_METADATA
type REVERTED_TRANSACTION
type DELETE_METADATA

V2CreateTransactionResponse

{ "data": { "insertedAt": "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 } } } } } 

Properties

Name Type Required Restrictions Description
data V2Transaction true none none

V2RevertTransactionResponse

{ "data": { "insertedAt": "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 } } } } } 

Properties

None

V2GetTransactionResponse

{ "data": { "insertedAt": "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 } } } } } 

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" } 

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 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

V2Bulk

[ { "action": "string", "ik": "string", "data": { "timestamp": "2019-08-24T14:15:22Z", "postings": [ { "amount": 100, "asset": "COIN", "destination": "users:002", "source": "users:001" } ], "script": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } } } ] 

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": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } } } 

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": { "plain": "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n", "vars": { "user": "users:042" } }, "reference": "ref:001", "metadata": { "admin": "true" } } } 

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 } } 

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

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", "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 } } } } } ], "errorCode": "VALIDATION", "errorMessage": "[VALIDATION] invalid 'cursor' query param", "details": "https://play.numscript.org/?payload=eyJlcnJvciI6ImFjY291bnQgaGFkIGluc3VmZmljaWVudCBmdW5kcyJ9" } 

Properties

allOf

Name Type Required Restrictions Description
anonymous object false none none
» data [V2BulkElementResult] false none none

and

Name Type Required Restrictions Description
anonymous V2ErrorResponse false none none

V2BulkElementResult

{ "responseType": "string", "logID": 0, "data": { "insertedAt": "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 } } } } } 

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", "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 } } } } } 

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", "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 } } } } } 

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

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", "metadata": { "admin": "true" } } 

Properties

Name Type Required Restrictions Description
name string true none none
addedAt string(date-time) true none none
bucket string true none none
metadata V2Metadata false none none

V2LedgerListResponse

{ "cursor": { "pageSize": 15, "hasMore": false, "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=", "next": "", "data": [ { "name": "string", "addedAt": "2019-08-24T14:15:22Z", "bucket": "string", "metadata": { "admin": "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 [V2Ledger] true none none

V2UpdateLedgerMetadataRequest

{ "admin": "true" } 

Properties

None

V2GetLedgerResponse

{ "data": { "name": "string", "addedAt": "2019-08-24T14:15:22Z", "bucket": "string", "metadata": { "admin": "true" } } } 

Properties

Name Type Required Restrictions Description
data V2Ledger true none none