Licenses
Danh sách khóa bản quyền
deprecated
Lấy danh sách các khóa giấy phép liên kết với tài khoản của bạn.
GET
/
license_keys
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const licenseKey of client.licenseKeys.list()) {
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
)
page = client.license_keys.list()
page = page.items[0]
print(page.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"),
)
page, err := client.LicenseKeys.List(context.TODO(), dodopayments.LicenseKeyListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.licensekeys.LicenseKeyListPage;
import com.dodopayments.api.models.licensekeys.LicenseKeyListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
LicenseKeyListPage page = client.licenseKeys().list();
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.licensekeys.LicenseKeyListPage
import com.dodopayments.api.models.licensekeys.LicenseKeyListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val page: LicenseKeyListPage = client.licenseKeys().list()
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
page = dodo_payments.license_keys.list
puts(page)<?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 {
$page = $client->licenseKeys->list(
createdAtGte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
createdAtLte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
customerID: 'customer_id',
pageNumber: 0,
pageSize: 0,
productID: 'product_id',
source: 'auto',
status: 'active',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.LicenseKeys;
DodoPaymentsClient client = new();
LicenseKeyListParams parameters = new();
var page = await client.LicenseKeys.List(parameters);
await foreach (var item in page.Paginate())
{
Console.WriteLine(item);
}use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let result = client
.license_keys()
.list()
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/license_keys \
--header 'Authorization: Bearer <token>'{
"items": [
{
"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 Đã Bị Khai Tử: Các khóa giấy phép hiện được quản lý thông qua hệ thống Entitlements. Sử dụng List Customer Grants để liệt kê các khóa giấy phép đã được cấp (lọc với
integration_type=license_key); mỗi quyền cấp loại đều có chi tiết license_key riêng. Điểm kết này sẽ bị loại bỏ trong bản phát hành tương lai.Ủy quyền
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Tham số truy vấn
Page size default is 10 max is 100
Phạm vi bắt buộc:
x >= 0Page number default is 0
Phạm vi bắt buộc:
x >= 0Filter by customer ID
Filter by license key status
Tùy chọn có sẵn:
active, expired, disabled Filter by product ID
Filter license keys created on or after this timestamp
Filter license keys created on or before this timestamp
Filter by license key source
Tùy chọn có sẵn:
auto, import, manual Phản hồi
Show child attributes
Show child attributes
Lần sửa đổi cuối 9 tháng 7, 2026
Trang này có hữu ích không?
Trước
Lấy Khóa Bản QuyềnLấy thông tin chi tiết của một khóa bản quyền cụ thể theo ID của nó.
Tiếp theo
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const licenseKey of client.licenseKeys.list()) {
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
)
page = client.license_keys.list()
page = page.items[0]
print(page.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"),
)
page, err := client.LicenseKeys.List(context.TODO(), dodopayments.LicenseKeyListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.licensekeys.LicenseKeyListPage;
import com.dodopayments.api.models.licensekeys.LicenseKeyListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
LicenseKeyListPage page = client.licenseKeys().list();
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.licensekeys.LicenseKeyListPage
import com.dodopayments.api.models.licensekeys.LicenseKeyListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val page: LicenseKeyListPage = client.licenseKeys().list()
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
page = dodo_payments.license_keys.list
puts(page)<?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 {
$page = $client->licenseKeys->list(
createdAtGte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
createdAtLte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
customerID: 'customer_id',
pageNumber: 0,
pageSize: 0,
productID: 'product_id',
source: 'auto',
status: 'active',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.LicenseKeys;
DodoPaymentsClient client = new();
LicenseKeyListParams parameters = new();
var page = await client.LicenseKeys.List(parameters);
await foreach (var item in page.Paginate())
{
Console.WriteLine(item);
}use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let result = client
.license_keys()
.list()
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/license_keys \
--header 'Authorization: Bearer <token>'{
"items": [
{
"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>"
}
]
}