Skip to main content
PATCH
/
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.update('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.update(
id="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.Update(
context.TODO(),
"lic_7namTC0VcgrnzrF3GTSwB",
dodopayments.LicenseKeyUpdateParams{},
)
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.LicenseKeyUpdateParams;

public final class Main {
private Main() {}

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

LicenseKey licenseKey = client.licenseKeys().update("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.LicenseKeyUpdateParams

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

val licenseKey: LicenseKey = client.licenseKeys().update("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.update("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->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();
}
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);
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(())
}
curl --request PATCH \
--url https://test.dodopayments.com/license_keys/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"activations_limit": 123,
"disabled": true,
"expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "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. Configure activation limits and durations on the License Key entitlement, and use Revoke Grant to disable a customer’s key. This endpoint will be removed in a future release.
Updating a license key through the API does not trigger email notifications to the customer.

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

Body

application/json
activations_limit
integer<int32> | null

The updated activation limit for the license key. Use null to remove the limit, or omit this field to leave it unchanged.

disabled
boolean | null

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
string<date-time> | null

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.

Response

License key updated successfully

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 June 8, 2026