Product Collections
Cập nhật Mục Nhóm
Cập nhật một mục sản phẩm trong nhóm bộ sưu tập sản phẩm.
PATCH
/
product-collections
/
{id}
/
groups
/
{group_id}
/
items
/
{item_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.productCollections.groups.items.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: 'pdc_8BWv0hojwUH7iCDabr0NI',
group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
status: true,
});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.product_collections.groups.items.update(
item_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="pdc_8BWv0hojwUH7iCDabr0NI",
group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
status=True,
)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.ProductCollections.Groups.Items.Update(
context.TODO(),
"pdc_8BWv0hojwUH7iCDabr0NI",
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
dodopayments.ProductCollectionGroupItemUpdateParams{
Status: dodopayments.F(true),
},
)
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.productcollections.groups.items.ItemUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ItemUpdateParams params = ItemUpdateParams.builder()
.id("pdc_8BWv0hojwUH7iCDabr0NI")
.groupId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.itemId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.status(true)
.build();
client.productCollections().groups().items().update(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.productcollections.groups.items.ItemUpdateParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: ItemUpdateParams = ItemUpdateParams.builder()
.id("pdc_8BWv0hojwUH7iCDabr0NI")
.groupId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.itemId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.status(true)
.build()
client.productCollections().groups().items().update(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.product_collections.groups.items.update(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id: "pdc_8BWv0hojwUH7iCDabr0NI",
group_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
status: true
)
puts(result)<?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 {
$result = $client->productCollections->groups->items->update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
id: 'pdc_8BWv0hojwUH7iCDabr0NI',
groupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
status: true,
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.ProductCollections.Groups.Items;
DodoPaymentsClient client = new();
ItemUpdateParams parameters = new()
{
ID = "pdc_8BWv0hojwUH7iCDabr0NI",
GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
ItemID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Status = true,
};
await client.ProductCollections.Groups.Items.Update(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let group_id = "group_id";
let item_id = "item_id";
let result = client
.product_collections()
.groups()
.items()
.update()
.id(id)
.group_id(group_id)
.item_id(item_id)
.body(dodopayments::models::ProductCollectionsGroupsItemsUpdateParams {
status: Some(true),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request PATCH \
--url https://test.dodopayments.com/product-collections/{id}/groups/{group_id}/items/{item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"status": true
}'Ủy quyền
Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.
Tham số đường dẫn
Phản hồi
Product updated successfully
Lần sửa đổi cuối 26 tháng 6, 2026
Trang này có hữu ích không?
⌘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
});
await client.productCollections.groups.items.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: 'pdc_8BWv0hojwUH7iCDabr0NI',
group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
status: true,
});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.product_collections.groups.items.update(
item_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="pdc_8BWv0hojwUH7iCDabr0NI",
group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
status=True,
)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.ProductCollections.Groups.Items.Update(
context.TODO(),
"pdc_8BWv0hojwUH7iCDabr0NI",
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
dodopayments.ProductCollectionGroupItemUpdateParams{
Status: dodopayments.F(true),
},
)
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.productcollections.groups.items.ItemUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ItemUpdateParams params = ItemUpdateParams.builder()
.id("pdc_8BWv0hojwUH7iCDabr0NI")
.groupId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.itemId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.status(true)
.build();
client.productCollections().groups().items().update(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.productcollections.groups.items.ItemUpdateParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: ItemUpdateParams = ItemUpdateParams.builder()
.id("pdc_8BWv0hojwUH7iCDabr0NI")
.groupId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.itemId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.status(true)
.build()
client.productCollections().groups().items().update(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
result = dodo_payments.product_collections.groups.items.update(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id: "pdc_8BWv0hojwUH7iCDabr0NI",
group_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
status: true
)
puts(result)<?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 {
$result = $client->productCollections->groups->items->update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
id: 'pdc_8BWv0hojwUH7iCDabr0NI',
groupID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
status: true,
);
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using DodoPayments.Client;
using DodoPayments.Client.Models.ProductCollections.Groups.Items;
DodoPaymentsClient client = new();
ItemUpdateParams parameters = new()
{
ID = "pdc_8BWv0hojwUH7iCDabr0NI",
GroupID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
ItemID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Status = true,
};
await client.ProductCollections.Groups.Items.Update(parameters);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let group_id = "group_id";
let item_id = "item_id";
let result = client
.product_collections()
.groups()
.items()
.update()
.id(id)
.group_id(group_id)
.item_id(item_id)
.body(dodopayments::models::ProductCollectionsGroupsItemsUpdateParams {
status: Some(true),
..Default::default()
})
.await?;
println!("{result:?}");
Ok(())
}curl --request PATCH \
--url https://test.dodopayments.com/product-collections/{id}/groups/{group_id}/items/{item_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"status": true
}'