{"_id":"59dfa5848b51880010b74ae1","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"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","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-29T18:21:03.379Z","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":8,"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.\",\n    \"5-1\": \"Enter **ACTIVE** , **CANCELED**, **SUSPENDED** or **DELETED** to filter for subscriptions 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    \"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\\\": 2019,\\n                    \\\"cardLastFourDigits\\\": 1111,\\n                    \\\"cardSubType\\\": \\\"CREDIT\\\",\\n                  \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n                    \\\"cardType\\\": \\\"VISA\\\",\\n                    \\\"expirationMonth\\\": \\\"07\\\"\\n                }\\n            }},\\n            \\\"softDescriptor\\\": \\\"BLS&#x2a;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\\\": 2019,\\n                    \\\"cardLastFourDigits\\\": 1234,\\n                    \\\"cardSubType\\\": \\\"CREDIT\\\",\\n                  \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n                    \\\"cardType\\\": \\\"VISA\\\",\\n                    \\\"expirationMonth\\\": 10\\n                }\\n            }},\\n            \\\"softDescriptor\\\": \\\"BLS&#x2a;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>","excerpt":"","slug":"retrieve-all-subscriptions","type":"get","title":"Retrieve All Subscriptions"}

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

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

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 '

Response Examples

{
    "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": 2019,
                    "cardLastFourDigits": 1111,
                    "cardSubType": "CREDIT",
                  	"cardCategory": "CLASSIC",
                    "cardType": "VISA",
                    "expirationMonth": "07"
                }
            }},
            "softDescriptor": "BLS&#x2a;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": 2019,
                    "cardLastFourDigits": 1234,
                    "cardSubType": "CREDIT",
                  	"cardCategory": "CLASSIC",
                    "cardType": "VISA",
                    "expirationMonth": 10
                }
            }},
            "softDescriptor": "BLS&#x2a;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"
        }
    ]
}

Back to Top


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).



Back to Top