Retrieve All Plans

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 NameDescriptionExample
pagesizePositive integer. Sets the maximum number of results to return (i.e. page size).
Default is 10 if not set.
pagesize=20
afterPlan ID. The response will get the page of results after the specified ID (exclusive).after=1000
beforePlan ID. The response will get the page of results before the specified ID (exclusive).before=5000
gettotaltrue = Include the number of total results in the responsegettotal=true
fulldescriptiontrue (default) = Return complete details for each plan in the response

false = Return each plan's name and ID only
fulldescription=true
statusEnter 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 contains the planList object.


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/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/plans?pagesize=2&after=2185254&fulldescription=true \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \ 
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

Response Examples

{
    "totalResults": 47,
    "lastPage": false,
    "plans": [
        {
            "name": "Gold Plan",
            "planId": 2185253
        },
        {
            "name": "Silver Plan",
            "planId": 2185252
        },
        {
            "name": "Platinum Plan",
            "planId": 2185251
        },
        {
            "name": "Bronze Plan",
            "planId": 2185250
        },
        {
            "name": "Value Plan",
            "planId": 2185249
        }
    ]
}
{
    "lastPage": false,
    "plans": [
        {
            "chargeFrequency": "MONTHLY",
            "gracePeriodDays": 10,
            "trialPeriodDays": 14,
            "initialChargeAmount": 30,
            "name": "Gold Plan",
            "planId": 2185253,
            "currency": "USD",
            "maxNumberOfCharges": 12,
            "recurringChargeAmount": 29.99,
            "chargeOnPlanSwitch": true,
            "status": "ACTIVE"
        },
        {
            "chargeFrequency": "MONTHLY",
            "gracePeriodDays": 10,
            "trialPeriodDays": 14,
            "initialChargeAmount": 25,
            "name": "Silver Plan",
            "planId": 2185252,
            "currency": "USD",
            "maxNumberOfCharges": 12,
            "recurringChargeAmount": 17.99,
            "chargeOnPlanSwitch": true,
            "status": "ACTIVE"
        }
    ]
}

Back to Top


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
Language
Authorization
:
Click Try It! to start a request and see the response here!