{"_id":"59dfa5848b51880010b74add","category":{"_id":"59dfa5828b51880010b74abe","version":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-27T10:22:06.636Z","from_sync":false,"order":7,"slug":"subscriptions","title":"Subscriptions"},"project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"user":"560d5913af97231900938124","version":{"_id":"59dfa5828b51880010b74ab6","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-12T17:25:22.850Z","releaseDate":"2017-10-12T17:25:22.850Z","categories":["59dfa5828b51880010b74ab7","59dfa5828b51880010b74ab8","59dfa5828b51880010b74ab9","59dfa5828b51880010b74aba","59dfa5828b51880010b74abb","59dfa5828b51880010b74abc","59dfa5828b51880010b74abd","59dfa5828b51880010b74abe","59dfa5828b51880010b74abf","59dfa5828b51880010b74ac0","59dfa5828b51880010b74ac1","59dfa5828b51880010b74ac2","59dfa5828b51880010b74ac3","59dfa5828b51880010b74ac4","59dfa5828b51880010b74ac5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-29T13:11:38.259Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"","language":"text"}]},"auth":"optional","params":[],"url":""},"isReference":false,"order":2,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/recurring/plans?{parameters}</span>\n\n##Documentation\nThe Retrieve All Plans request enables you to retrieve details about all existing plans in your account. You can filter by status.\n\n###Request Content\nEnter any of the query parameters below into the request URL. For example:\n`services/2/recurring/plans?pagesize=20&after=2185254&gettotal=true`\n\n**Query Parameters** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Example\",\n    \"0-0\": \"`pagesize`\",\n    \"1-0\": \"`after`\",\n    \"2-0\": \"`before`\",\n    \"3-0\": \"`gettotal`\",\n    \"5-0\": \"`status`\",\n    \"3-1\": \"**true** = Include the number of total results in the response\",\n    \"4-0\": \"`fulldescription`\",\n    \"4-1\": \"**true** (default) = Return complete details for each plan in the response\\n\\n**false** = Return each plan's name and ID only\",\n    \"1-1\": \"Plan ID. The response will get the page of results after the specified ID (exclusive).\",\n    \"2-1\": \"Plan ID. The response will get the page of results before the specified ID (exclusive).\",\n    \"0-1\": \"Positive integer. Sets the maximum number of results to return (i.e. page size).\\nDefault is **10** if not set.\",\n    \"5-1\": \"Enter **ACTIVE** or **INACTIVE** to filter for plans with that status.\",\n    \"0-2\": \"`pagesize=20`\",\n    \"1-2\": \"`after=1000`\",\n    \"2-2\": \"`before=5000`\",\n    \"3-2\": \"`gettotal=true`\",\n    \"4-2\": \"`fulldescription=true`\",\n    \"5-2\": \"`status=ACTIVE`\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the [planList](doc:plans) object.\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/plans?pagesize=5&after=2185254&gettotal=true&fulldescription=false \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"Retrieve Plans Request\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/plans?pagesize=2&after=2185254&fulldescription=true \\\\\\n-H 'Content-Type: application/json' \\\\\\n-H 'Accept: application/json' \\\\ \\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\",\n      \"language\": \"curl\",\n      \"name\": \"with full description \"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"totalResults\\\": 47,\\n    \\\"lastPage\\\": false,\\n    \\\"plans\\\": [\\n        {\\n            \\\"name\\\": \\\"Gold Plan\\\",\\n            \\\"planId\\\": 2185253\\n        },\\n        {\\n            \\\"name\\\": \\\"Silver Plan\\\",\\n            \\\"planId\\\": 2185252\\n        },\\n        {\\n            \\\"name\\\": \\\"Platinum Plan\\\",\\n            \\\"planId\\\": 2185251\\n        },\\n        {\\n            \\\"name\\\": \\\"Bronze Plan\\\",\\n            \\\"planId\\\": 2185250\\n        },\\n        {\\n            \\\"name\\\": \\\"Value Plan\\\",\\n            \\\"planId\\\": 2185249\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Retrieve Plans Response: 200 OK\"\n    },\n    {\n      \"code\": \"{\\n    \\\"lastPage\\\": false,\\n    \\\"plans\\\": [\\n        {\\n            \\\"chargeFrequency\\\": \\\"MONTHLY\\\",\\n            \\\"gracePeriodDays\\\": 10,\\n            \\\"trialPeriodDays\\\": 14,\\n            \\\"initialChargeAmount\\\": 30,\\n            \\\"name\\\": \\\"Gold Plan\\\",\\n            \\\"planId\\\": 2185253,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"maxNumberOfCharges\\\": 12,\\n            \\\"recurringChargeAmount\\\": 29.99,\\n            \\\"chargeOnPlanSwitch\\\": true,\\n            \\\"status\\\": \\\"ACTIVE\\\"\\n        },\\n        {\\n            \\\"chargeFrequency\\\": \\\"MONTHLY\\\",\\n            \\\"gracePeriodDays\\\": 10,\\n            \\\"trialPeriodDays\\\": 14,\\n            \\\"initialChargeAmount\\\": 25,\\n            \\\"name\\\": \\\"Silver Plan\\\",\\n            \\\"planId\\\": 2185252,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"maxNumberOfCharges\\\": 12,\\n            \\\"recurringChargeAmount\\\": 17.99,\\n            \\\"chargeOnPlanSwitch\\\": true,\\n            \\\"status\\\": \\\"ACTIVE\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - with full description\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\n\n###Retrieve Plans\nThe 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.\n\n###Retrieve Plans with full description\nThe 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**).\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"retrieve-all-plans","type":"get","title":"Retrieve All Plans"}

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