Skip to main content
GET
/
license_keys
/
{id}
JavaScript
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.retrieve('lic_7namTC0VcgrnzrF3GTSwB');

console.log(licenseKey.id);
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.retrieve(
"lic_7namTC0VcgrnzrF3GTSwB",
)
print(license_key.id)
package main

import (
"context"
"fmt"

"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)

func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
licenseKey, err := client.LicenseKeys.Get(context.TODO(), "lic_7namTC0VcgrnzrF3GTSwB")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", licenseKey.ID)
}
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.LicenseKeyRetrieveParams;

public final class Main {
private Main() {}

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

LicenseKey licenseKey = client.licenseKeys().retrieve("lic_7namTC0VcgrnzrF3GTSwB");
}
}
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.LicenseKeyRetrieveParams

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

val licenseKey: LicenseKey = client.licenseKeys().retrieve("lic_7namTC0VcgrnzrF3GTSwB")
}
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.retrieve("lic_7namTC0VcgrnzrF3GTSwB")

puts(license_key)
<?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->retrieve('lic_7namTC0VcgrnzrF3GTSwB');

var_dump($licenseKey);
} catch (APIException $e) {
echo $e->getMessage();
}
using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.LicenseKeys;

DodoPaymentsClient client = new();

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

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

Console.WriteLine(licenseKey);
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.license_keys()
.retrieve()
.id(id)
.await?;
println!("{result:?}");
Ok(())
}
curl --request GET \
--url https://test.dodopayments.com/license_keys/{id} \
--header 'Authorization: Bearer <token>'
{
  "brand_id": "<string>",
  "business_id": "<string>",
  "created_at": "2024-01-01T00:00:00.000Z",
  "customer_id": "cus_123",
  "id": "lic_123",
  "instances_count": 123,
  "key": "<string>",
  "product_id": "<string>",
  "activations_limit": 5,
  "expires_at": "2024-12-31T23:59:59.000Z",
  "payment_id": "<string>",
  "subscription_id": "<string>"
}
Deprecated API: License keys are now managed through the Entitlements system. Use List Customer Grants (filter with integration_type=license_key) to retrieve a key’s grant and its license_key details. This endpoint will be removed in a future release.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

License key ID

Response

License key found

brand_id
string
required

Brand id this license key belongs to

business_id
string
required

The unique identifier of the business associated with the license key.

created_at
string<date-time>
required

The timestamp indicating when the license key was created, in UTC.

Example:

"2024-01-01T00:00:00.000Z"

customer_id
string
required

The unique identifier of the customer associated with the license key.

Example:

"cus_123"

id
string
required

The unique identifier of the license key.

Example:

"lic_123"

instances_count
integer<int32>
required

The current number of instances activated for this license key.

key
string
required

The license key string.

product_id
string
required

The unique identifier of the product associated with the license key.

source
enum<string>
required

The source of the license key - 'auto' for keys generated by payment/subscription flows, 'import' for merchant-imported keys.

Available options:
auto,
import,
manual
status
enum<string>
required

The current status of the license key (e.g., active, inactive, expired).

Available options:
active,
expired,
disabled
activations_limit
integer<int32> | null

The maximum number of activations allowed for this license key.

Example:

5

expires_at
string<date-time> | null

The timestamp indicating when the license key expires, in UTC.

Example:

"2024-12-31T23:59:59.000Z"

payment_id
string | null

The unique identifier of the payment associated with the license key, if any.

subscription_id
string | null

The unique identifier of the subscription associated with the license key, if any.

Last modified on July 8, 2026