Licenses
List Licenses
Retrieve a list of license keys associated with your account.
GET
/
license_keys
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: 'My Bearer Token',
});
// Automatically fetches more pages as needed.
for await (const licenseKey of client.licenseKeys.list()) {
console.log(licenseKey.id);
}from dodopayments import DodoPayments
client = DodoPayments(
bearer_token="My Bearer Token",
)
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)curl --request GET \
--url https://test.dodopayments.com/license_keys \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.dodopayments.com/license_keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"items": [
{
"business_id": "<string>",
"created_at": "2024-01-01T00:00:00Z",
"customer_id": "cus_123",
"id": "lic_123",
"instances_count": 123,
"key": "<string>",
"payment_id": "<string>",
"product_id": "<string>",
"status": "active",
"activations_limit": 5,
"expires_at": "2024-12-31T23:59:59Z",
"subscription_id": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Page size default is 10 max is 100
Required range:
x >= 0Page number default is 0
Required range:
x >= 0Filter by customer ID
Filter by license key status
Available options:
active, expired, disabled Filter by product ID
Response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: 'My Bearer Token',
});
// Automatically fetches more pages as needed.
for await (const licenseKey of client.licenseKeys.list()) {
console.log(licenseKey.id);
}from dodopayments import DodoPayments
client = DodoPayments(
bearer_token="My Bearer Token",
)
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)curl --request GET \
--url https://test.dodopayments.com/license_keys \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.dodopayments.com/license_keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"items": [
{
"business_id": "<string>",
"created_at": "2024-01-01T00:00:00Z",
"customer_id": "cus_123",
"id": "lic_123",
"instances_count": 123,
"key": "<string>",
"payment_id": "<string>",
"product_id": "<string>",
"status": "active",
"activations_limit": 5,
"expires_at": "2024-12-31T23:59:59Z",
"subscription_id": "<string>"
}
]
}