{"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 Subscriptions","type":"endpoint","slug":"retrieve-all-subscriptions","excerpt":"","body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/recurring/subscriptions?{parameters}</span>\n\n##Documentation\nThe Retrieve All Subscriptions request enables you to retrieve details about all existing subscriptions in your account, or else for a specific shopper or plan ID.\nYou can filter by status, shopper, or plan.\n\n###Request Content\nEnter any of the query parameters below into the request URL. For example:\n`services/2/recurring/subscriptions?pagesize=20&after=34567&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 subscription in the response\\n\\n**false** = Return limited information about each subscription\",\n \"1-1\": \"Subscription ID. The response will get the page of results after the specified ID (exclusive).\",\n \"2-1\": \"Subscription 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.\\nMaximum is **500**.\",\n \"5-1\": \"Enter **ACTIVE** , **CANCELED**, **SUSPENDED** or **DELETED** to filter for subscriptions with that status.\",\n \"0-2\": \"`pagesize=50`\",\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 \"6-0\": \"`shopperid`\",\n \"7-0\": \"`planid`\",\n \"6-2\": \"`shopperid=16985478`\",\n \"7-2\": \"`planid=2345`\",\n \"6-1\": \"Retrieve the subscriptions for a specific shopper.\",\n \"7-1\": \"Retrieve the subscriptions associated to a specific plan.\"\n },\n \"cols\": 3,\n \"rows\": 8\n}\n[/block]\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the **[subscriptionList](doc:recurring-subscriptions)** 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/subscriptions?pagesize=5&after=34567&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 Subscriptions Request\"\n },\n {\n \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/subscriptions?pagesize=2&after=343435&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\\\": 42,\\n \\\"lastPage\\\": false,\\n \\\"subscriptions\\\": [\\n {\\n \\\"vaultedShopperId\\\": 19550180,\\n \\\"planId\\\": 2186200,\\n \\\"subscriptionId\\\": 34566\\n },\\n {\\n \\\"vaultedShopperId\\\": 1976543,\\n \\\"planId\\\": 2186208,\\n \\\"subscriptionId\\\": 34565\\n },\\n {\\n \\\"vaultedShopperId\\\": 1923456,\\n \\\"planId\\\": 2195008,\\n \\\"subscriptionId\\\": 34564\\n },\\n {\\n \\\"vaultedShopperId\\\": 1975746,\\n \\\"planId\\\": 6208208,\\n \\\"subscriptionId\\\": 34563\\n },\\n {\\n \\\"vaultedShopperId\\\": 1922334,\\n \\\"planId\\\": 408567,\\n \\\"subscriptionId\\\": 34562\\n }\\n ]\\n}\",\n \"language\": \"json\",\n \"name\": \"Retrieve Subscriptions Response: 200 OK\"\n },\n {\n \"code\": \"{\\n \\\"lastPage\\\": true,\\n \\\"subscriptions\\\": [\\n {\\n \\\"nextChargeDate\\\": \\\"2016-08-15\\\",\\n \\\"quantity\\\": 1,\\n \\\"trialPeriodDays\\\": 14,\\n \\\"paymentSource\\\": {\\\"creditCardInfo\\\": {\\n \\\"billingContactInfo\\\": {\\n \\\"firstName\\\": \\\"John\\\",\\n \\\"lastName\\\": \\\"Doe\\\"\\n },\\n \\\"creditCard\\\": {\\n \\\"expirationYear\\\": 2023,\\n \\\"cardLastFourDigits\\\": 1111,\\n \\\"cardSubType\\\": \\\"CREDIT\\\",\\n \\\"cardCategory\\\": \\\"CLASSIC\\\", \\n \\\"cardType\\\": \\\"VISA\\\",\\n \\\"expirationMonth\\\": \\\"07\\\"\\n }\\n }},\\n \\\"softDescriptor\\\": \\\"BLS*default_descriptor\\\",\\n \\\"recurringChargeAmount\\\": 29.99,\\n \\\"chargeFrequency\\\": \\\"MONTHLY\\\",\\n \\\"vaultedShopperId\\\": 21188039,\\n \\\"payerInfo\\\": {\\n \\\"firstName\\\": \\\"John\\\",\\n \\\"lastName\\\": \\\"Doe\\\"\\n },\\n \\\"initialChargeAmount\\\": 100,\\n \\\"autoRenew\\\": true,\\n \\\"planId\\\": 2283845,\\n \\\"currency\\\": \\\"USD\\\",\\n \\\"subscriptionId\\\": 343434,\\n \\\"status\\\": \\\"ACTIVE\\\"\\n },\\n {\\n \\\"nextChargeDate\\\": \\\"2016-08-30\\\",\\n \\\"quantity\\\": 1,\\n \\\"trialPeriodDays\\\": 14,\\n \\\"paymentSource\\\": {\\\"creditCardInfo\\\": {\\n \\\"billingContactInfo\\\": {\\n \\\"firstName\\\": \\\"Bob\\\",\\n \\\"lastName\\\": \\\"Shopper\\\"\\n },\\n \\\"creditCard\\\": {\\n \\\"expirationYear\\\": 2023,\\n \\\"cardLastFourDigits\\\": 1234,\\n \\\"cardSubType\\\": \\\"CREDIT\\\",\\n \\\"cardCategory\\\": \\\"CLASSIC\\\",\\n \\\"cardType\\\": \\\"VISA\\\",\\n \\\"expirationMonth\\\": 10\\n }\\n }},\\n \\\"softDescriptor\\\": \\\"BLS*default_descriptor\\\",\\n \\\"recurringChargeAmount\\\": 29.99,\\n \\\"chargeFrequency\\\": \\\"MONTHLY\\\",\\n \\\"vaultedShopperId\\\": 2134539,\\n \\\"payerInfo\\\": {\\n \\\"firstName\\\": \\\"Bob\\\",\\n \\\"lastName\\\": \\\"Shopper\\\"\\n },\\n \\\"initialChargeAmount\\\": 100,\\n \\\"autoRenew\\\": true,\\n \\\"planId\\\": 2283845,\\n \\\"currency\\\": \\\"USD\\\",\\n \\\"subscriptionId\\\": 343433,\\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 Subscriptions\nThe example above shows how to retrieve all subscriptions in your account. Results are limited to subscriptions after subscription ID 34567, and a maximum of 5 subscriptions 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 subscription IDs to retrieve more details about each subscription.\n\n###Retrieve Subscriptions 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":9,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"628531cd1258c8003f6dd228","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Subscriptions","slug":"subscriptions","order":11,"from_sync":false,"reference":false,"_id":"628531cd1258c8003f6dd1c6","version":"628531cd1258c8003f6dd27d","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2016-07-27T10:22:06.636Z","__v":0},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"version":"8976-JSON","version_clean":"8976.0.0-JSON","codename":"3.42 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["628531cd1258c8003f6dd1bf","628531cd1258c8003f6dd1c0","628531cd1258c8003f6dd1c1","628531cd1258c8003f6dd1c2","628531cd1258c8003f6dd1c3","628531cd1258c8003f6dd1c4","628531cd1258c8003f6dd1c5","628531cd1258c8003f6dd1c6","628531cd1258c8003f6dd1c7","628531cd1258c8003f6dd1c8","628531cd1258c8003f6dd1c9","628531cd1258c8003f6dd1ca","628531cd1258c8003f6dd1cb","628531cd1258c8003f6dd1cc","628531cd1258c8003f6dd1cd","628531cd1258c8003f6dd1ce","628531cd1258c8003f6dd1cf","628531cd1258c8003f6dd1d0","628531cd1258c8003f6dd1d1","628531cd1258c8003f6dd1d2"],"_id":"628531cd1258c8003f6dd27d","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"622783372cd60c003782d77e","createdAt":"2018-04-24T15:22:41.561Z","releaseDate":"2018-04-24T15:22:41.561Z"},"createdAt":"2016-07-29T18:21:03.379Z","githubsync":"","__v":0}
getRetrieve All Subscriptions
Definition
https://sandbox.bluesnap.com/services/2/recurring/subscriptions?{parameters}
Documentation
The Retrieve All Subscriptions request enables you to retrieve details about all existing subscriptions in your account, or else for a specific shopper or plan ID.
You can filter by status, shopper, or plan.
Request Content
Enter any of the query parameters below into the request URL. For example:services/2/recurring/subscriptions?pagesize=20&after=34567&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.
Maximum is 500.
pagesize=50
after
Subscription ID. The response will get the page of results after the specified ID (exclusive).
after=1000
before
Subscription 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 subscription in the response
false = Return limited information about each subscription
fulldescription=true
status
Enter ACTIVE , CANCELED, SUSPENDED or DELETED to filter for subscriptions with that status.
status=ACTIVE
shopperid
Retrieve the subscriptions for a specific shopper.
shopperid=16985478
planid
Retrieve the subscriptions associated to a specific plan.
planid=2345
Response Details
If successful, the response HTTP status code is 200 OK.
The response contains the subscriptionList object.
Examples
Request Examples
curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/subscriptions?pagesize=5&after=34567&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/subscriptions?pagesize=2&after=343435&fulldescription=true \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"totalResults": 42,
"lastPage": false,
"subscriptions": [
{
"vaultedShopperId": 19550180,
"planId": 2186200,
"subscriptionId": 34566
},
{
"vaultedShopperId": 1976543,
"planId": 2186208,
"subscriptionId": 34565
},
{
"vaultedShopperId": 1923456,
"planId": 2195008,
"subscriptionId": 34564
},
{
"vaultedShopperId": 1975746,
"planId": 6208208,
"subscriptionId": 34563
},
{
"vaultedShopperId": 1922334,
"planId": 408567,
"subscriptionId": 34562
}
]
}
{
"lastPage": true,
"subscriptions": [
{
"nextChargeDate": "2016-08-15",
"quantity": 1,
"trialPeriodDays": 14,
"paymentSource": {"creditCardInfo": {
"billingContactInfo": {
"firstName": "John",
"lastName": "Doe"
},
"creditCard": {
"expirationYear": 2023,
"cardLastFourDigits": 1111,
"cardSubType": "CREDIT",
"cardCategory": "CLASSIC",
"cardType": "VISA",
"expirationMonth": "07"
}
}},
"softDescriptor": "BLS*default_descriptor",
"recurringChargeAmount": 29.99,
"chargeFrequency": "MONTHLY",
"vaultedShopperId": 21188039,
"payerInfo": {
"firstName": "John",
"lastName": "Doe"
},
"initialChargeAmount": 100,
"autoRenew": true,
"planId": 2283845,
"currency": "USD",
"subscriptionId": 343434,
"status": "ACTIVE"
},
{
"nextChargeDate": "2016-08-30",
"quantity": 1,
"trialPeriodDays": 14,
"paymentSource": {"creditCardInfo": {
"billingContactInfo": {
"firstName": "Bob",
"lastName": "Shopper"
},
"creditCard": {
"expirationYear": 2023,
"cardLastFourDigits": 1234,
"cardSubType": "CREDIT",
"cardCategory": "CLASSIC",
"cardType": "VISA",
"expirationMonth": 10
}
}},
"softDescriptor": "BLS*default_descriptor",
"recurringChargeAmount": 29.99,
"chargeFrequency": "MONTHLY",
"vaultedShopperId": 2134539,
"payerInfo": {
"firstName": "Bob",
"lastName": "Shopper"
},
"initialChargeAmount": 100,
"autoRenew": true,
"planId": 2283845,
"currency": "USD",
"subscriptionId": 343433,
"status": "ACTIVE"
}
]
}
Example Descriptions
Retrieve Subscriptions
The example above shows how to retrieve all subscriptions in your account. Results are limited to subscriptions after subscription ID 34567, and a maximum of 5 subscriptions 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 subscription IDs to retrieve more details about each subscription.
Retrieve Subscriptions 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).