# Plan Change

This service is used to request plan changes.

# Special notes:

Various preconditions on the client's account must be met before sending a successful request, please see all responses on the failed request about eligibility of sending a plan change request.

# Request Configuration

# Request Endpoint

/api/Account/ChangePlan

# Request Method

POST

# Request Headers

Name Type Description
aaid string Use aaid returned from Login
token string Use token returned from Login
cnum string Currently use cnum returned from PhoneBox Customer Care, will automate this process

# Request Parameters:

Name Type Description
pfid int
  • If currently on Prepaid Plans, use PlanId returned from Get Prepaid Plans
  • If currently on Postpaid Plans, use pfid returned from Get Postpaid Plans
  • We do not support changing from Prepaid plan to Postpaid plan, or vice versa
reason string reason of requesing a plan change. more details on this coming soon.
effDate DateTime Date when PlanChange should become effective. This value of effDate depends on Cut off Date.

Cut off Date: 2 DAY before the Last Date of the Month.
  • If requested after cut off, effective date must be one month after the following month.
  • Eg. if requested between July 30th to August 1st, effective date should be September 2nd.
  • Effective Date must always be 2nd of the month.

# Request Body

None

# Sample Reqeust

# Sample Request URL

http://localhost:60904/api/Activation/GetTotalPrepaid?orderSimCard=True&PlanID=6666&CountryId=42&ProvinceCode=BC&start=2020-10-31&promocode=MyPromoCode

# cURL

curl --location --request GET 'http://localhost:60904/api/Activation/GetTotalPrepaid?orderSimCard=True&PlanID=6666&CountryId=42&ProvinceCode=BC&start=2020-10-31&promocode=MyPromoCode' \
--header 'client: 6666' \
--header 'apitoken: foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'

# Python - Requests

import requests
url = "http://localhost:60904/api/Activation/GetTotalPrepaid"

params = {
        'orderSimCard': 'True', 
        'PlanID': '66666',
        'CountryId': '247',
        'ProvinceCode': 'ON',
        'start': '2020-10-31',
        'promocode': 'MyPromoCode' 
}

headers = {
    'client': '1234',
    'apitoken': 'foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'
}
response = requests.get(url, headers=headers, params=params)

print(response.text.encode('utf8'))

# NodeJs -Axios

var axios = require('axios');

var data = {};

const params = new URLSearchParams({
    carrier: 'R',
    promocode: 'MyPromoCode'
}).toString();

const url =
    "https://testmyaccount.azurewebsites.net/api/Activation/PrepaidPlans" +
    params;



axios
    .get(
        url,
        {
            headers: {
                client: '66666',
                apitoken: 'foqxcFJ82EhecRXnIZbeQbb8m9'
            },
            params: {
                orderSimCard: 'True', 
                PlanID: '66666',
                CountryId: '247',
                ProvinceCode: 'ON',
                start: '2020-10-31',
                promocode: 'MyPromoCode' 
            }
        }
    )
    .then(res => {
        console.log(JSON.parse(res.data));
    })
    .catch(err => {
        console.log(err);
    });

# Response

# Success

return a list of JSON containing below information

[[
    {
        "currency": "CAD",
        "plan_Amt": 45.00,
        "prorate_Duration": "Oct 31, 2020~Nov 01, 2020",
        "charge_Duration": "Nov 02, 2020~Dec 01, 2020",
        "prorate_Amt": 3.00,
        "simcard_amt": 0.0,
        "subtotal": 48.00,
        "gst_rate": 5.000,
        "pst_rate": 7.000,
        "gst_Amt": 2.40,
        "pst_Amt": 3.36,
        "promo_Amt": 0.00,
        "total": 53.76,
        "prorate_Start": "Oct 31, 2020",
        "prorate_End": "Nov 01, 2020",
        "prorate_DataCap": "204.80 MB",
        "firstmonth_DataCap": "204.80 MB",
        "charge_Start": "Nov 02, 2020",
        "dataaddon_Fee": 0.0,
        "prorate_Pct": 0.07
    }
]

# Fail

  1. Failed Authorization

    reason: wrong login credential or client number cnum does not belong to this partner

    {
        "Message": "Authorization has been denied for this request."
    }
    
  2. Wrong Client Info

    reason: entered invalid client number cnum

    {
        "ERROR: Cannot find client info!";
    }
    
  3. Duplicated Request

    reason: there is a pending change plan request on this client's account

    {
        "Failed: Request duplicating.";
    }
    
  4. Invalid Effective Date

    reason: effdate must strictly follow conditions listed above.

    {
        "Failed: Invalid date.";
    }
    
  5. Client's account is ineligible for a plan change

    reason: client is using a device contract plan

    {
        "Please contact Customer support by calling us toll free at 1-855-886-0505 chat with us live on our website gophonebox.com or email us at services@gophonebox.com.";
    }
    
LastUpdated: 1/7/2021, 7:42:25 PM