브랜드 보관
브랜드를 보관하고 해당 브랜드의 제품, 활성 구독 및 제품 컬렉션을 동일한 비즈니스의 다른 브랜드로 이동합니다.
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
본문
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.
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>"
}