Create product

View as Markdown
## Create product Creates a new product under the authenticated merchant's store. Optionally links the product to existing apps (POS/store apps) and modifiers in the same store. ### Authentication Requires a Merchant API key sent in the `x-api-key` header (alias `x-account-api-key`). The key must carry the `Merchant.product.create` scope. To scope the key to a specific store/account you may also send the optional `x-application-account-id` header (alias `x-account-id`) or the `application_account_id` / `account_id` query param. ### Body JSON body (`application/json`) described by `CreateProductDto`: - `name` (required) — product name, max 200 chars. - `description` (optional) — max 255 chars. - `imageUrl` (optional) — product image URL. - `sku` (optional) — unique SKU; when supplied it must be globally unique or the request fails with 400. - `price` (required) — price in SATS; must be a positive number. - `productCategoryId` (optional) — UUID of an existing product category. - `appsIds` (optional) — array of unique app IDs to link; every ID must belong to your store. - `modifiersIds` (optional) — array of unique modifier UUIDs to link; every ID must belong to your store. ### Side effects & status - Validates SKU uniqueness (400 `The SKU '<sku>' is already in use.` if taken). - Creates the product, then in a transaction creates `productApps` and `productModifiers` join rows for the supplied IDs. - If any supplied app or modifier does not belong to your store, responds 403 `Some apps do not belong to your store` / `Some modifiers do not belong to your store` (the product row may already have been created before this validation). Returns a simple confirmation message, not the created entity. --- **Notas:** Only `name` and `price` are required (`sku` is @IsOptionalString in CreateProductDto). Returns only a confirmation message, not the created product. SKU uniqueness is enforced globally (unique column). App/modifier ownership is validated against the caller's store; note the product row is created before the join-table ownership checks run, so a 403 can occur after the product already exists.

Authentication

x-api-keystring
API Key authentication via header

Headers

x-application-account-idstringOptional

Scope the request to a specific store / account instead of the one resolved from the API key. Aliases: the x-account-id header, or the application_account_id / account_id query parameter.

Request

This endpoint expects an object.
namestringRequired
priceintegerRequired