> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# SubmitAndWait

Ledger API

›

[Protobuf](https://docs.canton.network/reference/protobuf/overview.md)

›

[com.daml.ledger.api.v2](https://docs.canton.network/reference/protobuf/packages/com-daml-ledger-api-v2.md)

›

SubmitAndWait

com.daml.ledger.api.v2

# SubmitAndWait

gRPC

RPC

`/com.daml.ledger.api.v2.CommandService/SubmitAndWait`

## Protocol Details

Protocol
gRPC

Service
CommandService

RPC
SubmitAndWait

Client stream
No

Server stream
No

## Inputs

### SubmitAndWaitRequest

Message
com.daml.ledger.api.v2.SubmitAndWaitRequest

Client stream
No

`commands`
Commands

## Outputs

### SubmitAndWaitResponse

Message
com.daml.ledger.api.v2.SubmitAndWaitResponse

Server stream
No

`update_id`
string

`completion_offset`
int64

## Related Schemas

> [accordion] com.daml.ledger.api.v2.SubmitAndWaitRequest
>
> `commands`
> Commands

> [accordion] com.daml.ledger.api.v2.Commands
>
> `workflow_id`
> string
>
> `user_id`
> string
>
> `command_id`
> string
>
> `commands`
> repeated Command
>
> `deduplication_duration`
> Duration
>
> `deduplication_offset`
> int64
>
> `min_ledger_time_abs`
> Timestamp
>
> `min_ledger_time_rel`
> Duration
>
> `act_as`
> repeated string
>
> `read_as`
> repeated string
>
> `submission_id`
> string
>
> `disclosed_contracts`
> repeated DisclosedContract
>
> `synchronizer_id`
> string
>
> `package_id_selection_preference`
> repeated string
>
> `prefetch_contract_keys`
> repeated PrefetchContractKey
>
> `taps_max_passes`
> uint32

> [accordion] com.daml.ledger.api.v2.Command
>
> `create`
> CreateCommand
>
> `exercise`
> ExerciseCommand
>
> `exercise_by_key`
> ExerciseByKeyCommand
>
> `create_and_exercise`
> CreateAndExerciseCommand

> [accordion] com.daml.ledger.api.v2.CreateCommand
>
> `template_id`
> Identifier
>
> `create_arguments`
> Record

> [accordion] com.daml.ledger.api.v2.Identifier
>
> `package_id`
> string
>
> `module_name`
> string
>
> `entity_name`
> string

> [accordion] com.daml.ledger.api.v2.Record
>
> `record_id`
> Identifier
>
> `fields`
> repeated RecordField

> [accordion] com.daml.ledger.api.v2.RecordField
>
> `label`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Value
>
> `unit`
> Empty
>
> `bool`
> bool
>
> `int64`
> sint64
>
> `date`
> int32
>
> `timestamp`
> sfixed64
>
> `numeric`
> string
>
> `party`
> string
>
> `text`
> string
>
> `contract_id`
> string
>
> `optional`
> Optional
>
> `list`
> List
>
> `text_map`
> TextMap
>
> `gen_map`
> GenMap
>
> `record`
> Record
>
> `variant`
> Variant
>
> `enum`
> Enum

> [accordion] com.daml.ledger.api.v2.Optional
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.List
>
> `elements`
> repeated Value

> [accordion] com.daml.ledger.api.v2.TextMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.TextMap.Entry
>
> `key`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.GenMap
>
> `entries`
> repeated Entry

> [accordion] com.daml.ledger.api.v2.GenMap.Entry
>
> `key`
> Value
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Variant
>
> `variant_id`
> Identifier
>
> `constructor`
> string
>
> `value`
> Value

> [accordion] com.daml.ledger.api.v2.Enum
>
> `enum_id`
> Identifier
>
> `constructor`
> string

> [accordion] com.daml.ledger.api.v2.ExerciseCommand
>
> `template_id`
> Identifier
>
> `contract_id`
> string
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.ExerciseByKeyCommand
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.CreateAndExerciseCommand
>
> `template_id`
> Identifier
>
> `create_arguments`
> Record
>
> `choice`
> string
>
> `choice_argument`
> Value

> [accordion] com.daml.ledger.api.v2.DisclosedContract
>
> `template_id`
> Identifier
>
> `contract_id`
> string
>
> `created_event_blob`
> bytes
>
> `synchronizer_id`
> string

> [accordion] com.daml.ledger.api.v2.PrefetchContractKey
>
> `template_id`
> Identifier
>
> `contract_key`
> Value
>
> `limit`
> uint32

> [accordion] com.daml.ledger.api.v2.SubmitAndWaitResponse
>
> `update_id`
> string
>
> `completion_offset`
> int64

grpcurl

```bash grpcurl theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Add -plaintext if the server is not using TLS.
grpcurl \
  -d @ \
  <HOST:PORT> \
  com.daml.ledger.api.v2.CommandService/SubmitAndWait <<'EOF'
{
  "commands": {
    "workflowId": "string",
    "userId": "string",
    "commandId": "string",
    "commands": [
      {
        "create": {
          "templateId": {},
          "createArguments": {}
        }
      }
    ],
    "deduplicationDuration": "string",
    "minLedgerTimeAbs": "string",
    "minLedgerTimeRel": "string"
  }
}
EOF
```

OK

application/json

```json OK theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "updateId": "string",
  "completionOffset": "0"
}
```
