Retrieve 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 NameDescriptionExample
pagesizePositive integer. Sets the maximum number of results to return (i.e. page size).
Default is 10 if not set.
Maximum is 500.
pagesize=20
afterCharge ID. The response will get the page of results after the specified ID (exclusive).after=112233
beforeCharge ID. The response will get the page of results before the specified ID (exclusive).before=556677
gettotaltrue = Include the number of total results in the responsegettotal=true
fulldescriptiontrue (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": 2023,
                "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": 2025,
                "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
Language
Authorization
:
Click Try It! to start a request and see the response here!