# Construct **POST /shared-wallets/{walletId}/transactions-construct**

status: stable

Create a transaction to be signed from the shared wallet. Works for the following fields: - payments - metadata - validity_interval ## Servers - https://localhost:8090/v2: https://localhost:8090/v2 () ## Parameters #### Path parameters - **walletId** (string(hex)) ## Body parameters Content-type: application/json - **payments** (array[object]) A list of target outputs with amounts specified. When creating a new transaction, the wallet software ensures that all user-specified transaction outputs have ada amounts that satisfy the ledger minimum UTxO rule: - If a user-specified transaction output has an ada `amount` that is **zero**, the wallet software will automatically assign a minimal amount of ada to the output so that it satisfies the ledger minimum UTxO rule. - If a user-specified transaction output has an ada `amount` that is **non-zero**, the wallet software will verify that the specified amount is large enough to satisfy the ledger minimum UTxO rule. If the amount is not large enough, the wallet software will return a `utxo_too_small` error, together with a revised ada amount that does satisfy the minimum UTxO rule. - **withdrawal** (string) When provided, instruments the server to automatically withdraw rewards from the source wallet when they are deemed sufficient (i.e. they contribute to the balance for at least as much as they cost). As a consequence, the resulting transaction may or may not have a withdrawal object. Summarizing: withdrawal field | reward balance | result --- | --- | --- `null` | too small | ✓ no withdrawals generated `null` | big enough | ✓ no withdrawals generated `"self"` | too small | ✓ no withdrawals generated `"self"` | big enough | ✓ withdrawal generated - **metadata** (object | null) **⚠️ WARNING ⚠️** _Please note that metadata provided in a transaction will be stored on the blockchain forever. Make sure not to include any sensitive data, in particular personally identifiable information (PII)._ Extra application data attached to the transaction. Cardano allows users and developers to embed their own authenticated metadata when submitting transactions. Metadata can be expressed as a JSON object with some restrictions: 1. All top-level keys must be integers between `0` and `2^64 - 1`. 2. Each metadata value is tagged with its type. 3. Strings must be at most 64 bytes when UTF-8 encoded. 4. Bytestrings are hex-encoded, with a maximum length of 64 bytes. Metadata aren't stored as JSON on the Cardano blockchain but are instead stored using a compact binary encoding (CBOR). The binary encoding of metadata values supports three simple types: * Integers in the range `-(2^64 - 1)` to `2^64 - 1` * Strings (UTF-8 encoded) * Bytestrings And two compound types: * Lists of metadata values * Mappings from metadata values to metadata values It is possible to transform any JSON object into this schema. However, if your application uses floating point values, they will need to be converted somehow, according to your requirements. Likewise for `null` or `bool` values. When reading metadata from chain, be aware that integers may exceed the javascript numeric range, and may need special "bigint" parsing. - **encrypt_metadata** (object) If used then metadata in a transaction is going to be encrypted by AES 256 using CBC mode which is a default method (called base). PBKDF2 password stretching is used to get a 32-byte secret key and a 16-byte initialization vector required in the cipher. PBKDF2 encryption algorithm using HMAC with the SHA256 hash algorithm is employed, and 10000 iterations to get key and iv pair are used. Cipher algorithm uses 8-byte salt, PKCS#7 padding as specified in https://datatracker.ietf.org/doc/html/rfc5652#section-6.3 is applied. Only metadata value under `msg` field is encrypted. If `msg` field is missing error will be emitted. Metadata encryption is in accordance to CIP 83 (https://cips.cardano.org/cips/cip83/). - **mint_burn** (array[object]) An entry for each unique asset to be minted and/or burned, containing helpful information. - **vote** (string | string(bech32)) Decentralized representative (DRep) that the wallet is delegating its vote to. One can abstain, give no confidence vote, or vote for a representative specified by a key hash or script hash. Vote delegation can be done together with stake delegation action. - **delegations** (array[object])

status: stable

A list of staking actions (joining, rejoining or leaving from stake pools). Using '0H' stake key index is supported at this moment. This will change with multi-account support. Only one delegation action can be used. - **validity_interval** (object) Specify only invalid_before or invalid_hereafter or both. Please note that, if not set, the default values are: - `"invalid_before": {"quantity":0, "unit":"slot"}` - `"invalid_hereafter":{"quantity":7200, "unit":"second"}` Which translates to 2h transaction TTL. - **reference_policy_script_template** (string | object) Optional policy script template that could be used as a script reference in another transaction. In the current transaction, the script will be included as the first output (`index = 0`). The script is constructed by replacing the cosigner with the policy public key of the wallet. In future transactions, the reference script can be used by any wallet multiple times by referencing the current transaction `id` and `index = 0`. The script template must contain a single cosigner only, but it may include time locks. - **encoding** (string) Encoding of transaction CBOR returned in response (base64 by default). ## Responses ### 415: Unsupported Media Type #### Body Parameters: application/json (object) - **message** (string) May occur when providing an invalid 'Content-Type' header. - **code** (string) ### 406: Not Acceptable #### Body Parameters: application/json (object) - **message** (string) May occur when providing an invalid 'Accept' header. - **code** (string) ### 404: Not Found #### Body Parameters: application/json (object) - **message** (string) May occur when a given walletId does not match with any known wallets (because it has been deleted, or has never existed). - **code** (string) - **info** (object) ### 400: Bad Request #### Body Parameters: application/json (object) - **message** (string) May occur when a request is not well-formed; that is, it fails to parse successfully. This could be the case when some required parameters are missing or, when malformed values are provided. - **code** (string) ### 403: Forbidden #### Body Parameters: application/json (object) - **message** (string) May occur when trying to perform an operation not supported by this type of wallet. - **code** (string) ### 202: Accepted #### Body Parameters: application/json (object) - **transaction** (string(base64|base16)) The CBOR-encoded transaction, represented in either hex or base64 encoding. This always includes the transaction body and the witness set, even if the latter is empty. - **coin_selection** (object) - **fee** (object) Coins, in Lovelace. Only relates to 'Ada'. Refer to `assets` for multi-assets wallets instead. [Powered by Bump.sh](https://bump.sh)