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

# Create Transaction

> This endpoint creates a transaction.

## Path Parameters

<ParamField path="user_id" type="string" required />

<ParamField path="member_id" type="string" required />

<ParamField path="account_id" type="string" required />

## Body Parameters

| field                              | description                                                                                                                                                                                                                                                                              |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                               | Unique identifier for the transaction                                                                                                                                                                                                                                                    |
| `description`                      | Description of the transaction. Cannot be longer than 255 characters                                                                                                                                                                                                                     |
| `type`                             | DEBIT or CREDIT                                                                                                                                                                                                                                                                          |
| `amount`                           | Amount of the transaction. The value is always unsigned.                                                                                                                                                                                                                                 |
| `status`                           | PENDING or POSTED                                                                                                                                                                                                                                                                        |
| `transacted_on` or `transacted_at` | The date of the transaction. When provided as transacted\_on, the date is required to be in ISO 8601 format (e.g. 2011-03-28). When provided as transacted\_at, the date is required to be in Unix Epoch format (eg.1355429710).                                                         |
| `posted_on` or `posted_at`         | The date the transaction was posted. When provided as posted\_on, the date is required to be in ISO 8601 format (e.g. 2011-03-28). When provided as posted\_at, the date is required to be in Unix Epoch format (eg.1355429710). Not required for transactions with a status of PENDING. |

<RequestExample>
  ```shell Request theme={null}
  curl -i -X POST https://int-migration.moneydesktop.com/{client_id}/users/{user_id}/migrate/members/{member_id}/accounts/{account_id}/transactions \
    -d '<transaction><id>:id</id><amount>:amount</amount><description>:description</description><status>:status</status><type>:type</type><transacted_on>:transacted_on</transacted_on></transaction>' \
    -H "Content-Type:application/vnd.mx.migration.v1+xml" \
    -H "Accept:application/vnd.mx.migration.v1+xml" \
    -H "MD-API-KEY: :api_key"
  ```
</RequestExample>

<ResponseExample>
  ```xml Response theme={null}
  <transaction>
    <id>T-3QP5X0</id>
    <account_guid>ACT-2eb8cf90-367f-1184-f0d1-bede60d3e07c</account_guid>
    <account_id>A-XZ5Y4L</account_id>
    <amount type="float">8.2</amount>
    <category_guid>CAT-f7851c65-3353-c490-1953-fb9235e681e4</category_guid>
    <category>Gas</category>
    <description>Costco (Gas)</description>
    <guid>TRN-cd2987fe-9afb-e912-a5e3-2eaabb866e43</guid>
    <member_guid>MBR-523ee604-10d7-f94c-556e-8cd7b6d639af</member_guid>
    <member_id>M-39XBF7</member_id>
    <memo>POS Purchase</memo>
    <user_guid>USR-c921d57a-9ae3-1fe2-6c4f-96a84fb92b50</user_guid>
    <user_id>U-39XBF7</user_id>
    <longitude type="float">-43.2075</longitude>
    <latitude type="float">-22.90278</latitude>
    <check_image>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==</check_image>
    <check_number>9543</check_number>
    <type>DEBIT</type>
    <status>POSTED</status>
    <posted_at type="integer">1382975431</posted_at>
    <transacted_at type="integer">1382961600</transacted_at>
  </transaction>
  ```
</ResponseExample>
