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

# 라이센스 키 업데이트

> 이 엔드포인트는 ID로 라이센스 키를 업데이트할 수 있습니다.

<Warning>
  **사용 중단된 API**: 라이선스 키는 이제 [Entitlements](/features/entitlements/introduction) 시스템을 통해 관리됩니다. [License Key entitlement](/api-reference/entitlements/update-entitlement)에서 활성화 제한 및 기간을 구성하고, [Revoke Grant](/api-reference/entitlements/revoke-grant)를 사용하여 고객의 키를 비활성화합니다. 이 엔드포인트는 향후 릴리스에서 제거될 예정입니다.
</Warning>

<Info>
  API를 통해 라이선스 키를 업데이트해도 고객에게 이메일 알림이 전송되지 않습니다.
</Info>


## OpenAPI

````yaml patch /license_keys/{id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.105.11
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /license_keys/{id}:
    patch:
      tags:
        - License Keys
      operationId: update_license_key
      parameters:
        - name: id
          in: path
          description: License key ID
          required: true
          schema:
            type: string
          example: lic_7namTC0VcgrnzrF3GTSwB
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchLicenseKeyRequest'
        required: true
      responses:
        '200':
          description: License key updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyResponse'
        '400':
          description: Cannot set expiry for subscription-based license
        '404':
          description: License key not found
        '422':
          description: New activation limit is less than current instances count
        '500':
          description: Something went wrong :(
      deprecated: true
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import DodoPayments from 'dodopayments';


            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });


            const licenseKey = await
            client.licenseKeys.update('lic_7namTC0VcgrnzrF3GTSwB');


            console.log(licenseKey.id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            license_key = client.license_keys.update(
                id="lic_7namTC0VcgrnzrF3GTSwB",
            )
            print(license_key.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tlicenseKey, err := client.LicenseKeys.Update(\n\t\tcontext.TODO(),\n\t\t\"lic_7namTC0VcgrnzrF3GTSwB\",\n\t\tdodopayments.LicenseKeyUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", licenseKey.ID)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.models.licensekeys.LicenseKey;

            import
            com.dodopayments.api.models.licensekeys.LicenseKeyUpdateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    LicenseKey licenseKey = client.licenseKeys().update("lic_7namTC0VcgrnzrF3GTSwB");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.licensekeys.LicenseKey

            import
            com.dodopayments.api.models.licensekeys.LicenseKeyUpdateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val licenseKey: LicenseKey = client.licenseKeys().update("lic_7namTC0VcgrnzrF3GTSwB")
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )


            license_key =
            dodo_payments.license_keys.update("lic_7namTC0VcgrnzrF3GTSwB")


            puts(license_key)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $licenseKey = $client->licenseKeys->update(
                'lic_7namTC0VcgrnzrF3GTSwB',
                activationsLimit: 0,
                disabled: true,
                expiresAt: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
              );

              var_dump($licenseKey);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using DodoPayments.Client;

            using DodoPayments.Client.Models.LicenseKeys;


            DodoPaymentsClient client = new();


            LicenseKeyUpdateParams parameters = new() { ID =
            "lic_7namTC0VcgrnzrF3GTSwB" };


            var licenseKey = await client.LicenseKeys.Update(parameters);


            Console.WriteLine(licenseKey);
        - lang: Rust
          source: |-
            use dodopayments::Client;

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let id = "id";
                let result = client
                    .license_keys()
                    .update()
                    .id(id)
                    .body(Default::default())
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    PatchLicenseKeyRequest:
      type: object
      properties:
        activations_limit:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The updated activation limit for the license key.

            Use `null` to remove the limit, or omit this field to leave it
            unchanged.
        disabled:
          type:
            - boolean
            - 'null'
          description: >-
            Indicates whether the license key should be disabled.

            A value of `true` disables the key, while `false` enables it. Omit
            this field to leave it unchanged.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The updated expiration timestamp for the license key in UTC.

            Use `null` to remove the expiration date, or omit this field to
            leave it unchanged.
    LicenseKeyResponse:
      type: object
      required:
        - id
        - business_id
        - key
        - status
        - customer_id
        - product_id
        - instances_count
        - created_at
        - source
        - brand_id
      properties:
        activations_limit:
          type:
            - integer
            - 'null'
          format: int32
          description: The maximum number of activations allowed for this license key.
          example: 5
        brand_id:
          type: string
          description: Brand id this license key belongs to
        business_id:
          type: string
          description: >-
            The unique identifier of the business associated with the license
            key.
        created_at:
          type: string
          format: date-time
          description: The timestamp indicating when the license key was created, in UTC.
          example: '2024-01-01T00:00:00.000Z'
        customer_id:
          type: string
          description: >-
            The unique identifier of the customer associated with the license
            key.
          example: cus_123
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: The timestamp indicating when the license key expires, in UTC.
          example: '2024-12-31T23:59:59.000Z'
        id:
          type: string
          description: The unique identifier of the license key.
          example: lic_123
        instances_count:
          type: integer
          format: int32
          description: The current number of instances activated for this license key.
        key:
          type: string
          description: The license key string.
        payment_id:
          type:
            - string
            - 'null'
          description: >-
            The unique identifier of the payment associated with the license
            key, if any.
        product_id:
          type: string
          description: >-
            The unique identifier of the product associated with the license
            key.
        source:
          $ref: '#/components/schemas/LicenseKeySource'
          description: >-
            The source of the license key - 'auto' for keys generated by
            payment/subscription flows, 'import' for merchant-imported keys.
        status:
          $ref: '#/components/schemas/LicenseKeyStatus'
          description: >-
            The current status of the license key (e.g., active, inactive,
            expired).
        subscription_id:
          type:
            - string
            - 'null'
          description: >-
            The unique identifier of the subscription associated with the
            license key, if any.
    LicenseKeySource:
      type: string
      enum:
        - auto
        - import
        - manual
    LicenseKeyStatus:
      type: string
      enum:
        - active
        - expired
        - disabled
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````