# Create and update transactions

Source: https://developer.avalara.com/products/mylodge/integration-guides/mylodgetax/prr8080814548621/

Guide: MyLodgeTax

# Create and update transactions

**Element type**: Required

**Endpoint/model**: [addOrUpdateRevenueTransactions](https://developer.avalara.com/api-reference/myLodgeAPI/v1/methods/Revenue/addOrUpdateRevenueTransaction/)

Your integration must allow users to run transactions. You run transactions using the [addOrUpdateRevenueTransactions](https://developer.avalara.com/api-reference/myLodgeAPI/v1/methods/Revenue/addOrUpdateRevenueTransaction/) endpoint. This endpoint allows you to submit revenue information for a given location, and stores it under the provided transaction ID. If the provided transaction ID already exists, this operation will overwrite the previously submitted data.

The table below shows the fields that you can include in MyLodgeTax transactions.

Field

Description

Type

`bookingDate`

The date when you booked the rental property. The expected date format is _YYYY-MM-DD_. If you include this date, it cannot be after the `transactionDate`.

string

`exemptNights`

The number of total nights exempt from tax.

number

`exemptRevenue`

The amount of total revenue that is exempt from taxation.

number

`memo`

Memo field that describes the transaction data. This is what the customer will see in the Avalara MyLodgeTax application. Partners should provide a meaningful description for the customer's reference, although this is optional.

string

`sourceMarketing`

The marketplace that the transaction applies to (for example, `Airbnb`, `Vrbo`, `FlipKey`). You don't need to supply this field if you represent a single marketplace; in this case, `sourceMarketplace` will be inferred from your API key. For partners that list on multiple 3rd party marketplaces, this field is required so that the correct customer-owed tax can be computed based on the tax that the given marketplace is known to collect and pay.

string

`totalNights`

The number of nights for which you collected the revenue.

number

`totalRevenue`

The system reports the total revenue amount. Tax is not included in this value.

number

`transactionDate`

The date that the revenue is being is reported for. The expected date format is _YYYY-MM-DD_.

Transaction dates will only be accepted for the current month or for the previous calendar month through 04:59:59 am on the 1st day of the month, U.S. Pacific Time. Tax returns are filed based on the transaction date, and tax monies will be debited from the customer's account during the month the tax return will be filed.

string

The example below creates a new transaction for location 00001. The transaction ID for this location is 123456789. If a transaction ID already exists, then this API will overwrite the previously submitted data.

```
curl -X 'PUT' \
  'https://mylodgetaxapi-sbx.avalara.net/v1/locations/00001/revenuetransactions/123456789' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "transactionDate": "2022-12-01",
    "totalRevenue": "1000",
    "exemptRevenue": "0",
    "totalNights": "11",
    "exemptNights": "1",
    "memo": "PLS Testing",
    "sourceMarketplace": "Vrbo",
    "bookingDate": "2022-12-01"
}'
```