FORMAT: 1A

# Group Vectorapi
Group of all vectorapi-related resources.

## Subaccount Royalty Collection Territories

This resource retrieves collection of royalty collection territories based on subaccount id.

## Index [/vectorapi/subaccountroyaltycollection/index{?subaccountId,limit,access_token}]

### Index [GET]

+ Parameters

    + subaccountId (required, number, `17`)
    + limit  (optional, number, `2`)
    + access_token (varchar, `some token`)
  
+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "testing.vapi.devorch.com",
      "httpStatusCode": 200
    },
    "request": "subaccountroyaltycollection/index?params=vectorapi&subaccountroyaltycollection&index&json&1&2&<some_token>",
    "response": {
      "subaccountRoyaltyCollectionTerritories": {
        "subaccount": {
          "subaccountId": 1,
          "subaccountName": "Label One"
        },
        "countryId": [
          {
            "id": 1,
            "name": "USA",
            "abbrivation": "US",
            "continent": "North America"
          },
          {
            "id": 2,
            "name": "Canada",
            "abbrivation": "CA",
            "continent": "North America"
          }
        ]
      }
    }
  }
}

+ **Other Optional Parameters**

    + Pagination Options : limit, offset
    + Sort Options : sort_by, sort_order (By default order is ASC)
    + Parameter options : subaccountId


## POST [/vectorapi/subaccountroyaltycollection/post{?data,access_token}]

### Post [POST]

+ Parameters

    + data (varchar, `{"subaccountId":"1","territories":[1,2]}`)
    + access_token (varchar, `some token`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "testing.vapi.devorch.com",
      "httpStatusCode": 200
    },
    "request": "subaccountroyaltycollection/post?params=vectorapi&subaccountroyaltycollection&post&json&{\"subaccountId\":\"1\",\"territories\":[1,2]}&<some_token>",
    "response": {
      "subaccountRoyaltyCollection": {
        "subaccountRoyaltyCollectionId": 22,
        "subaccountRoyaltyCollectionTerritories": [
          3054,
          3055
        ]
      }
    }
  }
}

+ **Required Parameters**

    + subaccountId, territories


## Delete [/vectorapi/subaccountroyaltycollection/delete{?subaccountId,access_token}]

### Delete [DELETE]

+ Parameters

    + subaccountId (required, number, `1`)
    + access_token (required ,varchar, `some token`)

+ Request JSON Message
    
    + Headers

            Accept: application/json

+ Response 200 (application/json)

    + Body
{
  "envelope": {
    "header": {
      "apiVersion": "1.0",
      "baseUrl": "testing.vapi.devorch.com",
      "httpStatusCode": 200
    },
    "request": "subaccountroyaltycollection/delete?params=vectorapi&subaccountroyaltycollection&delete&json&1&<some_token>",
    "response": {
      "subaccountId": "1"
    }
  }
}


+ **Required Parameters**

    + subaccountId - Primary key of subaccount table.
