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

# Batch Create Offers

> Create up to 100 offers in a single request.

Creates multiple offers at once; the whole batch is validated and processed together.

## Query parameters

<ParamField query="fields" type="string">
  Comma-separated fields to include in the returned offers. Prefix with `+`/`-` to add to or remove from the defaults.
</ParamField>

## Body parameters

<ParamField body="offers" type="object[]" required>
  Between 1 and 100 offers to create.

  <Expandable title="properties">
    <ParamField body="sku" type="string" required>The seller's SKU for the listing.</ParamField>
    <ParamField body="variant_id" type="string" required>ID of the product variant being listed.</ParamField>
    <ParamField body="shipping_profile_id" type="string" required>ID of the shipping profile used to fulfill the offer.</ParamField>

    <ParamField body="prices" type="object[]" required>
      At least one price.

      <Expandable title="properties">
        <ParamField body="amount" type="number" required>Price amount.</ParamField>
        <ParamField body="currency_code" type="string" required>Currency code, e.g. `usd`.</ParamField>
        <ParamField body="min_quantity" type="number">Minimum quantity for the price to apply; positive integer.</ParamField>
        <ParamField body="max_quantity" type="number">Maximum quantity for the price to apply; positive integer.</ParamField>
        <ParamField body="rules" type="object">Price rules as attribute-to-value pairs.</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="inventory_items" type="object[]" required>
      At least one inventory item.

      <Expandable title="properties">
        <ParamField body="title" type="string">Title for the created inventory item.</ParamField>
        <ParamField body="sku" type="string">SKU for the created inventory item.</ParamField>
        <ParamField body="required_quantity" type="number" default="1">Units consumed per sale; positive integer.</ParamField>

        <ParamField body="stock_levels" type="object[]">
          <Expandable title="properties">
            <ParamField body="location_id" type="string" required>Stock location ID.</ParamField>
            <ParamField body="stocked_quantity" type="number" required>Stocked quantity at the location; non-negative integer.</ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="ean" type="string">EAN barcode.</ParamField>
    <ParamField body="upc" type="string">UPC barcode.</ParamField>
    <ParamField body="metadata" type="object">Custom key-value pairs.</ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="offers" type="object[]">
  <Expandable title="properties">
    <ResponseField name="id" type="string">The offer's ID.</ResponseField>
    <ResponseField name="variant_id" type="string">ID of the listed product variant.</ResponseField>
    <ResponseField name="sku" type="string">The seller's SKU for the listing.</ResponseField>
    <ResponseField name="prices" type="object[]">The offer's prices.</ResponseField>
    <ResponseField name="inventory_items" type="object[]">Linked inventory items.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'http://localhost:9000/vendor/offers/batch' \
    -H 'Authorization: Bearer <token>' \
    -H 'x-seller-id: <seller_id>' \
    -H 'Content-Type: application/json' \
    -d '{
      "offers": [
        {
          "sku": "ACME-SHIRT-S",
          "variant_id": "variant_01HABC",
          "shipping_profile_id": "sp_01HXYZ",
          "prices": [{ "amount": 2500, "currency_code": "usd" }],
          "inventory_items": [{ "required_quantity": 1 }]
        },
        {
          "sku": "ACME-SHIRT-M",
          "variant_id": "variant_01HXYZ",
          "shipping_profile_id": "sp_01HXYZ",
          "prices": [{ "amount": 2500, "currency_code": "usd" }],
          "inventory_items": [{ "required_quantity": 1 }]
        }
      ]
    }'
  ```

  ```ts JS Client theme={null}
  const { offers } = await client.vendor.offers.batch.mutate({
    offers: [
      {
        sku: "ACME-SHIRT-M",
        variant_id: "variant_01HXYZ",
        shipping_profile_id: "sp_01HXYZ",
        prices: [{ amount: 2500, currency_code: "usd" }],
        inventory_items: [{ required_quantity: 1 }],
      },
    ],
  })
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "offers": [
      {
        "id": "offer_01HABC",
        "variant_id": "variant_01HABC",
        "sku": "ACME-SHIRT-S"
      },
      {
        "id": "offer_01HXYZ",
        "variant_id": "variant_01HXYZ",
        "sku": "ACME-SHIRT-M"
      }
    ]
  }
  ```
</ResponseExample>
