> For the complete documentation index, see [llms.txt](https://help.mimeeq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.mimeeq.com/api/market-cost-prices/bulk-upsert-market-cost-prices.md).

# Bulk upsert Market Cost Prices

Create or upsert market cost prices in bulk (1–5000).

Use this for a batch price synchronization. Inspect the per-batch result and invalid codes before considering the import complete.

### Behaviour

With `mode: UPSERT` existing full codes are updated (counted under `updated`); the market must be configured for the customer, or the row is reported in `invalidCodes`.

Currency is not accepted — it is derived from the market.

Each item is a full replacement: omitting `rrp` clears any stored RRP.

Requires the `marketCostPrices:write` scope.

```json
{"openapi":"3.1.0","info":{"title":"Mimeeq External API","version":"1.1.0"},"tags":[{"name":"Market Cost Prices","description":"Manage cost prices and optional recommended retail prices for a configured market, item code and quantity. The market selects the currency; requests do not supply a separate currency.\n\nUse this section to synchronize market-specific price inputs from a pricing or ERP system. Use Price Lists for selling-price lists and Companies for their assignments.\n\n## What you can do\n\n| Task | Reference |\n| --- | --- |\n| Find available market cost prices | [List Market Cost Prices](https://help.mimeeq.com/developers/market-cost-prices/list-market-cost-prices) |\n| Add a new market cost price | [Create Market Cost Price](https://help.mimeeq.com/developers/market-cost-prices/create-market-cost-price) |\n| Import or update market cost prices | [Bulk upsert Market Cost Prices](https://help.mimeeq.com/developers/market-cost-prices/bulk-upsert-market-cost-prices) |\n| Change market cost price | [Update Market Cost Price](https://help.mimeeq.com/developers/market-cost-prices/update-market-cost-price) |\n\n## Before you start\n\nYour API key needs `marketCostPrices:read` to read these resources. Use `marketCostPrices:write` for write operations.\n\n## Important behaviour\n\nRead Customer pricing settings for valid markets. The combination of market, code and quantity identifies a price record. Updates and bulk upserts replace the submitted price fields; omitting rrp clears it. The list has a 10000-record retrieval ceiling, so check page.truncated and use search to narrow large datasets."}],"servers":[{"url":"https://admin.mimeeqapi.com","description":"Production API"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key sent as a bearer token (mk_live_… / mk_test_…)."}},"schemas":{"MarketCostPricesBulkResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"existingCount":{"type":"number","description":"Records already stored for the customer before the import."},"added":{"type":"number"},"updated":{"type":"number","description":"Existing rows re-written (UPSERT). Currently includes rows re-sent unchanged."},"unchanged":{"type":"number","description":"Existing rows re-sent with no change. Reserved: currently always 0 (such rows are counted under `updated`) until server-side change detection ships."},"processed":{"type":"number"},"invalidCodes":{"type":"array","items":{"type":"string"},"description":"Full codes rejected by validation."},"skippedCodes":{"type":"array","items":{"type":"string"},"description":"Full codes skipped because they already exist (CREATE mode; UPSERT updates them)."}},"required":["existingCount","added","updated","unchanged","processed","invalidCodes","skippedCodes"],"additionalProperties":false}},"required":["data"],"additionalProperties":false,"description":"Data schema used by Bulk upsert Market Cost Prices (POST /v1/market-cost-prices:bulk). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."},"PublicError":{"description":"An API error response. Use code and the HTTP status to classify the failure, message and optional details for context, and requestId when reporting it. Edge firewall responses may omit requestId.","type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string","description":"Present on every error the API itself returns; absent when the edge firewall rejected the request."},"details":{"description":"Optional error-specific details (e.g. per-field validation reasons)."}}},"MarketCostPricesBulkRequest":{"type":"object","properties":{"mode":{"default":"CREATE","description":"CREATE adds only (existing full codes are skipped); UPSERT updates them.","type":"string","enum":["CREATE","UPSERT"]},"items":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"market":{"type":"string","minLength":1,"maxLength":255,"description":"Market the price applies to, as configured for the customer."},"code":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[./\\\\_\\-\\w]+$","description":"Product/variant code."},"quantity":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Quantity tier the price applies to (integer ≥ 0)."},"cost":{"type":"number","minimum":0,"description":"Cost price in the market currency."},"rrp":{"type":"number","minimum":0,"description":"Recommended retail price in the market currency."}},"required":["market","code","quantity","cost"],"additionalProperties":false},"description":"1–5000 items."}},"required":["items"],"additionalProperties":false,"description":"Data schema used by Bulk upsert Market Cost Prices (POST /v1/market-cost-prices:bulk). Read that operation for usage, permissions and update rules. Required fields and allowed values are defined below; request and response shapes can differ."}}},"paths":{"/v1/market-cost-prices:bulk":{"post":{"summary":"Bulk upsert Market Cost Prices","tags":["Market Cost Prices"],"description":"Create or upsert market cost prices in bulk (1–5000).\n\nUse this for a batch price synchronization. Inspect the per-batch result and invalid codes before considering the import complete.\n\n## Behaviour\n\nWith `mode: UPSERT` existing full codes are updated (counted under `updated`); the market must be configured for the customer, or the row is reported in `invalidCodes`.\n\nCurrency is not accepted — it is derived from the market.\n\nEach item is a full replacement: omitting `rrp` clears any stored RRP.\n\nRequires the `marketCostPrices:write` scope.","responses":{"200":{"description":"Successful response.","headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCostPricesBulkResponse"}}}},"400":{"description":"Invalid request data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}}},"403":{"description":"The API key lacks the required scope (`scope_denied`), or the operation is not permitted for this account (`operation_not_permitted`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"409":{"description":"Conflict with the current state (e.g. the resource already exists).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"429":{"description":"The API key exceeded its request rate (`rate_limit_exceeded`) or its monthly quota (`quota_exceeded`). Both carry `Retry-After`; the `RateLimit-*` headers accompany `rate_limit_exceeded` only, since a spent quota says nothing about the bucket.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicError"}}},"headers":{"RateLimit-Limit":{"description":"Requests that can be admitted at once (the tier burst).","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Tokens left after this request.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the bucket is full again.","schema":{"type":"integer"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketCostPricesBulkRequest"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.mimeeq.com/api/market-cost-prices/bulk-upsert-market-cost-prices.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
