POST
/tenants/{tenantId}/catalog/products
tenantCatalogCreateProduct · Catalog
Requires USER catalog.write in the requested tenant. Create in DRAFT; publish by PUT after an active variant exists. Type, unit and tracking become immutable once any variant exists.
- Autenticación
- SupabaseBearer · http bearer
Ejemplo
Los valores entre <> y {} son marcadores: sustitúyelos
por los tuyos antes de ejecutarlo.
curl --request POST \
--url 'https://api.marky.ec/v1/tenants/{tenantId}/catalog/products' \
--header 'Authorization: Bearer <SupabaseBearer>' \
--header 'Idempotency-Key: <Idempotency-Key>' \
--header 'Content-Type: application/json' \
--data @body.json
Parámetros
| Nombre | En | Tipo | Descripción |
|---|---|---|---|
tenantIdobligatorio
|
path | stringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ |
|
Idempotency-Keyobligatorio
|
header | stringformato uuid |
UUIDv4 or UUIDv7. Normalized input fingerprint; same actor/tenant/operation and key replay for 24 hours. Changed input conflicts; authorization rechecked before replay. |
Cuerpo (obligatorio)
application/jsonCatalogProductCreateInput
objectsin otras propiedades
-
nameobligatoriostringlongitud mín. 1longitud máx. 200 -
slugstring | nullpatrón ^[a-z0-9]+(-[a-z0-9]+)*$longitud máx. 160Web identifier, unique per company and kept reserved after archiving. Optional. Omitted or null on creation: generated from the name (accents and symbols removed, words joined by hyphens, at most 160 characters) and, when taken, completed with -2, -3… Stated: used as given, 409 when taken. Omitted or null on update: the product keeps its slug; renaming a product never changes it.
-
variantModeuno de "SINGLE", "MULTIPLE", nullSINGLE: an article sold as one SKU. MULTIPLE: an article that holds several versions of itself, each with its own SKU. Omitted or null on creation: MULTIPLE when more than one variant is created with the product, SINGLE otherwise. Omitted or null on update: unchanged. SINGLE is refused (409) while the product has more than one active variant.
-
productTypeobligatoriouno de "GOOD", "SERVICE" -
categoryIdstring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
brandIdstring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
manufacturerIdstring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
unitOfMeasureobligatoriostringpatrón ^[A-Z][A-Z0-9_]{0,15}$longitud máx. 16 -
trackInventorybooleanpor defecto false -
trackSerialsbooleanpor defecto false -
publicationStatusuno de "DRAFT", "PUBLISHED"por defecto DRAFT -
descriptionstring | nulllongitud máx. 10000 -
shortDescriptionstring | nulllongitud máx. 500 -
attributesobjectBounded JSON (500 nodes, depth 5, 16000 characters). Reserved credential/prototype keys and secret patterns rejected. Never included in API-key reads.
-
variantsarrayelementos máx. 100Variants created with the product in the same transaction: all of them or nothing. A SKU that is invalid or repeated in the request is a 400; one already taken in the company, archived variants included, is a 409, and neither leaves a product behind. Omitted: the product is created alone, as before, and completed later. With at least one variant the product may be created PUBLISHED; alone it is always a DRAFT.
Cada elementoCatalogVariantInputobjectsin otras propiedades-
modelNumberstring | nulllongitud máx. 100 -
barcodestring | nulllongitud máx. 100 -
storagestring | nulllongitud máx. 100 -
colorstring | nulllongitud máx. 100 -
skuobligatoriostringpatrón ^[A-Z0-9][A-Z0-9_./-]{0,99}$longitud máx. 100 -
conditionuno de "NEW", "USED", "REFURBISHED", "OPEN_BOX", "AS_IS", null -
gradeuno de "A", "B", "C", null -
simTypeuno de "ESIM", "PHYSICAL_SIM", "PHYSICAL_ESIM", "DUAL_SIM", "NOT_APPLICABLE"por defecto NOT_APPLICABLE -
attributesobjectBounded JSON (500 nodes, depth 5, 16000 characters). Reserved credential/prototype keys and secret patterns rejected. Never included in API-key reads.
-
searchAliasesarrayelementos máx. 16por defecto []sin repetidosCurated variant search aliases; NFKC/trim/space normalization, duplicates ignoring case/accents rejected. Public search may match aliases; arbitrary attributes are never indexed. Omitted in full variant replacement resets aliases to [].
Cada elementostringlongitud mín. 1longitud máx. 80
-
Respuestas
201 Success
-
X-Request-Idstringformato uuid -
X-RateLimit-Limitintegermín. 1Effective requests per fixed minute window -
X-RateLimit-Remainingintegermín. 0Remaining capacity of the most restrictive dimension -
X-RateLimit-ResetintegerRedis window reset, Unix seconds -
Idempotency-Replayeduno de "true"Present on successful replay.
application/jsonCatalogProductCreated
objectsin otras propiedades
-
idobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
tenantIdobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
statusobligatoriouno de "ACTIVE", "ARCHIVED" -
archivedAtobligatoriostring | nullformato date-time -
createdAtobligatoriostringformato date-time -
updatedAtobligatoriostringformato date-time -
nameobligatoriostringlongitud mín. 1longitud máx. 200 -
slugobligatoriostringpatrón ^[a-z0-9]+(-[a-z0-9]+)*$longitud máx. 160 -
variantModeobligatoriouno de "SINGLE", "MULTIPLE"What the product is in practice: MULTIPLE when it was declared so or has more than one active variant; SINGLE otherwise.
-
variantCountobligatoriointegermín. 0Active variants of the product. Zero: it has no SKU yet.
-
singleSkuobligatoriostring | nullSKU of the only active variant when the product has exactly one; null otherwise.
-
singleVariantIdobligatoriostring | nullformato uuidId of the only active variant when the product has exactly one; null otherwise. Human reads only: API-key projections never carry it.
-
productTypeobligatoriouno de "GOOD", "SERVICE" -
categoryIdobligatoriostring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
brandIdobligatoriostring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
manufacturerIdobligatoriostring | nullformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
unitOfMeasureobligatoriostringpatrón ^[A-Z][A-Z0-9_]{0,15}$longitud máx. 16 -
trackInventoryobligatoriobooleanpor defecto false -
trackSerialsobligatoriobooleanpor defecto false -
publicationStatusobligatoriouno de "DRAFT", "PUBLISHED"por defecto DRAFT -
descriptionobligatoriostring | nulllongitud máx. 10000 -
shortDescriptionobligatoriostring | nulllongitud máx. 500 -
attributesobligatorioobjectBounded JSON (500 nodes, depth 5, 16000 characters). Reserved credential/prototype keys and secret patterns rejected. Never included in API-key reads.
-
variantsarrayelementos máx. 100The variants created with the product, in the order of the request. Present only when the request carried `variants`; a product created alone answers as it always did.
Cada elementoCatalogVariantobjectsin otras propiedades-
idobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
tenantIdobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
statusobligatoriouno de "ACTIVE", "ARCHIVED" -
archivedAtobligatoriostring | nullformato date-time -
createdAtobligatoriostringformato date-time -
updatedAtobligatoriostringformato date-time -
modelNumberobligatoriostring | nulllongitud máx. 100 -
barcodeobligatoriostring | nulllongitud máx. 100 -
storageobligatoriostring | nulllongitud máx. 100 -
colorobligatoriostring | nulllongitud máx. 100 -
skuobligatoriostringpatrón ^[A-Z0-9][A-Z0-9_./-]{0,99}$longitud máx. 100 -
conditionobligatoriouno de "NEW", "USED", "REFURBISHED", "OPEN_BOX", "AS_IS", null -
gradeobligatoriouno de "A", "B", "C", null -
simTypeobligatoriouno de "ESIM", "PHYSICAL_SIM", "PHYSICAL_ESIM", "DUAL_SIM", "NOT_APPLICABLE"por defecto NOT_APPLICABLE -
attributesobligatorioobjectBounded JSON (500 nodes, depth 5, 16000 characters). Reserved credential/prototype keys and secret patterns rejected. Never included in API-key reads.
-
productIdobligatoriostringformato uuidpatrón ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ -
searchAliasesobligatorioarrayelementos máx. 16por defecto []sin repetidosCurated variant search aliases; NFKC/trim/space normalization, duplicates ignoring case/accents rejected. Public search may match aliases; arbitrary attributes are never indexed. Omitted in full variant replacement resets aliases to [].
Cada elementostringlongitud mín. 1longitud máx. 80
-
400 Invalid request
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
401 Missing or invalid access token
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
403 Identity, membership or permission denied
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
404 Unknown resource
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
409 Conflict or last manager
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
413 Payload too large
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
429 Per-minute rate or monthly quota exceeded; authenticated API clients require PUBLIC_API entitlement.
-
Retry-Afterintegermín. 1Seconds before retrying; quota reset is UTC next month.
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
500 Internal failure
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-
503 Auth/database/governance unavailable; no memory fallback for Redis.
application/problem+jsonProblemDetails
objectsin otras propiedades
-
typeobligatoriovalor fijo "about:blank" -
statusobligatoriointeger -
codeobligatoriostring -
titleobligatoriostring -
detailobligatoriostring -
requestIdobligatoriostringformato uuid -
errorsarrayelementos máx. 200Where each problem is, for the codes that can say it: a JSON pointer into the request or the record (`/items/0/devices/1/imei1`) and the reason. A line of a serialized article that is short of units also says how many it bills and how many are identified. Never a value typed by the user, and never an identifier of a unit.
Cada elementoobjectsin otras propiedades-
pointerobligatoriostring -
codeobligatoriostring -
requiredintegermín. 0máx. 1000For a line short of units (UNITS_DIFFER_FROM_QUANTITY, RECEIPT_REQUIRED, DELIVERY_REQUIRED): how many units the line bills.
-
identifiedintegermín. 0máx. 1000For the same line: how many units are identified and linked to it. Given to every reader of the document; no IMEI or serial number is.
-