---
title: "Export a catalog variance batch (local only)"
method: POST
path: "/catalog/variance-batches/{id}/export"
tags: ["catalog"]
---

# Export a catalog variance batch (local only)

`POST /catalog/variance-batches/{id}/export`

Marks the batch as exported without sending data to any external system. Sets exported_at to the current timestamp and api_status to success. Returns the exported batch with its costbatch_payload. Returns 400 if the batch is already exported.

## Path parameters

- `id` string, required

## Headers

- `Authorization` string, required
- `X-Api-Key` string, required
- `X-API-Version` string
- `Idempotency-Key` string

## Response `200`

Batch successfully marked as exported

- CatalogVarianceBatchObject — A Catalog Variance Manager batch, draft or exported.
  - `id` string, required — Unique batch identifier (prefixed with ctb_)
  - `ottimate_company_id` integer, required — Company ID this batch belongs to
  - `batch_number` integer, required — Sequential batch number within the company
  - `export_status` 'draft' | 'exported', required — 'draft' when exported_at is null, 'exported' once exported_at is set
  - `exported_at` string, date-time, nullable — Timestamp when the batch was exported. Null for draft batches.
  - `exported_at_utc` string, date-time, nullable — UTC equivalent of exported_at. ISO 8601 with Z suffix, e.g. "2025-05-20T15:17:35.652584Z". Null for draft batches.
  - `costbatch_payload` CostBatchPayload, required — Costbatch payload in the same shape as the Pyxis /costbatch endpoint.
    - `description` string — Human-readable batch description, e.g. 'Catalog Batch 42'
    - `zone` string — Geographical zone for this batch
    - `import_def_id` integer — Pyxis import definition ID from the company token. Defaults to 0 if no Pyxis token is configured.
    - `external_batch_number` string — String representation of the batch number
    - `start_datetime` string, date-time — Start date for this batch's price updates
    - `catalog_items` CatalogItemPayload[] — List of catalog items with updated costs

## Other responses

- `400` — Bad request - Invalid parameters or request format
- `403` — Forbidden — caller does not have access to this batch's company
- `404` — Not found - Resource does not exist

## Changes

- **2026-08-22** `75aab60eedc9` — 2 breaking, 1 warning
  - for the `header` request parameter `Idempotency-Key`, the minLength was increased from `0` to `1`
  - added the pattern `^[A-Za-z0-9._\-+=/]{1,128}$` to the `header` request parameter `Idempotency-Key`
  - for the `header` request parameter `Idempotency-Key`, the maxLength was set to `128`
- **2026-08-19** `c0b5cf6c7a72` — 2 breaking, 1 warning, 2 info
  - the response property `exported_at` became nullable for the status `200`
  - the response property `exported_at` became optional for the status `200`
  - added the new `draft` enum value to the `export_status` response property for the response status `200`
  - the response property `request_id` became required for the status `403`
  - …1 more
- **2026-08-17** `c231509a03cf` — 3 breaking, 8 info
  - the `message` response's property type/format changed from `string`/`` to ``/`` for status `400`
  - the `message` response's property type/format changed from `string`/`` to ``/`` for status `403`
  - the `message` response's property type/format changed from `string`/`` to ``/`` for status `404`
  - the response property `code` became required for the status `400`
  - …7 more
- …earlier changes not shown

[Full history](https://skmtc.dev/ottimate/apis/api-reference/changes/catalog/variance-batches/:id/export/post.md)

---

[API](https://skmtc.dev/ottimate/apis/api-reference.md) · [All operations](https://skmtc.dev/ottimate/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ottimate/api-reference/revisions/ba91ff4c6969/schema)
