> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api/admin-apis/subscription-management/retrieve-the-subscription/getting-all-subscriptions-for-a-shopper.md).

# Getting all subscriptions for a shopper

To manage and understand your shopper's subscriptions, our API provides a straightforward method to retrieve detailed subscription information. By sending a simple `GET` request with a shopper's unique identifier or ERID, you can access comprehensive subscription data, including payment options, product details, and key subscription dates. This guide will walk you through making this request and interpreting the response, ensuring you have all the necessary information at your fingertips.

Retrieving subscription information is particularly useful in several scenarios:

* **Billing and invoicing**: Before generating invoices or during billing cycles, you can update billing details or confirm subscription statuses.
* **Customer support**: When handling customer inquiries or resolving subscription-related issues, such as upgrades, downgrades, or cancellations.
* **Subscription management**: To monitor and manage the lifecycle of subscriptions, including renewals, expiration, and auto-renewal statuses.
* **Analytics and reporting**: For creating detailed reports on subscription metrics, usage, and trends over time.
* **Personalized marketing**: To tailor marketing communications based on the subscription details, such as renewal reminders or offers on additional features or services.

Send a [`GET /v1/subscriptions?shopperId={shopperId}`](https://docs.digitalriver.com/commerce-api-references/admin-apis/subscription-mangement/retrieve-subscriptions#v1-subscriptions) request retrieve a shopper's subscription using the shopper's identifier or ERID,. You'll need to replace `{shopperId}` with the shopper’s actual identifier (`shopperId`) or external reference identifier (`ERID`).

{% tabs %}
{% tab title="cURL" %}

```javascript
curl --location --request GET 'https://api.digitalriver.com/v1/subscription?shopperId={shopperId or ERID}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {Your_Authorization}' \
```

{% endtab %}

{% tab title="200 OK response" %}
You will receive a `200 OK` response.

{% code overflow="wrap" %}

```json
{
  "subscriptions": [
    {
      "id": "14554435010",
      "externalReferenceId": "subext123232",
      "creationDate": "2020-06-12T06:49:21.000Z",
      "activationDate": "2020-06-12T00:00:00.000Z",
      "nextRenewalDate": "2020-07-02T05:00:00.000Z",
      "expirationDate": "2020-07-12T05:00:00.000Z",
      "graceDate": "2020-07-12T00:00:00.000Z",
      "cancellationDate": null,
      "currentQuantity": 4,
      "renewalQuantity": 2,
      "autoRenewal": true,
      "locale": "en_US",
      "state": "Subscribed",
      "duration": 30,
      "frequency": 30,
      "currentBillingCycleNumber": 0,
      "totalNumberOfBillingCycle": 0,
      "siteId": "sub2test",
      "term": {
        "termUnit": "MONTHS",
        "termLength": "1"
      },
      "product": {
        "id": "SubProd1234561",
        "name": "This is sub product",
        "externalReferenceID": "32323323"
      },
      "shipToAddress": {
        "id": "123232213",
        "firstName": "Jane", 
        "lastName": "Doe", 
        "companyName": "Acme Company", 
        "line1": "1234 Fake Street",
        "line2": "Apt. 2", 
        "city": "Minnetonka",
        "countrySubdivision": "MN",
        "postalCode": "55343",
        "country": "US",
        "countryName": "United States",
        "phoneNumber": "555-253-1234",
        "emailAddress": "jdoe@acme.com"
      },
      "paymentOption": {
        "id": "14827725210",
        "nickName": "Visa 1111",
        "isDefault": "false",
        "type": "CreditCardMethod",
        "sourceId": "323223232323",
        "creditCard": {
          "expirationMonth": "11",
          "expirationYear": "2034",
          "displayableNumber": "fadfafafdfadafad",
          "type": "visa",
          "displayName": "Visa"
        },
        "address": {
          "id": "123232213",
          "firstName": "Jane", 
          "lastName": "Doe", 
          "companyName": "Acme Company", 
          "line1": "1234 Fake Street",
          "line2": "Apt. 2", 
          "city": "Minnetonka",
          "countrySubdivision": "MN",
          "postalCode": "55343",
          "country": "US",
          "countryName": "United States",
          "phoneNumber": "555-253-1234",
          "emailAddress": "jdoe@acme.com"
        }
      },
      "addOns": [
        {
          "product": {
            "id": "SubProd1234561",
            "name": "This is sub-product addon1",
            "externalReferenceID": "32323377"
          },
          "quantity": 2
        },
        {
          "product": {
            "id": "B123",
            "name": "This is another sub product",
            "externalReferenceID": "32323555"
          },
          "quantity": 1
        }
      ]
    }
  ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

A successful request returns a `200 OK` response containing the subscription details, including IDs, dates, quantities, product information, and payment options associated with the shopper's subscription.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digitalriver.com/commerce-api/admin-apis/subscription-management/retrieve-the-subscription/getting-all-subscriptions-for-a-shopper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
