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

# Update Products' Metadata in Bulk

> Updates metadata parameters for a list of products. Every resource in the list will receive the metadata defined in the request.

The request can include up to **10 MB** of data.

The response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:

- The status of your request (in queue, in progress, done, or failed)

- Resources that failed to be updated

- The report file with details about the update


If a product object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.

This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.



## OpenAPI

````yaml /openapi/products.json post /v1/products/metadata/async
openapi: 3.0.1
info:
  title: Voucherify API - Products
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/products/metadata/async:
    post:
      tags:
        - Products
      summary: Update Products' Metadata in Bulk
      description: >-
        Updates metadata parameters for a list of products. Every resource in
        the list will receive the metadata defined in the request.


        The request can include up to **10 MB** of data.


        The response returns a unique asynchronous action ID. Use this ID in the
        query paramater of the [GET Async
        Action](/api-reference/async-actions/get-async-action) endpoint to
        check, e.g.:


        - The status of your request (in queue, in progress, done, or failed)


        - Resources that failed to be updated


        - The report file with details about the update



        If a product object is not found, it is **upserted**. This is shown in
        the report file in the **GET** Async Action endpoint. The upserted
        resources have value `false` in the `found` column and `true` in the
        `updated` column.


        This API request starts a process that affects Voucherify data in bulk.
        In the case of small jobs (like bulk update), the request is put into a
        queue and processed when every other bulk request placed in the queue
        prior to this request is finished.
      operationId: update-products-metadata-in-bulk
      parameters: []
      requestBody:
        description: >-
          List the `source_ids` of the products you would like to update with
          the metadata key/value pairs.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductsMetadataUpdateInBulkRequestBody'
            examples:
              Example:
                value:
                  source_ids:
                    - 123-567-3433
                    - test_volleyball
                  metadata:
                    label: true
                    origin: PL
        required: true
      responses:
        '202':
          description: >-
            Returns the ID of the scheduled asynchronous action. The response
            informs you that the request has been accepted and the resources
            will be updated in the repository asynchronously. To check the
            status and result, copy the `async_action_id` from the response and
            use it as a query parameter in the [GET Async
            Action](/api-reference/async-actions/get-async-action) endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductsMetadataUpdateInBulkResponseBody'
              examples:
                Example:
                  value:
                    async_action_id: aa_0a875d56c805df6601
        '413':
          description: Returns an error if the payload exceeds 10 MB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
              examples:
                Request Entity Too Large:
                  value:
                    statusCode: 413
                    error: Request Entity Too Large
                    message: >-
                      Payload content length greater than maximum allowed:
                      10485760
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - products
components:
  schemas:
    ProductsMetadataUpdateInBulkRequestBody:
      type: object
      title: Products Metadata Update In Bulk Request Body
      description: Request schema for **POST** `v1/products/metadata/async`.
      properties:
        source_ids:
          type: array
          description: Array of unique product source IDs.
          items:
            type: string
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            product. A set of key/value pairs that you can attach to a product
            object. It can be useful for storing additional information about
            the product in a structured format.
      required:
        - source_ids
        - metadata
    ProductsMetadataUpdateInBulkResponseBody:
      type: object
      title: Products Metadata Update In Bulk Response Body
      description: Response body schema for **POST** `v1/products/metadata/async`.
      allOf:
        - $ref: '#/components/schemas/AsyncActions'
    BadRequest:
      title: Error Object
      type: object
      description: Error details
      properties:
        statusCode:
          type: integer
          description: Error's HTTP status code.
        error:
          type: string
          description: A human-readable message providing a short description of the error.
        message:
          type: string
          description: A human-readable message providing more details about the error.
    AsyncActions:
      type: object
      title: Asynchronous Actions
      description: Response to requests that are processed asynchronously.
      properties:
        async_action_id:
          type: string
          example: aa_0a875d56c805df6601
          description: The ID of the scheduled asynchronous action.
      required:
        - async_action_id
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````