Buy-link template for ordering a service via Storefront
When a customer orders a new subscription via Storefront, a buy link attached to the Buy now (or Try it) button on the product page (see Product page) is used. A buy link is generated using a template and includes information required for ordering a subscription. By clicking the button, a customer is redirected to the Customer Control Panel to create a sales order.
In this article:
Template
A buy link for ordering a subscription via Storefront is generated using the following template:
{base_path}?shopping_cart_items[][plan_id]={plan_id}&shopping_cart_items[][plan_period_id]={plan_period_id}&shopping_cart_items[][resources][][id]={resource_id}&shopping_cart_items[][resources][][quantity]={resource_quantity}&shopping_cart_items[][type]=application&manager_key={manager_key}&order_type={order_type}&shopping_cart_items[][type]=topup&shopping_cart_items[][amount]={topup_amount}&skip_all_steps=1&_ga={ga_values}
Attributes in a buy link are specified via &
. Some attributes are optional (see the description and examples below). The attribute shopping_cart_items[][type]=application
does not require modifications and must always be specified as is.
Attributes
Attribute | Required/Optional | Description |
---|---|---|
base_path | Required | The base path of a buy link. It depends on the External application URL value (see External application URL settings in Customer Store general settings):
|
plan_id | Required | The ID of the plan to which a subscription is ordered (see Viewing the list of plans) |
plan_period_id | Required | The ID of the plan period to which a subscription is ordered (see Updating plan periods) In Storefront, on the product page, the ID of a plan period corresponding to a subscription with the minimal price within the plan is automatically linked to the Buy now button. The ID of a trial plan period is automatically linked to the Try it button (see Product page). A customer can change the plan period on the subscription configuration step in the Customer Control Panel. |
resource_id | Optional | The ID of a resource to include in a subscription with the specified amount. To add several resources in a subscription, specify |
resource_quantity | Optional | The quantity of a resource with the specified ID to include in a subscription. Required for every resource_id |
manager_key | Optional | The key of a manager if it is necessary to link the customer's account to a given manager. In Storefront, the manager's key is not displayed in the URLs of its pages. A manager needs to manually provide a customer with a link that includes the key. The manager's key can be added to a link with the URL of any page of Storefront. The key is case-sensitive, so it is important to specify it in a buy link exactly as on the manager information page. For example, Links with the attribute |
order_type | Optional | Defines the type of order a customer creates by following a buy link:
Mandatory depends on the External application URL value (see External application URL settings in Customer Store general settings):
|
topup_amount | Optional | The amount of a top-up payment in the reseller currency required to start the service provisioning. The attribute can only be used to order a prepaid subscription with the 0 order amount (for example, for a subscription with the Pay as you go billing type, see Pay as you go. Charges generation), and when actions with the account balance are allowed by the reseller (see Managing financial settings). When a customer orders a new subscription via Storefront, using a link with the attribute More info The top-up prepayment is required to make sure that an ordered subscription with the Pay as you go billing type will not be stopped almost right after its activation:
|
skip_all_steps=1 | Optional | When a customer orders a new subscription via Storefront, using a link with the |
ga_values | Optional | The values of a Google Analytics tag |
Examples
A buy link to order a subscription from the test.activeplatform.com reseller to a plan with the ID = 425 and a plan period with the ID = 1840:
https://test.activeplatform.com/client/new_order?shopping_cart_items[][plan_id]=425&shopping_cart_items[][plan_period_id]=1840&shopping_cart_items[][type]=application&order_type=SalesOrder
A buy link to order a subscription from the test.activeplatform.com reseller to a plan with the ID = 425 and a plan period with the ID = 1840, the manager's key is carter81:
https://test.activeplatform.com/client/new_order?shopping_cart_items[][plan_id]=425&shopping_cart_items[][plan_period_id]=1840&shopping_cart_items[][type]=application&manager_key=ivanov22&order_type=SalesOrder
A buy link to order a prepaid subscription with the Pay as you go (internal) billing type from the test.activeplatform.com reseller to a plan with the ID = 569 and a plan period with the ID = 2072, the top-up amount is 1000:
https://test.activeplatform.com/client/new_order?shopping_cart_items[][plan_id]=569&shopping_cart_items[][plan_period_id]=2072&shopping_cart_items[][type]=application&shopping_cart_items[][type]=topup&shopping_cart_items[][amount]={1000}&skip_all_steps=1&order_type=SalesOrder