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

# Update module config

> Update non-secret configuration for one module on a modular inventory source

`PATCH /api/v2/storefront/inventory-sources/{sourceId}/modular/modules/{moduleInstanceId}/config`

Updates the non-secret configuration for one module on a modular inventory source. Nested config objects are deep-merged by default; pass `merge: false` to replace the module config wholesale.

## Request

<CodeGroup>
  ```bash curl theme={null}
  curl -X PATCH \
    https://api.interchange.io/api/v2/storefront/inventory-sources/retail-modular/modular/modules/inventory-feed-1/config \
    -H "Authorization: Bearer $SCOPE3_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "config": {
        "feedUrl": "https://feeds.retail-network.example.com/avails.csv",
        "refreshCron": "0 * * * *"
      },
      "merge": true
    }'
  ```

  ```json Replace config theme={null}
  {
    "config": { "feedUrl": "https://feeds.retail-network.example.com/avails.csv" },
    "merge": false,
    "status": "CONFIGURING"
  }
  ```
</CodeGroup>

## Parameters

| Field              | Type          | Required | Notes                                                                                                                                                   |
| ------------------ | ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sourceId`         | string (path) | Yes      | Storefront-scoped inventory source ID                                                                                                                   |
| `moduleInstanceId` | string (path) | Yes      | Seller-local module instance id                                                                                                                         |
| `config`           | object        | Yes      | Non-secret module configuration values to write                                                                                                         |
| `merge`            | boolean       | No       | `true` (default) deep-merges into existing config; `false` replaces it                                                                                  |
| `status`           | enum          | No       | Manual module status: `CONFIGURING`, `DISABLED`, or `ERROR`. `ACTIVE` is derived by readiness workflows and cannot be set here. Omit to leave unchanged |

## Response

`200 OK` with the refreshed `InventorySourceRuntimeProjection` (same shape as [Get modular readiness](/v2/storefront/inventory-sources/tasks/get-modular-readiness)). The updated module reflects the new `configuredFieldKeys` and recomputed `missingSetupFieldsBySource`:

```json theme={null}
{
  "inventorySource": {
    "id": "900222",
    "storefrontId": "42",
    "sourceId": "retail-modular",
    "name": "Retail Modular Source",
    "executionType": "MODULAR_SOURCE",
    "status": "ACTIVE",
    "healthStatus": "healthy",
    "lastError": null,
    "lastCheckedAt": "2026-05-02T09:00:00Z"
  },
  "modules": [
    {
      "moduleRowId": "7001",
      "inventorySourceId": "900222",
      "moduleInstanceId": "inventory-feed-1",
      "kind": "INVENTORY_FEED",
      "name": "Inventory Feed",
      "provider": null,
      "status": "CONFIGURING",
      "contractId": null,
      "contractVersion": null,
      "contract": null,
      "configuredFieldKeys": ["feedUrl", "refreshCron"],
      "missingSetupFieldsBySource": [],
      "lifecycle": [],
      "openWorkItemCount": 0,
      "lastError": null,
      "lastCheckedAt": null,
      "issues": []
    }
  ],
  "openWorkItemCount": 0
}
```

## Errors

* `400 VALIDATION_ERROR` — missing `config`, or `status: ACTIVE` (not settable here).
* `401 UNAUTHORIZED` — missing or invalid API key.
* `404 NOT_FOUND` — no modular source with this `sourceId`, or no module with this `moduleInstanceId`.

See [Errors](/v2/reference/errors) for the full error contract.

## Related

<CardGroup cols={2}>
  <Card title="Inventory source tasks" href="/v2/storefront/inventory-sources/tasks" icon="list-check">
    All operations
  </Card>

  <Card title="Get modular readiness" href="/v2/storefront/inventory-sources/tasks/get-modular-readiness" icon="diagram-project">
    See missing fields and lifecycle stages
  </Card>

  <Card title="Get inventory source" href="/v2/storefront/inventory-sources/tasks/get-inventory-source" icon="magnifying-glass">
    Read the source row
  </Card>

  <Card title="Inventory sources overview" href="/v2/storefront/inventory-sources/overview" icon="plug">
    Concepts and lifecycle
  </Card>
</CardGroup>
