# GetMySubscription

Checks if the current user is subscribed to a specific service

`GET /api/v2/utilities/subscriptions/{serviceTypeId}`

**API:** AvaTax API
**Tag:** Utilities
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Utilities/GetMySubscription/

## Description

Returns a subscription object for the current account, or 404 Not Found if this subscription is not enabled for this account.
            
This API will return an error if it is called with invalid authentication credentials.
            
This API is intended to help you determine whether you have the necessary subscription to use certain API calls
within AvaTax.  You can examine the subscriptions returned from this API call to look for a particular product
or subscription to provide useful information to the current user as to whether they are entitled to use
specific features of AvaTax.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `serviceTypeId` | string | path | Yes | The service to check |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `SubscriptionModel` |
| 400 | Bad Request | `ProblemDetails` |
| 401 | Unauthorized | `ProblemDetails` |
| 404 | Not Found | `ProblemDetails` |

### 200 Response: `SubscriptionModel`

Represents a service that this account has subscribed to.

| Property | Type | Required | Description |
|---|---|---|---|
| `id` | integer | No | The unique ID number of this subscription. Example: `12345`. |
| `accountId` | integer | No | The unique ID number of the account this subscription belongs to. Example: `123456789`. |
| `subscriptionTypeId` | integer | No | The unique ID number of the service that the account is subscribed to. If this is provided, subscription description is ignored. Example: `2`. |
| `subscriptionDescription` | string | No | A friendly description of the service that the account is subscribed to. You can either provide the subscription type Id or this but not both. If
subscription type Id is provided, then this information is ignored and this field will be updated with the information from subscription type id. Example: `AvaTaxPro`. |
| `effectiveDate` | string | No | The date when the subscription began. Example: `2015-01-01T00:00:00`. |
| `endDate` | string | No | If the subscription has ended or will end, this date indicates when the subscription ends. |
| `createdDate` | string | No | The date when this record was created. |
| `createdUserId` | integer | No | The User ID of the user who created this record. |
| `modifiedDate` | string | No | The date/time when this record was last modified. |
| `modifiedUserId` | integer | No | The user ID of the user who last modified this record. |

## Example Request

```bash
curl -X GET "https://sandbox-rest.avatax.com/api/v2/utilities/subscriptions/{serviceTypeId}" \
  -H "Authorization: Basic <credentials>" \
  -H "Accept: application/json"
```