# UpdateSubscription

Update a single subscription

`PUT /api/v2/accounts/{accountId}/subscriptions/{id}`

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

Source: https://developer.avalara.com/products/crossborder/api/methods/Registrar/UpdateSubscription/

## Description

# For Registrar Use Only
This API is for use by Avalara Registrar administrative users only.
            
Replace the existing subscription object at this URL with an updated object.
A 'subscription' indicates a licensed subscription to a named Avalara service.
To request or remove subscriptions, please contact Avalara sales or your customer account manager.
All data from the existing object will be replaced with data in the object you PUT.
To set a field's value to null, you may either set its value to null or omit that field from the object you post.

### Security Policies

* This API requires one of the following user roles: BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `accountId` | integer | path | Yes | The ID of the account that this subscription belongs to. |
| `id` | integer | path | Yes | The ID of the subscription you wish to update |
| `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/) . |

## Request Body

**Schema:** `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. |

## Responses

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

### 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 PUT "https://sandbox-rest.avatax.com/api/v2/accounts/{accountId}/subscriptions/{id}" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "id": 12345,
  "accountId": 123456789,
  "subscriptionTypeId": 2,
  "subscriptionDescription": "AvaTaxPro",
  "effectiveDate": "2015-01-01"
}'
```