Query Information about the Plan Available for Subscription

Query detailed information about specific plan to which you are authorized to subscribe.

Tip: We provide step-by-step guidance for purchasing products via API. You can refer to the API tutorial to get started quickly.

Request URL

GET {base_url}/pricing/openapi/purchase/v1/purchase/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 product for which you want to query available subscription plans.
Note: 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 subscription plans.
status Integer The HTTP status code of the API request.
Plan_Info
Parameter Type Description
billingCycleList Array<String> The supported billing cycle of the plan.
  • annually
  • monthly
billingModelList Array<String> The supported billing model of the plan.
  • once
  • recurring
connectionServiceList Array<Service_Info>

Detailed information about the service that you can try or subscribe to with the plan.

name String Plan name.
planId String The unique ID of the plan.
purchaseInput Object<Purchase_Limit> The purchase limit for subscription plan.
purchaseMultiCycleList Array<String> The specific billing cycle of the plan.
purchaseParameter String The item that is available for subscription in the plan.
purchaseParameterId Integer The unique ID of the item that is available for subscription 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 or subscribe.
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.
purchaseInput Object<Purchase_Limit> The purchase limit for flat-rate or quantity-based subscription service.
purchaseMandatory Boolean

Whether the service must be renewed together with the subscription plan.

  • true: The service can only be renewed together with the subscription plan and shares the same expiration date.
  • false: The service can be renewed independently of the subscription plan.
purchaseParameter String The item that is available for trial or subscription in the service.
purchaseParameterId Integer The unique ID of the item that is available for trial or subscription 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.
Purchase_Limit
Note: The purchase limit indicates the allowed range for the unitName in subscription service.
Parameter Type Description
inputMaxValue String The maximum value allowed.
Note: If an expression is returned, it indicates that the service depends on another parameter. For example, 0.5*Concurrent Calls indicates that the maximum value allowed is half of the concurrent calls supported by the phone system.
inputMinValue Integer The minimum value allowed.
inputUnit String The valid values or the billing unit, depending on the pricing model.
  • Flat-rate subscription: The valid values.
  • Quantity-based subscription: The billing unit.

    For example, 1000 indicates that the service can be purchased in increments of 1000.

Purchase_Limit
Note: The purchase limit indicates the allowed range for the unitName in subscription plan.
Parameter Type Description
inputMaxValue String The maximum value allowed.
inputMinValue Integer The minimum value allowed.
inputUnit String The valid values or the billing unit, depending on the pricing model.
  • Flat-rate subscription: The valid values.
  • Quantity-based subscription: The billing unit.

    For example, 1000 indicates that the billing unit can be purchased in increments of 1000.

Example

Request example

Query information about the subscription of Enterprise Plan on a P-Series Software Edition (Product ID: 12 & Pricing Plan ID: 15438 & PBX SN: 3651E0233986).

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

Response example

{
    "code": "success",
    "detailMessage": "",
    "requestId": "7991ac49bf193e9a7482bc3f863ee2ef",
    "result": {
        "billingCycleList": [
            "annually"
        ],
        "billingModelList": [
            "recurring"
        ],
        "connectionServiceList": [
            {
                "billingCycle": "annually",
                "billingModel": "recurring",
                "connectionServiceList": [
                    {
                        "billingCycleList": [
                            "annually"
                        ],
                        "billingModelList": [
                            "recurring"
                        ],
                        "name": "Hot Standby",
                        "pricingServiceId": 22984,
                        "purchaseInput": null,
                        "purchaseMandatory": null,
                        "purchaseParameter": "Extensions",
                        "purchaseParameterId": 400010001,
                        "purchaseType": [
                            "purchase",
                            "trial"
                        ],
                        "serviceId": "3049060920480022528",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": null,
                        "unitName": "Extensions"
                    },
                    {
                        "billingCycleList": [
                            "annually",
                            "once"
                        ],
                        "billingModelList": [
                            "recurring",
                            "once"
                        ],
                        "name": "Maintenance",
                        "pricingServiceId": 22985,
                        "purchaseInput": null,
                        "purchaseMandatory": null,
                        "purchaseParameter": "",
                        "purchaseParameterId": null,
                        "purchaseType": [
                            "purchase"
                        ],
                        "serviceId": "3111639376985194496",
                        "trialPeriod": null,
                        "trialPrice": null,
                        "trialQuantity": null,
                        "unitName": ""
                    },
                   {
                        "billingCycleList": [
                            "annually"
                        ],
                        "billingModelList": [
                            "recurring"
                        ],
                        "name": "Outbound Call Center",
                        "pricingServiceId": 57551,
                        "purchaseInput": {
                            "inputMaxValue": "0.5*Concurrent Calls",
                            "inputMinValue": 1,
                            "inputUnit": "1"
                        },
                        "purchaseMandatory": null,
                        "purchaseParameter": "Channels",
                        "purchaseParameterId": 410161021,
                        "purchaseType": [
                            "purchase",
                            "trial"
                        ],
                        "serviceId": "3302296213345505280",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": 1,
                        "unitName": "channel (s)"
                    },
                    {
                        "billingCycleList": [
                            "annually"
                        ],
                        "billingModelList": [
                            "recurring"
                        ],
                        "name": "PMS",
                        "pricingServiceId": 22986,
                        "purchaseInput": null,
                        "purchaseMandatory": null,
                        "purchaseParameter": "Extensions",
                        "purchaseParameterId": 400010001,
                        "purchaseType": [
                            "purchase",
                            "trial"
                        ],
                        "serviceId": "3115983610256539648",
                        "trialPeriod": 30,
                        "trialPrice": 0.00,
                        "trialQuantity": null,
                        "unitName": "extensions"
                    }
                ]
            }
        ],
        "name": "Enterprise Plan",
        "planId": "3049040650094403584",
        "purchaseInput": {
            "inputMaxValue": "10000",
            "inputMinValue": 200,
            "inputUnit": "200, 500, 1200, 10000"
        },
        "purchaseMultiCycleList": [
            {
                "multiCycleIndex": 1
            },
            {
                "multiCycleIndex": 2
            },
            {
                "multiCycleIndex": 3
            },
            {
                "multiCycleIndex": 4
            },
            {
                "multiCycleIndex": 5
            }
        ],
        "purchaseParameter": "Extensions",
        "purchaseParameterId": 400010001,
        "unitName": "Extensions"
    },
    "status": 200
}