Create or update price codes

View as Markdown
Creates or updates price codes for a product and returns the product's complete set of price codes afterwards, ordered by `price_code`. Each entry is matched on `price_code`: an existing price code has its `price` replaced, and an unknown one is created. Price codes that are not sent are left unchanged, so this endpoint never removes a price code. Use `DELETE /products/{product_id}/price_codes/{price_code}/` to remove one. A request carries at most 100 price codes. Each `price_code` is trimmed of surrounding whitespace and compared case-insensitively, so sending both `Cust_1` and `cust_1` in the same request returns `400`. The request is applied in a single transaction: if any entry is rejected, nothing is written. A successful call also updates the product's `last_update` timestamp so the change is picked up by catalog syncs ordered on it. Changing a price code does not trigger a product webhook. Writing price codes requires Application API Scope. A Storefront API Scope request returns `403`.

Authentication

x-api-keystring
API Key authentication via header

Path parameters

product_idstringRequired
Merchant product ID

Request

This endpoint expects an object.
price_codeslist of objectsRequired
Price codes to create or update. At least one entry, and at most 100.

Response

200
price_codeslist of objects

Price codes configured for the product, ordered by price_code.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error