Query Information about the Plan Available for Trial

Query detailed information about specific plan that you are authorized to get a trial.

Request URL

GET {base_url}/pricing/openapi/purchase/v1/trial/plan_info/{pricingPlanId}?{query parameters}

Request parameters

Path parameter
Parameter Required Type Description
pricingPlanId Yes String

The unique pricing ID of specific plan for the desired product.

Note: To obtain the pricing plan ID, you need to first obtain product ID using the Query Available Subscription Products interface, then query the pricing plan ID using the Query Available Subscription / Trial Plans and Services for a Product interface.
Headers
Parameter Required Description
User-Agent Yes Provide information about the user agent, such as the type of web browser, operating system, software version, etc., so as to help Yeastar Partner Portal to identify the user or the application that is making the request.

Example: User-Agent: OpenAPI.

Authorization Yes Pass the access token in the header, so as to authenticate the API request.

Format: Bearer {access_token}.

Query parameters
Parameter Required Type Description
productId Yes Integer The unique ID of the product.
Note: You can query product ID using the Query Available Subscription Products interface.
productNo No String The Serial Number (SN) of the device for which you want to query information about the plan available for trial.
Note:
  • This parameter is required when you query available trial plans for Linkus Cloud Service or P-Series Plan for Appliance Edition.
  • You can query this information using the Query Product List interface or obtain it from PBX web portal.

Response parameters

Parameter Type Description
code String The response message of the API request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

requestId String The unique ID of the request, which can be used to quickly locate the request.
result Object<Plan_Info> Detailed information about the trials of plans.
status Integer The HTTP status code of the API request.
Plan_Info
Parameter Type Description
connectionServiceList Array<Service_Info>

Detailed information about the services that you can try with the plan.

name String Plan name.
planId String The unique ID of the plan.
purchaseParameter String The item that is available for trial in the plan.
purchaseParameterId Integer The unique ID of the item that is available for trial in the plan.
trialPeriod Integer Trial period of the plan.
trialPrice Number Trial price of the plan.
trialQuantity Integer The supported quantity of the item that is available for trial in the plan.
unitName String The unit of the item in the plan.
Service_Info
Parameter Type Description
billingCycle String The billing cycle of the service.
  • annually
  • monthly
billingModel String The billing model of the service.
  • once
  • recurring
connectionServiceList Array<Service_Details> Detailed information about the services that you can try.
Service_Details
Parameter Type Description
billingCycleList Array<String> The supported billing cycle of the service.
  • annually
  • monthly
billingModelList Array<String> The supported billing model of the service.
  • once
  • recurring
name String Service name.
pricingServiceId Integer The unique pricing ID of the service.
purchaseParameter String The item that is available for trial in the service.
purchaseParameterId Integer The unique ID of the item that is available for trial in the service.
purchaseType Array<String> The supported purchase type for the service.
  • purchase
  • trial
  • switch
  • switchTrial
  • renew
serviceId String The unique ID of the service.
trialPeriod Integer Trial period of the service.
trialPrice Number Trial price of the service.
trialQuantity Integer The supported quantity of the item that is available for trial in the service.
unitName String The unit of the item in the service.

Example

Request example

Query information about the trial of Enterprise Plan on P-Series Software Edition (Product ID: 12 & Pricing Plan ID: 15438).

GET /pricing/openapi/purchase/v1/trial/plan_info/15438?productId=12 HTTP/1.1
Host: openapi.partner.yeastar.com
User-Agent: OpenAPI
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmVzMSJdLCJYLU1TLVVTRVIiOiJ7XCJleHByXCI6XCIwXCIsXCJ0eXBlXCI6XCJwYXJ0bmVyXCIsXCJ1Y0lkXCI6XCIzMDc2OTEzNjQ0ODkwODMyODk2XCIsXCJ1c2VyQ29kZVwiOlwiRGlzdHJpYnV0b3JcIixcInVzZXJJZFwiOlwiMzA3NjkxMzY0NDkxNTk5ODcyMFwiLFwidXNlcm5hbWVcIjpcImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbVwifSIsInVzZXJfbmFtZSI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE3MzkyNTgwMTUsInRva2VuX3R5cGUiOiJvcGVuYXBpIiwiYXV0aG9yaXRpZXMiOlsiNzciXSwianRpIjoibDkzTXhVMWlWYm1MeEhuOWkrdzRVaitqZ0JZPSIsImNsaWVudF9pZCI6ImFjMGYyZTViZWU3NmI2ZDdmNDU0NTY5NmMyNGZjMWYzIn0.4jMWQBsRMZp2Q0Lxo_NTOsM2V89r4FphvKlDe667oCA

Response example

{
    "code": "success",
    "detailMessage": "",
    "requestId": "be024c3cdaf9ab931e10708b43e9a4ce",
    "result": {
        "connectionServiceList": [
            {
                "billingCycle": "",
                "billingModel": "",
                "connectionServiceList": [
                    {
                        "billingCycleList": [],
                        "billingModelList": [],
                        "name": "Hot Standby",
                        "pricingServiceId": 22984,
                        "purchaseParameter": "Extensions",
                        "purchaseParameterId": 400010001,
                        "purchaseType": [],
                        "serviceId": "3049060920480022528",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": null,
                        "unitName": "Extensions"
                    },
                    {
                        "billingCycleList": [],
                        "billingModelList": [],
                        "name": "Outbound Call Center",
                        "pricingServiceId": 57551,
                        "purchaseParameter": "Channels",
                        "purchaseParameterId": 410161021,
                        "purchaseType": [],
                        "serviceId": "3302296213345505280",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": 1,
                        "unitName": "channel (s)"
                     },
                    {
                        "billingCycleList": [],
                        "billingModelList": [],
                        "name": "PMS",
                        "pricingServiceId": 22986,
                        "purchaseParameter": "Extensions",
                        "purchaseParameterId": 400010001,
                        "purchaseType": [],
                        "serviceId": "3115983610256539648",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": null,
                        "unitName": "extensions"
                    }
                ]
            }
        ],
        "name": "Enterprise Plan",
        "planId": "3049040650094403584",
        "purchaseParameter": "Extensions",
        "purchaseParameterId": 400010001,
        "trialPeriod": 30,
        "trialPrice": 0.00,
        "trialQuantity": 100,
        "unitName": "Extensions"
    },
    "status": 200
}