{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"optional","settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"get","results":{"codes":[{"code":"","language":"text"}]},"params":[]},"next":{"description":"","pages":[]},"title":"Retrieve All Plans","type":"endpoint","slug":"retrieve-all-plans","excerpt":"","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>","updates":[],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5ff39c12e2e8fa00503ad594","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Subscriptions","slug":"subscriptions","order":10,"from_sync":false,"reference":false,"_id":"5ff39c12e2e8fa00503ad534","version":"5ff39c12e2e8fa00503ad5e4","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-07-27T10:22:06.636Z","__v":0},"project":"57336fd5a6a9c40e00e13a0b","parentDoc":null,"user":"560d5913af97231900938124","version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.36.1 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5ff39c12e2e8fa00503ad52d","5ff39c12e2e8fa00503ad52e","5ff39c12e2e8fa00503ad52f","5ff39c12e2e8fa00503ad530","5ff39c12e2e8fa00503ad531","5ff39c12e2e8fa00503ad532","5ff39c12e2e8fa00503ad533","5ff39c12e2e8fa00503ad534","5ff39c12e2e8fa00503ad535","5ff39c12e2e8fa00503ad536","5ff39c12e2e8fa00503ad537","5ff39c12e2e8fa00503ad538","5ff39c12e2e8fa00503ad539","5ff39c12e2e8fa00503ad53a","5ff39c12e2e8fa00503ad53b","5ff39c12e2e8fa00503ad53c","5ff39c12e2e8fa00503ad53d","5ff39c12e2e8fa00503ad53e","5ff39c12e2e8fa00503ad53f"],"_id":"5ff39c12e2e8fa00503ad5e4","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5fc6c6094cb8fa066b0d2ea3","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"createdAt":"2016-07-29T13:11:38.259Z","githubsync":"","__v":0}
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
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 '
{
"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"
}
]
}
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).