> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive Brand

> Archive a brand and move its products, live subscriptions, and product collections to another brand of the same business.



## OpenAPI

````yaml post /brands/{id}/archive
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.113.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
  - name: Payment Connector Webhooks
paths:
  /brands/{id}/archive:
    post:
      tags:
        - Brands
      summary: >-
        Archive a brand. Its products, live subscriptions, and product
        collections

        move to the `move_products_to` brand. Archive is permanent.
      operationId: archive_brand_handler
      parameters:
        - name: id
          in: path
          description: Brand Id
          required: true
          schema:
            type: string
          example: brnd_8dFiAW42v28JzhlVSocjq
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArchiveBrandRequest'
        required: true
      responses:
        '200':
          description: Archived Brand
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArchiveBrandResponse'
        '403':
          description: The primary brand cannot be archived
        '404':
          description: Brand not found
        '409':
          description: Brand is already archived
        '422':
          description: Invalid or missing move_products_to target
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tresponse, err := client.Brands.Archive(\n\t\tcontext.TODO(),\n\t\t\"brnd_8dFiAW42v28JzhlVSocjq\",\n\t\tdodopayments.BrandArchiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.BrandID)\n}\n"
        - lang: Java
          source: |-
            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");
                }
            }
        - lang: Kotlin
          source: |-
            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")
            }
        - lang: Ruby
          source: >-
            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)
        - lang: PHP
          source: |-
            <?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();
            }
        - lang: C#
          source: >-
            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);
        - lang: Rust
          source: |-
            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(())
            }
components:
  schemas:
    ArchiveBrandRequest:
      type: object
      properties:
        move_products_to:
          type:
            - string
            - 'null'
          description: >-
            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.
    ArchiveBrandResponse:
      type: object
      required:
        - brand_id
        - archived_at
        - products_moved
        - subscriptions_moved
        - collections_moved
      properties:
        archived_at:
          type: string
          format: date-time
          description: Time the brand was archived.
        brand_id:
          type: string
          description: The archived brand.
        collections_moved:
          type: integer
          format: int64
          description: Count of product collections moved to the target brand.
          minimum: 0
        moved_to_brand_id:
          type:
            - string
            - 'null'
          description: >-
            Brand that received the moved records. Null when no target was
            given.
        products_moved:
          type: integer
          format: int64
          description: Count of products moved to the target brand.
          minimum: 0
        subscriptions_moved:
          type: integer
          format: int64
          description: Count of live subscriptions moved to the target brand.
          minimum: 0
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````