> ## 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.

# Update Product Collection

> Update a product collection's details.



## OpenAPI

````yaml patch /product-collections/{id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.102.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
paths:
  /product-collections/{id}:
    patch:
      tags:
        - Product Collections
      operationId: patch_product_collection
      parameters:
        - name: id
          in: path
          description: Product Collection Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchProductCollectionRequest'
        required: true
      responses:
        '200':
          description: Product Collection Updated Successfully
        '422':
          description: Invalid Request Object or Parameters
        '500':
          description: Something went wrong :(
      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
            });

            await client.productCollections.update('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
            )
            client.product_collections.update(
                id="id",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\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\terr := client.ProductCollections.Update(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t\tdodopayments.ProductCollectionUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\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.productcollections.ProductCollectionUpdateParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    client.productCollections().update("id");
                }
            }
        - 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.productcollections.ProductCollectionUpdateParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                client.productCollections().update("id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            result = dodo_payments.product_collections.update("id")

            puts(result)
        - 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 {
              $result = $client->productCollections->update(
                'id',
                brandID: 'brand_id',
                description: 'description',
                effectiveAtOnDowngrade: 'immediately',
                effectiveAtOnUpgrade: 'immediately',
                groupOrder: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],
                imageID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                name: 'name',
                onPaymentFailure: 'prevent_change',
                prorationBillingModeOnDowngrade: 'prorated_immediately',
                prorationBillingModeOnUpgrade: 'prorated_immediately',
              );

              var_dump($result);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using DodoPayments.Client;
            using DodoPayments.Client.Models.ProductCollections;

            DodoPaymentsClient client = new();

            ProductCollectionUpdateParams parameters = new() { ID = "id" };

            await client.ProductCollections.Update(parameters);
components:
  schemas:
    PatchProductCollectionRequest:
      type: object
      properties:
        brand_id:
          type:
            - string
            - 'null'
          description: Optional brand_id update
        description:
          type:
            - string
            - 'null'
          description: >-
            Optional description update - pass null to remove, omit to keep
            unchanged
        effective_at_on_downgrade:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EffectiveAt'
              description: >-
                Effective_at setting for downgrades: Some(Some(val)) = set,
                Some(None) = clear (inherit), None = no change
        effective_at_on_upgrade:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EffectiveAt'
              description: >-
                Effective_at setting for upgrades: Some(Some(val)) = set,
                Some(None) = clear (inherit), None = no change
        group_order:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: >-
            Optional new order for groups (array of group UUIDs in desired
            order)
        image_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Optional image update - pass null to remove, omit to keep unchanged
        name:
          type:
            - string
            - 'null'
          description: Optional new name for the collection
        on_payment_failure:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/OnPaymentFailure'
              description: >-
                On payment failure behavior: Some(Some(val)) = set, Some(None) =
                clear (inherit), None = no change
        proration_billing_mode_on_downgrade:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ProrationBillingMode'
              description: >-
                Proration billing mode for downgrades: Some(Some(val)) = set,
                Some(None) = clear (inherit), None = no change
        proration_billing_mode_on_upgrade:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ProrationBillingMode'
              description: >-
                Proration billing mode for upgrades: Some(Some(val)) = set,
                Some(None) = clear (inherit), None = no change
    EffectiveAt:
      type: string
      description: When to apply a subscription plan change.
      enum:
        - immediately
        - next_billing_date
    OnPaymentFailure:
      type: string
      description: >-
        Specifies how to handle subscription plan changes when payment fails.


        This enum controls whether the subscription should be updated
        immediately

        or only after payment succeeds.
      enum:
        - prevent_change
        - apply_change
    ProrationBillingMode:
      type: string
      title: Proration Billing Mode
      enum:
        - prorated_immediately
        - full_immediately
        - difference_immediately
        - do_not_bill
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````