> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://amer.developers.trustly.com/llms.txt.
> For full documentation content, see https://amer.developers.trustly.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.com/_mcp/server.

# Idempotency

Idempotency helps merchants mitigate operational or financial issues caused by accidental duplicate API calls.

Idempotency requires that the `merchantReference` field is unique per merchant and per environment. The API verifies this uniqueness and returns an error if the value is a duplicate.

For verification workflows, Trustly recommends using unique merchant references for captures and verifications. This prevents validation errors when reusing a reference from a capture that achieved an Authorized status.

## Availability

Idempotency protection applies to transactions that reach the `Authorized`, `Processed`, or `Completed` status. This validation is active for the following transaction types:

* `Pay`
* `Authorize`
* `Capture`
* `Deposit`

If you are unable to support the unique merchant reference requirement, [please contact support](/integrate/get-started/get-support).

## Capture and deposit API usage

To execute the [Capture API](/api-reference/api/transactions/post-transactions-transaction-id-capture) and [Deposit API](/api-reference/api/transactions/post-transactions-deposit) requests, you must pass the following fields:

* `splitToken`: The [Split Token](/integrate/core-concepts/tokens-and-account-security) received from the Bank Authorization Notification.
* `amount`: The amount to be captured or deposited.
* `merchantReference`: Your specific, unique identifier for this transaction . This value appears in [Event Notifications](/integrate/core-concepts/webhooks-and-events) and [Reports](/integrate/manage-your-integration/reports-and-reconciliation).

### Duplicate request response

If a duplicate `merchantReference` is sent for a transaction that is already complete with a status of `Authorized`,`Processed`, or `Completed`, the API ignores the request  and returns the following response:

|  Code | Description                                        |
| :---: | :------------------------------------------------- |
| `210` | `This is a duplicate request. It has been ignored` |

***

### Idempotency edge cases

This following tables details specific transaction scenarios and statuses where the duplicate `merchantReference` validation is either not applied or requires special consideration.

| Scenario                 | Idempotency Validation | Rule                                                                                                                            |
| :----------------------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
| Refunds                  | Not applied.           | The duplicate `merchantReference` validation does not apply to the Refund API.                                                  |
| Pending Authorization    | Not applied.           | If the bank authorization is still `pending`, the same bank authorization can be used again.                                    |
| Canceled Authorization   | Not applied.           | If the bank authorization is `canceled`, the same bank authorization can be used again.                                         |
| Successful Authorization | Applied.               | If the bank authorization is `successful`, the same bank authorization cannot be used again using the same `merchantReference`. |