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

# Versioning & safe updates

> Use the version field so two edits never silently overwrite each other.

Every party and account carries a `version` number that goes up by one each time the resource changes. You use it to update safely.

## Why it matters

If two people — or two of your own processes — edit the same party at the same time, the second save could quietly wipe out the first. The `version` field prevents this: an update only succeeds if you're working from the latest copy.

## How to update

<Steps>
  <Step title="Read the resource">
    Fetch it and note the `version` (for example, `0`).
  </Step>

  <Step title="Send that version with your change">
    Include the `version` you just read in your `PATCH` request body.
  </Step>

  <Step title="Handle a conflict">
    If someone changed the resource after you read it, the API returns `409`. Re-fetch to get the new `version`, reapply your change, and send it again.
  </Step>
</Steps>

```bash theme={null}
curl --request PATCH \
  --url https://api.venlyfinance.com/v1/parties/{partyId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "version": 0, "firstName": "Janet" }'
```

A stale `version` returns:

```json theme={null}
{
  "success": false,
  "errors": [
    { "code": "concurrent-modification", "message": "This request has been modified by another user. Please refresh and try again." }
  ]
}
```

<Note>
  Always send the `version` from your most recent read — never a cached or hard-coded value.
</Note>

## API version

The Finance API is at **v1.1.0**, which adds the payment-request [settle, reverse, and update](/guides/finance/payment-requests) endpoints and `POLYGON` as a [supported chain](/guides/finance/supported-chains-and-assets).

<Info>
  Payment-request amounts are objects that carry both sides of the conversion — `{ "fiat": <number>, "crypto": "<string>" }` — across `amount`, `originalAmount`, `settlementAmount`, `settledAmount`, and `shortfallAmount`. See [Payment requests](/guides/finance/payment-requests#amounts-carry-fiat-and-crypto).
</Info>

## Next steps

<CardGroup cols={2}>
  <Card title="Update a party" icon="code" href="/api-reference/Finance-API/parties/update-party-details">
    Send the `version` with your PATCH request.
  </Card>

  <Card title="Safe retries with idempotency keys" icon="key" href="/guides/finance/idempotency">
    The other half of safe writes — duplicate-proof creates.
  </Card>
</CardGroup>
