Account Plans

 

EndpointAction
GET /account_plans Get a list of all available account plans
GET /account_plans/<plan_id> Get a single plan
GET /accounts/<account_id>/account_plans/price Get the prices for all available account plans (not plans on the account)
GET /accounts/<account_id>/account_plans Get the plans on an account
PUT /accounts/<account_id>/account_plans Update the plans on an account

Get all account plans

Request

curl -X GET -H "X-Auth-Token:fad3e56d000000000000000000000000" {api_url}/v2/account_plans/

Response data

[
  {
    "_id": "1234567",
    "plan_id": "1234567",
    "name": "Test Account Plan",
    "description": "An example of an account plan.",
    "limits": {
      "users": 10,
      "devices": 15,
      "phone_numbers": 0
    }
  },
  {
    ...
  }
]

Get a single account plan

Request

curl -X GET -H "X-Auth-Token:fad3e56d000000000000000000000000" {api_url}/v2/account_plans/1234567

Response data

{
  "_id": "1234567",
  "plan_id": "1234567",
  "name": "Test Account Plan",
  "description": "An example of an account plan.",
  "limits": {
    "users": 10,
    "devices": 15,
    "phone_numbers": 0
  }
},

Get account plan prices

Request

curl -X GET -H "X-Auth-Token:fad3e56d000000000000000000000000" {api_url}/v2/accounts/b78a0df2000000000000000000000000/account_plans/price

Response data

{
  "1234567": "10.00",
  "7654321": "20.00"
}

Get plans on an account

Shows plans for each business partner location

Request

curl -X GET -H "X-Auth-Token:fad3e56d000000000000000000000000" {api_url}/v2/accounts/b78a0df2000000000000000000000000/account_plans

Response data

"account_plans": {
            "1000023": {
                "1020592": {
                    "name": "Name", 
                    "quantity": 90
                }, 
                "1020594": {
                    "name": "Name2", 
                    "quantity": 33
                }
            }, 
            "1000350": {
                "1020592": {
                    "name": "Name", 
                    "quantity": 90
                }, 
                "1020594": {
                    "name": "Name2", 
                    "quantity": 31
                }
            }
        }

Update plans on an account

Request

curl -X PUT -H "X-Auth-Token:fad3e56d000000000000000000000000" {api_url}/v1/accounts/b78a0df2000000000000000000000000/account_plans -d '{"data":{"business_partner_location_id": "1000350", "account_plans":{"1020592": {"quantity": 90, "name": "Name"}, "1020594": {"quantity": 31, "name": "Name2"}}}}'

Response data

        "account_plans": {
            "1000023": {
                "1020592": {
                    "name": "Name", 
                    "quantity": 90
                }, 
                "1020594": {
                    "name": "Name2", 
                    "quantity": 33
                }
            }, 
            "1000350": {
                "1020592": {
                    "name": "Name", 
                    "quantity": 90
                }, 
                "1020594": {
                    "name": "Name2", 
                    "quantity": 31
                }
            }
        }