Entitlements
Danh sách các khoản cấp
Liệt kê tất cả các khoản cấp cho một quyền lợi, với các bộ lọc tùy chọn theo trạng thái và ID khách hàng. Mỗi khoản cấp mang trạng thái hoàn thành theo từng khách hàng, bao gồm các khóa cấp phép và URL tải xuống tệp kỹ thuật số nếu có.
GET
/
entitlements
/
{id}
/
grants
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 entitlementGrant of client.entitlements.grants.list('ent_jt7jcvI79Xh8eehqgWdcm')) {
console.log(entitlementGrant.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.entitlements.grants.list(
id="ent_jt7jcvI79Xh8eehqgWdcm",
)
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.Entitlements.Grants.List(
context.TODO(),
"ent_jt7jcvI79Xh8eehqgWdcm",
dodopayments.EntitlementGrantListParams{},
)
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.entitlements.grants.GrantListPage;
import com.dodopayments.api.models.entitlements.grants.GrantListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
GrantListPage page = client.entitlements().grants().list("ent_jt7jcvI79Xh8eehqgWdcm");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.entitlements.grants.GrantListPage
import com.dodopayments.api.models.entitlements.grants.GrantListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val page: GrantListPage = client.entitlements().grants().list("ent_jt7jcvI79Xh8eehqgWdcm")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
page = dodo_payments.entitlements.grants.list("ent_jt7jcvI79Xh8eehqgWdcm")
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->entitlements->grants->list(
'ent_jt7jcvI79Xh8eehqgWdcm',
customerID: 'customer_id',
pageNumber: 0,
pageSize: 0,
status: 'Pending',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Entitlements.Grants;
DodoPaymentsClient client = new();
GrantListParams parameters = new() { ID = "ent_jt7jcvI79Xh8eehqgWdcm" };
var page = await client.Entitlements.Grants.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 id = "id";
let result = client
.entitlements()
.grants()
.list()
.id(id)
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/entitlements/{id}/grants \
--header 'Authorization: Bearer <token>'{
"items": [
{
"brand_id": "<string>",
"business_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"entitlement_id": "<string>",
"id": "<string>",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"digital_product_delivery": {
"files": [
{
"download_url": "<string>",
"expires_in": 123,
"file_id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"file_size": 123
}
],
"external_url": "<string>",
"instructions": "<string>"
},
"error_code": "<string>",
"error_message": "<string>",
"feature": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"license_key": {
"activations_used": 123,
"key": "<string>",
"activations_limit": 123,
"expires_at": "2023-11-07T05:31:56Z"
},
"oauth_expires_at": "2023-11-07T05:31:56Z",
"oauth_url": "<string>",
"payment_id": "<string>",
"revocation_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"subscription_id": "<string>"
}
]
}Ủy quyền
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Tham số đường dẫn
Entitlement ID
Tham số truy vấn
Page size (default 10, max 100)
Phạm vi bắt buộc:
x >= 0Page number (default 0)
Phạm vi bắt buộc:
x >= 0Filter by grant status
Tùy chọn có sẵn:
Pending, Delivered, Failed, Revoked Filter by customer ID
Phản hồi
Show child attributes
Show child attributes
Lần sửa đổi cuối 13 tháng 5, 2026
Trang này có hữu ích không?
Trước
Liệt kê Quyền lợi Khách hàngLiệt kê tất cả các quyền lợi của một khách hàng trên mọi quyền, mỗi hàng một quyền, với các bộ lọc tùy chọn theo trạng thái và loại tích hợp. Các quyền cấp cờ tính năng bao gồm payload tính năng kiểu.
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 entitlementGrant of client.entitlements.grants.list('ent_jt7jcvI79Xh8eehqgWdcm')) {
console.log(entitlementGrant.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.entitlements.grants.list(
id="ent_jt7jcvI79Xh8eehqgWdcm",
)
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.Entitlements.Grants.List(
context.TODO(),
"ent_jt7jcvI79Xh8eehqgWdcm",
dodopayments.EntitlementGrantListParams{},
)
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.entitlements.grants.GrantListPage;
import com.dodopayments.api.models.entitlements.grants.GrantListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
GrantListPage page = client.entitlements().grants().list("ent_jt7jcvI79Xh8eehqgWdcm");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.entitlements.grants.GrantListPage
import com.dodopayments.api.models.entitlements.grants.GrantListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val page: GrantListPage = client.entitlements().grants().list("ent_jt7jcvI79Xh8eehqgWdcm")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
page = dodo_payments.entitlements.grants.list("ent_jt7jcvI79Xh8eehqgWdcm")
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->entitlements->grants->list(
'ent_jt7jcvI79Xh8eehqgWdcm',
customerID: 'customer_id',
pageNumber: 0,
pageSize: 0,
status: 'Pending',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Entitlements.Grants;
DodoPaymentsClient client = new();
GrantListParams parameters = new() { ID = "ent_jt7jcvI79Xh8eehqgWdcm" };
var page = await client.Entitlements.Grants.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 id = "id";
let result = client
.entitlements()
.grants()
.list()
.id(id)
.query(serde_json::json!({}))
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/entitlements/{id}/grants \
--header 'Authorization: Bearer <token>'{
"items": [
{
"brand_id": "<string>",
"business_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "<string>",
"entitlement_id": "<string>",
"id": "<string>",
"metadata": {},
"updated_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"digital_product_delivery": {
"files": [
{
"download_url": "<string>",
"expires_in": 123,
"file_id": "<string>",
"filename": "<string>",
"content_type": "<string>",
"file_size": 123
}
],
"external_url": "<string>",
"instructions": "<string>"
},
"error_code": "<string>",
"error_message": "<string>",
"feature": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"license_key": {
"activations_used": 123,
"key": "<string>",
"activations_limit": 123,
"expires_at": "2023-11-07T05:31:56Z"
},
"oauth_expires_at": "2023-11-07T05:31:56Z",
"oauth_url": "<string>",
"payment_id": "<string>",
"revocation_reason": "<string>",
"revoked_at": "2023-11-07T05:31:56Z",
"subscription_id": "<string>"
}
]
}