> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/core-api-reference/in_stock_subscriptions/retrieve.md).

# Retrieve an in stock subscription

How to fetch a specific in stock subscription via API

To [fetch](https://docs.commercelayer.io/core/fetching-resources) a single in stock subscription, send a `GET` request to the `/api/in_stock_subscriptions/:id` endpoint, where `id` is the ID of the resource that you want to retrieve.

## Request

**GET** <https://yourdomain.commercelayer.io/api/in\\_stock\\_subscriptions/:id>

### **Example**

{% tabs %}
{% tab title="Request" %}
The following request fetches the in stock subscription identified by the ID "XAyRWNUzyN":

```shell
curl -g -X GET \
  'https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token'
```

{% endtab %}

{% tab title="Response" %}
On success, the API responds with a `200 OK` status code, returning a single resource object:

```json
{
  "data": {
    "id": "XAyRWNUzyN",
    "type": "in_stock_subscriptions",
    "links": {
      "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN"
    },
    "attributes": {
      "status": "active",
      "customer_email": "john@example.com",
      "sku_code": "TSHIRTMM000000FFFFFFXLXX",
      "stock_threshold": 3,
      "created_at": "2018-01-01T12:00:00.000Z",
      "updated_at": "2018-01-01T12:00:00.000Z",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "market": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/relationships/market",
          "related": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/market"
        }
      },
      "customer": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/relationships/customer",
          "related": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/customer"
        }
      },
      "sku": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/relationships/sku",
          "related": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/sku"
        }
      },
      "events": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/relationships/events",
          "related": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/events"
        }
      },
      "event_stores": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/relationships/event_stores",
          "related": "https://yourdomain.commercelayer.io/api/in_stock_subscriptions/XAyRWNUzyN/event_stores"
        }
      }
    },
    "meta": {
      "mode": "test",
      "organization_id": "xRRkjDFafe",
      "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
    }
  },
  "meta": {
    "mode": "test",
    "organization_id": "xRRkjDFafe",
    "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
  }
}
```

{% endtab %}
{% endtabs %}


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/core-api-reference/in_stock_subscriptions/retrieve.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
