> 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-a-subscription-by-identifier.md).

# Getting a subscription by identifier

By using the [`GET /v1/subscriptions/{subscriptionId}`](https://docs.digitalriver.com/commerce-api-references/admin-apis/subscription-mangement/retrieve-subscriptions#v1-subscriptions-subid) request, you can fetch detailed information about a specific subscription using the subscription's unique identifier. This information includes the basic subscription details and intricate aspects such as billing, renewal dates, product details, and associated add-ons.&#x20;

You need to replace the `{subscriptionId}` with the subscription identifier and `{YourAPIKey}` with your actual API key.&#x20;

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

```javascript
curl --location --request GET 'https://api.digitalriver.com/v1/subscriptions/{subscriptionId}' \
--header 'Authorization: Basic {YourAPIKey}' \
...
```

{% endtab %}

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

{% code overflow="wrap" %}

```json
{
    "id": "10499",
    "creationDate": "2020-10-05T11:59:53.000Z",
    "activationDate": "2020-10-05T05:00:00.000Z",
    "nextRenewalDate": "2021-10-05T05:00:00.000Z",
    "expirationDate": "2021-10-05T05:00:00.000Z",
    "graceDate": "2021-10-05T05:00:00.000Z",
    "currentQuantity": 1,
    "renewalQuantity": 1,
    "autoRenewal": false,
    "locale": "en_US",
    "state": "Subscribed",
    "duration": 365,
    "frequency": 365,
    "siteId": "sub2test",
    "term": {
        "termUnit": "YEARS",
        "termLength": 1
    },
    "product": {
        "id": "5396391800",
        "name": "Annual manual renewal Subscription"
    },
    "shipToAddress": {
        "id": "325333930516",
        "firstName": "John",
        "lastName": "Smith",
        "companyName": "Acme Company",
        "line1": "1234 Fake Street",
        "city": "Minnetonka",
        "postalCode": "55343",
        "countrySubdivision": "MN",
        "country": "US",
        "countryName": "United States",
        "phoneNumber": "5556543210",
        "emailAddress": "jsmith@acme.com"
    },
    "paymentOption": {
        "nickName": "Default",
        "id": "4010780499",
        "isDefault": "true",
        "type": "CreditCardMethod",
        "creditCard": {
            "expirationMonth": "2",
            "expirationYear": "2021",
            "displayableNumber": "************1111",
            "type": "visa",
            "displayName": "Visa"
        },
        "address": {
            "id": "325333930515",
            "firstName": "John",
            "lastName": "Smith",
            "companyName": "Acme Company",
            "line1": "1234 Fake Street",
            "city": "Minnetonka",
            "postalCode": "55343",
            "countrySubdivision": "MN",
            "country": "US",
            "countryName": "United States",
            "phoneNumber": "55343",
            "emailAddress": "jsmith@acme.com"
        }
    },
    "addOns": [ 
        {
          "product": {
            "id": "SubProd1234561",
            "name": "Thissub-product is sub product addon1",
            "externalReferenceID": "32323377"
          },
          "quantity": 2
        },        
    ]
}
```

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

A successful request will return a `200 OK` response status, along with json data that contains the details of the subscription, such as its `id`, `creationDate`, `state`, and product information.


---

# 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-a-subscription-by-identifier.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.
