> ## 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 Vouchers in Bulk

> Updates specific metadata parameters for each code, respectively, in one asynchronous operation.

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

Upserts are not supported.

> 🚧 Currently, only **metadata** updates are supported.

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



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/vouchers.json post /v1/vouchers/bulk/async
openapi: 3.0.1
info:
  title: Voucherify API - Vouchers
  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/vouchers/bulk/async:
    post:
      tags:
        - Vouchers
      summary: Update Vouchers in Bulk
      description: >-
        Updates specific metadata parameters for each code, respectively, in one
        asynchronous operation.


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


        Upserts are not supported.


        > 🚧 Currently, only **metadata** updates are supported.


        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




        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-vouchers-in-bulk
      parameters: []
      requestBody:
        required: true
        description: >-
          List the codes to be updated with the metadata key/value pairs for
          that code.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VouchersUpdateInBulkRequestBody'
            examples:
              Example:
                value:
                  - code: example_code
                    metadata:
                      lang: en
                      test: false
                      MetadataTest: Update metadata
                      update_value: 1
                      next_update_date: '2022-11-11T09:00:00.000Z'
                  - code: example_code2
                    metadata:
                      lang: pl
                      test: false
                      MetadataTest: Update metadata
                      update_value: 2
      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/VouchersUpdateInBulkResponseBody'
              examples:
                Example:
                  $ref: '#/components/examples/res_async_actions'
        '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
            - vouchers
components:
  schemas:
    VouchersUpdateInBulkRequestBody:
      title: Vouchers Update In Bulk Request Body
      type: array
      description: Request body schema for **POST** `v1/vouchers/bulk/async`.
      items:
        $ref: '#/components/schemas/VouchersUpdateInBulkItemRequestBody'
    VouchersUpdateInBulkResponseBody:
      title: Vouchers Update In Bulk Response Body
      description: Response body schema for **POST** `v1/vouchers/bulk/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.
    VouchersUpdateInBulkItemRequestBody:
      title: Vouchers Update In Bulk Request Body Item
      type: object
      properties:
        code:
          type: string
          description: Unique voucher code.
        metadata:
          type: object
          description: >-
            The metadata object stores all custom attributes assigned to the
            code. A set of key/value pairs that you can attach to a voucher
            object. It can be useful for storing additional information about
            the voucher in a structured format.
      required:
        - code
        - metadata
    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
  examples:
    res_async_actions:
      value:
        async_action_id: aa_0ab2df092385be5ca5
  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`.

````