> For the complete documentation index, see [llms.txt](https://docs.hos.accessacloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hos.accessacloud.com/atreemo-api/api-reference/atreemo-api-reference/subscription.md).

# Subscription

Api Methods for Subscription

## Get

> Retrieves subscriptions through two source overloads consolidated from the public catalogue. With no ExternalID the successful result is a collection; with ExternalID it is a single subscription. Preserve the retained query variants and response union. Permission, invalid-input and not-found paths are not equivalent to a successful empty list.

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Subscription","description":"Api Methods for Subscription"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"Subscription":{"type":"object","properties":{"ExternalID":{"type":"string","description":"Subscription External ID"},"SubscriptionCode":{"type":"string","description":"Subscription Code"},"SubscriptionDescription":{"type":"string","description":"Subscription Description"},"SubscriptionField1":{"type":"string","description":"Extra Field 1"},"SubscriptionField2":{"type":"string","description":"Extra Field 2"},"SubscriptionField3":{"type":"string","description":"Extra Field 3"},"SubscriptionField4":{"type":"string","description":"Extra Field 4"},"SubscriptionField5":{"type":"string","description":"Extra Field 5"},"SubscriptionPrice":{"type":"number","format":"double","nullable":true,"description":"Subscription Price"}},"required":["ExternalID","SubscriptionCode","SubscriptionDescription"]}}},"paths":{"/api/Subscription/Get":{"get":{"operationId":"SubscriptionGet","summary":"Get","tags":["Subscription"],"description":"Retrieves subscriptions through two source overloads consolidated from the public catalogue. With no ExternalID the successful result is a collection; with ExternalID it is a single subscription. Preserve the retained query variants and response union. Permission, invalid-input and not-found paths are not equivalent to a successful empty list.","parameters":[{"name":"ExternalID","in":"query","schema":{"type":"string","nullable":true},"description":"Native query parameter. CLR string ExternalID in the pinned controller signature. Optional across Get() and Get(string ExternalID); omission returns a list.","required":false}],"responses":{"200":{"description":"OK. Sample responses in the collection show an array when no `ExternalID` is supplied and a single object when it is.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Subscription"},{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}]}}}}}}}}}
```

## GetSubscriptionByContact

> Get Subscription linked to specified contact

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Subscription","description":"Api Methods for Subscription"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"SubscriberDetails":{"type":"object","properties":{"CtcID":{"type":"integer","format":"int32","nullable":true,"description":"CtcID of the subscriber"},"MemberID":{"type":"integer","format":"int32","nullable":true,"description":"MemberID of the subscriber"},"OriginID":{"type":"string","description":"OriginID of the subscriber"},"SourceID":{"type":"string","description":"Subscriber Source ID"}}},"ContactSubscriptionOutPut":{"type":"object","properties":{"ContactSubscriptionField1":{"type":"string","description":"Subscription Custom Field 1"},"ContactSubscriptionField2":{"type":"string","description":"Subscription Custom Field 2"},"ContactSubscriptionField3":{"type":"string","description":"Subscription Custom Field 3"},"ContactSubscriptionField4":{"type":"string","description":"Subscription Custom Field 4"},"ContactSubscriptionField5":{"type":"string","description":"Subscription Custom Field 5"},"ExpiryDate":{"type":"string","format":"date-time","nullable":true,"description":"Subscription Expiry Date"},"LocationID":{"type":"string","description":"Subscription Location ID"},"NbDaysToExpire":{"type":"integer","format":"int32","nullable":true,"description":"Number of Days to Expire"},"PaidAmount":{"type":"number","format":"double","nullable":true,"description":"Paid Amount"},"StartDate":{"type":"string","format":"date-time","nullable":true,"description":"Subscription Start Date"},"Status":{"description":"Active = 1, Renew = 2, AutoRenew = 3, CancelledByCustomer = 4, CancelledCardExpired = 5, CancelledPaymentDeclined = 6, PendingCancellation = 7, Paused = 8, Trial = 9, Pending= 10 (Documented as type `EnumSubscriptionStatus`. The published description lists the values captured in `x-atreemo-documented-values`; their wire representation (number or name) and whether the list is exhaustive are not documented.)","type":"integer","format":"int32"},"SubscriptionCode":{"type":"string","description":"Subscription Code"}}}}},"paths":{"/api/Subscription/GetSubscriptionByContact":{"post":{"operationId":"SubscriptionGetSubscriptionByContact","summary":"GetSubscriptionByContact","tags":["Subscription"],"description":"Get Subscription linked to specified contact","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriberDetails"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContactSubscriptionOutPut"}}}}}}}}}}
```

## Post

> Add a Subscription

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Subscription","description":"Api Methods for Subscription"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"Subscription":{"type":"object","properties":{"ExternalID":{"type":"string","description":"Subscription External ID"},"SubscriptionCode":{"type":"string","description":"Subscription Code"},"SubscriptionDescription":{"type":"string","description":"Subscription Description"},"SubscriptionField1":{"type":"string","description":"Extra Field 1"},"SubscriptionField2":{"type":"string","description":"Extra Field 2"},"SubscriptionField3":{"type":"string","description":"Extra Field 3"},"SubscriptionField4":{"type":"string","description":"Extra Field 4"},"SubscriptionField5":{"type":"string","description":"Extra Field 5"},"SubscriptionPrice":{"type":"number","format":"double","nullable":true,"description":"Subscription Price"}},"required":["ExternalID","SubscriptionCode","SubscriptionDescription"]},"ApiOutput":{"type":"object","properties":{"Error":{"type":"string","description":"Error description"},"Response":{"type":"boolean","description":"The status call"}}}}},"paths":{"/api/Subscription/Post":{"post":{"operationId":"SubscriptionPost","summary":"Post","tags":["Subscription"],"description":"Add a Subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOutput"}}}}}}}}}
```

## PostSubscriptionContact

> Add or update a contact Subsciption

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Subscription","description":"Api Methods for Subscription"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"ContactSubscription":{"type":"object","properties":{"ContactSubscriptionField1":{"type":"string","description":"Subscription Custom Field 1"},"ContactSubscriptionField2":{"type":"string","description":"Subscription Custom Field 2"},"ContactSubscriptionField3":{"type":"string","description":"Subscription Custom Field 3"},"ContactSubscriptionField4":{"type":"string","description":"Subscription Custom Field 4"},"ContactSubscriptionField5":{"type":"string","description":"Subscription Custom Field 5"},"ExpiryDate":{"type":"string","format":"date-time","nullable":true,"description":"Subscription Expiry Date"},"LocationID":{"type":"string","description":"Subscription Location ID"},"NbDaysToExpire":{"type":"integer","format":"int32","nullable":true,"description":"Number of Days to Expire"},"PaidAmount":{"type":"number","format":"double","nullable":true,"description":"Paid Amount"},"StartDate":{"type":"string","format":"date-time","nullable":true,"description":"Subscription Start Date"},"Status":{"description":"Active = 1, Renew = 2, AutoRenew = 3, CancelledByCustomer = 4, CancelledCardExpired = 5, CancelledPaymentDeclined = 6, PendingCancellation = 7, Paused = 8, Trial = 9, Pending= 10 (Documented as type `EnumSubscriptionStatus`. The published description lists the values captured in `x-atreemo-documented-values`; their wire representation (number or name) and whether the list is exhaustive are not documented.)","type":"integer","format":"int32"},"SubscriptionCode":{"type":"string","description":"Subscription Code"}},"required":["StartDate","Status","SubscriptionCode"]},"ApiOutput":{"type":"object","properties":{"Error":{"type":"string","description":"Error description"},"Response":{"type":"boolean","description":"The status call"}}}}},"paths":{"/api/Subscription/PostSubscriptionContact":{"post":{"operationId":"SubscriptionPostSubscriptionContact","summary":"PostSubscriptionContact","tags":["Subscription"],"description":"Add or update a contact Subsciption","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubscription"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOutput"}}}}}}}}}
```

## Put

> Update a Subscription

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Subscription","description":"Api Methods for Subscription"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"Subscription":{"type":"object","properties":{"ExternalID":{"type":"string","description":"Subscription External ID"},"SubscriptionCode":{"type":"string","description":"Subscription Code"},"SubscriptionDescription":{"type":"string","description":"Subscription Description"},"SubscriptionField1":{"type":"string","description":"Extra Field 1"},"SubscriptionField2":{"type":"string","description":"Extra Field 2"},"SubscriptionField3":{"type":"string","description":"Extra Field 3"},"SubscriptionField4":{"type":"string","description":"Extra Field 4"},"SubscriptionField5":{"type":"string","description":"Extra Field 5"},"SubscriptionPrice":{"type":"number","format":"double","nullable":true,"description":"Subscription Price"}},"required":["ExternalID","SubscriptionCode","SubscriptionDescription"]},"ApiOutput":{"type":"object","properties":{"Error":{"type":"string","description":"Error description"},"Response":{"type":"boolean","description":"The status call"}}}}},"paths":{"/api/Subscription/Put":{"post":{"operationId":"SubscriptionPut","summary":"Put","tags":["Subscription"],"description":"Update a Subscription","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOutput"}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hos.accessacloud.com/atreemo-api/api-reference/atreemo-api-reference/subscription.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 `automate deployments from our CI pipeline` 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.
