# Direct sale scenario

Source: https://developer.avalara.com/marketplace-integration-guide/test-transactions/direct-sale-scenario/

This scenario shows how to create sales transactions with goods sold direcly by you and with goods sold by two different merchants. For example, imagine a scenario where a buyer is purchasing a record player directly from you and two vinyl albums from two different merchants. For this scenario, the example below creates three separate transactions, though the user sees only a single checkout.

Keep in mind that your business model will determine whether you will combine the merchant transactions into a single, multi-merchant transaction or whether you will create a transaction for each merchant. You should also determine how you will handle shipping for this type of transaction. Specifically, will you charge a single, lump sum for shipping across the entire order, or will you charge shipping per vendor?

This scenario assumes the following:

Transaction 1

-   This includes a direct sales transaction for a record player.

-   Line 1 `amount` is $200, and the `taxCode` is `P0000000`.

-   The `shipFrom` address from the direct sale is in WA state.

-   The `shipTo` address is in WA state.

-   A flat, non-taxable shipping rate of $5.00 is applied to the direct sales transaction.

Transaction 2

-   This includes a sales transaction for a single vinyl record.

-   The `merchantSellerIdentifier` field for this merchant is specified as `Merchant12345`.

-   The `amount` is $25, and the `taxCode` is P0000000.

-   The `shipFrom` address is in WA state.

-   The `shipTo` address is in WA state.

-   No shipping charges are applied to this sales transaction.

Transaction 3

-   This includes a sales transaction for a single vinyl record.

-   The `merchantSellerIdentifier` field for this merchant is specified as `Merchant23456`.

-   Line 2 `amount` is $25, and the `taxCode` is `P0000000`.

-   The `shipFrom` address is in CA.

-   The `shipTo` address is in WA state.

-   No shipping charges are applied to this sales transaction.

## Expected result

For the three transactions:

-   The total amount for the items should be $250.

-   The total freight should be $5.00.

-   The total tax calculated for the three transactions shipping to WA state should be $25.26.

    -   $20.20 tax collected from transaction 1.

    -   $2.53 tax collected from transaction 2.

    -   $2.53 tax collected from transaction 3.

![Marketplace direct scale transaction](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Resources/Images/DevDot/direct-sale-scenario_716x501.png)  

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 1 request](javascript:void\(0\);)

```
{  "lines": [    {      "number":"1",      "quantity":1,      "amount":200,      "taxCode":"P0000000",      "itemCode":"DSRECPLYR",      "description":"Direct Sale - Record Player",      "discounted": false    },    {      "number":"2",      "quantity":1,      "amount":5,      "taxCode":"NT",      "itemCode":"Freight",      "description":"Common Carrier for Item 1",      "discounted": false,      "ref1": "Freight from Direct Sale"    }  ],  "addresses": {    "shipFrom":{      "line1":"100 Ravine Ln NE",      "city":"Bainbridge Island",      "region":"WA",      "country":"US",      "postalCode":"98110-2687"    },    "shipTo":{      "line1":"1942 Westlake Avenue",      "city":"Seattle",      "region":"WA",      "country":"US",      "postalCode":"98101"    }  },  "code":"Direct Sale Scenario 1",  "type":"SalesInvoice",  "companyCode":"AVALARADEMOSTORE",  "date":"2024-07-25",  "customerCode":"Test Customer ID",  "commit":true,  "currencyCode":"USD"}
```

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 1 response](javascript:void\(0\);)

```
...  "totalAmount": 205,  "totalExempt": 5,  "totalDiscount": 0,  "totalTax": 20.2,  "totalTaxable": 200,  "totalTaxCalculated": 20.2,...
```

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 2 request](javascript:void\(0\);)

```
{  "lines": [    {      "number":"1",      "quantity":1,      "amount":25,      "taxCode":"P0000000",      "itemCode":"MPFVinylRecord",      "description":"MPF Vinyl Record One",      "discounted": false,      "merchantSellerIdentifier": "Merchant12345",      "addresses": {        "shipFrom":{          "line1":"12348 NE 115th Pl",          "city":"Kirkland",          "region":"WA",          "country":"US",          "postalCode":"98033"        },        "shipTo":{          "line1":"1942 Westlake Avenue",          "city":"Seattle",          "region":"WA",          "country":"US",          "postalCode":"98101"        }      }    }  ],  "code":"Direct Sale Scenario 2",  "type":"SalesInvoice",  "companyCode":"DICEYREILLYS",  "date":"2024-07-25",  "customerCode":"Test Customer ID",  "commit":true,  "currencyCode":"USD",  "isSellerImporterOfRecord":true}
```

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 2 response](javascript:void\(0\);)

Verify that the total tax calculated for this $25 transaction is $2.53.

```
...  "totalAmount": 25,  "totalExempt": 0,  "totalDiscount": 0,  "totalTax": 2.53,  "totalTaxable": 25,  "totalTaxCalculated": 2.53,...
```

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 3 request](javascript:void\(0\);)

```
{  "lines": [    {      "number":"1",      "quantity":1,      "amount":25,      "taxCode":"P0000000",      "itemCode":"MPFVinylRecord",      "description":"MPF Vinyl Record Two",      "discounted": false,      "merchantSellerIdentifier": "Merchant23456",      "addresses": {        "shipFrom":{          "line1":"145 W Santa Clara St",          "city":"San Jose",          "region":"CA",          "country":"US",          "postalCode":"95113"        },        "shipTo":{          "line1":"1942 Westlake Avenue",          "city":"Seattle",          "region":"WA",          "country":"US",          "postalCode":"98101"        }      }    }  ],  "code":"Direct Sale Scenario 3",  "type":"SalesInvoice",  "companyCode":"DICEYREILLYS",  "date":"2024-07-25",  "customerCode":"Test Customer ID",  "commit":true,  "currencyCode":"USD",  "isSellerImporterOfRecord":true}
```

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Transaction 3 response](javascript:void\(0\);)

Verify that the total tax calculated for this $25 transaction is $2.53.

```
...  "totalAmount": 25,  "totalExempt": 0,  "totalDiscount": 0,  "totalTax": 2.53,  "totalTaxable": 25,  "totalTaxCalculated": 2.53,...
```