Query Available Subscription / Trial Plans and Services for a Product

Query the plans and services that you are authorized to subscribe to or try for a specific product.

Note: For trial plans, the purchaseType of the associated services will be returned as trial instead of purchase, as theses services are dependent on a valid plan subscription and cannot be purchased separately during the trial period.

Request URL

GET {base_url}/pricing/openapi/purchase/v1/purchase_product_info?{query parameters}

Request parameters

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 available trials and subscriptions.
Note: This parameter is required when you query available trials and subscriptions for Linkus Cloud Service or P-Series Plan for Appliance Edition.

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<Details>

Detailed information about the plans and services supported for the product.

status Integer The HTTP status code of the API request.

Details

Parameter Type Description
offeringId String The unique offering ID of the product.
productName String Product name.
quPurchaseInfo Object<Product_Details>

Detailed information about the plans and services of the product.

Product_Details
Parameter Type Description
purchasePlanInfoList Array<Plan_Info>

Detailed information about the trials and subscriptions of plans.

purchaseServiceInfoList Array<Service_Info>

Detailed information about the trials and subscriptions of services.

Plan_Info
Parameter Type Description
name String Plan name.
pricingPlanId Integer The unique pricing ID of the plan.
purchasePricingInfoList Array<Plan_Pricing>

Detailed information about the supported billing cycle and purchase type of the plan.

trialPeriod Integer Trial period of the plan.
trialPrice Number Trial price of the plan.
Plan_Pricing
Parameter Type Description
cycle String

The supported billing cycle for the subscription plan.

purchaseType Array<String> The supported purchase type for the plan.
Important: The value returned indicates whether you can subscribe to or try the plan.
  • purchase
  • trial
  • switch
  • switchTrial
  • renew
Service_Info
Parameter Type Description
isConnect Boolean Whether the service is dependent on a plan.
  • true: The service is dependent on a plan.
  • false: The service is NOT dependent on a plan.
name String Service name.
pricingServiceId Integer The unique pricing ID of the service.
purchasePricingInfoList Array<Service_Pricing>

Detailed information about the supported billing cycle and purchase type for the service.

trialPeriod Integer Trial period of the service.
trialPrice Number Trial price of the service.
Service_Pricing
Parameter Type Description
cycle String

The supported billing cycle for the subscription service.

purchaseType Array<String> The supported purchase type for the service.
Important: The value returned indicates whether you can subscribe to or try the service.
  • purchase
  • trial
  • switch
  • switchTrial
  • renew

Example

Request example

Query plans and services supported for a P-Series Software Edition (Product ID: 12 & PBX SN: 3651D5061439).

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

Response example

{
    "code": "success",
    "detailMessage": "",
    "requestId": "16908a8861bdc64af5cfd9567ed57ebd",
    "result": {
        "offeringId": "3049039276655034368",
        "productName": "Software PBX (PSE Self-hosted)",
        "quPurchaseInfo": {
            "purchasePlanInfoList": [
                {
                    "name": "Enterprise Plan",
                    "planId": "3049040650094403584",
                    "pricingPlanId": 15438,
                    "purchasePricingInfoList": [
                        {
                            "cycle": "annually",
                            "purchaseType": [
                                "renew"
                            ]
                        }
                    ],
                    "trialPeriod": 30,
                    "trialPrice": 0.00
                },
                {
                    "name": "Ultimate Plan",
                    "planId": "3049041101760282624",
                    "pricingPlanId": 15439,
                    "purchasePricingInfoList": [
                        {
                            "cycle": "annually",
                            "purchaseType": [
                                "trial",
                                "switch"
                            ]
                        }
                    ],
                    "trialPeriod": 30,
                    "trialPrice": 0
                }
            ],
            "purchaseServiceInfoList": [
                {
                    "isConnect": true,
                    "name": "Extension Expansion",
                    "pricingServiceId": 22983,
                    "purchasePricingInfoList": [
                        {
                            "cycle": "annually",
                            "purchaseType": [
                                "purchase"
                            ]
                        }
                    ],
                    "serviceId": "3049060579827040256",
                    "trialPeriod": null,
                    "trialPrice": 0.00
                },
                {
                    "isConnect": true,
                    "name": "Hot Standby",
                    "pricingServiceId": 22984,
                    "purchasePricingInfoList": [],
                    "serviceId": "3049060920480022528",
                    "trialPeriod": 30,
                    "trialPrice": 0.00
                },
                {
                    "isConnect": true,
                    "name": "Maintenance",
                    "pricingServiceId": 22985,
                    "purchasePricingInfoList": [
                        {
                            "cycle": "once",
                            "purchaseType": [
                                "purchase"
                            ]
                        },
                        {
                            "cycle": "annually",
                            "purchaseType": [
                                "purchase"
                            ]
                        }
                    ],
                    "serviceId": "3111639376985194496",
                    "trialPeriod": null,
                    "trialPrice": 0.00
                },
               {
                    "isConnect": true,
                    "name": "Outbound Call Center",
                    "pricingServiceId": 57551,
                    "purchasePricingInfoList": [],
                    "serviceId": "3302296213345505280",
                    "trialPeriod": null,
                    "trialPrice": null
                },
                {
                    "isConnect": true,
                    "name": "PMS",
                    "pricingServiceId": 22986,
                    "purchasePricingInfoList": [
                        {
                            "cycle": "annually",
                            "purchaseType": [
                                "purchase",
                                "trial"
                            ]
                        }
                    ],
                    "serviceId": "3115983610256539648",
                    "trialPeriod": 30,
                    "trialPrice": 0.00
                }
            ]
        }
    },
    "status": 200
}