curl --request POST \
--url https://api.example.com/v2/commands/submit-and-wait-for-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commands": {
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<unknown>",
"choice": "<string>",
"choiceArgument": "<unknown>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123
}
}
},
"minLedgerTimeAbs": "<string>",
"submissionId": "<string>",
"disclosedContracts": [
{
"createdEventBlob": "<string>",
"templateId": "<string>",
"contractId": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<unknown>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
}
'import requests
url = "https://api.example.com/v2/commands/submit-and-wait-for-transaction"
payload = { "commands": {
"commands": [{ "CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<unknown>",
"choice": "<string>",
"choiceArgument": "<unknown>"
} }],
"commandId": "<string>",
"actAs": ["<string>"],
"userId": "<string>",
"readAs": ["<string>"],
"workflowId": "<string>",
"deduplicationPeriod": { "DeduplicationDuration": { "value": {
"seconds": 123,
"nanos": 123
} } },
"minLedgerTimeAbs": "<string>",
"submissionId": "<string>",
"disclosedContracts": [
{
"createdEventBlob": "<string>",
"templateId": "<string>",
"contractId": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": ["<string>"],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<unknown>",
"limit": 123
}
],
"tapsMaxPasses": 123
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commands: {
commands: [
{
CreateAndExerciseCommand: {
templateId: '<string>',
createArguments: '<unknown>',
choice: '<string>',
choiceArgument: '<unknown>'
}
}
],
commandId: '<string>',
actAs: ['<string>'],
userId: '<string>',
readAs: ['<string>'],
workflowId: '<string>',
deduplicationPeriod: {DeduplicationDuration: {value: {seconds: 123, nanos: 123}}},
minLedgerTimeAbs: '<string>',
submissionId: '<string>',
disclosedContracts: [
{
createdEventBlob: '<string>',
templateId: '<string>',
contractId: '<string>',
synchronizerId: '<string>'
}
],
synchronizerId: '<string>',
packageIdSelectionPreference: ['<string>'],
prefetchContractKeys: [{templateId: '<string>', contractKey: '<unknown>', limit: 123}],
tapsMaxPasses: 123
}
})
};
fetch('https://api.example.com/v2/commands/submit-and-wait-for-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/commands/submit-and-wait-for-transaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'commands' => [
'commands' => [
[
'CreateAndExerciseCommand' => [
'templateId' => '<string>',
'createArguments' => '<unknown>',
'choice' => '<string>',
'choiceArgument' => '<unknown>'
]
]
],
'commandId' => '<string>',
'actAs' => [
'<string>'
],
'userId' => '<string>',
'readAs' => [
'<string>'
],
'workflowId' => '<string>',
'deduplicationPeriod' => [
'DeduplicationDuration' => [
'value' => [
'seconds' => 123,
'nanos' => 123
]
]
],
'minLedgerTimeAbs' => '<string>',
'submissionId' => '<string>',
'disclosedContracts' => [
[
'createdEventBlob' => '<string>',
'templateId' => '<string>',
'contractId' => '<string>',
'synchronizerId' => '<string>'
]
],
'synchronizerId' => '<string>',
'packageIdSelectionPreference' => [
'<string>'
],
'prefetchContractKeys' => [
[
'templateId' => '<string>',
'contractKey' => '<unknown>',
'limit' => 123
]
],
'tapsMaxPasses' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/commands/submit-and-wait-for-transaction"
payload := strings.NewReader("{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/commands/submit-and-wait-for-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/commands/submit-and-wait-for-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"updateId": "<string>",
"effectiveAt": "<string>",
"events": [
{
"ArchivedEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"witnessParties": [
"<string>"
],
"packageName": "<string>",
"implementedInterfaces": [
"<string>"
]
}
}
],
"offset": 123,
"synchronizerId": "<string>",
"recordTime": "<string>",
"commandId": "<string>",
"workflowId": "<string>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"externalTransactionHash": "<string>",
"paidTrafficCost": 123
}
}"<string>"{
"code": "<string>",
"cause": "<string>",
"context": {},
"errorCategory": 123,
"correlationId": "<string>",
"traceId": "<string>",
"resources": [
[
"<string>"
]
],
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": true
}POST /v2/commands/submit-and-wait-for-transaction
Submits a single composite command, waits for its result, and returns the transaction. Propagates the gRPC error of failed submissions including Daml interpretation errors.
curl --request POST \
--url https://api.example.com/v2/commands/submit-and-wait-for-transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commands": {
"commands": [
{
"CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<unknown>",
"choice": "<string>",
"choiceArgument": "<unknown>"
}
}
],
"commandId": "<string>",
"actAs": [
"<string>"
],
"userId": "<string>",
"readAs": [
"<string>"
],
"workflowId": "<string>",
"deduplicationPeriod": {
"DeduplicationDuration": {
"value": {
"seconds": 123,
"nanos": 123
}
}
},
"minLedgerTimeAbs": "<string>",
"submissionId": "<string>",
"disclosedContracts": [
{
"createdEventBlob": "<string>",
"templateId": "<string>",
"contractId": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": [
"<string>"
],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<unknown>",
"limit": 123
}
],
"tapsMaxPasses": 123
}
}
'import requests
url = "https://api.example.com/v2/commands/submit-and-wait-for-transaction"
payload = { "commands": {
"commands": [{ "CreateAndExerciseCommand": {
"templateId": "<string>",
"createArguments": "<unknown>",
"choice": "<string>",
"choiceArgument": "<unknown>"
} }],
"commandId": "<string>",
"actAs": ["<string>"],
"userId": "<string>",
"readAs": ["<string>"],
"workflowId": "<string>",
"deduplicationPeriod": { "DeduplicationDuration": { "value": {
"seconds": 123,
"nanos": 123
} } },
"minLedgerTimeAbs": "<string>",
"submissionId": "<string>",
"disclosedContracts": [
{
"createdEventBlob": "<string>",
"templateId": "<string>",
"contractId": "<string>",
"synchronizerId": "<string>"
}
],
"synchronizerId": "<string>",
"packageIdSelectionPreference": ["<string>"],
"prefetchContractKeys": [
{
"templateId": "<string>",
"contractKey": "<unknown>",
"limit": 123
}
],
"tapsMaxPasses": 123
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commands: {
commands: [
{
CreateAndExerciseCommand: {
templateId: '<string>',
createArguments: '<unknown>',
choice: '<string>',
choiceArgument: '<unknown>'
}
}
],
commandId: '<string>',
actAs: ['<string>'],
userId: '<string>',
readAs: ['<string>'],
workflowId: '<string>',
deduplicationPeriod: {DeduplicationDuration: {value: {seconds: 123, nanos: 123}}},
minLedgerTimeAbs: '<string>',
submissionId: '<string>',
disclosedContracts: [
{
createdEventBlob: '<string>',
templateId: '<string>',
contractId: '<string>',
synchronizerId: '<string>'
}
],
synchronizerId: '<string>',
packageIdSelectionPreference: ['<string>'],
prefetchContractKeys: [{templateId: '<string>', contractKey: '<unknown>', limit: 123}],
tapsMaxPasses: 123
}
})
};
fetch('https://api.example.com/v2/commands/submit-and-wait-for-transaction', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/commands/submit-and-wait-for-transaction",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'commands' => [
'commands' => [
[
'CreateAndExerciseCommand' => [
'templateId' => '<string>',
'createArguments' => '<unknown>',
'choice' => '<string>',
'choiceArgument' => '<unknown>'
]
]
],
'commandId' => '<string>',
'actAs' => [
'<string>'
],
'userId' => '<string>',
'readAs' => [
'<string>'
],
'workflowId' => '<string>',
'deduplicationPeriod' => [
'DeduplicationDuration' => [
'value' => [
'seconds' => 123,
'nanos' => 123
]
]
],
'minLedgerTimeAbs' => '<string>',
'submissionId' => '<string>',
'disclosedContracts' => [
[
'createdEventBlob' => '<string>',
'templateId' => '<string>',
'contractId' => '<string>',
'synchronizerId' => '<string>'
]
],
'synchronizerId' => '<string>',
'packageIdSelectionPreference' => [
'<string>'
],
'prefetchContractKeys' => [
[
'templateId' => '<string>',
'contractKey' => '<unknown>',
'limit' => 123
]
],
'tapsMaxPasses' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/commands/submit-and-wait-for-transaction"
payload := strings.NewReader("{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/commands/submit-and-wait-for-transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/commands/submit-and-wait-for-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commands\": {\n \"commands\": [\n {\n \"CreateAndExerciseCommand\": {\n \"templateId\": \"<string>\",\n \"createArguments\": \"<unknown>\",\n \"choice\": \"<string>\",\n \"choiceArgument\": \"<unknown>\"\n }\n }\n ],\n \"commandId\": \"<string>\",\n \"actAs\": [\n \"<string>\"\n ],\n \"userId\": \"<string>\",\n \"readAs\": [\n \"<string>\"\n ],\n \"workflowId\": \"<string>\",\n \"deduplicationPeriod\": {\n \"DeduplicationDuration\": {\n \"value\": {\n \"seconds\": 123,\n \"nanos\": 123\n }\n }\n },\n \"minLedgerTimeAbs\": \"<string>\",\n \"submissionId\": \"<string>\",\n \"disclosedContracts\": [\n {\n \"createdEventBlob\": \"<string>\",\n \"templateId\": \"<string>\",\n \"contractId\": \"<string>\",\n \"synchronizerId\": \"<string>\"\n }\n ],\n \"synchronizerId\": \"<string>\",\n \"packageIdSelectionPreference\": [\n \"<string>\"\n ],\n \"prefetchContractKeys\": [\n {\n \"templateId\": \"<string>\",\n \"contractKey\": \"<unknown>\",\n \"limit\": 123\n }\n ],\n \"tapsMaxPasses\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"updateId": "<string>",
"effectiveAt": "<string>",
"events": [
{
"ArchivedEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"witnessParties": [
"<string>"
],
"packageName": "<string>",
"implementedInterfaces": [
"<string>"
]
}
}
],
"offset": 123,
"synchronizerId": "<string>",
"recordTime": "<string>",
"commandId": "<string>",
"workflowId": "<string>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"externalTransactionHash": "<string>",
"paidTrafficCost": 123
}
}"<string>"{
"code": "<string>",
"cause": "<string>",
"context": {},
"errorCategory": 123,
"correlationId": "<string>",
"traceId": "<string>",
"resources": [
[
"<string>"
]
],
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": true
}Authorizations
Ledger API standard JWT token
Body
These commands are executed as a single atomic transaction.
The commands to be submitted.
Required
Show child attributes
Show child attributes
If no transaction_format is provided, a default will be used where transaction_shape is set to
TRANSACTION_SHAPE_ACS_DELTA, event_format is defined with filters_by_party containing wildcard-template
filter for all original act_as and read_as parties and the verbose flag is set.
Optional
Show child attributes
Show child attributes
Response
The transaction that resulted from the submitted command. The transaction might contain no events (request conditions result in filtering out all of them).
Required
Show child attributes
Show child attributes
Was this page helpful?