> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayar.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Activate License (SaaS)

> Endpoint to activate a SaaS subscription license code.

```bash Request Example theme={null}
curl --request POST 'https://api.mayar.id/saas/v2/license/activate' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
    "licenseCode": "YOUR-LICENSE-CODE",
    "productId": "YOUR-PRODUCT-ID"
}'
```

```json Response Example 200 theme={null}
{
    "statusCode": 200,
    "message": "Success updating license code status to ACTIVE."
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/saas/v2/license/activate
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/saas/v2/license/activate
```

## Authorization

**Authorization** `string` *required*

Example:

`Authorization | Bearer Paste-Your-API-Key-Here`

## Request Body

**licenseCode** `string` *required*

The license code to activate.

**productId** `string` *required*

The ID of the product (payment link) associated with the license.

## Response

Successful Response

### Main Structure (Root)

**statusCode** `integer`

Status code from the API. `200` on successful activation.

**message** `string`

Status message describing the result.

> [!NOTE]
>
> By performing this action, the status of the license code will change to `ACTIVE`.

## Errors

**400 Bad Request** `object`

Returned when `licenseCode` or `productId` is missing or invalid.

**401 Unauthorized** `object`

Returned when the Authorization header is missing or invalid.

**400 Failed identifying request** `object`

Returned when the request cannot be processed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.