This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Plans in Recurly
Overview
The following operations allow you to work with plans. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with plans, see Sample configuration.
Operation | Description |
---|---|
Creates a plan. | |
getPlanByCode | Retrieves a plan by code. |
listPlans | Retrieves all the plans. |
Operation details
This section provides further details on the operations related to plans.
Creating a plan
The createPlan
operation creates a plan.
<recurly.createPlan> <planCode>{$ctx:planCode}</planCode> <name>{$ctx:name}</name> <unitAmountInCents>{$ctx:unitAmountInCents}</unitAmountInCents> <accountingCode>{$ctx:accountingCode}</accountingCode> <setupFeeInCents>{$ctx:setupFeeInCents}</setupFeeInCents> <taxCode>{$ctx:taxCode}</taxCode> <successUrl>{$ctx:successUrl}</successUrl> <trialIntervalLength>{$ctx:trialIntervalLength}</trialIntervalLength> <planIntervalLength>{$ctx:planIntervalLength}</planIntervalLength> <trialIntervalUnit>{$ctx:trialIntervalUnit}</trialIntervalUnit> <description>{$ctx:description}</description> <unitName>{$ctx:unitName}</unitName> <displayQuantity>{$ctx:displayQuantity}</displayQuantity> <cancelUrl>{$ctx:cancelUrl}</cancelUrl> <totalBillingCycles>{$ctx:totalBillingCycles}</totalBillingCycles> <planIntervalUnit>{$ctx:planIntervalUnit}</planIntervalUnit> <taxExempt>{$ctx:taxExempt}</taxExempt> </recurly.createPlan>
Properties
Required - The unique code to identify the plan.planCode:
Required - The plan name.name:
Required - The amount of a unit in cents.unitAmountInCents:
The accounting code for related invoice line items.accountingCode:
The fee for setup in cents.setupFeeInCents:
The tax code.taxCode:
The URL to redirect to after signup.successUrl:
The trial interval length.trialIntervalLength:
The plan interval length.planIntervalLength:
The trial interval unit such as days or months.trialIntervalUnit:
The plan description.description:
The unit description for the quantity.unitName:
Whether the display quantity is shown on the hosted payment page.displayQuantity:
The URL to redirect to on, cancelled signup.cancelUrl:
The number of billing cycles before the plan stops renewing.totalBillingCycles:
The plan interval unit such as days or months.planIntervalUnit:
The tax exempt status; if "true", exempts tax on the plan.taxExempt:
Sample request
Following is a sample REST/XML request that can be handled by the
operation.createPlan
<createPlan> <planCode>goldttt</planCode> <name>Gold plan</name> <setupFeeInCents> <values> <USD>1000</USD> <EUR>800</EUR> </values> </setupFeeInCents> <unitAmountInCents> <values> <USD>6000</USD> <EUR>4500</EUR> </values> </unitAmountInCents> <planIntervalLength>1</planIntervalLength> <planIntervalUnit>months</planIntervalUnit> <taxExempt>false</taxExempt> <apiUrl>https://virtusax.recurly.com</apiUrl> <apiKey>09da0279537848789809f1f86e349afb</apiKey> </createPlan>
Related Recurly documentation
https://docs.recurly.com/api/plans#create-plan
Retrieving a plan by code
The
operation retrieves a plan by code.getPlanByCode
<recurly.getPlanByCode> <planCode>{$ctx:planCode}</planCode> </recurly.getPlanByCode>
Properties
Required - The unique code to identify the plan.planCode:
Sample request
Following is a sample REST/XML request that can be handled by the
operation.getPlanByCode
<getPlanByCode> <apiUrl>https://virtusax.recurly.com</apiUrl> <apiKey>09da0279537848789809f1f86e349afb</apiKey> <planCode>gold123</planCode> </getPlanByCode>
Related Recurly documentation
https://docs.recurly.com/api/plans#lookup-plan
Retrieving all the plans
The
operation retrieves all the plans.listPlans
<recurly.listPlans> <cursor>{$ctx:cursor}</cursor> <perPage>{$ctx:perPage}</perPage> </recurly.listPlans>
Properties
The link for the next page.cursor:
The number of records to be retrieved per page.perPage:
Sample request
Following is a sample REST/XML request that can be handled by the
operation.listPlans
<listPlans> <apiUrl>https://virtusax.recurly.com</apiUrl> <apiKey>09da0279537848789809f1f86e349afb</apiKey> <perPage>1</perPage> <cursor>1596131336932158860</cursor> </listPlans>
Related Recurly documentation
https://docs.recurly.com/api/plans#list-plans
Sample configuration
Following is a sample proxy service that illustrates how to connect to Recurly with the init
operation and use the
operation. The sample request for this proxy can be found in the createPlan sample request. You can use this sample as a template for using other operations in this category.createPlan
<proxy xmlns="http://ws.apache.org/ns/synapse" name="recurly_createPlan" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="planCode" expression="//planCode/text()"/> <property name="name" expression="//name/text()"/> <property name="unitAmountInCents" expression="//unitAmountInCents/values"/> <property name="description" expression="//description/text()"/> <property name="accountingCode" expression="//accountingCode/text()"/> <property name="planIntervalUnit" expression="//planIntervalUnit/text()"/> <property name="planIntervalLength" expression="//planIntervalLength/text()"/> <property name="trialIntervalUnit" expression="//trialIntervalUnit/text()"/> <property name="trialIntervalLength" expression="//trialIntervalLength/text()"/> <property name="setupFeeInCents" expression="//setupFeeInCents/values"/> <property name="totalBillingCycles" expression="//totalBillingCycles/text()"/> <property name="unitName" expression="//unitName/text()"/> <property name="displayQuantity" expression="//displayQuantity/text()"/> <property name="successUrl" expression="//successUrl/text()"/> <property name="cancelUrl" expression="//cancelUrl/text()"/> <property name="taxExempt" expression="//taxExempt/text()"/> <property name="taxCode" expression="//taxCode/text()"/> <property name="apiUrl" expression="//apiUrl/text()"/> <property name="apiKey" expression="//apiKey/text()"/> <recurly.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </recurly.init> <recurly.createPlan> <accountingCode>{$ctx:accountingCode}</accountingCode> <unitAmountInCents>{$ctx:unitAmountInCents}</unitAmountInCents> <setupFeeInCents>{$ctx:setupFeeInCents}</setupFeeInCents> <taxCode>{$ctx:taxCode}</taxCode> <successUrl>{$ctx:successUrl}</successUrl> <trialIntervalLength>{$ctx:trialIntervalLength}</trialIntervalLength> <planIntervalLength>{$ctx:planIntervalLength}</planIntervalLength> <trialIntervalUnit>{$ctx:trialIntervalUnit}</trialIntervalUnit> <description>{$ctx:description}</description> <unitName>{$ctx:unitName}</unitName> <displayQuantity>{$ctx:displayQuantity}</displayQuantity> <planCode>{$ctx:planCode}</planCode> <name>{$ctx:name}</name> <cancelUrl>{$ctx:cancelUrl}</cancelUrl> <totalBillingCycles>{$ctx:totalBillingCycles}</totalBillingCycles> <planIntervalUnit>{$ctx:planIntervalUnit}</planIntervalUnit> <taxExempt>{$ctx:taxExempt}</taxExempt> </recurly.createPlan> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>