> For the complete documentation index, see [llms.txt](https://docs.delos.financial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delos.financial/validation/transaction-creation.md).

# Transaction creation

### General principle

The request body for creating a transaction has the same shape for every type, but the valid values and combinations of the `paymentType`, `sourceRequisit`, and `destinationRequisit` fields depend on the value of the `type` field. Below is how to correctly build a request for each type.

***

### Type `EXCHANGE` — currency exchange

How to build the request:

1. Set `type: "EXCHANGE"`.
2. `paymentType` must always be set to `"EMPTY"`.
3. `sourceRequisit.account` and `destinationRequisit.account` must reference two different accounts that are in **different currencies**. The same account cannot be used for both source and destination.
4. `sourceRequisit.account`  must belong to `customerId`.

Example of a valid request:

```json
{
  "customerId": "DHgsZkC-rvmu-0HYxwr1B65nD",
  "paymentType": "EMPTY",
  "type": "EXCHANGE",
  "sourceRequisit": {
    "account": "Usco8JZs2Nfo"
  },
  "destinationRequisit": {
    "account": "EOdGnNNGgjbd"
  },
  "amount": {
    "units": "1",
    "nanos": 0
  }
}
```

***

### Type `TRANSFER` —  transferring funds between own or other customers’ accounts within our system.

How to build the request:

1. Set `type: "TRANSFER"`.
2. `paymentType` must always be set to `"EMPTY"`.
3. `sourceRequisit.account` and `destinationRequisit.account` must reference two different accounts that are in **the same currency**.
4. `sourceRequisit.account`  must belong to `customerId`.

Example of a valid request:

```json
{
  "customerId": "DHgsZkC-rvmu-0HYxwr1B65nD",
  "paymentType": "EMPTY",
  "type": "TRANSFER",
  "sourceRequisit": {
    "account": "Usco8JZs2Nfo"
  },
  "destinationRequisit": {
    "account": "UOdGnNNGgjbd"
  },
  "amount": {
    "units": "1",
    "nanos": 0
  }
}
```

***

### Type `WITHDRAW` — withdrawal to a beneficiary

How to build the request:

1. Set `type: "WITHDRAW"`.
2. `paymentType` **cannot** be `"EMPTY"` — it must be set to the value matching the support rail (payment system) of the beneficiary's account, for example `"SWIFT"`.
3. `destinationRequisit` must always be described via the `beneficiar` field (not `account`) — it holds the recipient's account.
4. `sourceRequisit.account`  must belong to `customerId`.

Example of a valid request:

```json
{
  "customerId": "DHgsZkC-rvmu-0HYxwr1B65nD",
  "paymentType": "SWIFT",
  "type": "WITHDRAW",
  "sourceRequisit": {
    "account": "Usco8JZs2Nfo"
  },
  "destinationRequisit": {
    "beneficiar": "UOdGnNNGgjbd"
  },
  "amount": {
    "units": "1",
    "nanos": 0
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.delos.financial/validation/transaction-creation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
