> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Files

> Update the files associated with a product.



## OpenAPI

````yaml put /products/{id}/files
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.61.5
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: Licenses
  - name: Discounts
  - name: Meters
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /products/{id}/files:
    put:
      tags:
        - Products
      operationId: upload_product_file
      parameters:
        - name: id
          in: path
          description: Product Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadProductFile'
        required: true
      responses:
        '200':
          description: Aws s3 presigned URL. Upload image to this URL within 60s
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadProductFileResponse'
        '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: 'My Bearer Token',
            });


            const response = await client.products.updateFiles('id', {
            file_name: 'file_name' });


            console.log(response.file_id);
        - lang: Python
          source: |-
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token="My Bearer Token",
            )
            response = client.products.update_files(
                id="id",
                file_name="file_name",
            )
            print(response.file_id)
        - lang: Go
          source: |
            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.Products.UpdateFiles(
                context.TODO(),
                "id",
                dodopayments.ProductUpdateFilesParams{
                  FileName: dodopayments.F("file_name"),
                },
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", response.FileID)
            }
        - 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.products.ProductUpdateFilesParams;

            import
            com.dodopayments.api.models.products.ProductUpdateFilesResponse;


            public final class Main {
                private Main() {}

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

                    ProductUpdateFilesParams params = ProductUpdateFilesParams.builder()
                        .id("id")
                        .fileName("file_name")
                        .build();
                    ProductUpdateFilesResponse response = client.products().updateFiles(params);
                }
            }
        - 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.products.ProductUpdateFilesParams

            import
            com.dodopayments.api.models.products.ProductUpdateFilesResponse


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

                val params: ProductUpdateFilesParams = ProductUpdateFilesParams.builder()
                    .id("id")
                    .fileName("file_name")
                    .build()
                val response: ProductUpdateFilesResponse = client.products().updateFiles(params)
            }
        - 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.products.update_files("id", file_name:
            "file_name")


            puts(response)
components:
  schemas:
    UploadProductFile:
      type: object
      required:
        - file_name
      properties:
        file_name:
          type: string
    UploadProductFileResponse:
      type: object
      required:
        - url
        - file_id
      properties:
        file_id:
          type: string
          format: uuid
        url:
          type: string
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````