---
title: "Create a PSBT"
method: POST
path: "/v1/cryptos/{cryptoCode}/derivations/{derivationScheme}/psbt/create"
tags: ["Derivations"]
---

# Create a PSBT

`POST /v1/cryptos/{cryptoCode}/derivations/{derivationScheme}/psbt/create`

A [Partially Signed Bitcoin Transaction (PSBT)](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki) is a standard format to represent a transaction with pending signatures associated to it. A PSBT can be signed independently by many signers, and combined together before broadcast.

## Path parameters

- `cryptoCode` string, required
- `derivationScheme` string, required

## Request body

- PSBTRequest
  - `PSBTVersion` integer — Optional. The format of the PSBT. (0 or 2). Default is 1.
  - `seed` integer — Optional. A seed specific to get a deterministic PSBT, useful for testing purposes. Default is null.
  - `rbf` boolean — Optional. Determines if the transaction should have Replace-By-Fee (RBF) activated. Default is true if 'disableFingerprintRandomization' is true.
  - `version` integer — Optional. The version of the transaction. Default is 1 if 'disableFingerprintRandomization' is true.
  - `timeLock` integer — Optional. The timelock (nLockTime) of the transaction. Activates RBF if not null. Default is 0 if 'disableFingerprintRandomization' is true.
  - `includeGlobalXPub` boolean — Optional. Whether to include the global xpubs of the derivation scheme in the PSBT. Default is false.
  - `reserveChangeAddress` boolean — Optional. If true, the creation of this PSBT will reserve a new change address. Default is false.
  - `spendAllMatchingOutpoints` boolean — Optional. If true, all the UTXOs that have been selected will be used as inputs in the PSBT. Default is false.
  - `explicitChangeAddress` string — Optional. Use a specific change address or script (in hex format). Mutually exclusive with 'reserveChangeAddress'. Default is null.
  - `minConfirmations` integer — Optional. The minimum number of confirmations a UTXO needs to be selected. By default, both unconfirmed and confirmed UTXOs will be used.
  - `includeOnlyOutpoints` string[] — Optional. Only select the specified outpoints for creating the PSBT. Can select outpoints that have been spent but are unconfirmed, useful for RBF. Default is null.
  - `excludeOutpoints` string[] — Optional. Do not select the specified outpoints for creating the PSBT. Default is an empty array.
  - `minValue` integer — Optional. UTXOs with value below this amount (in satoshis) will be ignored. Default is null.
  - `destinations` object[], required — Required. An array of destinations where funds will be sent.
    - `destination` string, required — Required. The destination as an address or a script. (in hex)
    - `amount` integer — Optional. The amount (in satoshis) to send to the destination. Mutually exclusive with 'sweepAll'.
    - `substractFees` boolean — Optional. If true, the fees will be subtracted from this destination's amount. Mutually exclusive with 'sweepAll'. Default is false.
    - `sweepAll` boolean — Optional. If true, will sweep all the balance of your wallet to this destination. Mutually exclusive with 'amount' and 'substractFees'. Default is false.
  - `feePreference` object — Optional. Preferences for how transaction fees are calculated.
    - `explicitFeeRate` integer — Optional. An explicit fee rate for the transaction in satoshis per virtual byte (vByte). Mutually exclusive with 'blockTarget', and 'fallbackFeeRate'.
    - `explicitFee` integer — Optional. An explicit total fee for the transaction in satoshis.
    - `blockTarget` integer — Optional. The target number of blocks within which the user expects the transaction to be confirmed. Mutually exclusive with 'explicitFeeRate'.
    - `fallbackFeeRate` integer — Optional. A fallback fee rate in satoshis per vByte to use if fee estimation is unavailable. Ensures 'fee-estimation-unavailable' error is not sent. Mutually exclusive with 'explicitFeeRate'.
  - `discourageFeeSniping` boolean — Optional. If 'timeLock' is not set, sets the 'timeLock' to a random value to discourage fee sniping. Default is true if 'disableFingerprintRandomization' is true.
  - `rebaseKeyPaths` object[] — Optional. Rebase the HD key paths to adjust key paths in the PSBT to match the signer's expectations.
    - `accountKey` string, required — The account extended public key (xpub) to rebase.
    - `accountKeyPath` string, required — The derivation path from the root to the account key, prefixed by the master public key fingerprint.
  - `disableFingerprintRandomization` boolean — Optional. Disables the randomization of default parameter values to match the network's fingerprint distribution. Randomized default values include 'version', 'timeLock', 'rbf', and 'discourageFeeSniping'. Default is false.
  - `alwaysIncludeNonWitnessUTXO` boolean — Optional. If true, includes the full previous transaction in 'non_witness_utxo' even for SegWit inputs. Default is false.
  - `mergeOutputs` boolean — Optional. If true, outputs sending to the same scriptPubKey will be merged into a single output. Default is true.

## Response `200`

A PSBT get returned

- object
  - `psbt` string — Partially signed Bitcoin transaction in Base64 encoding
  - `changeAddress` string — Bitcoin address where change will be sent
  - `suggestions` object
    - `shouldEnforceLowR` boolean — Indicates whether to enforce LowR signatures

## Other responses

- `400` — Impossible to satisfy the request. Code: `not-enough-funds`, `output-too-small`, `fee-estimation-unavailable`.
- `404` — The `cryptoCode` isn't supported. Code: `cryptoCode-not-supported`.

## Changes

- **2025-03-05** `96ff58e343f7` — 1 info
  - added the new optional request property `PSBTVersion`
- **2024-11-28** `32910c4ec4c8` — 1 info
  - api operation id `CreatePSBT` was added
- **2024-11-25** `cfaf4efd4ea8` — 1 info
  - endpoint added
- **2024-11-18** `b5092f204599` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/changes/v1/cryptos/:cryptoCode/derivations/:derivationScheme/psbt/create/post.md)

---

[API](https://skmtc.dev/btcpayserver/apis/nbxplorer-api.md) · [All operations](https://skmtc.dev/btcpayserver/apis/nbxplorer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/btcpayserver/nbxplorer-api/revisions/208cac39e31a/schema)
