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

# लाइसेंस मान्य करें

> यह एंडपॉइंट उपयोगकर्ता के लिए लाइसेंस को मान्य करने की अनुमति देता है।

<Info>
  **कोई API कुंजी आवश्यक नहीं**: यह एक सार्वजनिक एंडपॉइंट है जिसके लिए प्रमाणीकरण की आवश्यकता नहीं है। आप इसे सीधे क्लाइंट एप्लिकेशन्स, डेस्कटॉप सॉफ़्टवेयर, या CLI से कॉल कर सकते हैं ताकि अपने API क्रेडेंशियल्स को बिना एक्सपोज़ किए लाइसेंस कुंजियाँ सत्यापित की जा सकें।
</Info>


## OpenAPI

````yaml post /licenses/validate
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.106.2
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
  - name: Payment Connector Webhooks
paths:
  /licenses/validate:
    post:
      tags:
        - Licenses
      operationId: validate_license_key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateLicenseKeyRequest'
        required: true
      responses:
        '200':
          description: License key validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateLicenseKeyResponse'
        '422':
          description: Invalid request format
        '500':
          description: Something went wrong :(
      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 response = await client.licenses.validate({
              license_key: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',
            });

            console.log(response.valid);
        - 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
            )
            response = client.licenses.validate(
                license_key="2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43",
            )
            print(response.valid)
        - 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\tresponse, err := client.Licenses.Validate(context.TODO(), dodopayments.LicenseValidateParams{\n\t\tLicenseKey: dodopayments.F(\"2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43\"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Valid)\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.licenses.LicenseValidateParams;
            import com.dodopayments.api.models.licenses.LicenseValidateResponse;

            public final class Main {
                private Main() {}

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

                    LicenseValidateParams params = LicenseValidateParams.builder()
                        .licenseKey("2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43")
                        .build();
                    LicenseValidateResponse response = client.licenses().validate(params);
                }
            }
        - 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.licenses.LicenseValidateParams
            import com.dodopayments.api.models.licenses.LicenseValidateResponse

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

                val params: LicenseValidateParams = LicenseValidateParams.builder()
                    .licenseKey("2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43")
                    .build()
                val response: LicenseValidateResponse = client.licenses().validate(params)
            }
        - lang: Ruby
          source: >-
            require "dodopayments"


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


            response = dodo_payments.licenses.validate(license_key:
            "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43")


            puts(response)
        - 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 {
              $response = $client->licenses->validate(
                licenseKey: '2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43',
                licenseKeyInstanceID: 'lki_123',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Licenses;

            DodoPaymentsClient client = new();

            LicenseValidateParams parameters = new()
            {
                LicenseKey = "2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43"
            };

            var response = await client.Licenses.Validate(parameters);

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

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let result = client
                    .licenses()
                    .validate()
                    .body(dodopayments::models::LicensesValidateParams {
                            license_key: Some("2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43".to_string()),
                            ..Default::default()
                        })
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    ValidateLicenseKeyRequest:
      type: object
      required:
        - license_key
      properties:
        license_key:
          type: string
          example: 2b1f8e2d-c41e-4e8f-b2d3-d9fd61c38f43
        license_key_instance_id:
          type:
            - string
            - 'null'
          example: lki_123
    ValidateLicenseKeyResponse:
      type: object
      required:
        - valid
      properties:
        valid:
          type: boolean
          example: true

````