# addOrUpdateRevenueTransaction

Creates or updates revenue information for a given location, stored by the provided transaction id.

`PUT /v1/locations/{locationid}/revenuetransactions/{transactionid}`

**API:** Avalara MyLodgeTax API
**Tag:** Revenue
**API Version:** v1.2
**Base URL:** https://mylodgetaxapi-sbx.avalara.net
**Content-Type:** `application/json`
**Authentication:** API Key (`Authorization` in header)

Source: https://developer.avalara.com/products/mylodge/api/methods/Revenue/addOrUpdateRevenueTransaction/

## Description

The PUT operation of the revenuetransactions endpoint allows for the submittal of revenue information for a given location, to be stored under the provided transaction id.
>
If the provided transaction id already exists, this operation will overwrite the previously submitted data.
>
Booking date, if supplied, cannot be after transaction date.
>
Transaction dates will only be accepted for the current month, or for the previous calendar month, through 04:59:59 am on the first day of the month, U.S. Pacific Time.  Tax returns are filed based on transaction date, and tax monies will be debited from the customer's account during the month the tax return will be filed.  See _API Receipt Start_ and _API Receipt Cutoff_ columns in sample schedules below.
>

Customers with API-linked revenue will be able to confirm revenue via the Avalara MyLodgeTax application starting on the first day of the month at 05:00:00 am, U.S. Pacific Time. See _Customer Confirmation Start_ column in sample schedules below.
>
If a customer does not manually confirm revenue, revenue delivered via this API endpoint will be automatically confirmed after 16:00:00, U.S. Pacific Time, on:
* the fifth day of the month if any of the customer's tax returns are due the tenth day of the month or earlier
* the tenth day of the month if all of the customer's tax returns are due after the tenth day of the month
See _Customer Confirmation Cutoff_ column in sample schedules below.
>
Customer bank accounts will be debited for net tax owed during the month that the tax return is due when revenue is confirmed.  Tax returns will be filed during the same month based on jurisdiction due dates.  See _Filing & Remittal Date_ column below.
>
Sample schedules are as follows:
===
>
Jurisdictions that require monthly filing & remittance
___
Transaction Date  | API Receipt Start | API Receipt Cutoff | Customer Confirmation Start | Customer Confirmation Cutoff  | Filing & Remittal Date
----------------  | ----------------- | ----------------------- | ---------------------  | ----------------------------  | ----------------------
2019-01-**        | 2019-01-01        | 2019-02-01 4:59:59 am PT      | 2019-02-01 5:00:00 am PT                  | 2019-02-05 or 2019-02-10      | 2019-02-05 thru 2019-02-25
2019-02-**        | 2019-02-01        | 2019-03-01 4:59:59 am PT      | 2019-03-01 5:00:00 am PT                  | 2019-03-05 or 2019-03-10      | 2019-03-05 thru 2019-03-25
...               | ...               | ...             | ...                         | ...                              | ...
2019-11-**        | 2019-11-01        | 2019-12-01 4:59:59 am PT      | 2019-12-01 5:00:00 am PT                  | 2019-12-05 or 2019-12-10      | 2019-12-05 thru 2019-12-25
2019-12-**        | 2019-12-01        | 2020-01-01 4:59:59 am PT      | 2020-01-01 5:00:00 am PT                  | 2020-01-05 or 2020-01-10      | 2020-01-05 thru 2020-01-25
>
Jurisdictions that require quarterly filing & remittance (filing dates for sample jurisdiction fiscal year starting January 1; note that some jurisdictions' fiscal years do not start in January)
___
Transaction Date  | API Receipt Start | API Receipt Cutoff | Customer Confirmation Start | Customer Confirmation Cutoff  | Filing & Remittal Date
----------------  | ----------------- | ----------------------- | ---------------------  | ----------------------------  | ----------------------
2019-01-**        | 2019-01-01        | 2019-02-01 4:59:59 am PT      | 2019-02-01 5:00:00 am PT                  | 2019-02-05 or 2019-02-10      | 2019-04-05 thru 2019-04-25
2019-02-**        | 2019-02-01        | 2019-03-01 4:59:59 am PT      | 2019-03-01 5:00:00 am PT                  | 2019-03-05 or 2019-03-10      | 2019-04-05 thru 2019-04-25
2019-03-**        | 2019-03-01        | 2019-04-01 4:59:59 am PT      | 2019-04-01 5:00:00 am PT                  | 2019-04-05 or 2019-04-10      | 2019-04-05 thru 2019-04-25
2019-04-**        | 2019-04-01        | 2019-05-01 4:59:59 am PT      | 2019-05-01 5:00:00 am PT                  | 2019-05-05 or 2019-05-10      | 2019-07-05 thru 2019-07-25
2019-05-**        | 2019-05-01        | 2019-06-01 4:59:59 am PT      | 2019-06-01 5:00:00 am PT                  | 2019-06-05 or 2019-06-10      | 2019-07-05 thru 2019-07-25
2019-06-**        | 2019-06-01        | 2019-07-01 4:59:59 am PT      | 2019-07-01 5:00:00 am PT                  | 2019-07-05 or 2019-07-10      | 2019-07-05 thru 2019-07-25
...               | ...               | ...             | ...                         | ...                              | ...
2019-10-**        | 2019-10-01        | 2019-11-01 4:59:59 am PT      | 2019-11-01 5:00:00 am PT                  | 2019-11-05 or 2019-11-10      | 2020-01-05 thru 2020-01-25
2019-11-**        | 2019-11-01        | 2019-12-01 4:59:59 am PT      | 2019-12-01 5:00:00 am PT                  | 2019-12-05 or 2019-12-10      | 2020-01-05 thru 2020-01-25
2019-12-**        | 2019-12-01        | 2020-01-01 4:59:59 am PT      | 2020-01-01 5:00:00 am PT                  | 2020-01-05 or 2020-01-10      | 2020-01-05 thru 2020-01-25
>
Jurisdictions that require annual filing & remittance (filing dates for sample jurisdiction fiscal year starting January 1; note that some jurisdictions' fiscal years do not start in January)
___
Transaction Date  | API Receipt Start | API Receipt Cutoff | Customer Confirmation Start | Customer Confirmation Cutoff  | Filing & Remittal Date
----------------  | ----------------- | ----------------------- | ---------------------  | ----------------------------  | ----------------------
2019-01-**        | 2019-01-01        | 2019-02-01 4:59:59 am PT      | 2019-02-01 5:00:00 am PT                  | 2019-02-05 or 2019-02-10      | 2020-01-05 thru 2020-01-25
2019-02-**        | 2019-02-01        | 2019-03-01 4:59:59 am PT      | 2019-03-01 5:00:00 am PT                  | 2019-03-05 or 2019-03-10      | 2020-01-05 thru 2020-01-25
...               | ...               | ...             | ...                         | ...                              | ...
2019-11-**        | 2019-11-01        | 2019-12-01 4:59:59 am PT      | 2019-12-01 5:00:00 am PT                  | 2019-12-05 or 2019-12-10      | 2020-01-05 thru 2020-01-25
2019-12-**        | 2019-12-01        | 2020-01-01 4:59:59 am PT      | 2020-01-01 5:00:00 am PT                  | 2020-01-05 or 2020-01-10      | 2020-01-05 thru 2020-01-25

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `locationid` | string | path | Yes | Unique location identifier assigned when posting a partnerLead (_locationId_). |
| `transactionid` | string | path | Yes | Partner-defined unique identifier for a revenue transaction. |

## Request Body

**Schema:** `PutRevenueTransactionsRequest`

Request body definition for call to PUT /v1/locations/{locationid}/revenuetransactions/{transactionid}. The fields 'memo', 'bookingDate', and 'sourceMarketplace' are optional.

| Property | Type | Required | Description |
|---|---|---|---|
| `transactionDate` | string | No | The date that the revenue is being reported for. Expected date format is 'YYYY-MM-DD'. |
| `totalRevenue` | number | No | The total revenue amount being reported.  Tax should not be included in this value. |
| `exemptRevenue` | number | No | The amount of the totalRevenue that is exempt from being taxed. |
| `totalNights` | number | No | The number of nights that the revenue was collected for. |
| `exemptNights` | number | No | The number of the totalNights that are exempt from being taxed. |
| `memo` | string | No | Memo field that describes the transaction data.  This is what the customer will see in the Avalara MyLodgeTax application.  Although optional, partners are strongly encouraged to provide a meaningful description for the customer's reference. |
| `sourceMarketplace` | string | No | The marketplace that the transaction applies to (e.g. AirbnB, Vrbo, etc). This field does not need to be supplied from partners who represent a single marketplace; sourceMarketplace will be inferred from your API key.
For partners that list on multiple third-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 remit. |
| `bookingDate` | string | No | The date that the rental property was booked. Expected date format is 'YYYY-MM-DD'. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | OK |  |
| 400 | Bad request: check response body message for details | `ErrorResponse` |
| 401 | Unauthorized | `ErrorResponse` |
| 404 | Location Not Found | `ErrorResponse` |
| 409 | The given transactionId is already associated with another property | `ErrorResponse` |
| 422 | The provided location id is for an inactive location  -OR- the transaction date in the request-body is outside the  current reporting-period  -OR- The provided location id is not linked to a MyLodgeTax property. | `ErrorResponse` |
| 429 | Exceeded API Rate Limits | `ErrorResponse` |

## Example Request

```bash
curl -X PUT "https://mylodgetaxapi-sbx.avalara.net/v1/locations/{locationid}/revenuetransactions/{transactionid}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "transactionDate": "",
  "totalRevenue": "",
  "exemptRevenue": "",
  "totalNights": "",
  "exemptNights": "",
  "memo": "",
  "sourceMarketplace": "",
  "bookingDate": ""
}'
```