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

# Bulk update products

> Two request shapes share this endpoint.

Send `ids` and `archived` to archive or unarchive products. Send `mappings` to map
products to QuickBooks items.

When `mappings` is present it takes precedence, and `ids` and `archived` are ignored.

Mappings are applied in one transaction. If any mapping is rejected nothing is saved
and the response is a 422, so a partial apply is not possible.




## OpenAPI

````yaml /api-reference/openapi.yaml patch /products/bulk_update
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, and deposit links programmatically through this API,
    and receive webhooks when deposit links change. All requests must be
    authenticated with an API key.
  version: 1.6.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
paths:
  /products/bulk_update:
    patch:
      tags:
        - Products
      summary: Bulk update products
      description: >
        Two request shapes share this endpoint.


        Send `ids` and `archived` to archive or unarchive products. Send
        `mappings` to map

        products to QuickBooks items.


        When `mappings` is present it takes precedence, and `ids` and `archived`
        are ignored.


        Mappings are applied in one transaction. If any mapping is rejected
        nothing is saved

        and the response is a 422, so a partial apply is not possible.
      operationId: bulkUpdateProducts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - title: Archive or unarchive
                  type: object
                  required:
                    - ids
                    - archived
                  properties:
                    ids:
                      type: array
                      items:
                        type: integer
                      description: Array of product IDs to update
                    archived:
                      type: boolean
                      description: Set to true to archive, false to unarchive
                - title: Map products to QuickBooks items
                  type: object
                  required:
                    - mappings
                  properties:
                    mappings:
                      type: array
                      description: >
                        The mappings to apply. Each entry names one of your
                        products and the

                        QuickBooks item it maps to.


                        Applying a mapping also sets the product's
                        `quickbooks_synced_at`.
                      items:
                        type: object
                        required:
                          - id
                          - quickbooks_item_id
                        properties:
                          id:
                            type: integer
                            description: The ID of the product to map
                          quickbooks_item_id:
                            type: integer
                            nullable: true
                            description: >
                              The QuickBooks item id, a positive integer, or
                              null to clear the

                              mapping.


                              The id is not checked against QuickBooks when you
                              send it. An id

                              that does not exist there, or one belonging to a
                              QuickBooks

                              category rather than an item, is accepted here and
                              rejected by

                              QuickBooks later, when an invoice carrying this
                              product is

                              exported.
      responses:
        '200':
          description: Products updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  updated:
                    type: integer
                    description: >
                      Number of products updated.


                      For a `mappings` request this counts the mappings that
                      were applied. An

                      entry naming a product that is not yours, or one that has
                      been merged

                      away, is skipped rather than failing the batch, so this
                      can be lower than

                      the number of mappings you sent. Re-read the products
                      rather than

                      inferring which entries landed.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: >
            Unprocessable entity. For a `mappings` request, nothing was saved.


            A rejected mapping reports `Invalid QuickBooks item id for product
            <id>: <reason>`,

            and a malformed `mappings` value reports `mappings must be an array
            of objects with

            id and quickbooks_item_id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: ids cannot be empty
components:
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.