メインコンテンツへスキップ
PATCH
/
products
/
{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
});

await client.products.update('pdt_R8AWMPiV8RyJElcCKvAID');
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
)
client.products.update(
id="pdt_R8AWMPiV8RyJElcCKvAID",
)
package main

import (
"context"

"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)

func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.Products.Update(
context.TODO(),
"pdt_R8AWMPiV8RyJElcCKvAID",
dodopayments.ProductUpdateParams{},
)
if err != nil {
panic(err.Error())
}
}
package com.dodopayments.api.example;

import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.ProductUpdateParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

client.products().update("pdt_R8AWMPiV8RyJElcCKvAID");
}
}
package com.dodopayments.api.example

import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.ProductUpdateParams

fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

client.products().update("pdt_R8AWMPiV8RyJElcCKvAID")
}
require "dodopayments"

dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)

result = dodo_payments.products.update("pdt_R8AWMPiV8RyJElcCKvAID")

puts(result)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
use Dodopayments\CreditEntitlements\CbbOverageBehavior;
use Dodopayments\Misc\TaxCategory;
use Dodopayments\Misc\Currency;
use Dodopayments\Products\CbbProrationBehavior;
use Dodopayments\Products\LocalizedPrices\PricingMode;
use Dodopayments\Subscriptions\TimeInterval;

$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);

try {
$result = $client->products->update(
'pdt_R8AWMPiV8RyJElcCKvAID',
addons: ['string'],
brandID: 'brand_id',
creditEntitlements: [
[
'creditEntitlementID' => 'credit_entitlement_id',
'creditsAmount' => 'credits_amount',
'currency' => Currency::AED,
'expiresAfterDays' => 0,
'lowBalanceThresholdPercent' => 0,
'maxRolloverCount' => 0,
'overageBehavior' => CbbOverageBehavior::FORGIVE_AT_RESET,
'overageEnabled' => true,
'overageLimit' => 'overage_limit',
'pricePerUnit' => 'price_per_unit',
'prorationBehavior' => CbbProrationBehavior::PRORATE,
'rolloverEnabled' => true,
'rolloverPercentage' => 0,
'rolloverTimeframeCount' => 0,
'rolloverTimeframeInterval' => TimeInterval::DAY,
'trialCredits' => 'trial_credits',
'trialCreditsExpireAfterTrial' => true,
],
],
description: 'description',
digitalProductDelivery: [
'externalURL' => 'external_url',
'files' => ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],
'instructions' => 'instructions',
],
entitlements: [['entitlementID' => 'entitlement_id']],
imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
licenseKeyActivationMessage: 'license_key_activation_message',
licenseKeyActivationsLimit: 0,
licenseKeyDuration: ['count' => 0, 'interval' => TimeInterval::DAY],
licenseKeyEnabled: true,
metadata: ['foo' => 'string'],
name: 'name',
price: [
'currency' => Currency::AED,
'discount' => 0,
'price' => 0,
'purchasingPowerParity' => true,
'type' => 'one_time_price',
'payWhatYouWant' => true,
'suggestedPrice' => 0,
'taxInclusive' => true,
],
pricingMode: PricingMode::BY_CURRENCY,
taxCategory: TaxCategory::DIGITAL_PRODUCTS,
);

var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}
using DodoPayments.Client;
using DodoPayments.Client.Models.Products;

DodoPaymentsClient client = new();

ProductUpdateParams parameters = new() { ID = "pdt_R8AWMPiV8RyJElcCKvAID" };

await client.Products.Update(parameters);
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.products()
.update()
.id(id)
.body(Default::default())
.await?;
println!("{result:?}");
Ok(())
}
curl --request PATCH \
--url https://test.dodopayments.com/products/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"addons": [
"<string>"
],
"brand_id": "<string>",
"credit_entitlements": [
{
"credit_entitlement_id": "<string>",
"credits_amount": "<string>",
"expires_after_days": 123,
"low_balance_threshold_percent": 123,
"max_rollover_count": 123,
"overage_enabled": true,
"overage_limit": "<string>",
"price_per_unit": "<string>",
"rollover_enabled": true,
"rollover_percentage": 123,
"rollover_timeframe_count": 123,
"trial_credits": "<string>",
"trial_credits_expire_after_trial": true
}
],
"description": "<string>",
"digital_product_delivery": {
"external_url": "<string>",
"files": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"instructions": "<string>"
},
"entitlements": [
{
"entitlement_id": "<string>"
}
],
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"license_key_activation_message": "<string>",
"license_key_activations_limit": 123,
"license_key_duration": {
"count": 123
},
"license_key_enabled": true,
"metadata": {},
"name": "<string>",
"price": {
"discount": 123,
"price": 123,
"purchasing_power_parity": true,
"type": "one_time_price",
"pay_what_you_want": true,
"suggested_price": 123,
"tax_inclusive": true
}
}
'

承認

Authorization
string
header
必須

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

パスパラメータ

id
string
必須

Product Id

ボディ

application/json
addons
string[] | null

Available Addons for subscription products

brand_id
string | null
credit_entitlements
object[] | null

Credit entitlements to update (replaces all existing when present) Send empty array to remove all, omit field to leave unchanged

description
string | null

Description of the product, optional and must be at most 1000 characters.

digital_product_delivery
null | Patch Digital Product Delivery Request · object

Choose how you would like you digital product delivered

deprecated: use entitlements instead

entitlements
object[] | null

Entitlements to attach (replaces all existing when present) Send empty array to remove all, omit field to leave unchanged

image_id
string<uuid> | null

Product image id after its uploaded to S3

license_key_activation_message
string | null
非推奨

Message sent to the customer upon license key activation.

Only applicable if license_key_enabled is true. This message contains instructions for activating the license key.

deprecated: use entitlements instead

license_key_activations_limit
integer<int32> | null
非推奨

Limit for the number of activations for the license key.

Only applicable if license_key_enabled is true. Represents the maximum number of times the license key can be activated.

deprecated: use entitlements instead

license_key_duration
null | License Key Duration · object

Duration of the license key if enabled.

Only applicable if license_key_enabled is true. Represents the duration in days for which the license key is valid.

deprecated: use entitlements instead

license_key_enabled
boolean | null
非推奨

Whether the product requires a license key.

If true, additional fields related to license key (duration, activations limit, activation message) become applicable.

deprecated: use entitlements instead

metadata
null | Metadata · object

Additional metadata for the product

name
string | null

Name of the product, optional and must be at most 100 characters.

price
One Time Price · object

Price details of the product.

pricing_mode
null | enum<string>

Update the pricing mode. Omit to leave unchanged; set to null to clear (which archives all active localized rules for this product). Changing to a different non-null mode also archives any rules whose mode doesn't match the new mode.

利用可能なオプション:
by_currency,
by_country
tax_category
null | enum<string>

Tax category of the product.

利用可能なオプション:
digital_products,
saas,
e_book,
edtech

レスポンス

Product Updated Successfully

最終更新日 2026年4月1日