मुख्य सामग्री पर जाएं
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>"
}
अप्रचलित API: लाइसेंस कुंजियाँ अब अधिकार प्रणाली के माध्यम से प्रबंधित की जाती हैं। लाइसेंस कुंजी अधिकार पर सक्रियण सीमाएँ और अवधि कॉन्फ़िगर करें, और ग्राहक की कुंजी को अक्षम करने के लिए अनुदान रद्द करें का उपयोग करें। यह एंडपॉइंट भविष्य के किसी रिलीज़ में हटा दिया जाएगा।
API के माध्यम से लाइसेंस कुंजी को अपडेट करना ग्राहक को ईमेल सूचनाएं ट्रिगर नहीं करता है।

प्राधिकरण

Authorization
string
header
आवश्यक

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

पथ पैरामीटर

id
string
आवश्यक

License key ID

बॉडी

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.

प्रतिक्रिया

License key updated successfully

brand_id
string
आवश्यक

Brand id this license key belongs to

business_id
string
आवश्यक

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

created_at
string<date-time>
आवश्यक

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

उदाहरण:

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

customer_id
string
आवश्यक

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

उदाहरण:

"cus_123"

id
string
आवश्यक

The unique identifier of the license key.

उदाहरण:

"lic_123"

instances_count
integer<int32>
आवश्यक

The current number of instances activated for this license key.

key
string
आवश्यक

The license key string.

product_id
string
आवश्यक

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

source
enum<string>
आवश्यक

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

उपलब्ध विकल्प:
auto,
import,
manual
status
enum<string>
आवश्यक

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

उपलब्ध विकल्प:
active,
expired,
disabled
activations_limit
integer<int32> | null

The maximum number of activations allowed for this license key.

उदाहरण:

5

expires_at
string<date-time> | null

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

उदाहरण:

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

अंतिम संशोधन 9 जून 2026