# Create

Source: https://docs.settlemint.com/docs/operators/system-addons/xvp-settlement/actions/create
Create an XvP settlement from an XvP add-on factory, add local and external flows,
configure cutoff and HTLC details, then submit the reviewed settlement.




The XvP settlement wizard creates one settlement contract from a selected XvP add-on factory. Use the wizard when at least one leg settles on the current chain. Add external flows only for matching legs that settle on another chain under the same settlement terms.

The wizard has three steps: **Asset Flows**, **Configuration**, and **Summary**. You can move between the steps while the draft is valid. If you leave the wizard before creating the settlement, the platform asks you to confirm because unsaved draft values are not submitted.

## Prerequisites [#prerequisites]

* Access to the XvP Settlement add-on in the platform
* Permission to create settlements for the selected XvP add-on factory
* Wallet addresses for the parties sending and receiving assets
* Token contract addresses for the assets being exchanged
* For external flows: the external chain ID, token decimals, and either a precomputed hashlock or the raw secret used to derive one
* For V3 XvP factories: the ISO 3166-1 numeric country code for the settlement

<Callout type="info" title="Create access is permission-gated">
  If the **Create Settlement** action is unavailable, check that your platform role and the selected add-on factory
  allow you to manage XvP settlements.
</Callout>

## Create a settlement [#create-a-settlement]

<Steps>
  <Step>
    ### Open the XvP add-on page [#open-the-xvp-add-on-page]

    In the sidebar, open the XvP add-on factory you want to use, then click **Create Settlement**.

    The settlement is created against that factory. If you operate more than one XvP add-on factory, confirm that you are on the correct add-on page before opening the wizard.
  </Step>

  <Step>
    ### Add asset flows [#add-asset-flows]

    On **Asset Flows**, add the transfers that make up the settlement. Each flow defines the asset, sender, recipient, and amount.

    Use **Add Local Flow** for transfers that execute on the current chain. Use **Add External Flow** for a matching transfer that executes on another chain. Every settlement must include at least one local flow, so the wizard keeps the last local row in place even when the exchange also coordinates external legs.

    | Flow type | Purpose                                           | Required fields                                                                  | Amount precision                                   |
    | --------- | ------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------- |
    | Local     | A transfer executed by the current XvP settlement | Token address, sender wallet, recipient wallet, amount                           | Token symbol and decimals come from the asset      |
    | External  | A matching transfer coordinated on another chain  | Token address, sender wallet, recipient wallet, amount, chain ID, token decimals | Token decimals are entered before the amount field |

    <Callout type="info" title="Local vs external flows">
      Local flows use the selected token on the current chain and the wizard reads its symbol and decimals before you enter
      the amount. External flows record the matching transfer on another chain, including its chain ID and token decimals,
      but do not execute locally.
    </Callout>

    For larger exchanges, use **Import Flows** to upload one or more JSON files. Imported flows are appended to the wizard instead of replacing existing rows. The wizard accepts up to five files at a time and previews parsed flows before you import them.
  </Step>

  <Step>
    ### Configure settlement options [#configure-settlement-options]

    On **Configuration**, enter the settlement-level details.

    | Option           | Description                                                                                                                                                                 |
    | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Name**         | A clear settlement name, such as `BOND-for-USDC Trade`                                                                                                                      |
    | **Cutoff date**  | The future deadline after which the settlement can no longer proceed                                                                                                        |
    | **Auto-execute** | When enabled, the settlement executes automatically after required local approvals are complete. External-flow settlements also require the matching secret to be revealed. |
    | **Country**      | Shown for V3 XvP factories. Use the ISO 3166-1 numeric country code for the settlement.                                                                                     |

    For V3 factories, confirm the country code on this step before continuing to the summary. The field is not shown for earlier factory versions.

    If the settlement contains any external flow, choose one HTLC mode:

    * **Enter hashlock** when a counterparty has already shared the `0x`-prefixed 32-byte hashlock for the external leg.
    * **Enter secret** when you want the platform to derive the hashlock from a raw secret that is at least 32 characters long. You can generate a mnemonic secret in the wizard or paste your own; the wizard shows the derived hashlock for review.

    <Callout type="warn" title="Keep the secret available">
      If you use a raw secret, store it securely before submitting. The secret is needed to coordinate execution on chains
      that use the same hashlock. If you only enter a hashlock, make sure the party responsible for the external leg can
      reveal the matching secret when settlement execution requires it.
    </Callout>
  </Step>

  <Step>
    ### Review and create [#review-and-create]

    On **Summary**, review the settlement before submission:

    * Check each asset address, sender, recipient, amount, and external chain value.
    * Confirm the cutoff date gives every sender enough time to approve.
    * For external flows, confirm the hashlock matches the value expected by the counterparties.

    Click **Create** and authenticate with your PIN or OTP to submit the transaction. The platform validates the final request before submission, including the local-flow requirement and the hashlock or secret requirement for settlements with external flows.
  </Step>
</Steps>

## After creation [#after-creation]

After the transaction is submitted:

* The settlement appears in the XvP add-on settlement list after the creation transaction has been processed and indexed.
* The settlement detail page shows the settlement ID, status, flows, and required actions.
* Senders for local flows can approve and lock their assets into the settlement.
* For external-flow settlements, coordinate the shared hashlock and secret handling with the counterparties responsible for the other chain.

## Import flows from JSON [#import-flows-from-json]

For complex settlements with many flows, you can import flow rows from JSON files.

1. On **Asset Flows**, click **Import Flows**.
2. Upload up to five `.json` files.
3. Review the parsed flows in the import dialog.
4. Click **Import Flows** to append them to the wizard.

Each file must contain a JSON array of flow objects. The import file contains flow rows only, not the settlement name, cutoff date, auto-execute setting, country, secret, or hashlock.

```json
[
  {
    "type": "local",
    "assetId": "0x1234567890abcdef1234567890abcdef12345678",
    "assetSymbol": "USDC",
    "assetDecimals": 6,
    "from": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "to": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "amount": "1000000"
  },
  {
    "type": "external",
    "assetId": "0x567890abcdef1234567890abcdef1234567890ab",
    "from": "0xcccccccccccccccccccccccccccccccccccccccc",
    "to": "0xdddddddddddddddddddddddddddddddddddddddd",
    "amount": "500000000000000000",
    "externalChainId": 1,
    "externalAssetDecimals": 18
  }
]
```

**Field reference:**

| Field                   | Required for local | Required for external | Description                                     |
| ----------------------- | ------------------ | --------------------- | ----------------------------------------------- |
| `type`                  | Yes                | Yes                   | `"local"` or `"external"`                       |
| `assetId`               | Yes                | Yes                   | Token contract address                          |
| `from`                  | Yes                | Yes                   | Sender wallet address                           |
| `to`                    | Yes                | Yes                   | Recipient wallet address                        |
| `amount`                | Yes                | Yes                   | Amount as a string in the token's smallest unit |
| `assetSymbol`           | Yes                | No                    | Token symbol for local imported flows           |
| `assetDecimals`         | Yes                | No                    | Decimals for local imported flows               |
| `externalChainId`       | No                 | Yes                   | Chain ID for external flows                     |
| `externalAssetDecimals` | No                 | Yes                   | Decimals for external flows                     |

Imported files must be valid JSON arrays. If a file is empty, malformed, not an array, or missing required fields, the wizard shows the validation error before import. Local imported flows must include `assetSymbol` and `assetDecimals` because the import payload carries the display metadata used to format the amount.

## Next steps [#next-steps]

<Cards>
  <Card title="Approve flows" href="/docs/operators/system-addons/xvp-settlement/actions/approve">
    How senders lock their assets into the settlement.
  </Card>

  <Card title="Local walkthrough" href="/docs/operators/system-addons/xvp-settlement/local/walkthrough">
    See a complete local settlement example.
  </Card>
</Cards>

## Related [#related]

* [XvP settlement overview](/docs/operators/system-addons/xvp-settlement/overview)
* [Approve flows](/docs/operators/system-addons/xvp-settlement/actions/approve)
