{"_id":"59dfa5848b51880010b74ae3","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,"project":"57336fd5a6a9c40e00e13a0b","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-29T19:37:23.228Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"code":"","language":"text"}]},"settings":"57ee593a21ceb20e0061959e","examples":{"codes":[]},"method":"get","auth":"optional","params":[],"url":""},"isReference":false,"order":10,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/recurring/subscriptions/:subscriptionId/charges?{parameters}</span>\n\n##Documentation\nThe Retrieve All Subscription Charges request enables you to retrieve details about all charges that have been processed for an existing subscription.\n\n###Request Content\nEnter any of the query parameters below into the request URL. For example:\n`services/2/recurring/subscriptions/121212/charges?pagesize=20&after=112233&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    \"3-1\": \"**true** = Include the number of total results in the response\",\n    \"1-1\": \"Charge ID. The response will get the page of results after the specified ID (exclusive).\",\n    \"2-1\": \"Charge 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    \"0-2\": \"`pagesize=20`\",\n    \"1-2\": \"`after=112233`\",\n    \"2-2\": \"`before=556677`\",\n    \"3-2\": \"`gettotal=true`\",\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    \"4-2\": \"`fulldescription=true`\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response contains the **[chargeList](doc:charges)** 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/4444/charges?pagesize=3&after=163193&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 Charges Request\"\n    },\n    {\n      \"code\": \"curl -v -X GET https://sandbox.bluesnap.com/services/2/recurring/subscriptions/39511316/charges?pagesize=2&after=163375&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  \\t\\\"charges\\\": [\\n        {\\n            \\\"amount\\\": 80,\\n            \\\"chargeId\\\": 163193,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"transactionDate\\\": \\\"2016-07-08\\\"\\n        },\\n        {\\n            \\\"amount\\\": 130,\\n            \\\"chargeId\\\": 163191,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"transactionDate\\\": \\\"2016-07-08\\\"\\n        },\\n        {\\n            \\\"amount\\\": 100,\\n            \\\"chargeId\\\": 163189,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"transactionDate\\\": \\\"2016-07-08\\\"\\n        }\\n    ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Retrieve Charges Response: 200 OK\"\n    },\n    {\n      \"code\": \"{\\n    \\\"lastPage\\\": true,\\n  \\t\\\"charges\\\": [\\n        {\\n            \\\"amount\\\": 50,\\n            \\\"vaultedShopperId\\\": 19550460,\\n            \\\"chargeInfo\\\": {\\n                \\\"fromDate\\\": \\\"2016-08-19\\\",\\n                \\\"toDate\\\": \\\"2016-09-19\\\",\\n                \\\"chargeType\\\": \\\"RECURRING\\\"\\n            },\\n            \\\"chargeId\\\": 163373,\\n            \\\"paymentSource\\\": {\\\"creditCardInfo\\\": {\\\"creditCard\\\": {\\n                \\\"expirationYear\\\": 2018,\\n                \\\"cardLastFourDigits\\\": \\\"0026\\\",\\n                \\\"cardType\\\": \\\"VISA\\\",\\n              \\t\\\"cardSubType\\\": \\\"CREDIT\\\", \\n              \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n                \\\"expirationMonth\\\": \\\"01\\\"\\n            }}},\\n            \\\"softDescriptor\\\": \\\"BLS*Merchant\\\",\\n            \\\"planId\\\": 2186280,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"transactionDate\\\": \\\"2016-08-01\\\",\\n            \\\"subscriptionId\\\": 39511316,\\n            \\\"transactionId\\\": 38485436\\n        },\\n        {\\n            \\\"amount\\\": 13.2,\\n            \\\"vaultedShopperId\\\": 19550460,\\n            \\\"chargeInfo\\\": {\\n                \\\"fromDate\\\": \\\"2016-07-19\\\",\\n                \\\"toDate\\\": \\\"2016-08-19\\\",\\n                \\\"chargeType\\\": \\\"INITIAL\\\"\\n            },\\n            \\\"chargeId\\\": 163275,\\n            \\\"paymentSource\\\": {\\\"creditCardInfo\\\": {\\\"creditCard\\\": {\\n                \\\"expirationYear\\\": 2018,\\n                \\\"cardLastFourDigits\\\": \\\"0026\\\",\\n                \\\"cardType\\\": \\\"VISA\\\",\\n              \\t\\\"cardSubType\\\": \\\"CREDIT\\\", \\n              \\t\\\"cardCategory\\\": \\\"CLASSIC\\\",\\n                \\\"expirationMonth\\\": \\\"01\\\"\\n            }}},\\n            \\\"softDescriptor\\\": \\\"BLS*Merchant\\\",\\n            \\\"planId\\\": 2186278,\\n            \\\"currency\\\": \\\"USD\\\",\\n            \\\"transactionDate\\\": \\\"2016-07-19\\\",\\n            \\\"subscriptionId\\\": 39511316,\\n            \\\"transactionId\\\": 38485250\\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 Description\n\n###Retrieve Charges\nThe example above shows how to retrieve all charges for a specific subscription. Results are limited to charges after charge ID 163193, and a maximum of 3 charges per page. Because `fulldescription=false`, the response includes limited information, and you can use the charge IDs to retrieve more details about each charge.\n\n###Retrieve Charges with full description\nThe example above shows how to retrieve charges 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-subscription-charges","type":"get","title":"Retrieve All Charges for a Subscription"}

getRetrieve All Charges for a Subscription


Definition

https://sandbox.bluesnap.com/services/2/recurring/subscriptions/:subscriptionId/charges?{parameters}

Documentation

The Retrieve All Subscription Charges request enables you to retrieve details about all charges that have been processed for an existing subscription.

Request Content

Enter any of the query parameters below into the request URL. For example:
services/2/recurring/subscriptions/121212/charges?pagesize=20&after=112233&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

Charge ID. The response will get the page of results after the specified ID (exclusive).

after=112233

before

Charge ID. The response will get the page of results before the specified ID (exclusive).

before=556677

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

Response Details

If successful, the response HTTP status code is 200 OK.
The response contains the chargeList object.


Examples

Request Examples

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

Response Examples

{
    "totalResults": 42,
    "lastPage": false,
  	"charges": [
        {
            "amount": 80,
            "chargeId": 163193,
            "currency": "USD",
            "transactionDate": "2016-07-08"
        },
        {
            "amount": 130,
            "chargeId": 163191,
            "currency": "USD",
            "transactionDate": "2016-07-08"
        },
        {
            "amount": 100,
            "chargeId": 163189,
            "currency": "USD",
            "transactionDate": "2016-07-08"
        }
    ]
}
{
    "lastPage": true,
  	"charges": [
        {
            "amount": 50,
            "vaultedShopperId": 19550460,
            "chargeInfo": {
                "fromDate": "2016-08-19",
                "toDate": "2016-09-19",
                "chargeType": "RECURRING"
            },
            "chargeId": 163373,
            "paymentSource": {"creditCardInfo": {"creditCard": {
                "expirationYear": 2018,
                "cardLastFourDigits": "0026",
                "cardType": "VISA",
              	"cardSubType": "CREDIT", 
              	"cardCategory": "CLASSIC",
                "expirationMonth": "01"
            }}},
            "softDescriptor": "BLS*Merchant",
            "planId": 2186280,
            "currency": "USD",
            "transactionDate": "2016-08-01",
            "subscriptionId": 39511316,
            "transactionId": 38485436
        },
        {
            "amount": 13.2,
            "vaultedShopperId": 19550460,
            "chargeInfo": {
                "fromDate": "2016-07-19",
                "toDate": "2016-08-19",
                "chargeType": "INITIAL"
            },
            "chargeId": 163275,
            "paymentSource": {"creditCardInfo": {"creditCard": {
                "expirationYear": 2018,
                "cardLastFourDigits": "0026",
                "cardType": "VISA",
              	"cardSubType": "CREDIT", 
              	"cardCategory": "CLASSIC",
                "expirationMonth": "01"
            }}},
            "softDescriptor": "BLS*Merchant",
            "planId": 2186278,
            "currency": "USD",
            "transactionDate": "2016-07-19",
            "subscriptionId": 39511316,
            "transactionId": 38485250
        }
    ]
}

Back to Top


Example Description

Retrieve Charges

The example above shows how to retrieve all charges for a specific subscription. Results are limited to charges after charge ID 163193, and a maximum of 3 charges per page. Because fulldescription=false, the response includes limited information, and you can use the charge IDs to retrieve more details about each charge.

Retrieve Charges with full description

The example above shows how to retrieve charges 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