Connections

Listing requirements

Lists the fields a category or product type requires.

GET
/v1/connections/{id}/listing-requirements

Read category requirements

  • MockDevelopment only
  • Mercado LivreSupported
  • MagaluPlanned
  • AmazonPlanned
  • TikTok ShopPlanned
  • ShopeePlanned

Tells you what to fill in to publish. Send categoryId, productType or both. With none, the answer is 400 VALIDATION_ERROR, with the issue in details pointing at categoryId. A productType that applies to several categories also gives 400, with details.reason product_type_ambiguous: send categoryId. With productType and categoryId together, the category must be one of the type's: otherwise the answer is 400, with details.reason product_type_category_mismatch. This includes a category that does not exist (it is not 404). An unknown productType, though, gives 404 even with categoryId: the type is checked first. Send a pair that belongs together, or only one of them. With catalogProductId, the API checks that the product exists, and the fields the marketplace requires only for a catalog listing become required, with no condition (on Mercado Livre, catalog_required: without catalogProductId they come required with the condition catalogReference.desired.catalogProductId present). The catalogProductId must belong to the same category and productType you sent: otherwise the answer is 400, with details.reason catalog_product_mismatch (also when the category has no catalog). Without productType, a categoryId the marketplace does not know gives 404. An unknown catalogProductId gives 404 too, unless the productType (ambiguous, or with a categoryId that is not one of its categories) was already refused with 400, or Mercado Livre lost the category of the productType (the 503 next). If Mercado Livre loses the category it listed itself for the productType, the answer is 503 MARKETPLACE_UNAVAILABLE: try again.

curl "$BACKEND_URL/v1/connections/$CONNECTION_ID/listing-requirements?categoryId=mock-cellphones" \
  -H "Authorization: Bearer mk_your_api_key"

Each item of fields is a field to fill in:

FieldWhat it says
pathwhere the value goes: a canonical field (fiscal.ncm), an attribute (attributes[BRAND]) or a marketplace option (marketplaceOptions.mock.listingType)
scopewhich record carries the value: product, variant, marketplace_product, marketplace_product_variant, listing or binding
requirementrequired (the marketplace refuses without it), recommended (weighs on quality or exposure), optional or conditional (required or not depending on other values; see Check conditional fields)
conditionsempty: the requirement always applies. With items: it only applies when all conditions are true. Each has path, operator (equals, not_equals, in, present, absent) and values

Example. GTIN is required, unless the seller states why there is none (EMPTY_GTIN_REASON):

{
  "path": "attributes[GTIN]",
  "scope": "marketplace_product_variant",
  "requirement": "required",
  "conditions": [
    {
      "path": "attributes[EMPTY_GTIN_REASON]",
      "operator": "absent",
      "values": []
    }
  ]
}

Read it like this: GTIN is required while attributes[EMPTY_GTIN_REASON] is missing (absent). Once the reason is filled in, the condition stops holding and GTIN is no longer required. present and absent take no values.

Each field also has the allowed values, the units (UCUM) and variationAxis, which marks a field that becomes a variation, such as color. Outside the fields, limits has the category caps, like maxPictures. To check a listing against this list, use Validate listing.

Check conditional fields

conditional means the field is required or not depending on other values, by a rule the marketplace does not publish (on Mercado Livre, conditional_required, such as GTIN in Cell phones). It always comes with conditions: []: the list does not explain the rule.

To decide it, send the values chosen so far as attributes[KEY]=value. The value is the field's allowedValues[].value, or free text; for a boolean field, true or false. The brand goes by the id that List brands returns. Up to 50 entries.

curl -g "$BACKEND_URL/v1/connections/$CONNECTION_ID/listing-requirements?categoryId=MLB1055&attributes[BRAND]=Samsung" \
  -H "Authorization: Bearer mk_your_api_key"

With attributes[...], the marketplace decides every conditional field: it comes back as required or optional. In the example, the GTIN of Cell phones comes back required. Typical flow: fetch the requirements, fill the form, and call again with what you chose so far, before publishing.

  • Closed world. With values sent, a key you did not send counts as not filled.
  • Decided conditions. A condition on attributes[...] is resolved: conditions: [] means decided, so read requirement as is. A field whose condition came out false becomes optional. No field disappears from the list.
  • 400 VALIDATION_ERROR: repeated key, invalid key, empty value, value over 500 characters, or more than 50 entries.

Part of Publish listings. Synchronous read, no Job, as in List categories.

Authorization

api_key
headerAuthorizationBearer <token>

API key (mk_...)

Path Parameters

id*string

Identifier of the resource, as returned by the API.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Query Parameters

categoryId?string

The category to describe.

Length1 <= length <= 200
productType?string

The product type to describe, for marketplaces that ask by product type.

Length1 <= length <= 200
catalogProductId?string

A catalog product of the categoryId or productType sent. The API checks that it exists and belongs to them, and the fields the marketplace requires only for catalog listings become required.

Length1 <= length <= 200
attributes?

Attribute values you already have, written as attributes[KEY]=value (KEY is the key of a field, value the value of one of its allowedValues or free text). The marketplace then decides what depends on them: a condition on attributes[...] is settled by what you sent, and a conditional field becomes required or optional. A key you leave out counts as not filled. Fields are never removed. Each key once, up to 50 entries, each value 1 to 500 characters. Omit it for the requirements as the marketplace publishes them.

Propertiesproperties <= 50

Response Body

The fields the category asks for, each with its path, scope, requirement and conditions, and the limits of the category. With attributes, what depends on them is decided: conditions: [] means decided, and no field is left conditional.

application/json
  1. response

What a category asks for before a listing can be published in it.

categoryId*string

The category these requirements are for.

Length1 <= length <= 200
productType*|

The product type of the category, when the marketplace has one. null when it has none.

catalogProductId*|

The catalog product the requirements were asked for, or null when they were asked for the category alone.

fields*array<>

Every field the category asks for.

Itemsitems <= 500
limits*

Limits of the category. A limit the marketplace does not state is left out.

curl -X GET "https://example.com/v1/connections/3d1c8a52-7f0e-4b0a-8a65-9c1b2f6d7e01/listing-requirements?categoryId=mock-cellphones"
{  "categoryId": "mock-cellphones",  "productType": "CELLULAR_PHONE",  "catalogProductId": null,  "fields": [    {      "path": "attributes[BRAND]",      "key": "BRAND",      "label": "Brand",      "scope": "marketplace_product",      "requirement": "required",      "conditions": [],      "valueType": "enum",      "multiple": false,      "maxValues": null,      "allowedValues": [        {          "value": "mock-brand-acme",          "label": "Acme"        }      ],      "allowCustomValue": false,      "allowedUnits": [],      "constraints": {},      "editable": "always",      "variationAxis": false,      "marketplaceData": {}    }  ],  "limits": {    "maxPictures": 10,    "maxVariants": 100  }}