# Subscription

A subscription represents a contact's membership in a recurring product, such as a loyalty programme or membership tier.

## List all subscriptions

> Returns a list of subscriptions. The subscriptions are returned in descending order by creation date.

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Subscription","description":"A subscription represents a contact's membership in a recurring product, such as a loyalty programme or membership tier."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Subscription-subscription.read":{"type":"object","description":"A subscription represents a contact's membership in a recurring product, such as a loyalty programme or membership tier.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"contact":{"type":"integer"},"status":{"type":"string","enum":["Active","Inactive","Pending","Cancelled","Trial"]},"cancelAt":{"type":["string","null"],"format":"date-time"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"product":{"type":"integer"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/RecurringProductTierPricing-subscription.read"},{"type":"null"}]},"pricingPeriod":{"type":["string","null"],"enum":["Monthly","Yearly",null]},"paymentsStartedAt":{"type":["string","null"],"format":"date-time"},"tierId":{"readOnly":true,"type":["integer","null"]},"storedCreditAccountId":{"readOnly":true,"type":["integer","null"]}}},"RecurringProductTierPricing-subscription.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"monthlyPrice":{"type":"integer"},"yearlyPrice":{"type":"integer"},"storeCurrency":{"$ref":"#/components/schemas/StoreCurrency-subscription.read"},"orderUnitPrice":{"default":0,"type":"integer"}}},"StoreCurrency-subscription.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"currencyCode":{"type":"string"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/subscriptions":{"get":{"operationId":"api_subscriptions_get_collection","tags":["Subscription"],"responses":{"200":{"description":"Subscription collection","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Subscription-subscription.read"}}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"List all subscriptions","description":"Returns a list of subscriptions. The subscriptions are returned in descending order by creation date.","parameters":[{"name":"page","in":"query","description":"The collection page number","required":false,"deprecated":false,"schema":{"type":"integer","default":1},"style":"form","explode":true},{"name":"createdAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"createdAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"updatedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"startedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"startedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"startedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"startedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"endedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"endedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"endedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"endedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelledAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelledAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelledAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"cancelledAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"paymentsStartedAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"paymentsStartedAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"paymentsStartedAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"paymentsStartedAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"trialEndsAt[before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"trialEndsAt[strictly_before]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"trialEndsAt[after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false},{"name":"trialEndsAt[strictly_after]","in":"query","description":"","required":false,"deprecated":false,"schema":{"type":"string"},"style":"form","explode":false}]}}}}
```

## Retrieve a subscription

> Retrieve a subscription

```json
{"openapi":"3.1.0","info":{"title":"Glu","version":"1.0.0"},"tags":[{"name":"Subscription","description":"A subscription represents a contact's membership in a recurring product, such as a loyalty programme or membership tier."}],"servers":[{"url":"https://api.glu.io","description":"Production API"}],"security":[{"x_api_key":[]}],"components":{"securitySchemes":{"x_api_key":{"type":"apiKey","description":"Value for the x-api-key header parameter.","name":"x-api-key","in":"header"}},"schemas":{"Subscription-subscription.read":{"type":"object","description":"A subscription represents a contact's membership in a recurring product, such as a loyalty programme or membership tier.","properties":{"id":{"readOnly":true,"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":["string","null"],"format":"date-time"},"contact":{"type":"integer"},"status":{"type":"string","enum":["Active","Inactive","Pending","Cancelled","Trial"]},"cancelAt":{"type":["string","null"],"format":"date-time"},"cancelledAt":{"type":["string","null"],"format":"date-time"},"product":{"type":"integer"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/RecurringProductTierPricing-subscription.read"},{"type":"null"}]},"pricingPeriod":{"type":["string","null"],"enum":["Monthly","Yearly",null]},"paymentsStartedAt":{"type":["string","null"],"format":"date-time"},"tierId":{"readOnly":true,"type":["integer","null"]},"storedCreditAccountId":{"readOnly":true,"type":["integer","null"]}}},"RecurringProductTierPricing-subscription.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"monthlyPrice":{"type":"integer"},"yearlyPrice":{"type":"integer"},"storeCurrency":{"$ref":"#/components/schemas/StoreCurrency-subscription.read"},"orderUnitPrice":{"default":0,"type":"integer"}}},"StoreCurrency-subscription.read":{"type":"object","properties":{"id":{"readOnly":true,"type":"integer"},"currencyCode":{"type":"string"}}},"Error.jsonld":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"},"description":{"readOnly":true,"type":["string","null"]}}},"Error":{"type":"object","description":"A representation of common errors.","properties":{"title":{"readOnly":true,"description":"A short, human-readable summary of the problem.","type":["string","null"]},"detail":{"readOnly":true,"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"status":{"type":["number","null"],"default":400},"instance":{"readOnly":true,"description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.","type":["string","null"]},"type":{"readOnly":true,"description":"A URI reference that identifies the problem type","type":"string"}}}}},"paths":{"/subscriptions/{id}":{"get":{"operationId":"api_subscriptions_id_get","tags":["Subscription"],"responses":{"200":{"description":"Subscription resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription-subscription.read"}}}},"403":{"description":"Forbidden","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}},"404":{"description":"Not found","content":{"application/ld+json":{"schema":{"$ref":"#/components/schemas/Error.jsonld"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"links":{}}},"summary":"Retrieve a subscription","description":"Retrieve a subscription","parameters":[{"name":"id","in":"path","description":"Subscription identifier","required":true,"deprecated":false,"schema":{"type":"string"},"style":"simple","explode":false}]}}}}
```


---

# Agent Instructions: 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:

```
GET https://glu.gitbook.io/docs/api-reference/organisation-api/subscription.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
