Brands
归档品牌
归档一个品牌,并将其产品、有效订阅和产品集合迁移到同一业务的另一个品牌。
POST
/
brands
/
{id}
/
archive
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.brands.archive('brnd_8dFiAW42v28JzhlVSocjq');
console.log(response.brand_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.brands.archive(
id="brnd_8dFiAW42v28JzhlVSocjq",
)
print(response.brand_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.Brands.Archive(
context.TODO(),
"brnd_8dFiAW42v28JzhlVSocjq",
dodopayments.BrandArchiveParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.BrandID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.brands.BrandArchiveParams;
import com.dodopayments.api.models.brands.BrandArchiveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
BrandArchiveResponse response = client.brands().archive("brnd_8dFiAW42v28JzhlVSocjq");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.brands.BrandArchiveParams
import com.dodopayments.api.models.brands.BrandArchiveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: BrandArchiveResponse = client.brands().archive("brnd_8dFiAW42v28JzhlVSocjq")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.brands.archive("brnd_8dFiAW42v28JzhlVSocjq")
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->brands->archive(
'brnd_8dFiAW42v28JzhlVSocjq', moveProductsTo: 'move_products_to'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Brands;
DodoPaymentsClient client = new();
BrandArchiveParams parameters = new() { ID = "brnd_8dFiAW42v28JzhlVSocjq" };
var response = await client.Brands.Archive(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
.brands()
.archive()
.id(id)
.body(Default::default())
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/brands/{id}/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"move_products_to": "<string>"
}
'{
"archived_at": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"collections_moved": 1,
"products_moved": 1,
"subscriptions_moved": 1,
"moved_to_brand_id": "<string>"
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
路径参数
Brand Id
请求体
application/json
Brand that takes over the products and the live subscriptions of the brand you archive. It must be a brand of the same business, and it must not be archived. The primary brand (its brand id is the business id) is a valid target. Omit this field only when the brand holds no products and no live subscriptions.
响应
Archived Brand
Time the brand was archived.
The archived brand.
Count of product collections moved to the target brand.
必填范围:
x >= 0Count of products moved to the target brand.
必填范围:
x >= 0Count of live subscriptions moved to the target brand.
必填范围:
x >= 0Brand that received the moved records. Null when no target was given.
最后修改于 2026年8月21日
⌘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.brands.archive('brnd_8dFiAW42v28JzhlVSocjq');
console.log(response.brand_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.brands.archive(
id="brnd_8dFiAW42v28JzhlVSocjq",
)
print(response.brand_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.Brands.Archive(
context.TODO(),
"brnd_8dFiAW42v28JzhlVSocjq",
dodopayments.BrandArchiveParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.BrandID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.brands.BrandArchiveParams;
import com.dodopayments.api.models.brands.BrandArchiveResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
BrandArchiveResponse response = client.brands().archive("brnd_8dFiAW42v28JzhlVSocjq");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.brands.BrandArchiveParams
import com.dodopayments.api.models.brands.BrandArchiveResponse
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val response: BrandArchiveResponse = client.brands().archive("brnd_8dFiAW42v28JzhlVSocjq")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
response = dodo_payments.brands.archive("brnd_8dFiAW42v28JzhlVSocjq")
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->brands->archive(
'brnd_8dFiAW42v28JzhlVSocjq', moveProductsTo: 'move_products_to'
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Brands;
DodoPaymentsClient client = new();
BrandArchiveParams parameters = new() { ID = "brnd_8dFiAW42v28JzhlVSocjq" };
var response = await client.Brands.Archive(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
.brands()
.archive()
.id(id)
.body(Default::default())
.await?;
println!("{result:?}");
Ok(())
}curl --request POST \
--url https://test.dodopayments.com/brands/{id}/archive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"move_products_to": "<string>"
}
'{
"archived_at": "2023-11-07T05:31:56Z",
"brand_id": "<string>",
"collections_moved": 1,
"products_moved": 1,
"subscriptions_moved": 1,
"moved_to_brand_id": "<string>"
}