FORMAT: 1A
HOST: http://orchardapi.theorchard.com/

# Group Vectorapi
Group of all vectorapi-related resources.

## Track Pricing

Each track of a release may have tier assigned to it. Track related tier may assign to different territories. User can select those territories from the bunch of territories. A bunch of territories are territories which are already assigned to pricing scheme of that pricing tier.

This API resource maintain track related pricing tier information for different territories assigned to it.

## Request example for Index 1 [/vectorapi/trackPricing/index{?trackId,limit}]

### Index [GET]

+ Parameters

    + trackId (required, number, `18128695`)
    + limit (optional, number, `2`)
 
+ Request JSON Message
    
    + Headers

            Accept: application/json
            access_token : (access_token as per user type)

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackPricing/index?trackId=18128695&limit=2",
    "response": {
      "trackPricingTier": [
        {
          "id": 2,
          "uniqueTrackId": "18128695",
          "active": "Y",
          "addedByUserId": 1,
          "addedByUserType": "oa",
          "pricingTier": "Frontline",
          "trackCustomPricing": [],
          "trackPricingTierCountry": [
            {
              "id": 203,
              "country": {
                "id": 1,
                "name": "USA",
                "abbrivation": "US",
                "continent": "North America"
              }
            },
            {
              "id": 204,
              "country": {
                "id": 3,
                "name": "United Kingdom",
                "abbrivation": "GB",
                "continent": "Europe"
              }
            }
          ],
          "pricingTierId": 151,
          "DmsMasterPricingScheme": "Amazon",
          "pricingSchemeId": 17
        }
      ]
    }
  }
}

## Request example for Index 2 [/vectorapi/trackPricing/index{?uniqueTrackIds,limit}]

Request for Multiple tracks ids

### Index [GET]

+ Parameters

    + uniqueTrackIds (required, number, `18135944,18219773,18245142`)
    + limit (optional, number, `2`)
 
+ Request JSON Message
    
    + Headers

            Accept: application/json
            access_token : (access_token as per user type)

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackPricing/index?uniqueTrackIds=18135944%2C18219773%2C18245142&limit=2",
    "response": {
      "trackPricingTier": [
        {
          "id": 8,
          "uniqueTrackId": "18135944",
          "active": "Y",
          "addedByUserId": 1,
          "addedByUserType": "oa",
          "pricingTier": "Mid",
          "trackCustomPricing": [],
          "trackPricingTierCountry": [
            {
              "id": 233,
              "country": {
                "id": 1,
                "name": "USA",
                "abbrivation": "US",
                "continent": "North America"
              }
            },
            {
              "id": 234,
              "country": {
                "id": 3,
                "name": "United Kingdom",
                "abbrivation": "GB",
                "continent": "Europe"
              }
            }
          ],
          "pricingTierId": 25,
          "DmsMasterPricingScheme": "iTunes Music",
          "pricingSchemeId": 8
        }
      ]
    }
  }
}


+ **Other Optional Parameters**

    + Optional Parameters : limit, offset
    + Sort Options : sortBy, sortOrder
    + Parameter options (filter): trackId,uniqueTrackIds,active  

## GET [/vectorapi/trackpricing/get{?id}]

+ Parameters

    + id (required,number, `2`) 

### Get [GET]

+ Request JSON Message
    
    + Headers

            Accept: application/json
            access_token : (access_token as per user type)

+ Response 200 (application/json)
    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackpricing/get?id=2",
    "response": {
      "trackPricingTier": {
        "id": 2,
        "uniqueTrackId": "18128695",
        "addedByUserId": 1,
        "addedByUserType": "oa",
        "trackCustomPricing": {},
        "trackPricingTierCountry": [
          {
            "id": 203,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 1,
              "name": "USA",
              "abbrivation": "US",
              "continent": "North America",
              "latitude": "37.090240",
              "longitude": "-95.712891",
              "iso3166a3": "USA",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 204,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 3,
              "name": "United Kingdom",
              "abbrivation": "GB",
              "continent": "Europe",
              "latitude": "55.378051",
              "longitude": "-3.435973",
              "iso3166a3": "GBR",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 205,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 16,
              "name": "Austria",
              "abbrivation": "AT",
              "continent": "Europe",
              "latitude": "47.516231",
              "longitude": "14.550072",
              "iso3166a3": "AUT",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 206,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 6,
              "name": "France",
              "abbrivation": "FR",
              "continent": "Europe",
              "latitude": "46.227638",
              "longitude": "2.213749",
              "iso3166a3": "FRA",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 207,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 4,
              "name": "Germany",
              "abbrivation": "DE",
              "continent": "Europe",
              "latitude": "51.165691",
              "longitude": "10.451526",
              "iso3166a3": "DEU",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 208,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 90,
              "name": "Ireland",
              "abbrivation": "IE",
              "continent": "Europe",
              "latitude": "53.412910",
              "longitude": "-8.243890",
              "iso3166a3": "IRL",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 209,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 9,
              "name": "Japan",
              "abbrivation": "JP",
              "continent": "Asia",
              "latitude": "36.204824",
              "longitude": "138.252924",
              "iso3166a3": "JPN",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 210,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 15,
              "name": "Spain",
              "abbrivation": "ES",
              "continent": "Europe",
              "latitude": "40.463667",
              "longitude": "-3.749220",
              "iso3166a3": "ESP",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 211,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 11,
              "name": "Switzerland",
              "abbrivation": "CH",
              "continent": "Europe",
              "latitude": "46.818188",
              "longitude": "8.227512",
              "iso3166a3": "CHE",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 212,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 12,
              "name": "Italy",
              "abbrivation": "IT",
              "continent": "Europe",
              "latitude": "41.871940",
              "longitude": "12.567380",
              "iso3166a3": "ITA",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          }
        ],
        "pricingTierId": 151
      }
    }
  }
}

## POST [/vectorapi/trackpricing/post{?data}]

### Post [POST]

+ Parameters

    + data (varchar, `{"uniqueTrackId":18219773,"pricingTierId":1,"countryIds":[1,2,3],"trackCustomPricing":[{"price":0.3,"currencyCode":"USD"}]}`)

+ Request JSON Message
    
    + Headers

            Accept: application/json
            access_token : (access_token as per user type)

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackpricing/post?data=%7B%22uniqueTrackId%22%3A18219773%2C%22pricingTierId%22%3A1%2C%22countryIds%22%3A%5B1%2C2%2C3%5D%2C%22trackCustomPricing%22%3A%5B%7B%22price%22%3A0.3%2C%22currencyCode%22%3A%22USD%22%7D%5D%7D",
    "response": {
      "id": 3993
    }
  }
}


+ **Other Parameters**

    + Required Parameters : uniqueTrackId,pricingTierId 
    + Optional Parameters : countryIds,trackCustomPricing,addedByUserId,addedByuserType


## PUT [/vectorapi/trackpricing/put{?data}]

### Put [POST]

+ Parameters

    + data (varchar, `{"id":10,"uniqueTrackId":18219773,"pricingTierId":25,"countryIds":[1,2,3],"trackCustomPricing":[{"price":0.5,"currencyCode":"USD"}]}`)

+ Request JSON Message
    
    + Headers

            Accept: application/json
            access_token : (access_token as per user type)

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackpricing/put?data=%7B%22id%22%3A10%2C%22uniqueTrackId%22%3A18219773%2C%22pricingTierId%22%3A25%2C%22countryIds%22%3A%5B1%2C2%2C3%5D%2C%22trackCustomPricing%22%3A%5B%7B%22price%22%3A0.5%2C%22currencyCode%22%3A%22USD%22%7D%5D%7D",
    "response": {
      "trackPricingTier": {
        "id": 10,
        "uniqueTrackId": 18219773,
        "addedByUserId": "5",
        "addedByUserType": "oa",
        "trackPricingTierCountry": [
          {
            "id": 445,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 1,
              "name": "USA",
              "abbrivation": "US",
              "continent": "North America",
              "latitude": "37.090240",
              "longitude": "-95.712891",
              "iso3166a3": "USA",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 446,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 3,
              "name": "United Kingdom",
              "abbrivation": "GB",
              "continent": "Europe",
              "latitude": "55.378051",
              "longitude": "-3.435973",
              "iso3166a3": "GBR",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          },
          {
            "id": 457,
            "trackPricingTier": {},
            "country": {
              "__isInitialized__": true,
              "id": 2,
              "name": "Canada",
              "abbrivation": "CA",
              "continent": "North America",
              "latitude": "56.130366",
              "longitude": "-106.346771",
              "iso3166a3": "CAN",
              "CountryLanguage": {},
              "CountryRatingAdvisorySystem": {}
            }
          }
        ],
        "trackCustomPricing": [
          {
            "id": 55,
            "trackPricingTier": {},
            "customPrice": 0.5,
            "currencyCode": "USD"
          }
        ],
        "pricingTierId": 25
      }
    }
  }
}


+ **Other Parameters**

    + Required Parameters : id
    + Optional Parameters : uniqueTrackId,pricingTierId,countryIds,trackCustomPricing,addedByUserId,addedByuserType 
     

## Delete [/vectorapi/trackpricing/delete{?id}]

### Delete [GET]

+ Parameters

    + id (required, varchar, `1079`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "orchardapi.theorchard.com",
      "httpStatusCode": 200
    },
    "request": "/vectorapi/trackpricing/delete?id=1079",
    "response": {
      "trackPricingTier": true
    }
  }
}