권한 생성
라이선스 키, 디지털 파일, Discord, GitHub, Telegram, Figma, Framer, Notion 등 모든 통합 유형의 새 사용 권한을 생성하세요.
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const entitlement = await client.entitlements.create({
integration_config: { feature_id: 'feature_id', feature_type: 'boolean' },
integration_type: 'discord',
name: 'name',
});
console.log(entitlement.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
)
entitlement = client.entitlements.create(
integration_config={
"feature_id": "feature_id",
"feature_type": "boolean",
},
integration_type="discord",
name="name",
)
print(entitlement.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"),
)
entitlement, err := client.Entitlements.New(context.TODO(), dodopayments.EntitlementNewParams{
IntegrationConfig: dodopayments.F[dodopayments.IntegrationConfigUnionParam](dodopayments.IntegrationConfigFeatureFlagConfigParam{
FeatureID: dodopayments.F("feature_id"),
FeatureType: dodopayments.F(dodopayments.FeatureTypeBoolean),
}),
IntegrationType: dodopayments.F(dodopayments.EntitlementIntegrationTypeDiscord),
Name: dodopayments.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", entitlement.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.entitlements.Entitlement;
import com.dodopayments.api.models.entitlements.EntitlementCreateParams;
import com.dodopayments.api.models.entitlements.EntitlementIntegrationType;
import com.dodopayments.api.models.entitlements.FeatureType;
import com.dodopayments.api.models.entitlements.IntegrationConfig;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
EntitlementCreateParams params = EntitlementCreateParams.builder()
.integrationConfig(IntegrationConfig.FeatureFlagConfig.builder()
.featureId("feature_id")
.featureType(FeatureType.BOOLEAN)
.build())
.integrationType(EntitlementIntegrationType.DISCORD)
.name("name")
.build();
Entitlement entitlement = client.entitlements().create(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.entitlements.Entitlement
import com.dodopayments.api.models.entitlements.EntitlementCreateParams
import com.dodopayments.api.models.entitlements.EntitlementIntegrationType
import com.dodopayments.api.models.entitlements.FeatureType
import com.dodopayments.api.models.entitlements.IntegrationConfig
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: EntitlementCreateParams = EntitlementCreateParams.builder()
.integrationConfig(IntegrationConfig.FeatureFlagConfig.builder()
.featureId("feature_id")
.featureType(FeatureType.BOOLEAN)
.build())
.integrationType(EntitlementIntegrationType.DISCORD)
.name("name")
.build()
val entitlement: Entitlement = client.entitlements().create(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
entitlement = dodo_payments.entitlements.create(
integration_config: {feature_id: "feature_id", feature_type: :boolean},
integration_type: :discord,
name: "name"
)
puts(entitlement)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
use Dodopayments\Entitlements\FeatureType;
use Dodopayments\Entitlements\EntitlementIntegrationType;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$entitlement = $client->entitlements->create(
integrationConfig: [
'featureID' => 'feature_id', 'featureType' => FeatureType::BOOLEAN
],
integrationType: EntitlementIntegrationType::DISCORD,
name: 'name',
description: 'description',
metadata: ['foo' => 'string'],
);
var_dump($entitlement);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Entitlements;
DodoPaymentsClient client = new();
EntitlementCreateParams parameters = new()
{
IntegrationConfig = new FeatureFlagConfig()
{
FeatureID = "feature_id",
FeatureType = FeatureType.Boolean,
},
IntegrationType = EntitlementIntegrationType.Discord,
Name = "name",
};
var entitlement = await client.Entitlements.Create(parameters);
Console.WriteLine(entitlement);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let result = client
.entitlements()
.create()
.body(dodopayments::models::EntitlementsCreateParams {
integration_config: Some(Box::new(dodopayments::models::IntegrationConfig::Variant0(serde_json::json!({"feature_id":"feature_id","feature_type":"boolean"})))),
integration_type: Some(Box::new(dodopayments::models::EntitlementIntegrationType::Discord)),
name: Some("name".to_string()),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integration_config": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"name": "<string>",
"description": "<string>",
"metadata": {}
}
'{
"business_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"integration_config": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"is_active": true,
"metadata": {},
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}인증
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
본문
Platform-specific configuration (validated per integration_type)
- Feature Flag Config
- Github Config
- Discord Config
- Telegram Config
- Figma Config
- Framer Config
- Notion Config
- Digital Files Config
- License Key Config
Show child attributes
Show child attributes
Which platform integration this entitlement uses
discord, telegram, github, figma, framer, notion, digital_files, license_key, feature_flag Display name for this entitlement
Optional description
Additional metadata for the entitlement
Show child attributes
Show child attributes
응답
Detailed view of a single entitlement: identity, integration type, integration-specific configuration, and metadata.
Identifier of the business that owns this entitlement.
Timestamp when the entitlement was created.
Unique identifier of the entitlement.
Integration-specific configuration. For digital_files entitlements
this includes presigned download URLs for each attached file.
- Feature Flag Config
- Github Config
- Discord Config
- Telegram Config
- Figma Config
- Framer Config
- Notion Config
- Digital Files Config
- License Key Config
Show child attributes
Show child attributes
Platform integration this entitlement uses.
discord, telegram, github, figma, framer, notion, digital_files, license_key, feature_flag Always true for entitlements returned by the public API;
soft-deleted entitlements are not returned.
Arbitrary key-value metadata supplied at creation or via PATCH.
Show child attributes
Show child attributes
Display name supplied at creation.
Timestamp when the entitlement was last modified.
Optional description supplied at creation.
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const entitlement = await client.entitlements.create({
integration_config: { feature_id: 'feature_id', feature_type: 'boolean' },
integration_type: 'discord',
name: 'name',
});
console.log(entitlement.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
)
entitlement = client.entitlements.create(
integration_config={
"feature_id": "feature_id",
"feature_type": "boolean",
},
integration_type="discord",
name="name",
)
print(entitlement.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"),
)
entitlement, err := client.Entitlements.New(context.TODO(), dodopayments.EntitlementNewParams{
IntegrationConfig: dodopayments.F[dodopayments.IntegrationConfigUnionParam](dodopayments.IntegrationConfigFeatureFlagConfigParam{
FeatureID: dodopayments.F("feature_id"),
FeatureType: dodopayments.F(dodopayments.FeatureTypeBoolean),
}),
IntegrationType: dodopayments.F(dodopayments.EntitlementIntegrationTypeDiscord),
Name: dodopayments.F("name"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", entitlement.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.entitlements.Entitlement;
import com.dodopayments.api.models.entitlements.EntitlementCreateParams;
import com.dodopayments.api.models.entitlements.EntitlementIntegrationType;
import com.dodopayments.api.models.entitlements.FeatureType;
import com.dodopayments.api.models.entitlements.IntegrationConfig;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
EntitlementCreateParams params = EntitlementCreateParams.builder()
.integrationConfig(IntegrationConfig.FeatureFlagConfig.builder()
.featureId("feature_id")
.featureType(FeatureType.BOOLEAN)
.build())
.integrationType(EntitlementIntegrationType.DISCORD)
.name("name")
.build();
Entitlement entitlement = client.entitlements().create(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.entitlements.Entitlement
import com.dodopayments.api.models.entitlements.EntitlementCreateParams
import com.dodopayments.api.models.entitlements.EntitlementIntegrationType
import com.dodopayments.api.models.entitlements.FeatureType
import com.dodopayments.api.models.entitlements.IntegrationConfig
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: EntitlementCreateParams = EntitlementCreateParams.builder()
.integrationConfig(IntegrationConfig.FeatureFlagConfig.builder()
.featureId("feature_id")
.featureType(FeatureType.BOOLEAN)
.build())
.integrationType(EntitlementIntegrationType.DISCORD)
.name("name")
.build()
val entitlement: Entitlement = client.entitlements().create(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
entitlement = dodo_payments.entitlements.create(
integration_config: {feature_id: "feature_id", feature_type: :boolean},
integration_type: :discord,
name: "name"
)
puts(entitlement)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
use Dodopayments\Entitlements\FeatureType;
use Dodopayments\Entitlements\EntitlementIntegrationType;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$entitlement = $client->entitlements->create(
integrationConfig: [
'featureID' => 'feature_id', 'featureType' => FeatureType::BOOLEAN
],
integrationType: EntitlementIntegrationType::DISCORD,
name: 'name',
description: 'description',
metadata: ['foo' => 'string'],
);
var_dump($entitlement);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Entitlements;
DodoPaymentsClient client = new();
EntitlementCreateParams parameters = new()
{
IntegrationConfig = new FeatureFlagConfig()
{
FeatureID = "feature_id",
FeatureType = FeatureType.Boolean,
},
IntegrationType = EntitlementIntegrationType.Discord,
Name = "name",
};
var entitlement = await client.Entitlements.Create(parameters);
Console.WriteLine(entitlement);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let result = client
.entitlements()
.create()
.body(dodopayments::models::EntitlementsCreateParams {
integration_config: Some(Box::new(dodopayments::models::IntegrationConfig::Variant0(serde_json::json!({"feature_id":"feature_id","feature_type":"boolean"})))),
integration_type: Some(Box::new(dodopayments::models::EntitlementIntegrationType::Discord)),
name: Some("name".to_string()),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/entitlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"integration_config": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"name": "<string>",
"description": "<string>",
"metadata": {}
}
'{
"business_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"integration_config": {
"feature_id": "<string>",
"feature_type": "boolean"
},
"is_active": true,
"metadata": {},
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>"
}