Skip to Content
v1.5Official documentation for the LX CloudPos API · stable in production

Create brand

POST /api/v1/marcas

Creates a brand in the tenant’s catalog, or returns the one that already exists with that name. It exists because idMarca when creating a product is an id internal to LX CloudPos, and an external system knows the names of its brands, not those ids.

The brand is optional on a product: if the integration doesn’t manage brands, don’t use this endpoint and omit idMarca — the product ends up with no brand and sells just the same.

Authentication and permissions

AttributeValue
SchemeAPI key (X-Api-Key)
Required scopecatalogo:write
IdempotentDoes not accept Idempotency-Key, but the upsert by name is already retry-safe
Rate limit120 req/min per API key
Max body64 KB

Request body

{ "nombre": "Waffle Monkey" }

Responses

201 Created — the brand was created

{ "idMarca": 7, "nombre": "Waffle Monkey", "estado": true }

200 OK — a brand with that name already existed

Same shape. The comparison ignores case and leading/trailing whitespace: "waffle monkey " matches "Waffle Monkey". Creation is distinguished from a match by the status code.

estado can come back false: the search includes deactivated brands, because an inactive brand still works as a product’s idMarca, and returning it is preferable to creating a duplicate with the same name.

400 Bad Request

{ "error": "Debe indicar 'nombre'." }

And two edge cases:

{ "error": "No se pudo guardar la marca." }
{ "error": "La marca se guardó pero no se pudo releer." }

401 / 403 / 429 / 500

Same as the rest of the API. The 500 from this endpoint responds { "error": "Error interno guardando la marca." }.

Known limitation

The brand name has no unique index in the database. That means two things:

  1. If the tenant already had two brands with the same name —created from the POS before this endpoint existed—, the upsert always returns the one with the lowest id: the oldest one, which is the one most likely already referenced by products.
  2. Two simultaneous requests with the exact same name can end up creating two rows. In a sequential catalog sync —the normal case— this does not happen.

This situation cannot be avoided from the integrator’s side; it’s documented for informational purposes.

Data model

interface MarcaApiRequestDto { /** REQUIRED. Compared case-insensitively and with whitespace trimmed. */ nombre: string; } interface MarcaApiResponseDto { /** Use as idMarca when creating a product. */ idMarca: number; nombre: string; estado: boolean; }