> ## 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.

# Get License Key Instance

> Retrieve details of a specific license key instance by its ID.



## OpenAPI

````yaml get /license_key_instances/{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.102.0
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_key_instances/{id}:
    get:
      tags:
        - License Keys
      operationId: get_license_key_instance
      parameters:
        - name: id
          in: path
          description: License key instance ID
          required: true
          schema:
            type: string
          example: lki_123
      responses:
        '200':
          description: License key instance found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseKeyInstanceResponse'
        '404':
          description: License key instance not found
        '500':
          description: Something went wrong :(
      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 licenseKeyInstance = await
            client.licenseKeyInstances.retrieve('lki_123');


            console.log(licenseKeyInstance.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_instance = client.license_key_instances.retrieve(
                "lki_123",
            )
            print(license_key_instance.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\tlicenseKeyInstance, err := client.LicenseKeyInstances.Get(context.TODO(), \"lki_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", licenseKeyInstance.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.licensekeyinstances.LicenseKeyInstance;

            import
            com.dodopayments.api.models.licensekeyinstances.LicenseKeyInstanceRetrieveParams;


            public final class Main {
                private Main() {}

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

                    LicenseKeyInstance licenseKeyInstance = client.licenseKeyInstances().retrieve("lki_123");
                }
            }
        - 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.licensekeyinstances.LicenseKeyInstance

            import
            com.dodopayments.api.models.licensekeyinstances.LicenseKeyInstanceRetrieveParams


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

                val licenseKeyInstance: LicenseKeyInstance = client.licenseKeyInstances().retrieve("lki_123")
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


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


            license_key_instance =
            dodo_payments.license_key_instances.retrieve("lki_123")


            puts(license_key_instance)
        - 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 {
              $licenseKeyInstance = $client->licenseKeyInstances->retrieve('lki_123');

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

            using DodoPayments.Client;

            using DodoPayments.Client.Models.LicenseKeyInstances;


            DodoPaymentsClient client = new();


            LicenseKeyInstanceRetrieveParams parameters = new() { ID = "lki_123"
            };


            var licenseKeyInstance = await
            client.LicenseKeyInstances.Retrieve(parameters);


            Console.WriteLine(licenseKeyInstance);
components:
  schemas:
    LicenseKeyInstanceResponse:
      type: object
      required:
        - id
        - business_id
        - name
        - license_key_id
        - created_at
      properties:
        business_id:
          type: string
        created_at:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00Z'
        id:
          type: string
          example: lki_123
        license_key_id:
          type: string
          example: lic_123
        name:
          type: string
          example: Production Server 1
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````