Skip to main content
POST
/
licenses
/
activate
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 response = await client.licenses.activate({ license_key: 'license_key', name: 'name' });

console.log(response.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
)
response = client.licenses.activate(
    license_key="license_key",
    name="name",
)
print(response.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"),
	)
	response, err := client.Licenses.Activate(context.TODO(), dodopayments.LicenseActivateParams{
		LicenseKey: dodopayments.F("license_key"),
		Name:       dodopayments.F("name"),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.ID)
}
package com.dodopayments.api.example;

import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.licenses.LicenseActivateParams;
import com.dodopayments.api.models.licenses.LicenseActivateResponse;

public final class Main {
    private Main() {}

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

        LicenseActivateParams params = LicenseActivateParams.builder()
            .licenseKey("license_key")
            .name("name")
            .build();
        LicenseActivateResponse response = client.licenses().activate(params);
    }
}
package com.dodopayments.api.example

import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.licenses.LicenseActivateParams
import com.dodopayments.api.models.licenses.LicenseActivateResponse

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

    val params: LicenseActivateParams = LicenseActivateParams.builder()
        .licenseKey("license_key")
        .name("name")
        .build()
    val response: LicenseActivateResponse = client.licenses().activate(params)
}
require "dodopayments"

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

response = dodo_payments.licenses.activate(license_key: "license_key", name: "name")

puts(response)
<?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->activate(
    licenseKey: 'license_key', name: 'name'
  );

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

DodoPaymentsClient client = new();

LicenseActivateParams parameters = new()
{
    LicenseKey = "license_key",
    Name = "name",
};

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

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

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
    let client = Client::from_env()?;
    let result = client
        .licenses()
        .activate()
        .body(dodopayments::models::LicensesActivateParams {
                license_key: Some("license_key".to_string()),
                name: Some("name".to_string()),
                ..Default::default()
            })
        .await?;
    println!("{result:?}");
    Ok(())
}
curl --request POST \
  --url https://test.dodopayments.com/licenses/activate \
  --header 'Content-Type: application/json' \
  --data '
{
  "license_key": "<string>",
  "name": "<string>"
}
'
{
  "business_id": "<string>",
  "created_at": "2024-01-01T00:00:00.000Z",
  "customer": {
    "customer_id": "<string>",
    "email": "<string>",
    "name": "<string>",
    "metadata": {},
    "phone_number": "<string>"
  },
  "id": "lki_123",
  "license_key_id": "lic_123",
  "name": "Production Server 1",
  "product": {
    "product_id": "<string>",
    "name": "<string>"
  }
}
No API Key Required: This is a public endpoint that does not require authentication. You can call it directly from client applications, desktop software, or CLIs to activate license keys without exposing your API credentials.

Body

application/json
license_key
string
required
name
string
required

Response

License key instance created

business_id
string
required

Business ID

created_at
string<date-time>
required

Creation timestamp

Example:

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

customer
object
required

Limited customer details associated with the license key.

id
string
required

License key instance ID

Example:

"lki_123"

license_key_id
string
required

Associated license key ID

Example:

"lic_123"

name
string
required

Instance name

Example:

"Production Server 1"

product
object
required

Related product info. Present if the license key is tied to a product.

Last modified on March 25, 2026