Definition
https://sandbox.bluesnap.com/services/2/recurring/plans?{parameters}
Documentation
The Retrieve All Plans request enables you to retrieve details about all existing plans in your account. You can filter by status.
Request Content
Enter any of the query parameters below into the request URL. For example:
services/2/recurring/plans?pagesize=20&after=2185254&gettotal=true
Query Parameters
Parameter Name | Description | Example |
---|---|---|
pagesize | Positive integer. Sets the maximum number of results to return (i.e. page size). Default is 10 if not set. | pagesize=20 |
after | Plan ID. The response will get the page of results after the specified ID (exclusive). | after=1000 |
before | Plan ID. The response will get the page of results before the specified ID (exclusive). | before=5000 |
gettotal | true = Include the number of total results in the response | gettotal=true |
fulldescription | true (default) = Return complete details for each plan in the response false = Return each plan's name and ID only | fulldescription=true |
status | Enter ACTIVE or INACTIVE to filter for plans with that status. | status=ACTIVE |
Response Details
If successful, the response HTTP status code is 200 OK.
The response body contains the plans resource.
Examples
Request Examples
curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/plans?pagesize=5&after=2185254&gettotal=true&fulldescription=false \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/plans?pagesize=2&after=2185254&fulldescription=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
Response Examples
<plans xmlns="http://ws.plimus.com">
<total-results>47</total-results>
<last-page>false</last-page>
<plan>
<plan-id>2185253</plan-id>
<name>Gold Plan</name>
</plan>
<plan>
<plan-id>2185252</plan-id>
<name>Silver Plan</name>
</plan>
<plan>
<plan-id>2185251</plan-id>
<name>Platinum Plan</name>
</plan>
<plan>
<plan-id>2185250</plan-id>
<name>Bronze Plan</name>
</plan>
<plan>
<plan-id>2185249</plan-id>
<name>Value Plan</name>
</plan>
</plans>
<plans xmlns="http://ws.plimus.com">
<last-page>false</last-page>
<plan>
<plan-id>2185253</plan-id>
<name>Gold Plan</name>
<recurring-charge-amount>29.99</recurring-charge-amount>
<currency>USD</currency>
<charge-frequency>MONTHLY</charge-frequency>
<trial-period-days>14</trial-period-days>
<initial-charge-amount>30.00</initial-charge-amount>
<charge-on-plan-switch>true</charge-on-plan-switch>
<max-number-of-charges>12</max-number-of-charges>
<grace-period-days>10</grace-period-days>
<status>ACTIVE</status>
</plan>
<plan>
<plan-id>2185252</plan-id>
<name>Silver Plan</name>
<recurring-charge-amount>17.99</recurring-charge-amount>
<currency>USD</currency>
<charge-frequency>MONTHLY</charge-frequency>
<trial-period-days>14</trial-period-days>
<initial-charge-amount>25.00</initial-charge-amount>
<charge-on-plan-switch>true</charge-on-plan-switch>
<max-number-of-charges>12</max-number-of-charges>
<grace-period-days>10</grace-period-days>
<status>ACTIVE</status>
</plan>
</plans>
Example Descriptions
Retrieve Plans
The example above shows how to retrieve plans. Results are limited to plans after plan ID 2185254, and a maximum of 5 plans per page. Because gettotal=true
, the response includes the total number of results. Because fulldescription=false
, the response includes limited information, and you can use the plan IDs to retrieve more details about each plan.
Retrieve Plans with full description
The example above shows how to retrieve plans with their complete details, using the fulldescription=true
parameter (alternatively, you can just leave this parameter off, since the default is true).
Back to Top