Product Collections
Khôi phục Bộ sưu tập Sản phẩm
Khôi phục một bộ sưu tập sản phẩm liên kết với tài khoản của bạn.
POST
/
product-collections
/
{id}
/
unarchive
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const response = await client.productCollections.unarchive('pdc_8BWv0hojwUH7iCDabr0NI');
console.log(response.collection_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
)
response = client.product_collections.unarchive(
"pdc_8BWv0hojwUH7iCDabr0NI",
)
print(response.collection_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"),
)
response, err := client.ProductCollections.Unarchive(context.TODO(), "pdc_8BWv0hojwUH7iCDabr0NI")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.CollectionID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveParams;
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ProductCollectionUnarchiveResponse response = client.productCollections().unarchive("pdc_8BWv0hojwUH7iCDabr0NI");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveParams
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: ProductCollectionUnarchiveResponse = client.productCollections().unarchive("pdc_8BWv0hojwUH7iCDabr0NI")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.product_collections.unarchive("pdc_8BWv0hojwUH7iCDabr0NI")
puts(response)<?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 {
$response = $client->productCollections->unarchive(
'pdc_8BWv0hojwUH7iCDabr0NI'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.ProductCollections;
DodoPaymentsClient client = new();
ProductCollectionUnarchiveParams parameters = new()
{
ID = "pdc_8BWv0hojwUH7iCDabr0NI"
};
var response = await client.ProductCollections.Unarchive(parameters);
Console.WriteLine(response);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.product_collections()
.unarchive()
.id(id)
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/product-collections/{id}/unarchive \
--header 'Authorization: Bearer <token>'{
"collection_id": "<string>",
"excluded_product_ids": [
"<string>"
],
"message": "<string>"
}Ủ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.
Lần sửa đổi cuối 22 tháng 5, 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
});
const response = await client.productCollections.unarchive('pdc_8BWv0hojwUH7iCDabr0NI');
console.log(response.collection_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
)
response = client.product_collections.unarchive(
"pdc_8BWv0hojwUH7iCDabr0NI",
)
print(response.collection_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"),
)
response, err := client.ProductCollections.Unarchive(context.TODO(), "pdc_8BWv0hojwUH7iCDabr0NI")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.CollectionID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveParams;
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ProductCollectionUnarchiveResponse response = client.productCollections().unarchive("pdc_8BWv0hojwUH7iCDabr0NI");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveParams
import com.dodopayments.api.models.productcollections.ProductCollectionUnarchiveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: ProductCollectionUnarchiveResponse = client.productCollections().unarchive("pdc_8BWv0hojwUH7iCDabr0NI")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.product_collections.unarchive("pdc_8BWv0hojwUH7iCDabr0NI")
puts(response)<?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 {
$response = $client->productCollections->unarchive(
'pdc_8BWv0hojwUH7iCDabr0NI'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.ProductCollections;
DodoPaymentsClient client = new();
ProductCollectionUnarchiveParams parameters = new()
{
ID = "pdc_8BWv0hojwUH7iCDabr0NI"
};
var response = await client.ProductCollections.Unarchive(parameters);
Console.WriteLine(response);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let id = "id";
let result = client
.product_collections()
.unarchive()
.id(id)
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/product-collections/{id}/unarchive \
--header 'Authorization: Bearer <token>'{
"collection_id": "<string>",
"excluded_product_ids": [
"<string>"
],
"message": "<string>"
}