{
  "openapi": "3.1.0",
  "info": {
    "title": "MiddleX API reference",
    "version": "1.0.0",
    "description": "Future Shop, powered by MiddleX. This is the reference for the integration API\nthat your systems call.\n\nThe MiddleX ZKONG API pushes product data to ZKONG electronic shelf labels\nand reports, for every product, what was applied and what was refused.\n\n## Authentication\n\nEvery endpoint requires an OAuth2 client-credentials Bearer token,\n**except** `GET /health` and `POST /get-token` themselves.\n\n1. Call `POST /get-token` with your Auth0 `client_id` and `client_secret` to\n   obtain an access token.\n2. Send it as `Authorization: Bearer <token>` on every other request.\n\nTokens are verified (RS256, against Auth0's published signing keys, with issuer,\naudience and expiry all checked) against the audience configured for the\nenvironment you are calling. Your MiddleX contact supplies your client\ncredentials and the audience for each environment.\n\n## Merchant-mapping prerequisite (onboarding, not a request field)\n\nA client's Auth0 M2M `client_id` must be mapped, out of band, to a\nmerchant (and optionally a store) before it can call `POST /products` or\n`POST /products/extended`. There is no request field for this: tenant\nscoping is resolved exclusively from the authenticated token's\nclient-to-merchant mapping, looked up inside the service's authentication\nlayer, specifically to prevent merchant/agency spoofing via the\nrequest body.\n\n**The mapping must resolve to exactly one merchant.** A `client_id` that\ncannot be attributed to a single tenant is refused; the service does not\npick one of the candidates. A mapping problem therefore\nfails in one of four ways:\n\n- The service's authentication layer rejects **every** authenticated route (not just\n  `/products*`) with `403 {\"error\":\"access_denied\",\"message\":\"Client\n  credentials not authorized\"}` if the client_id has no mapping at all.\n- `403 {\"error\":\"access_denied\",\"message\":\"Client credentials not\n  authorized: mapping is incomplete\"}` if the client_id is mapped but the\n  mapping did not resolve to a merchant that exists and has not been\n  deleted, or, where the mapping designates a store, did not resolve to a\n  store that merchant owns and that has not been deleted. **Five conditions\n  produce this.** It names a merchant that does not exist; the mapping row\n  changed while the request was being authorised; it names a store its own\n  merchant does not own, which is refused rather than\n  served as a merchant-wide mapping, because merchant-wide is broader than\n  the store-scoped mapping the client was provisioned with; the merchant it\n  names has been deleted; or the store it names has been\n  deleted, refused on the same terms, whether or not the\n  request names a `storeId`. A provisioning state on our side, not\n  something the caller can correct.\n- `403 {\"error\":\"access_denied\",\"message\":\"Client credentials not\n  authorized: mapping is ambiguous\"}` if the mapping does not establish\n  exactly one tenant. **Two conditions produce this.** Either the client_id\n  is mapped more than once and the mappings disagree on which tenant to\n  serve; or it is mapped so many times that the service cannot establish\n  that the mappings agree, and so does not assume they do. The request is\n  refused rather than served against a guess. Ask support to correct the\n  mapping.\n\n  Duplicate mappings that all name the same merchant and the same store are\n  served normally, **up to a limit.** A client_id mapped many times beyond\n  it is refused as ambiguous even though the mappings agree. A client\n  provisioned that many times is a provisioning defect to fix, not a\n  supported configuration. Ask support to remove the duplicates.\n- If a token reaches a `/products*` route with no merchant mapping (for\n  example a user token), the service rejects with `403\n  {\"error\":\"Forbidden\",\"code\":\"MERCHANT_MAPPING_REQUIRED\",...}`.\n\nAll three `access_denied` shapes are retried in vain: they are provisioning\nstates, not transient failures. Contact support to configure the\nmapping before integrating.\n\n## Data-loss-relevant: an omitted field is CLEARED, not preserved\n\nEvery push on this API is sent to ZKONG with `emptyNeedDelete=1`. Under\nthat setting ZKONG clears every field the request does not carry a value\nfor: a field sent as an **explicit empty string** (`\"\"`) and a field\n**omitted** from the request are both cleared from the label. An omitted\nfield does NOT mean \"no change\". **Send every field you want ZKONG to keep,\nwith its value, on every request**; a partial payload is accepted, and\neach field it leaves out is wiped.\n\n\"Leaves out\" means absent from the item as MiddleX sends it, which is not\nalways the same as absent from your request. Some fields are defaulted or\nderived before the push, as each field's own description below says: for\nexample `attrCategory`/`attrName` take a default, `price` can fall back to\n`originalPrice`, and `memberPrice` can be synthesised when the merchant's\nmember-price substitution is on. A field MiddleX fills in is sent, with the\nvalue MiddleX gave it, and is not cleared.\n\nThe `priceOmissions` response schema below describes the same behaviour.\n\n`custFeature1`-`custFeature50` differ by endpoint:\n\n- **`POST /products/extended`**: an explicit `\"\"` on a `custFeature` field\n  is passed through to ZKONG rather than stripped, so it clears that field;\n  an omitted one is cleared too. Do not send `\"\"` for a field, or leave it\n  out, unless you intend to delete its current value.\n- **`POST /products`** (core): every `custFeature` field is discarded before\n  the push, whatever the request carried, so none is sent to ZKONG. Under\n  the rule above, a field the request does not carry is cleared, so a core\n  push should be expected to clear custom features set earlier through the\n  extended endpoint.\n\n## Non-blocking truncation warnings\n\nAny string field over its documented `maxLength` is clamped (not\nrejected) before being sent to ZKONG, and reported back as a\n`severity: \"warning\"` entry, not a `severity: \"error\"` entry, in the\nper-product `data[].validation`/`processingErrors` payload. The clamped\nvalue is still synced.\n\n## Rate limiting is environment-gated\n\n`POST /products` and `POST /products/extended` are rate-limited **only where\nrate limiting is enabled for the environment you are calling**. Where it is\nnot enabled, no rate limiting is applied at all, so do not assume 429 is\nalways a reachable response.\n",
    "contact": {
      "name": "MiddleX API support",
      "email": "support@futureshop.com.au"
    }
  },
  "servers": [
    {
      "url": "https://{gatewayHost}/api/v1/zkong",
      "description": "The MiddleX API gateway for your environment.",
      "variables": {
        "gatewayHost": {
          "default": "your-gateway-host.example.com",
          "description": "The gateway host for each environment is supplied by your MiddleX contact. Replace this placeholder with the host they give you."
        }
      }
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "Unauthenticated health/status probe."
    },
    {
      "name": "Auth",
      "description": "Auth0 machine-to-machine token exchange."
    },
    {
      "name": "Status",
      "description": "Authenticated API/environment status."
    },
    {
      "name": "Products",
      "description": "Push product data to ZKONG electronic shelf labels."
    },
    {
      "name": "Configuration",
      "description": "Client-specific field-mapping configuration."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "Health"
        ],
        "summary": "Unauthenticated health check",
        "description": "Returns a static, unauthenticated liveness signal for the ZKONG API: overall `status`, the current server timestamp, the API version, and the converter's field-support counts (23 core, 50 extended, 73 total). It deliberately exposes no uptime or internal metrics. Use it for load-balancer and uptime probes; it never requires a token.",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                },
                "example": {
                  "status": "healthy",
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "api": {
                    "version": "v1"
                  },
                  "converter": {
                    "status": "ready",
                    "fields": {
                      "core": 23,
                      "extended": 50,
                      "total": 73
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Health check itself failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnhealthyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/get-token": {
      "post": {
        "operationId": "getMachineToken",
        "tags": [
          "Auth"
        ],
        "summary": "Exchange Auth0 client credentials for an access token",
        "description": "Thin proxy to Auth0's own client-credentials `/oauth/token` endpoint. On success the **entire Auth0 response body is forwarded verbatim**: this API does not set or normalise `token_type`/`expires_in`/`access_token` itself, so treat the response schema below as indicative of what Auth0 typically returns for this grant type, not as a contract this API enforces.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              },
              "example": {
                "client_id": "exampleClientId0123456789abcdef",
                "client_secret": "example-client-secret-do-not-use"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Auth0's token response, forwarded as-is. `token_type: \"Bearer\"` and `expires_in: 86400` are commonly observed values for this grant type but are not asserted or validated by this API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                },
                "example": {
                  "access_token": "eyJ...example.not.a.real.token",
                  "token_type": "Bearer",
                  "expires_in": 86400,
                  "scope": ""
                }
              }
            }
          },
          "400": {
            "description": "Missing client_id or client_secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestSimple"
                },
                "example": {
                  "error": "Bad Request",
                  "message": "client_id and client_secret are required"
                }
              }
            }
          },
          "502": {
            "description": "Auth0 could not be reached at all (no HTTP response received). If Auth0 *did* respond with an error (e.g. an invalid_client), that status/body is forwarded as-is instead, and is not forced to 502.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenExchangeError"
                },
                "example": {
                  "error": "token_exchange_failed",
                  "message": "Failed to obtain machine token"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "operationId": "getStatus",
        "tags": [
          "Status"
        ],
        "summary": "Authenticated API and environment status",
        "description": "Returns authenticated API and environment status: the API version, the enabled feature flags, a fixed endpoint map, and a sanitised system-health block (overall `status` plus the connectivity of each backing service the API depends on). Use it as an authenticated readiness/diagnostics check; unlike `GET /health` it requires a Bearer token, and it deliberately omits uptime and environment name.",
        "responses": {
          "200": {
            "description": "Current API status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                },
                "example": {
                  "api": {
                    "version": "v1"
                  },
                  "features": {
                    "coreFields": true,
                    "extendedFields": true,
                    "fieldValidation": true,
                    "partialUpdates": true
                  },
                  "endpoints": {
                    "POST /api/v1/zkong/products": "Core fields processing (23 fields)",
                    "POST /api/v1/zkong/products/extended": "Extended fields processing (73 fields)",
                    "GET /api/v1/zkong/health": "Health check",
                    "GET /api/v1/zkong/status": "API status and configuration"
                  },
                  "system": {
                    "status": "healthy",
                    "database": {
                      "status": "connected"
                    },
                    "redis": {
                      "status": "connected"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenAccessDenied"
          },
          "500": {
            "description": "Failed to retrieve status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorSimple"
                },
                "example": {
                  "error": "Internal server error",
                  "message": "Failed to retrieve API status"
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "post": {
        "operationId": "postCoreProducts",
        "tags": [
          "Products"
        ],
        "summary": "Push products using the 23 core ZKONG fields",
        "description": "Batch cap: 5000 products per request. A larger batch is refused with a message that begins `products array cannot exceed 5000 items per request`. Every accepted product is validated for the 3 required fields (`barCode`/`attrCategory`/`attrName`, the latter two defaulted to `\"default\"` if absent) before being queued for push.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoreProductsRequest"
              },
              "example": {
                "products": [
                  {
                    "barcodes": [
                      "9312345678907"
                    ],
                    "name": "Organic Oats 1kg",
                    "prices": [
                      {
                        "originalPrice": 6.5,
                        "price": 5,
                        "memberPrice": 4.5
                      }
                    ],
                    "attrCategory": "Pantry",
                    "attrName": "Cereals"
                  }
                ],
                "storeId": "example-store-001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All submitted products processed with no validation errors.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 0,
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg",
                        "prices": [
                          {
                            "originalPrice": 6.5,
                            "price": 5,
                            "memberPrice": 4.5
                          }
                        ],
                        "attrCategory": "Pantry",
                        "attrName": "Cereals"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg",
                        "originalPrice": 650,
                        "price": 500,
                        "memberPrice": 450,
                        "attrCategory": "Pantry",
                        "attrName": "Cereals",
                        "shortTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 8
                      }
                    }
                  ],
                  "pushResult": {
                    "success": true,
                    "code": 17002,
                    "message": "success"
                  }
                }
              }
            }
          },
          "207": {
            "description": "Some products processed successfully, others failed (see `processingErrors`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 1,
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg",
                        "attrCategory": "default",
                        "attrName": "default",
                        "shortTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 5
                      },
                      "appliedDefaults": [
                        {
                          "field": "attrCategory",
                          "value": "default",
                          "reason": "Field not provided, set to default per ZKONG requirement"
                        },
                        {
                          "field": "attrName",
                          "value": "default",
                          "reason": "Field not provided, set to default per ZKONG requirement"
                        }
                      ]
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": 1,
                      "error": "Conversion failed: Field 'price' must be a non-negative number",
                      "message": "Product processing failed"
                    }
                  ],
                  "pushResult": {
                    "success": true,
                    "code": 17002,
                    "message": "success"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The documented causes: unmapped, incompletely mapped or ambiguously mapped client credentials, store-scope mismatch, a resolved store that cannot be routed because its external id is unusable, store not owned by the resolved merchant, or (rare; see the merchant-mapping prerequisite in the top-level description) no merchant context on the authenticated token. The `ForbiddenAny` schema gives the body for each. They are not the only 403s: the service's authentication layer can refuse the request first, with other bodies, as that schema's description says.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenAny"
                }
              }
            }
          },
          "422": {
            "description": "**No products landed.** On this endpoint that is a statement about the count that LANDED: it is reached when every product failed validation, when every item was dropped before anything was sent to ZKONG, or when ZKONG answered the batch with `success: true` and listed every item sent as failed, so nothing is left once its refusals are subtracted.\n**A push that fails outright (one that produces no `pushResult`) never answers here.** The service lets a push failure decide the status only where its classification CARRIES one, so `vendor-throttled`, `vendor-unrecognised`, `upstream-auth`, `upstream-http`, `transport-timeout`, `transport-unreachable`, `estate-unavailable` and `estate-credential-rejected` answer 502, 503 or 504 below. Two kinds carry none and keep the count-based status: a `vendor-rejected` verdict, which deliberately carries no status so the count keeps deciding a verdict about the caller's data, and a failure this service cannot classify at all. **Both answer `207` through this operation.** Both product operations push only when at least one product converted, and a failed push of these kinds leaves no `pushResult` to subtract refusals from, so the landed count stays at the converted count and is never zero. That includes ZKONG refusing the batch outright: a `success: false` answer carrying `17051` is classified `vendor-rejected`, so it answers 207, not 422.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 0,
                  "errors": 1,
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [],
                  "processingErrors": [
                    {
                      "productIndex": 0,
                      "error": "Conversion failed: Field 'price' must be a non-negative number",
                      "message": "Product processing failed"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "This service classified the push outcome into a category that carries a status of its own and overrides the count-based one. Four categories answer 502 and are described here. A timeout (`transport-timeout`) answers 504, and an exhausted vendor throttle (`vendor-throttled`) and a failed login to the estate (`estate-unavailable` and `estate-credential-rejected`) answer 503: see those responses. **That is a statement about the classification, not about who caused the failure**: `upstream-http` covers every non-2xx HTTP status other than 401 and 403, including a 4xx such as 400, and nothing in this response establishes whether the request played a part in it. The four that answer 502 are reported on the `processingErrors` entry as `category`: `upstream-auth` (the push got a 401 or 403 HTTP status to THIS SERVICE's own credential, from ZKONG or from something in front of it, so no caller action helps and `retryable` is `false`), `upstream-http` (the push got any other non-2xx HTTP status, from the same possible sources; `retryable` is `true` only for a 5xx or a 429), `transport-unreachable` (no answer arrived and the request did not time out), and `vendor-unrecognised` (ZKONG answered with a result code this service does not know how to read).\n**`vendor-unrecognised` does not mean ZKONG refused.** It means its answer was unreadable, and that reaches this status two ways. On an explicit `success: false` carrying an unknown code the attempt this service gave up on definitely did not succeed, though an earlier attempt in the same request may have (see `outcomeUncertain` on `ProcessingError`). On a `success: true` carrying an unknown code it may well have applied: that path sets `processed` to 0 and carries `outcomeUncertain: true`, and a client must not treat it as a rejection.\n**The failures described in this section (`upstream-auth`, `upstream-http`, `transport-unreachable` and `transport-timeout`) do not answer `207`.** A `207` is the count-based answer, about how many of the caller's products worked, and these failures carry **no reliable vendor verdict** on the batch. What each case does establish differs, so do not read one rule across them: on `upstream-auth` and `upstream-http` an HTTP answer arrived, from ZKONG or from something in front of it; on `transport-unreachable` no HTTP answer arrived; and on `transport-timeout`, which answers `504`, the push may have reached ZKONG and applied. Branch on `category` and `retryable`, not on the status alone.\n**`processed` is `0` where the push got no answer from the estate, and is not where it did**. On `upstream-http` for a 5xx and on `transport-unreachable` where the request left this service or failed with a transport code (a refused, reset or broken connection, a DNS failure, an unreachable or down host or network; a timeout answers 504, below), nothing came back from ZKONG, so `processed` is `0` and `pushResult` is absent. A `transport-unreachable` error raised while this service was building the request, or one that is not an HTTP-client error at all, is this service's own fault and not an estate outage: it leaves `processed` at the converted count and carries no `outcomeUncertain`. `data` still carries the converted rows. Their presence establishes neither delivery nor non-delivery: whether the push may have applied is what `outcomeUncertain` says, not `data`. The entry states `outcomeUncertain` either way on these classes. It is `true` for a 5xx, and for a connection that was reset or broken after the request was sent, or whose error carried no code: the request may have reached ZKONG, and a label may have been updated. It is `false` for a refused connection, a DNS failure and an unreachable or down host or network, where no connection was made and nothing was sent on that attempt. On `upstream-auth`, on `upstream-http` for a status below 500, and on `vendor-unrecognised` for a `success: false` answer that made the push fail outright, ZKONG DID answer, and `processed` still reports the products that CONVERTED and `data` still carries them, although none of them reached a label; the single `processingErrors` entry with `productIndex: \"all\"` is what says the batch did not land.\n**What a caller does next depends on the entry, not on the status alone.** Read `category`, `retryable` and `outcomeUncertain` on the `processingErrors` entry. With `retryable: true` and `outcomeUncertain` `false` or absent, the update did not land on the attempt this service gave up on, but a stated `false` does not cover an earlier attempt in the same request, which may have applied (see `outcomeUncertain` on `ProcessingError`): reconcile first, then send it again. Reconciling means finding out what reached the labels before the batch is sent again. The exception is `estate-credential-rejected`, which answers 503: a resend fails until MiddleX corrects the credential, so see that response. With `outcomeUncertain: true` it may already have applied, in whole or in part, so do not resend automatically: reconcile first. With `retryable: false`, do not resend until the cause named by `category` is fixed, whatever `outcomeUncertain` says; an unreadable `success: true` answer is both `retryable: false` and `outcomeUncertain: true`, so it needs reconciling, not a resend. This service stores nothing about a failed push, so an update that is not resent is lost.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 1,
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 5
                      }
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": "all",
                      "error": "Request failed with status code 401",
                      "message": "ZKONG push failed",
                      "category": "upstream-auth",
                      "retryable": false
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Three classifications answer 503, told apart by `category`: `estate-unavailable` and `estate-credential-rejected` (the login failed, so no push was sent), and `vendor-throttled`.\n**`estate-unavailable` and `estate-credential-rejected`: the push got no answer from the estate because the login failed**. Logging in to ZKONG failed, after this service's retries, before any push was sent. `estate-credential-rejected` is the case where ZKONG answered the login call and refused it: the credential this service holds for the merchant has to be corrected by an operator, so an immediate resend fails until it is. `estate-unavailable` is every other login failure: a timeout, a network fault, an HTTP error on the login call, or a local fault. Both carry `retryable: true`, because the update did not land on that attempt and is to be sent again, after reconciling, once the cause clears; `outcomeUncertain: false`, because no push was sent on the attempt this service gave up on; and `processed: 0`. `data` still carries the converted rows, whose presence establishes neither delivery nor non-delivery, and `pushResult` is absent. A login that fails on a retry can follow an earlier attempt that timed out and may have applied, which is why the resend follows a reconcile; see `outcomeUncertain` on `ProcessingError`. For `estate-credential-rejected` the cause clears only when MiddleX corrects the credential, so the caller stops resending, contacts support with the `requestId`, and keeps the update; once support confirms the credential is corrected, it reconciles and resends. Nothing is held for the caller: this service stores nothing about a failed push, so a caller that does not resend loses the update.\n**`vendor-throttled`.** ZKONG refused the batch with its throttle code (`10047`) on the attempt at which this service's retry budget ran out; see below for what that does and does not say about earlier attempts. `retryable` is `true`, because the refusal is transient by nature and a later resend, after reconciling, is the intended response.\n**Do not read this as \"nothing was applied\".** Both product operations push their batch as one page, and re-send that page on each retry. What this response establishes is that the attempt this service gave up on was refused with the throttle code once its retry budget for the request was spent, by the count cap (on the number of retries), the total throttle backoff ceiling or the push deadline. It does not establish that every earlier attempt was refused the same way: that budget is shared with transport retries, so an earlier attempt in the same request can have failed differently, including by timing out, and a timed-out attempt may have reached ZKONG and applied. The entry carries no `outcomeUncertain`, which is read as `false` for every `vendor-throttled` failure. That describes the refusal this service gave up on, not a finding that no earlier attempt applied. Nothing in this response says which, so a resend is not guaranteed to be a no-op. Reconcile first, then resend.\nOn `vendor-throttled`, `processed` and `data` are not zeroed, because ZKONG did answer, and `pushResult` is absent: see the note on the 502 response above.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "examples": {
                  "vendorThrottled": {
                    "summary": "ZKONG refused the batch with its throttle code",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 1,
                      "errors": 1,
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "ZKONG refused the batch: code=10047",
                          "message": "ZKONG push failed",
                          "category": "vendor-throttled",
                          "retryable": true,
                          "zkongCode": 10047
                        }
                      ]
                    }
                  },
                  "estateCredentialRejected": {
                    "summary": "The login was refused, so nothing was sent",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 0,
                      "errors": 1,
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "Login failed.",
                          "message": "ZKONG push failed",
                          "category": "estate-credential-rejected",
                          "retryable": true,
                          "outcomeUncertain": false
                        }
                      ]
                    }
                  },
                  "estateUnavailable": {
                    "summary": "The login failed for another reason, so nothing was sent",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 0,
                      "errors": 1,
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "Login failed.",
                          "message": "ZKONG push failed",
                          "category": "estate-unavailable",
                          "retryable": true,
                          "outcomeUncertain": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "No answer arrived from ZKONG within the deadline. Classified `transport-timeout`. **A client must NOT read a timeout as \"the push did not happen\"**, and nor any 502 whose entry carries `outcomeUncertain: true` (see the 502 response). On a timeout the request may have reached ZKONG and applied, in whole or in part, so the entry carries `outcomeUncertain: true` and a blind resend can duplicate work. Which items landed is not reported, because this service does not know; see `outcomeUncertain` on `ProcessingError`. A REFUSED connection is deliberately not reported here. That attempt definitely did not apply, so it answers 502 as `transport-unreachable`, and collapsing the two would destroy the distinction that matters most on this response. It says nothing about an earlier attempt in the same request; see `outcomeUncertain` on `ProcessingError`.\n`processed` is `0` here and `pushResult` is absent: see the note on the 502 response above.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 0,
                  "errors": 1,
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 5
                      }
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": "all",
                      "error": "timeout of 0ms exceeded",
                      "message": "ZKONG push failed",
                      "category": "transport-timeout",
                      "retryable": true,
                      "outcomeUncertain": true
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/products/extended": {
      "post": {
        "operationId": "postExtendedProducts",
        "tags": [
          "Products"
        ],
        "summary": "Push products using the 23 core + up to 50 extended (custFeature1-50) ZKONG fields",
        "description": "Batch cap: 1000 products per request (stricter than `/products` because of the larger `custFeature1`-`custFeature50` payload per item). Response includes `fieldSupport` reporting the field counts this deployment actually enforces.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtendedProductsRequest"
              },
              "example": {
                "products": [
                  {
                    "barcodes": [
                      "9312345678907"
                    ],
                    "name": "Steel Bottle 750ml",
                    "prices": [
                      {
                        "originalPrice": 35,
                        "price": 29,
                        "memberPrice": 25
                      }
                    ],
                    "attrCategory": "Homewares",
                    "attrName": "Drinkware",
                    "custFeature1": "Stainless Steel",
                    "custFeature2": "750ml"
                  }
                ],
                "clientConfig": {
                  "client": "generic"
                },
                "storeId": "example-store-001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "All submitted products processed with no blocking (severity=error) validation errors.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 0,
                  "fieldSupport": {
                    "core": 23,
                    "extended": 50,
                    "total": 73
                  },
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Steel Bottle 750ml",
                        "prices": [
                          {
                            "originalPrice": 35,
                            "price": 29,
                            "memberPrice": 25
                          }
                        ],
                        "attrCategory": "Homewares",
                        "attrName": "Drinkware",
                        "custFeature1": "Stainless Steel",
                        "custFeature2": "750ml"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Steel Bottle 750ml",
                        "originalPrice": 3500,
                        "price": 2900,
                        "memberPrice": 2500,
                        "attrCategory": "Homewares",
                        "attrName": "Drinkware",
                        "shortTitle": "Steel Bottle 750ml",
                        "custFeature1": "Stainless Steel",
                        "custFeature2": "750ml"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 11,
                        "errors": 0,
                        "warnings": 0
                      }
                    }
                  ],
                  "pushResult": {
                    "success": true,
                    "code": 17002,
                    "message": "success"
                  }
                }
              }
            }
          },
          "207": {
            "description": "Some products processed successfully, others failed (see `processingErrors`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 1,
                  "fieldSupport": {
                    "core": 23,
                    "extended": 50,
                    "total": 73
                  },
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9300000000011"
                        ],
                        "name": "Glass Jar 500ml",
                        "prices": [
                          {
                            "originalPrice": 100,
                            "memberPrice": 40
                          }
                        ]
                      },
                      "zkongData": {
                        "barCode": "9300000000011",
                        "itemTitle": "Glass Jar 500ml",
                        "originalPrice": 10000,
                        "price": 10000,
                        "memberPrice": 4000,
                        "attrCategory": "default",
                        "attrName": "default",
                        "shortTitle": "Glass Jar 500ml"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 9,
                        "errors": 0,
                        "warnings": 1
                      },
                      "appliedDefaults": [
                        {
                          "field": "attrCategory",
                          "value": "default",
                          "reason": "Field not provided, set to default per ZKONG requirement"
                        },
                        {
                          "field": "attrName",
                          "value": "default",
                          "reason": "Field not provided, set to default per ZKONG requirement"
                        }
                      ]
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": 1,
                      "errors": [
                        {
                          "field": "memberPrice",
                          "error": "business_rule_violation",
                          "message": "Member price cannot be higher than original price",
                          "value": "memberPrice: 8000, originalPrice: 5000",
                          "severity": "error"
                        }
                      ],
                      "message": "Product validation failed"
                    }
                  ],
                  "pushResult": {
                    "success": true,
                    "code": 17002,
                    "message": "success"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Same set of causes as `POST /products`. See that operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenAny"
                }
              }
            }
          },
          "422": {
            "description": "**No products landed**, on the same rule as `POST /products`: every product failed validation, every item was dropped before anything was sent to ZKONG, or ZKONG answered the batch with `success: true` and listed every item sent as failed. A push that fails outright (one that produces no `pushResult`) never answers here: one whose classification carries a status answers 502, 503 or 504, and a `vendor-rejected` verdict or an unclassified outright failure answers 207. See that operation's `422` for why a push that fails outright cannot reach this status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 0,
                  "errors": 1,
                  "fieldSupport": {
                    "core": 23,
                    "extended": 50,
                    "total": 73
                  },
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [],
                  "processingErrors": [
                    {
                      "productIndex": 0,
                      "errors": [
                        {
                          "field": "memberPrice",
                          "error": "business_rule_violation",
                          "message": "Member price cannot be higher than original price",
                          "value": "memberPrice: 8000, originalPrice: 5000",
                          "severity": "error"
                        }
                      ],
                      "message": "Product validation failed"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "description": "This service classified the push outcome into a category that carries a status of its own and overrides the count-based one. Four categories answer 502 and are described here. A timeout (`transport-timeout`) answers 504, and an exhausted vendor throttle (`vendor-throttled`) and a failed login to the estate (`estate-unavailable` and `estate-credential-rejected`) answer 503: see those responses. **That is a statement about the classification, not about who caused the failure**: `upstream-http` covers every non-2xx HTTP status other than 401 and 403, including a 4xx such as 400, and nothing in this response establishes whether the request played a part in it. The four that answer 502 are reported on the `processingErrors` entry as `category`: `upstream-auth` (the push got a 401 or 403 HTTP status to THIS SERVICE's own credential, from ZKONG or from something in front of it, so no caller action helps and `retryable` is `false`), `upstream-http` (the push got any other non-2xx HTTP status, from the same possible sources; `retryable` is `true` only for a 5xx or a 429), `transport-unreachable` (no answer arrived and the request did not time out), and `vendor-unrecognised` (ZKONG answered with a result code this service does not know how to read).\n**`vendor-unrecognised` does not mean ZKONG refused.** It means its answer was unreadable, and that reaches this status two ways. On an explicit `success: false` carrying an unknown code the attempt this service gave up on definitely did not succeed, though an earlier attempt in the same request may have (see `outcomeUncertain` on `ProcessingError`). On a `success: true` carrying an unknown code it may well have applied: that path sets `processed` to 0 and carries `outcomeUncertain: true`, and a client must not treat it as a rejection.\n**The failures described in this section (`upstream-auth`, `upstream-http`, `transport-unreachable` and `transport-timeout`) do not answer `207`.** A `207` is the count-based answer, about how many of the caller's products worked, and these failures carry **no reliable vendor verdict** on the batch. What each case does establish differs, so do not read one rule across them: on `upstream-auth` and `upstream-http` an HTTP answer arrived, from ZKONG or from something in front of it; on `transport-unreachable` no HTTP answer arrived; and on `transport-timeout`, which answers `504`, the push may have reached ZKONG and applied. Branch on `category` and `retryable`, not on the status alone.\n**`processed` is `0` where the push got no answer from the estate, and is not where it did.** On `upstream-http` for a 5xx and on `transport-unreachable` where the request left this service or failed with a transport code (a refused, reset or broken connection, a DNS failure, an unreachable or down host or network; a timeout answers 504, below), nothing came back from ZKONG, so `processed` is `0` and `pushResult` is absent. A `transport-unreachable` error raised while this service was building the request, or one that is not an HTTP-client error at all, is this service's own fault and not an estate outage: `processed` is the converted count and there is no `outcomeUncertain`. `data` still carries the converted rows. Their presence establishes neither delivery nor non-delivery: whether the push may have applied is what `outcomeUncertain` says, not `data`. The entry states `outcomeUncertain` either way on these classes. It is `true` for a 5xx, and for a connection that was reset or broken after the request was sent, or whose error carried no code: the request may have reached ZKONG, and a label may have been updated. It is `false` for a refused connection, a DNS failure and an unreachable or down host or network, where no connection was made and nothing was sent on that attempt. On `upstream-auth`, on `upstream-http` for a status below 500, and on `vendor-unrecognised` for a `success: false` answer that made the push fail outright, ZKONG DID answer, and `processed` still reports the products that CONVERTED and `data` still carries them, although none of them reached a label; the single `processingErrors` entry with `productIndex: \"all\"` is what says the batch did not land.\n**What a caller does next depends on the entry, not on the status alone.** Read `category`, `retryable` and `outcomeUncertain` on the `processingErrors` entry. With `retryable: true` and `outcomeUncertain` `false` or absent, the update did not land on the attempt this service gave up on, but a stated `false` does not cover an earlier attempt in the same request, which may have applied (see `outcomeUncertain` on `ProcessingError`): reconcile first, then send it again. Reconciling means finding out what reached the labels before the batch is sent again. The exception is `estate-credential-rejected`, which answers 503: a resend fails until MiddleX corrects the credential, so see that response. With `outcomeUncertain: true` it may already have applied, in whole or in part, so do not resend automatically: reconcile first. With `retryable: false`, do not resend until the cause named by `category` is fixed, whatever `outcomeUncertain` says; an unreadable `success: true` answer is both `retryable: false` and `outcomeUncertain: true`, so it needs reconciling, not a resend. This service stores nothing about a failed push, so an update that is not resent is lost.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 1,
                  "errors": 1,
                  "fieldSupport": {
                    "core": 23,
                    "extended": 50,
                    "total": 73
                  },
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 5
                      }
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": "all",
                      "error": "Request failed with status code 401",
                      "message": "ZKONG push failed",
                      "category": "upstream-auth",
                      "retryable": false
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Three classifications answer 503, told apart by `category`: `estate-unavailable` and `estate-credential-rejected` (the login failed, so no push was sent), and `vendor-throttled`.\n**`estate-unavailable` and `estate-credential-rejected`: the push got no answer from the estate because the login failed.** Logging in to ZKONG failed, after this service's retries, before any push was sent. `estate-credential-rejected` is the case where ZKONG answered the login call and refused it: the credential this service holds for the merchant has to be corrected by an operator, so an immediate resend fails until it is. `estate-unavailable` is every other login failure: a timeout, a network fault, an HTTP error on the login call, or a local fault. Both carry `retryable: true`, because the update did not land on that attempt and is to be sent again, after reconciling, once the cause clears; `outcomeUncertain: false`, because no push was sent on the attempt this service gave up on; and `processed: 0`. `data` still carries the converted rows, whose presence establishes neither delivery nor non-delivery, and `pushResult` is absent. A login that fails on a retry can follow an earlier attempt that timed out and may have applied, which is why the resend follows a reconcile; see `outcomeUncertain` on `ProcessingError`. For `estate-credential-rejected` the cause clears only when MiddleX corrects the credential, so the caller stops resending, contacts support with the `requestId`, and keeps the update; once support confirms the credential is corrected, it reconciles and resends. Nothing is held for the caller: this service stores nothing about a failed push, so a caller that does not resend loses the update.\n**`vendor-throttled`.** ZKONG refused the batch with its throttle code (`10047`) on the attempt at which this service's retry budget ran out; see below for what that does and does not say about earlier attempts. `retryable` is `true`, because the refusal is transient by nature and a later resend, after reconciling, is the intended response.\n**Do not read this as \"nothing was applied\".** Both product operations push their batch as one page, and re-send that page on each retry. What this response establishes is that the attempt this service gave up on was refused with the throttle code once its retry budget for the request was spent, by the count cap (on the number of retries), the total throttle backoff ceiling or the push deadline. It does not establish that every earlier attempt was refused the same way: that budget is shared with transport retries, so an earlier attempt in the same request can have failed differently, including by timing out, and a timed-out attempt may have reached ZKONG and applied. The entry carries no `outcomeUncertain`; for `vendor-throttled` it is to be read as `false`. That describes the refusal this service gave up on, not a finding that no earlier attempt applied. Nothing in this response says which, so a resend is not guaranteed to be a no-op. Reconcile first, then resend.\nOn `vendor-throttled`, `processed` and `data` are not zeroed, because ZKONG did answer, and `pushResult` is absent: see the note on the 502 response above.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "examples": {
                  "vendorThrottled": {
                    "summary": "ZKONG refused the batch with its throttle code",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 1,
                      "errors": 1,
                      "fieldSupport": {
                        "core": 23,
                        "extended": 50,
                        "total": 73
                      },
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "ZKONG refused the batch: code=10047",
                          "message": "ZKONG push failed",
                          "category": "vendor-throttled",
                          "retryable": true,
                          "zkongCode": 10047
                        }
                      ]
                    }
                  },
                  "estateCredentialRejected": {
                    "summary": "The login was refused, so nothing was sent",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 0,
                      "errors": 1,
                      "fieldSupport": {
                        "core": 23,
                        "extended": 50,
                        "total": 73
                      },
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "Login failed.",
                          "message": "ZKONG push failed",
                          "category": "estate-credential-rejected",
                          "retryable": true,
                          "outcomeUncertain": false
                        }
                      ]
                    }
                  },
                  "estateUnavailable": {
                    "summary": "The login failed for another reason, so nothing was sent",
                    "value": {
                      "requestId": "req-1751500800000",
                      "processed": 0,
                      "errors": 1,
                      "fieldSupport": {
                        "core": 23,
                        "extended": 50,
                        "total": 73
                      },
                      "timestamp": "2026-07-03T00:00:00.000Z",
                      "data": [
                        {
                          "originalProduct": {
                            "barcodes": [
                              "9312345678907"
                            ],
                            "name": "Organic Oats 1kg"
                          },
                          "zkongData": {
                            "barCode": "9312345678907",
                            "itemTitle": "Organic Oats 1kg"
                          },
                          "validation": {
                            "status": "valid",
                            "fieldCount": 5
                          }
                        }
                      ],
                      "processingErrors": [
                        {
                          "productIndex": "all",
                          "error": "Login failed.",
                          "message": "ZKONG push failed",
                          "category": "estate-unavailable",
                          "retryable": true,
                          "outcomeUncertain": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "No answer arrived from ZKONG within the deadline. Classified `transport-timeout`. **A client must NOT read a timeout as \"the push did not happen\"**, and nor any 502 whose entry carries `outcomeUncertain: true` (see the 502 response). On a timeout the request may have reached ZKONG and applied, in whole or in part, so the entry carries `outcomeUncertain: true` and a blind resend can duplicate work. Which items landed is not reported, because this service does not know; see `outcomeUncertain` on `ProcessingError`. A REFUSED connection is deliberately not reported here. That attempt definitely did not apply, so it answers 502 as `transport-unreachable`, and collapsing the two would destroy the distinction that matters most on this response. It says nothing about an earlier attempt in the same request; see `outcomeUncertain` on `ProcessingError`.\n`processed` is `0` here and `pushResult` is absent: see the note on the 502 response above.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtendedProductsResponse"
                },
                "example": {
                  "requestId": "req-1751500800000",
                  "processed": 0,
                  "errors": 1,
                  "fieldSupport": {
                    "core": 23,
                    "extended": 50,
                    "total": 73
                  },
                  "timestamp": "2026-07-03T00:00:00.000Z",
                  "data": [
                    {
                      "originalProduct": {
                        "barcodes": [
                          "9312345678907"
                        ],
                        "name": "Organic Oats 1kg"
                      },
                      "zkongData": {
                        "barCode": "9312345678907",
                        "itemTitle": "Organic Oats 1kg"
                      },
                      "validation": {
                        "status": "valid",
                        "fieldCount": 5
                      }
                    }
                  ],
                  "processingErrors": [
                    {
                      "productIndex": "all",
                      "error": "timeout of 0ms exceeded",
                      "message": "ZKONG push failed",
                      "category": "transport-timeout",
                      "retryable": true,
                      "outcomeUncertain": true
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/config": {
      "get": {
        "operationId": "listConfigurations",
        "tags": [
          "Configuration"
        ],
        "summary": "List the field-mapping configurations available to the calling client",
        "description": "Lists the configurations THIS caller may use: the `generic` default, which every client may use, plus the caller's own specialised configuration if its merchant resolves to one. Another client's specialised configuration is never listed. Each entry carries its display name, field-support counts and feature list, and `defaultClient` (`generic`) names the configuration applied when none is selected. The map is fixed in the service, not read from a datastore. Use it to discover the valid `clientConfig.client` values before pushing extended products.",
        "responses": {
          "200": {
            "description": "The configurations available to the calling client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigListResponse"
                },
                "example": {
                  "availableConfigurations": {
                    "generic": {
                      "name": "Generic Configuration",
                      "description": "Standard field mapping for all clients",
                      "fields": {
                        "core": 23,
                        "extended": 50,
                        "total": 73
                      },
                      "features": [
                        "coreFields",
                        "extendedFields",
                        "standardValidation"
                      ]
                    }
                  },
                  "defaultClient": "generic"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenAccessDenied"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/config/{clientId}": {
      "get": {
        "operationId": "getConfiguration",
        "tags": [
          "Configuration"
        ],
        "summary": "Get one client's field-mapping configuration",
        "description": "Returns a configuration the CALLING client is entitled to: `generic`, which every client may read, or the caller's own specialised configuration. Any other key is refused with 403, including a key that does not exist, so the response cannot be used to discover another client's configuration key. The keys are the fixed keys of the service's configuration map. A specialised configuration can report different field totals from `generic`, which is 23 core + 50 extended = 73.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested client's configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigResponse"
                },
                "example": {
                  "client": "generic",
                  "configuration": {
                    "name": "Generic Configuration",
                    "description": "Standard field mapping for all clients",
                    "fields": {
                      "core": 23,
                      "extended": 50,
                      "total": 73
                    },
                    "features": [
                      "coreFields",
                      "extendedFields",
                      "standardValidation"
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The caller is not entitled to this configuration key. Returned for an unknown key as well as for another client's key, so the two are indistinguishable.\nThis operation can additionally return any `access_denied` body described under the shared `ForbiddenAccessDenied` response. Of those, the unmapped, incomplete and ambiguous client-to-merchant mapping bodies are a subset: the token carrying no subject, and a machine token carrying no client identifier, are also possible and are not mapping causes. All of them carry `error: access_denied`; the entitlement body below carries `error: Forbidden`, which is what tells them apart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorSimple"
                },
                "examples": {
                  "notEntitled": {
                    "summary": "The configuration key is not this client's",
                    "value": {
                      "error": "Forbidden",
                      "message": "Configuration is scoped to the calling client"
                    }
                  },
                  "mappingAmbiguous": {
                    "summary": "The caller's merchant mapping does not resolve to one merchant",
                    "value": {
                      "error": "access_denied",
                      "message": "Client credentials not authorized: mapping is ambiguous"
                    }
                  },
                  "tokenSubjectMissing": {
                    "summary": "The verified token carries no subject",
                    "value": {
                      "error": "access_denied",
                      "message": "Token subject missing"
                    }
                  },
                  "clientIdentifierMissing": {
                    "summary": "A machine token that authenticates but carries no client identifier",
                    "value": {
                      "error": "access_denied",
                      "message": "Client credentials not recognized"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Auth0-issued access token obtained from `POST /get-token`. Verified locally (RS256/JWKS, issuer, audience, expiry). See the top-level Authentication section for the full flow and the merchant-mapping prerequisite."
      }
    },
    "parameters": {},
    "responses": {
      "Unauthorized": {
        "description": "No (or an unparseable) Authorization header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorSimple"
            },
            "example": {
              "error": "access_denied",
              "message": "Unauthorized"
            }
          }
        }
      },
      "ForbiddenAccessDenied": {
        "description": "Token subject missing, or (machine tokens) the token carries no client identifier, or the client_id's merchant mapping does not resolve to exactly one merchant. The service's authentication layer guards every authenticated operation, so all five bodies below can be returned by any of them, not only the product endpoints. The three mapping causes are separable by message. The missing-client-identifier body is refused before any mapping lookup, so it is not one of the three mapping causes.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorSimple"
            },
            "examples": {
              "tokenSubjectMissing": {
                "summary": "The verified token carries no subject",
                "value": {
                  "error": "access_denied",
                  "message": "Token subject missing"
                }
              },
              "clientIdentifierMissing": {
                "summary": "A machine token that authenticates but carries no client identifier",
                "value": {
                  "error": "access_denied",
                  "message": "Client credentials not recognized"
                }
              },
              "clientUnmapped": {
                "summary": "The client_id has no merchant mapping at all",
                "value": {
                  "error": "access_denied",
                  "message": "Client credentials not authorized"
                }
              },
              "mappingIncomplete": {
                "summary": "Mapped, but not to a merchant that exists and has not been deleted, or not to a store that merchant owns and that has not been deleted (provisioning error)",
                "value": {
                  "error": "access_denied",
                  "message": "Client credentials not authorized: mapping is incomplete"
                }
              },
              "mappingAmbiguous": {
                "summary": "Mapped more than once with the mappings disagreeing on the tenant, or mapped so many times that the service cannot establish that the mappings agree. Refused rather than served against a guess.",
                "value": {
                  "error": "access_denied",
                  "message": "Client credentials not authorized: mapping is ambiguous"
                }
              }
            }
          }
        }
      },
      "ForbiddenAny": {
        "description": "See the `ForbiddenAny` schema for the documented causes and their bodies. It is not the full set; its description names what else can answer 403.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ForbiddenAny"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Request body failed structural validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationErrorResponse"
            },
            "example": {
              "error": "Validation Error",
              "message": "Request validation failed",
              "details": [
                "products[0].barcodes is required"
              ],
              "requestId": "req-1751500800000"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit exceeded. Only reachable where rate limiting is enabled. See the top-level Rate limiting section.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TooManyRequestsResponse"
            },
            "example": {
              "error": "too_many_requests",
              "message": "Rate limit exceeded. Try again shortly."
            }
          }
        }
      },
      "InternalError": {
        "description": "Unhandled server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InternalErrorWithRequestId"
            },
            "example": {
              "error": "Internal server error",
              "message": "Failed to process products",
              "requestId": "req-1751500800000"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorSimple": {
        "type": "object",
        "description": "Minimal `{ error, message }` error envelope used by the shared 401/403 responses.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Short machine-readable error code (e.g. `access_denied`)."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the error."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "BadRequestSimple": {
        "type": "object",
        "description": "400 body returned by `POST /get-token` when a required credential is missing.",
        "properties": {
          "error": {
            "type": "string",
            "const": "Bad Request",
            "description": "Always the literal `Bad Request`."
          },
          "message": {
            "type": "string",
            "description": "Which credential was missing (e.g. `client_id and client_secret are required`)."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "InternalErrorSimple": {
        "type": "object",
        "description": "Minimal `{ error, message }` 500 body that carries no `requestId` (used by `GET /status`).",
        "properties": {
          "error": {
            "type": "string",
            "description": "Short error label (e.g. `Internal server error`)."
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the failure."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "InternalErrorWithRequestId": {
        "type": "object",
        "description": "500 error envelope that also echoes the `requestId` for log correlation (used by the products endpoints via the shared InternalError response).",
        "properties": {
          "error": {
            "type": "string",
            "const": "Internal server error",
            "description": "Always the literal `Internal server error`."
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the failure."
          },
          "requestId": {
            "type": "string",
            "description": "The request's correlation id, echoed for log tracing (the `x-request-id` header, truncated to 200 characters, when supplied, otherwise a generated `req-<epoch-ms>`)."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "TokenExchangeError": {
        "type": "object",
        "description": "Error body returned by `POST /get-token` when the Auth0 token exchange did not yield a token.",
        "properties": {
          "error": {
            "type": "string",
            "description": "`token_exchange_failed` when Auth0 could not be reached at all; otherwise Auth0's own `error` field, forwarded as-is (e.g. `invalid_client`), together with whatever HTTP status Auth0 sent."
          },
          "message": {
            "type": "string",
            "description": "Human-readable failure reason (Auth0's `error_description`/`message` when present, otherwise `Failed to obtain machine token`)."
          }
        },
        "required": [
          "error",
          "message"
        ]
      },
      "ValidationErrorResponse": {
        "type": "object",
        "description": "400 body returned when request-body structural validation fails, listing each failure as a human-readable string.",
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "Validation Error"
            ],
            "description": "Always the literal `Validation Error`."
          },
          "message": {
            "type": "string",
            "description": "Top-level validation summary (e.g. `Request validation failed`)."
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Human-readable validation failure strings (not the ValidationIssue object shape used inside product results)."
          },
          "requestId": {
            "type": "string",
            "description": "The request's correlation id, echoed for log tracing (the `x-request-id` header, truncated to 200 characters, when supplied, otherwise a generated `req-<epoch-ms>`)."
          }
        },
        "required": [
          "error",
          "message",
          "details",
          "requestId"
        ]
      },
      "TooManyRequestsResponse": {
        "type": "object",
        "description": "429 rate-limit body. Deliberately has no `statusCode` field.",
        "properties": {
          "error": {
            "type": "string",
            "const": "too_many_requests",
            "description": "Always the literal `too_many_requests`."
          },
          "message": {
            "type": "string",
            "description": "Human-readable rate-limit message (e.g. `Rate limit exceeded. Try again shortly.`)."
          }
        },
        "required": [
          "error",
          "message"
        ],
        "additionalProperties": false
      },
      "ForbiddenAny": {
        "description": "Seven 403 shapes, one per cause below; `oneOf` is illustrative, not a discriminated union. The list is not exhaustive: the service's authentication layer, which guards every authenticated operation, can also answer 403 bodies that are not listed here, for example `Token subject missing` (see the `ForbiddenAccessDenied` response).",
        "oneOf": [
          {
            "title": "Unmapped client credentials (all authenticated routes)",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "const": "access_denied",
                "description": "Always the literal `access_denied`."
              },
              "message": {
                "type": "string",
                "const": "Client credentials not authorized",
                "description": "Always the literal `Client credentials not authorized`."
              }
            }
          },
          {
            "title": "Incomplete client-to-merchant mapping (all authenticated routes)",
            "type": "object",
            "description": "The client_id is mapped, but the mapping did not resolve to a merchant that exists and has not been deleted, or, where it designates a store, to a store that merchant owns and that has not been deleted. Five conditions produce this: it names a merchant that does not exist; the mapping changed while the request was being authorised; it names a store its own merchant does not own; the merchant it names has been deleted; or the store it names has been deleted. It is a provisioning state on our side, not something the caller can correct.",
            "properties": {
              "error": {
                "type": "string",
                "const": "access_denied",
                "description": "Always the literal `access_denied`."
              },
              "message": {
                "type": "string",
                "const": "Client credentials not authorized: mapping is incomplete",
                "description": "Always this literal."
              }
            }
          },
          {
            "title": "Ambiguous client-to-merchant mapping (all authenticated routes)",
            "type": "object",
            "description": "The client_id's mapping does not establish exactly one tenant, so the request is refused rather than attributed to one of the candidates. Two conditions produce this: mappings that disagree on which tenant to serve, and a client mapped so many times that the service cannot establish that the mappings agree, so it does not assume they do. The conflicting merchants are deliberately NOT named in the response. Duplicate mappings that all name the same merchant and the same store do not produce this shape.",
            "properties": {
              "error": {
                "type": "string",
                "const": "access_denied",
                "description": "Always the literal `access_denied`."
              },
              "message": {
                "type": "string",
                "const": "Client credentials not authorized: mapping is ambiguous",
                "description": "Always this literal."
              }
            }
          },
          {
            "title": "Store scope mismatch (products endpoints)",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "const": "Forbidden",
                "description": "Always the literal `Forbidden`."
              },
              "message": {
                "type": "string",
                "description": "States the store scope the token is restricted to."
              },
              "requestId": {
                "type": "string",
                "description": "The request's correlation id (the `x-request-id` header truncated to 200 characters when supplied; otherwise a generated `req-<epoch-ms>`)."
              }
            }
          },
          {
            "title": "Resolved store cannot be routed (products endpoints)",
            "type": "object",
            "description": "The request resolves to a single store, but that store has no usable external id, so it cannot be named to ZKONG. It is refused rather than widened to a merchant-wide push. There are three ways to reach it, with different remedies. When the token is bound to a store whose external id is empty or whitespace, it is a provisioning state on our side, and neither a changed request nor a retry clears it. When the token carries no store binding and the body sends `storeId` with an empty value (`\"\"`, or the out-of-contract `null`, `0` or `false`), the caller clears it by omitting `storeId` (merchant scope) or sending a valid store id: only an absent `storeId` means merchant scope. When the token carries no store binding and the body sends a whitespace-only `storeId`, it reaches this refusal only if the merchant has a store, not soft-deleted, whose external id is exactly that value, the same provisioning defect as the first case, reached through the body; the caller clears it the same way, by omitting `storeId` or sending a valid store id. A whitespace-only `storeId` that matches no store of the merchant is refused as the store-not-owned shape below instead. With a token store binding, a body `storeId` that differs from the bound store's external id is refused as the store-scope mismatch above instead, because the token's store takes precedence. One equal to it changes nothing, so a bound store with an unusable external id reaches this refusal whether or not the body repeats that value.",
            "properties": {
              "error": {
                "type": "string",
                "const": "Forbidden",
                "description": "Always the literal `Forbidden`."
              },
              "message": {
                "type": "string",
                "const": "Store scope could not be resolved for this request",
                "description": "Always the literal `Store scope could not be resolved for this request`."
              },
              "requestId": {
                "type": "string",
                "description": "The request's correlation id (the `x-request-id` header truncated to 200 characters when supplied; otherwise a generated `req-<epoch-ms>`)."
              }
            }
          },
          {
            "title": "Store not owned by merchant (products endpoints)",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "const": "Forbidden",
                "description": "Always the literal `Forbidden`."
              },
              "message": {
                "type": "string",
                "const": "Store not found or not authorized for this merchant",
                "description": "Always the literal `Store not found or not authorized for this merchant`."
              },
              "requestId": {
                "type": "string",
                "description": "The request's correlation id (the `x-request-id` header truncated to 200 characters when supplied; otherwise a generated `req-<epoch-ms>`)."
              },
              "storeId": {
                "type": "string",
                "description": "The store id that was rejected."
              },
              "merchantId": {
                "type": "string",
                "description": "The resolved merchant id that does not own the store."
              }
            }
          },
          {
            "title": "MERCHANT_MAPPING_REQUIRED (products endpoints)",
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "const": "Forbidden",
                "description": "Always the literal `Forbidden`."
              },
              "code": {
                "type": "string",
                "const": "MERCHANT_MAPPING_REQUIRED",
                "description": "Always the literal `MERCHANT_MAPPING_REQUIRED`."
              },
              "message": {
                "type": "string",
                "description": "Explains that the authenticated token has no merchant mapping."
              },
              "requestId": {
                "type": "string",
                "description": "The request's correlation id (the `x-request-id` header truncated to 200 characters when supplied; otherwise a generated `req-<epoch-ms>`)."
              },
              "details": {
                "type": "string",
                "description": "Guidance on configuring the client-to-merchant mapping."
              }
            }
          }
        ]
      },
      "TokenRequest": {
        "type": "object",
        "description": "Auth0 client-credentials passed to `POST /get-token` and forwarded to Auth0's `/oauth/token` with `grant_type=client_credentials`.",
        "required": [
          "client_id",
          "client_secret"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "The Auth0 M2M application's client id."
          },
          "client_secret": {
            "type": "string",
            "description": "The Auth0 M2M application's client secret."
          },
          "audience": {
            "type": "string",
            "description": "Optional. Defaults to the audience configured for the environment if omitted."
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "description": "Auth0's raw token response, forwarded verbatim. This API does not construct or validate this body itself.",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The Auth0-issued JWT access token to send as `Authorization: Bearer <token>` on every other endpoint."
          },
          "token_type": {
            "type": "string",
            "description": "Not set by this API; whatever Auth0 returns (commonly \"Bearer\")."
          },
          "expires_in": {
            "type": "integer",
            "description": "Not set by this API; whatever Auth0 returns (commonly 86400 for this grant type)."
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited scopes granted to the token, when Auth0 returns any."
          }
        },
        "additionalProperties": true
      },
      "HealthResponse": {
        "type": "object",
        "description": "Body of a successful `GET /health` probe.",
        "properties": {
          "status": {
            "type": "string",
            "const": "healthy",
            "description": "Always the literal `healthy` on a 200."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the probe ran (ISO-8601)."
          },
          "api": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "v1",
                "description": "The API major version, always `v1`."
              }
            },
            "additionalProperties": false,
            "description": "Deliberately has no `uptime` field."
          },
          "converter": {
            "type": "object",
            "description": "Converter readiness and its field-support counts.",
            "properties": {
              "status": {
                "type": "string",
                "const": "ready",
                "description": "Always the literal `ready` on a healthy response."
              },
              "fields": {
                "$ref": "#/components/schemas/FieldSupport",
                "description": "The converter's field-support counts (23/50/73)."
              }
            }
          }
        },
        "required": [
          "status",
          "timestamp",
          "api",
          "converter"
        ]
      },
      "UnhealthyResponse": {
        "type": "object",
        "description": "Body of a `GET /health` probe when the health check itself failed with an error (503).",
        "properties": {
          "status": {
            "type": "string",
            "const": "unhealthy",
            "description": "Always the literal `unhealthy`."
          },
          "error": {
            "type": "string",
            "description": "The error message from the failed check."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the probe failed (ISO-8601)."
          }
        },
        "required": [
          "status",
          "error",
          "timestamp"
        ]
      },
      "FieldSupport": {
        "type": "object",
        "description": "The field-support counts this deployment enforces - see `x-zkong-field-support` below.",
        "properties": {
          "core": {
            "type": "integer",
            "const": 23,
            "description": "Number of core ZKONG fields supported."
          },
          "extended": {
            "type": "integer",
            "const": 50,
            "description": "Number of extended `custFeature1`-`custFeature50` fields supported."
          },
          "total": {
            "type": "integer",
            "const": 73,
            "description": "Total supported field count (core + extended)."
          }
        },
        "required": [
          "core",
          "extended",
          "total"
        ]
      },
      "StatusResponse": {
        "type": "object",
        "description": "Body of a successful `GET /status` call - API version, feature flags, endpoint map, and sanitised system health.",
        "properties": {
          "api": {
            "type": "object",
            "description": "API version block.",
            "properties": {
              "version": {
                "type": "string",
                "const": "v1",
                "description": "The API major version, always `v1`."
              }
            }
          },
          "features": {
            "type": "object",
            "description": "Which processing features this deployment has enabled (all currently `true`).",
            "properties": {
              "coreFields": {
                "type": "boolean",
                "const": true,
                "description": "Core-field processing is enabled."
              },
              "extendedFields": {
                "type": "boolean",
                "const": true,
                "description": "Extended `custFeature` processing is enabled."
              },
              "fieldValidation": {
                "type": "boolean",
                "const": true,
                "description": "Field-level validation is enabled."
              },
              "partialUpdates": {
                "type": "boolean",
                "const": true,
                "description": "Partial payloads are accepted: a request need not carry every field. It does NOT mean omitted fields are left unchanged; under the emptyNeedDelete=1 this API sends, a field absent from the item MiddleX sends is cleared at ZKONG, and a field MiddleX defaults or derives is sent with that value (see the data-loss section above)."
              }
            }
          },
          "endpoints": {
            "type": "object",
            "description": "A fixed, hand-maintained map of endpoint → description (not derived from the live router).",
            "additionalProperties": {
              "type": "string"
            }
          },
          "system": {
            "type": "object",
            "description": "Sanitised system-health snapshot (no internal metrics exposed).",
            "properties": {
              "status": {
                "type": "string",
                "description": "\"healthy\" or \"unhealthy\"."
              },
              "database": {
                "type": "object",
                "description": "Connectivity of one backing service.",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "\"connected\", \"error\", or \"unknown\"."
                  }
                }
              },
              "redis": {
                "type": "object",
                "description": "Connectivity of another backing service.",
                "properties": {
                  "status": {
                    "type": "string",
                    "description": "\"connected\", \"error\", or \"unknown\"."
                  }
                }
              }
            }
          }
        }
      },
      "BarcodeEntry": {
        "description": "A bare barcode string, or an object carrying the barcode under `code`. The first resolvable entry wins.",
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "object",
            "required": [
              "code"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "The barcode value."
              }
            }
          }
        ]
      },
      "PriceEntry": {
        "type": "object",
        "description": "All amounts are dollars (converted to integer cents in the response `zkongData`).",
        "properties": {
          "originalPrice": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Recommended/original price in dollars. NOT clearable: an empty string is refused here, because the everyday price is the one a label must always carry. Accepted forms: a number; a NUMERIC STRING; or `null`, treated as absent. A value that merely coerces -- `[]`, `[5]`, `true`, `false`, `\" \"` -- is REFUSED by name.\nThe `pattern` above is the same grammar the server applies to a price string. Decimal only: a hexadecimal, binary or octal literal is not a price. NON-NEGATIVE: a minus sign is refused here and `minimum: 0` says the same for the numeric form, because the server refuses every negative price with `must be a non-negative number`. The `pattern` cannot express one rule, a range: a string inside the grammar can overflow outright (`\"1e309\"`), and a finite value can still overflow once converted to cents, from roughly `1.8e306` upward. The server refuses both by name."
          },
          "price": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^$|^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Current sale price in dollars, or `\"\"` to CLEAR it -- an empty string asks ZKONG to clear the stored value rather than set one. Falls back to `originalPrice` when OMITTED, and deliberately does not fall back when explicitly cleared: \"clear my promotional price\" and \"I did not mention it\" are different instructions.\n**A clear needs a companion.** The cleared key is dropped from the outbound item, so a product whose ONLY price field is a clear carries no price at all and is refused with `price, originalPrice, or memberPrice is required`. Send the everyday price alongside the clear, which is what a real update does anyway. Accepted forms: a number; a NUMERIC STRING; or `null`, treated as absent. A value that merely coerces -- `[]`, `[5]`, `true`, `false`, `\" \"` -- is REFUSED by name.\nThe `pattern` above is the same grammar the server applies to a price string. Decimal only: a hexadecimal, binary or octal literal is not a price. NON-NEGATIVE: a minus sign is refused here and `minimum: 0` says the same for the numeric form, because the server refuses every negative price with `must be a non-negative number`. The `pattern` cannot express one rule, a range: a string inside the grammar can overflow outright (`\"1e309\"`), and a finite value can still overflow once converted to cents, from roughly `1.8e306` upward. The server refuses both by name."
          },
          "memberPrice": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^$|^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Member price in dollars, or `\"\"` to CLEAR it -- and like `price`, a clear needs a companion price field on the same product, or the item carries no price at all and is refused. A cleared member price does NOT trigger the substitution below, on any merchant: the substitution fires only when the field is omitted AND a NUMERIC sale price resolved -- an explicit `price: \"\"` leaves nothing to take 5% off, so the substitution does not run there either. When omitted with a numeric sale price, defaults server-side to a 5% discount off it for merchants that have the automatic member-price discount setting enabled, which is the default for any merchant with no explicit setting. Merchants configured to disable it get no `memberPrice` key at all.\n**That is not the same as leaving the stored value alone.** This endpoint pushes with `emptyNeedDelete=1`, under which ZKONG CLEARS any field the request omits, so a merchant with the substitution disabled has their member price cleared on every push rather than preserved. Send an explicit `memberPrice` to set one. Whenever the default is applied it is reported in `appliedDefaults` on the response.\nAccepted forms: a number; a NUMERIC STRING; or `null`, treated as absent. A value that merely coerces -- `[]`, `[5]`, `true`, `false`, `\" \"` -- is REFUSED by name.\nThe `pattern` above is the same grammar the server applies to a price string. Decimal only: a hexadecimal, binary or octal literal is not a price. NON-NEGATIVE: a minus sign is refused here and `minimum: 0` says the same for the numeric form, because the server refuses every negative price with `must be a non-negative number`. The `pattern` cannot express one rule, a range: a string inside the grammar can overflow outright (`\"1e309\"`), and a finite value can still overflow once converted to cents, from roughly `1.8e306` upward. The server refuses both by name."
          }
        }
      },
      "ProductInput": {
        "type": "object",
        "required": [
          "barcodes"
        ],
        "description": "The request-side \"product\" envelope. This is NOT the same shape as the response `zkongData`: several fields have aliases, and prices are supplied in dollars here vs. integer cents in the response. Only `barcodes` is enforced as required by request validation (`products[i].barcodes is required` / `must not be empty`). The service also accepts a singular `barcode` fallback, which it reads only when the first `barcodes` entry is empty, `0`, `false` or `null`. A non-empty string or a non-zero number there becomes the item key. An empty or absent `barcode` is refused (`Product barcode is required`), and validation refuses any other value that is not a string or number (an object, an array or a boolean) with `400` (`products[i].barcode must be a barcode string or number when barcodes[0] is falsy`).",
        "properties": {
          "barcodes": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/BarcodeEntry"
            },
            "description": "Source of the output `barCode` (first entry's `code`, or the entry itself if a bare string)."
          },
          "prices": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/PriceEntry"
            },
            "description": "Optional; only the first entry is used. It wins over the flat `originalPrice`/`price`/`memberPrice` properties below PER FIELD, not as a whole: each price is resolved separately. The entry's value is used when the entry supplies it and it is not `null`. Otherwise that one field comes from the flat property. A request carrying `prices: [{}]` is resolved entirely from the flat properties."
          },
          "name": {
            "type": "string",
            "description": "Preferred source for the output `itemTitle`. Wins over `itemTitle` below if both are given."
          },
          "itemTitle": {
            "type": "string",
            "description": "Fallback source for `itemTitle`, used only when `name` is absent."
          },
          "originalPrice": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Dollars. Used when `prices` is absent, and also when the first `prices` entry omits `originalPrice` or sends it as `null` -- the fallback is per field, not per array. NOT clearable: an empty string is refused here. Accepted forms: a number, a NUMERIC STRING, or `null`, treated as absent. A value that merely coerces is refused by name. The `pattern` is the grammar the server applies to a price string, and is non-negative because the server refuses every negative price. A value that overflows -- either as a string (`\"1e309\"`) or once multiplied to cents (anything from roughly `1.8e306` up) -- matches here and is refused by the server by name."
          },
          "price": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^$|^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Dollars, or `\"\"` to CLEAR it. Used when `prices` is absent, and also when the first `prices` entry omits `price` or sends it as `null` -- the fallback is per field, not per array. An entry sending `price: \"\"` is NOT nullish, so the clear sentinel wins over this property rather than falling through to it.\n**A clear needs a companion**, exactly as on `PriceEntry.price`: the cleared key is dropped from the outbound item, so a product whose only price field is a clear carries no price at all and is refused with `price, originalPrice, or memberPrice is required`. Send the everyday price alongside it. Accepted forms: a number, a NUMERIC STRING, or `null`, treated as absent. A value that merely coerces is refused by name. The `pattern` is the grammar the server applies to a price string, and is non-negative because the server refuses every negative price. A value that overflows -- either as a string (`\"1e309\"`) or once multiplied to cents (anything from roughly `1.8e306` up) -- matches here and is refused by the server by name."
          },
          "memberPrice": {
            "type": [
              "number",
              "string",
              "null"
            ],
            "pattern": "^$|^\\s*\\+?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?\\s*$",
            "minimum": 0,
            "description": "Dollars, or `\"\"` to CLEAR it -- and like `price`, a clear needs a companion price field on the same product, or the item carries no price at all and is refused. A cleared member price does NOT trigger the substitution below, on any merchant. Used when `prices` is absent, and also when the first `prices` entry omits `memberPrice` or sends it as `null` -- the fallback is per field, not per array.\nIf omitted AND a NUMERIC sale price resolved, defaults server-side to a 5% discount off it for merchants that have the automatic member-price discount setting enabled, which is the default for any merchant with no explicit setting. An explicit `price: \"\"` leaves nothing to take 5% off, so the substitution does not run there even when `originalPrice` is present.\nMerchants configured to disable it get no `memberPrice` KEY at all, and that is not the same as leaving the stored value alone: this endpoint pushes with `emptyNeedDelete=1`, under which ZKONG CLEARS any field the request omits, so their member price is cleared on every push rather than preserved. Send an explicit `memberPrice` to set one. The substitution is reported in `appliedDefaults` on the response whenever it is applied."
          },
          "attrCategory": {
            "type": "string",
            "maxLength": 100,
            "description": "Defaults to `\"default\"` server-side if omitted/empty - see `appliedDefaults` in the response."
          },
          "attrName": {
            "type": "string",
            "maxLength": 100,
            "description": "Defaults to `\"default\"` server-side if omitted/empty - see `appliedDefaults` in the response."
          },
          "shortTitle": {
            "type": "string",
            "maxLength": 500,
            "description": "Falls back to the first 20 characters of `name` (not `itemTitle`) if omitted."
          },
          "spec": {
            "type": "string",
            "maxLength": 100,
            "description": "Falls back to the first 100 characters of `description` if omitted."
          },
          "description": {
            "type": "string",
            "description": "Only used as the fallback source for `spec` above; not itself present in the response."
          },
          "unit": {
            "type": "string",
            "maxLength": 100,
            "description": "Unit of sale shown on the label (e.g. `each`, `kg`)."
          },
          "classLevel": {
            "type": "string",
            "maxLength": 100,
            "description": "Classification/category level label."
          },
          "productArea": {
            "type": "string",
            "maxLength": 100,
            "description": "Falls back to `origin` if omitted - wins over `origin` when both given."
          },
          "origin": {
            "type": "string",
            "description": "Fallback source for `productArea`."
          },
          "stock1": {
            "type": "number",
            "description": "Falls back to `stock`, then `inventory` (0 is preserved, not treated as absent)."
          },
          "stock": {
            "type": "number",
            "description": "First fallback source for `stock1`."
          },
          "inventory": {
            "type": "number",
            "description": "Second fallback source for `stock1`."
          },
          "stock2": {
            "type": "number",
            "description": "Secondary stock/inventory figure."
          },
          "stock3": {
            "type": "number",
            "description": "Tertiary stock/inventory figure."
          },
          "qrCode": {
            "type": "string",
            "maxLength": 1000,
            "description": "QR-code payload to render on the label."
          },
          "nfcUrl": {
            "type": "string",
            "maxLength": 1000,
            "description": "URL to encode into the label's NFC tag."
          },
          "proStartTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO-8601 timestamp; a `T` separator is converted to a space and the value is clamped to 19 characters (`yyyy-MM-dd HH:mm:ss`)."
          },
          "proEndTime": {
            "type": [
              "string",
              "null"
            ],
            "description": "Same handling as `proStartTime`."
          },
          "promotionText": {
            "type": "string",
            "maxLength": 100,
            "description": "Free-text promotional message shown on the label."
          },
          "label": {
            "type": "string",
            "maxLength": 20,
            "description": "Falls back to `tag` if omitted - wins over `tag` when both given."
          },
          "tag": {
            "type": "string",
            "description": "Fallback source for `label`."
          },
          "productCode": {
            "type": "string",
            "maxLength": 100,
            "description": "Falls back to `id` if omitted - wins over `id` when both given."
          },
          "id": {
            "type": "string",
            "description": "Fallback source for `productCode`."
          },
          "productSku": {
            "type": "string",
            "maxLength": 100,
            "description": "Falls back to `sku` if omitted - wins over `sku` when both given."
          },
          "sku": {
            "type": "string",
            "description": "Fallback source for `productSku`."
          }
        },
        "patternProperties": {
          "^custFeature([12])$": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ],
            "maxLength": 1000,
            "description": "Extended endpoint only; silently discarded (not an error) when sent to `/products`. On the extended endpoint an explicit `\"\"` clears the field on the label, and so does omitting it, because every push is sent with `emptyNeedDelete=1` (see the data-loss section).\nA NUMBER or a BOOLEAN is accepted and coerced to its text form, so `42` reaches the label as `42` and `true` as `true`. `null` is the exception and is NOT coerced: it means absent, exactly as omitting the field does, and never reaches the label as the text `null`. A structured value -- an object or an array -- is REFUSED with a named 400."
          },
          "^custFeature([345])$": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ],
            "maxLength": 500,
            "description": "Extended endpoint only; same clear-on-empty semantics as custFeature1-2, and the same accepted value set."
          },
          "^custFeature([6-9]|[1-4][0-9]|50)$": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ],
            "maxLength": 100,
            "description": "Extended endpoint only; same clear-on-empty semantics, and the same accepted value set."
          },
          "^extendedField([1-9]|[1-4][0-9]|50)$": {
            "type": [
              "string",
              "number",
              "boolean",
              "null"
            ],
            "description": "Legacy alias, auto-migrated server-side to the corresponding `custFeatureN` (only if `custFeatureN` was not itself also supplied). Same accepted value set, and the same refusal of a structured value."
          }
        },
        "additionalProperties": true
      },
      "AppliedDefault": {
        "type": "object",
        "description": "Records a field that was defaulted server-side because the request omitted it.",
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "attrCategory",
              "attrName",
              "memberPrice"
            ],
            "description": "The field that was defaulted."
          },
          "value": {
            "oneOf": [
              {
                "type": "string",
                "const": "default"
              },
              {
                "type": "integer",
                "minimum": 0
              }
            ],
            "description": "The value applied. The literal `default` for the template fields (`attrCategory`, `attrName`); integer cents for `memberPrice`."
          },
          "reason": {
            "type": "string",
            "description": "Why the default was applied (e.g. `Field not provided, set to default per ZKONG requirement`)."
          }
        },
        "required": [
          "field",
          "value",
          "reason"
        ]
      },
      "ValidationIssue": {
        "type": "object",
        "description": "A single field-level validation finding raised during product processing.",
        "properties": {
          "field": {
            "type": "string",
            "description": "The field the issue relates to."
          },
          "error": {
            "type": "string",
            "description": "e.g. required_field, max_length_truncated, invalid_type, min_value, business_rule_violation, invalid_enum."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the issue."
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ],
            "description": "`error` blocks the item from being pushed; `warning` is non-blocking (the clamped/adjusted value is still synced)."
          },
          "value": {
            "description": "Present on some (not all) issue types - the offending value or a short description of it."
          }
        },
        "required": [
          "field",
          "error",
          "message",
          "severity"
        ]
      },
      "ZkongDataCore": {
        "type": "object",
        "description": "The canonical 23-field ZKONG item built by the service. Price fields are integer cents (converted from the request's dollar amounts).",
        "properties": {
          "barCode": {
            "type": "string",
            "maxLength": 100,
            "description": "Barcode used to match the ZKONG label."
          },
          "itemTitle": {
            "type": "string",
            "maxLength": 500,
            "description": "Product title shown on the label."
          },
          "originalPrice": {
            "type": "integer",
            "minimum": 0,
            "description": "Integer cents."
          },
          "price": {
            "type": "integer",
            "minimum": 0,
            "description": "Integer cents."
          },
          "memberPrice": {
            "type": "integer",
            "minimum": 0,
            "description": "Integer cents."
          },
          "productCode": {
            "type": "string",
            "maxLength": 100,
            "description": "Sanitised product code (non-alphanumeric characters stripped)."
          },
          "productSku": {
            "type": "string",
            "maxLength": 100,
            "description": "Sanitised product SKU (non-alphanumeric characters stripped)."
          },
          "attrCategory": {
            "type": "string",
            "maxLength": 100,
            "description": "Defaults to \"default\" if not supplied."
          },
          "attrName": {
            "type": "string",
            "maxLength": 100,
            "description": "Defaults to \"default\" if not supplied."
          },
          "shortTitle": {
            "type": "string",
            "maxLength": 500,
            "description": "Short title shown on smaller labels."
          },
          "spec": {
            "type": "string",
            "maxLength": 100,
            "description": "Specification/description text."
          },
          "unit": {
            "type": "string",
            "maxLength": 100,
            "description": "Unit of sale."
          },
          "classLevel": {
            "type": "string",
            "maxLength": 100,
            "description": "Classification/category level."
          },
          "productArea": {
            "type": "string",
            "maxLength": 100,
            "description": "Product area/origin."
          },
          "stock1": {
            "type": "number",
            "minimum": 0,
            "description": "Primary stock/inventory figure."
          },
          "stock2": {
            "type": "number",
            "minimum": 0,
            "description": "Secondary stock/inventory figure."
          },
          "stock3": {
            "type": "number",
            "minimum": 0,
            "description": "Tertiary stock/inventory figure."
          },
          "qrCode": {
            "type": "string",
            "maxLength": 1000,
            "description": "QR-code payload rendered on the label."
          },
          "nfcUrl": {
            "type": "string",
            "maxLength": 1000,
            "description": "URL encoded into the label's NFC tag."
          },
          "proStartTime": {
            "type": "string",
            "maxLength": 19,
            "description": "Format: yyyy-MM-dd HH:mm:ss."
          },
          "proEndTime": {
            "type": "string",
            "maxLength": 19,
            "description": "Format: yyyy-MM-dd HH:mm:ss."
          },
          "promotionText": {
            "type": "string",
            "maxLength": 100,
            "description": "Promotional message shown on the label."
          },
          "label": {
            "type": "string",
            "maxLength": 20,
            "description": "Short label/tag text."
          }
        },
        "required": [
          "barCode"
        ]
      },
      "ZkongDataExtended": {
        "description": "ZkongDataCore plus up to 50 `custFeature1`-`custFeature50` fields.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ZkongDataCore"
          },
          {
            "type": "object",
            "patternProperties": {
              "^custFeature([12])$": {
                "type": "string",
                "maxLength": 1000
              },
              "^custFeature([345])$": {
                "type": "string",
                "maxLength": 500
              },
              "^custFeature([6-9]|[1-4][0-9]|50)$": {
                "type": "string",
                "maxLength": 100
              }
            }
          }
        ]
      },
      "ProductResultCore": {
        "type": "object",
        "description": "One successfully processed core product - the echoed request, the normalised ZKONG item, and its validation summary.",
        "properties": {
          "originalProduct": {
            "type": "object",
            "description": "The exact request product object, echoed back for correlation.",
            "additionalProperties": true
          },
          "zkongData": {
            "$ref": "#/components/schemas/ZkongDataCore",
            "description": "The normalised ZKONG item that was queued for push."
          },
          "validation": {
            "type": "object",
            "description": "Per-item validation summary for a processed core product.",
            "properties": {
              "status": {
                "type": "string",
                "const": "valid",
                "description": "Always \"valid\" here - items that fail core validation are excluded from `data[]` and appear in `processingErrors` instead."
              },
              "fieldCount": {
                "type": "integer",
                "description": "Number of fields in the normalised `zkongData` item."
              }
            }
          },
          "appliedDefaults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppliedDefault"
            },
            "description": "Present only when non-empty (i.e. attrCategory, attrName and/or memberPrice were defaulted)."
          }
        },
        "required": [
          "originalProduct",
          "zkongData",
          "validation"
        ]
      },
      "ProductResultExtended": {
        "type": "object",
        "description": "One successfully processed extended product - the echoed request, the normalised ZKONG item, and its validation summary (including warning counts).",
        "properties": {
          "originalProduct": {
            "type": "object",
            "description": "The exact request product object, echoed back for correlation.",
            "additionalProperties": true
          },
          "zkongData": {
            "$ref": "#/components/schemas/ZkongDataExtended",
            "description": "The normalised ZKONG item (core + custFeature fields) that was queued for push."
          },
          "validation": {
            "type": "object",
            "description": "Per-item validation summary for a processed extended product.",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "warning"
                ],
                "description": "\"warning\" when at least one non-blocking (severity=warning) validation issue was raised for this item; items with a blocking (severity=error) issue never appear in data[] at all."
              },
              "fieldCount": {
                "type": "integer",
                "description": "Number of keys counted in the normalised item. On this extended endpoint the count includes an internal `_appliedDefaults` key, so it reads one higher than the visible `zkongData` field count (unlike the core endpoint, which excludes it)."
              },
              "errors": {
                "type": "integer",
                "const": 0,
                "description": "Always literally 0 here - items with blocking errors are excluded from data[] and returned via processingErrors instead; this field does not count anything for items that do appear here."
              },
              "warnings": {
                "type": "integer",
                "description": "Count of non-blocking (severity=warning) validation issues for this item (e.g. truncation, sale-price-above-original, discount-over-50%)."
              }
            }
          },
          "appliedDefaults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppliedDefault"
            },
            "description": "Present only when non-empty (i.e. attrCategory, attrName and/or memberPrice were defaulted)."
          }
        },
        "required": [
          "originalProduct",
          "zkongData",
          "validation"
        ]
      },
      "ProcessingError": {
        "type": "object",
        "description": "A failure entry; the shape varies by cause. Usually **one entry per product** that failed to process, identified by `productIndex`. It is also the carrier for the **whole-batch** case, where `productIndex` is the literal `all` and the single entry is **scoped to the batch** rather than to any one product.\n**`all` does not mean every item failed.** A `vendor-throttled` 503 describes only the attempt this service gave up on, and an earlier attempt in the same request may have applied, as that response says; and a `vendor-unrecognised` entry with `outcomeUncertain: true` reports a `success: true` answer that may have applied in full, as the 502 response says. Read `category` and `outcomeUncertain` on the entry for what the batch-scoped failure means. The `category` description below separates the two vocabularies.",
        "properties": {
          "productIndex": {
            "description": "Zero-based index into the request `products` array, or the literal string `\"all\"` for an entry scoped to the whole batch, which does not mean every item failed (see the schema description). `-1` means the entry could not be attributed to a request product: it is used for an item this service rejected before anything was sent to ZKONG whose barcode did not match any product sent, which should not normally happen and is reported rather than guessed at. The `barcode` and `productCode` fields identify such an entry instead.",
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string",
                "const": "all"
              }
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            },
            "description": "Present when the product failed field validation."
          },
          "error": {
            "type": "string",
            "description": "Why the entry exists, as a string, instead of a validation issue list. Its content depends on the entry: an error message when the product (or the whole-batch push) failed, where on a refusal that named reason buckets `reasonText` may carry readable text for them; on the whole-batch `vendor-unrecognised` entry, a sentence naming the result code this service could not read; this service's reason on an entry for an item rejected before anything was sent to ZKONG (`message` = `Item was rejected before it reached ZKONG`); and the vendor's reason key, verbatim up to the cap described below (for example `temp_attr_none`), on a per-item `vendor-rejected` entry (`message` = `Item was rejected by ZKONG`), where `reasonText` may carry readable text for it.\n**This text can be cut.** It carries vendor-supplied text, so it is capped before it is served: at **200 characters** when it is a vendor-rejected reason key, and at **1000 characters** when it is the message of a push that failed outright (`productIndex` is `all`, `message` is `ZKONG push failed`). A value over its cap is shortened so that it ends in `...[truncated]` and is exactly the cap long. A value within its cap is served unchanged. Real reason keys are a few characters long, far inside the cap.\nThe cap applies to this field only. On a 17050 `pushResult.data` and `pushResult.partialFailures` still carry the vendor key in full, as ZKONG sent it. `category`, `retryable`, `outcomeUncertain` and `zkongCode` are decided from the uncut error and are not affected. A client that needs the full vendor key on a 17050 should read it from `partialFailures`, not from `error`."
          },
          "message": {
            "type": "string",
            "description": "Human-readable summary of why the product failed (e.g. `Product processing failed`, `Product validation failed`, `ZKONG push failed`)."
          },
          "reasonText": {
            "type": "string",
            "description": "Present on a per-item `vendor-rejected` entry (`message` = `Item was rejected by ZKONG`), and on the whole-batch `productIndex: all` entry of a ZKONG refusal that named reason buckets (`message` = `ZKONG push failed`), and only when this service has readable text for the vendor's reason bucket: for example `Invalid template category or type` for `temp_attr_none`. Absent for a bucket it has no text for, rather than repeating `error`. On a per-item entry `error` carries the bucket, within the cap described under `error`, and is the field to branch on. On the whole-batch entry `error` is unchanged: it still carries the code and the whole reason map as prose, and a refusal that named several recognised buckets gets their sentences joined with `; `, each once, in the order ZKONG listed the buckets. Only the first 20 buckets of a refusal are considered, and a bucket longer than 200 characters is not, since no recognised bucket is that long.\nThe text is drawn from a fixed set of sentences this service owns, one per vendor reason it recognises, and it never carries any text ZKONG supplied. A reason key ZKONG sends that is not one of those, including a key in the namespace this service reserves for items it rejects itself before the push, gets no `reasonText`, and `error` carries the key as for any other bucket."
          },
          "barcode": {
            "type": "string",
            "description": "Present only on an entry for an item this service rejected before anything was sent to ZKONG (`message` = `Item was rejected before it reached ZKONG`). The barcode this service reported the rejection against, and the identifier to use when `productIndex` is `-1`."
          },
          "productCode": {
            "type": "string",
            "description": "Present on the same entries for items rejected before anything was sent to ZKONG as `barcode`. The product code carried on the rejected item, where the item had one."
          },
          "field": {
            "type": "string",
            "description": "Present on the same entries for items rejected before anything was sent to ZKONG. Which field failed, e.g. `price`, `originalPrice`, `memberPrice`, `barCode`, `itemTitle`."
          },
          "category": {
            "type": "string",
            "description": "How the failure was classified. **Two sets of values share this field**, told apart by `productIndex`: a per-item value where `productIndex` is the index of a product (or `-1`), and a whole-batch value where it is `all`. The two sets overlap in one value, `vendor-rejected`, which is valid in both.\nPer item, from this service: `pricing` for a malformed value, `missing` for an absent required field, `notReady` for a price that is absent, null or zero and so means the product has no sellable price yet rather than that anything is wrong. `vendor-rejected` also appears per item, for an item ZKONG itself refused inside a batch it accepted.\nWhole batch, from the service's push-failure classification, **nine values**: `vendor-throttled` (503), `vendor-unrecognised` (502), `upstream-auth` (502), `upstream-http` (502), `transport-timeout` (504), `transport-unreachable` (502), `estate-unavailable` (503), `estate-credential-rejected` (503), and `vendor-rejected`. The two `estate-` values are a failed login: nothing was sent on the attempt this service gave up on, and they differ in that `estate-credential-rejected` is ZKONG refusing the login, which an operator has to fix, where `estate-unavailable` is every other login failure. That is usually transient, an outage or a network fault, but it can be a local fault that needs an operator, such as a failure using the stored credential.\n**`vendor-rejected` is valid for `productIndex: all` and is the one with no status of its own.** The service gives it no status code of its own, deliberately, so the count-based status keeps deciding a verdict about the caller's data. On this whole-batch entry that status is always **207**: the entry comes from a `success: false` answer that made the push fail outright, and an outright failure leaves the landed count at the converted count, which is never zero once a push was attempted. The per-item `vendor-rejected` entries above are the ones a 422 can carry. A client validating this field must admit it on a whole-batch entry; it is not confined to the per-item vocabulary above.\n**A whole-batch entry need not carry this field at all.** An unclassified outright failure omits it, along with `retryable`, `outcomeUncertain` and `zkongCode`; see `retryable` below for that shape."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether retrying the SAME request could plausibly succeed. Present on a **classified** whole-batch push failure, and absent from per-item entries. The exact rule: `true` for a throttle, a timeout, an unreachable vendor, a failed login (`estate-unavailable` and `estate-credential-rejected`), and an HTTP **5xx or 429** on the push, whether ZKONG or something in front of it answered. `false` for everything else, which is a **401 or 403** answered to this service's own credential (`upstream-auth`), **any other HTTP status below 500 that is not 429**, and a result code this service cannot read.\n**429 is the exception worth reading twice.** A rate limit is a 4xx and it IS retryable; an `upstream-auth` refusal is not, because the credential is this service's to rotate and no caller action helps.\n**An UNCLASSIFIED whole-batch outright failure carries none of it.** Where the classification matches nothing, the service returns the bare `{productIndex, error, message}` and stops, so the entry has no `retryable`, no `category`, no `outcomeUncertain` and no `zkongCode`. Such an outright failure also keeps the count-based status, which for an outright failure on these operations is always 207: never a 422, and never a 502, 503 or 504."
          },
          "outcomeUncertain": {
            "type": "boolean",
            "description": "Whether the push may already have applied. **Two shapes.** On a push that got no answer from the estate it is stated either way: `true` for a 5xx and for a connection that was reset or broken after the request was sent or whose error carried no code, and for a `transport-timeout`; `false` for a failed login (`estate-unavailable` and `estate-credential-rejected`) and for a refused connection, a DNS failure or an unreachable or down host or network, where nothing was sent on that attempt. A `transport-unreachable` error that is this service's own fault (raised while building the request, or not an HTTP-client error) is not that class and keeps the second shape. On every other classified outcome it is present, and always `true`, ONLY where this service knows it cannot say whether the push applied: a `success: true` answer carrying an unreadable result code; there it is omitted rather than sent as `false`, which is the response idiom. A caller holding `true` must not resend blindly, because the batch may already have applied.\n**What absence, and a stated `false`, mean depend on whether the entry is classified.** On an entry carrying `category`, absence or a stated `false` is this service reporting that its classification of the attempt it gave up on did not put the outcome in doubt, and nothing wider. It is not a finding that no attempt in the request applied. The service re-sends the batch after a throttle refusal and after any error that occurs while fetching the token or sending the batch, including an HTTP failure status, all on one retry budget. So a classified whole-batch entry can follow an earlier attempt in the same request that timed out, and a timed-out attempt may have reached ZKONG and applied. The flag reflects only the final attempt, and nothing in the entry says whether an earlier one was made. The `vendor-throttled` 503 response states this for a throttle refusal; it holds equally for every other classification reached after a retry. So a client must not read the missing field on a classified entry as proof that a resend is a no-op. Reconcile first, then resend. On an UNCLASSIFIED whole-batch entry, which has no `category` (see `retryable` above for that shape), the outcome is **not reported**: the push-failure classification matched nothing, and nothing establishes that the outright failure happened before the request was sent. A client must not treat the missing field there as proof that the push did not apply.\n**And it may have applied IN PART**, which is the trap in resending. An uncertain outcome is not a coin flip between \"all of it landed\" and \"none of it did\": the service reads an unreadable success code as either \"accepted but queued\" or \"partially applied\", and a timeout can equally interrupt a batch the vendor had begun applying. Nothing in this response identifies WHICH items landed, because this service does not know. Reconcile before resending rather than treating the batch as atomic."
          },
          "zkongCode": {
            "type": "integer",
            "description": "ZKONG's own result code, present only where the vendor actually sent one. Three classifications carry it: `vendor-throttled` (always `10047`), `vendor-unrecognised` and `vendor-rejected`. `vendor-unrecognised` also reaches this field by a second route: the entry the service adds for a `success: true` answer carrying a code this service cannot read, which completes, rather than failing outright. Omitted when the vendor sent none, which is a fact about the answer rather than a convention about the field, and omitted entirely on an unclassified outright failure.\n**So this field is not confined to the 502 and 503 responses.** `vendor-rejected` has no status code of its own by design, so an entry bearing a vendor code can equally arrive on the **207** that the count-based contract gives a data verdict on a push that failed outright. It does not arrive on a 422: a push that failed outright never answers 422 on these operations, and the per-item `vendor-rejected` entries a 422 can carry have no `zkongCode`."
          }
        },
        "required": [
          "productIndex",
          "message"
        ]
      },
      "PushResult": {
        "type": "object",
        "description": "What the push attempt returned. **Two different shapes appear here**:\n  1. The upstream ZKONG batch response, forwarded as ZKONG sent\n     it plus the fields below that this service adds, `zkongOutcome` among them.\n     This is the shape that\n     carries `code`, a ZKONG-defined status: `17002` = full success,\n     `17050` = partial success (some per-item errors reported), `17051` =\n     a rejected/failed batch. Those three are the codes this service's handling\n     recognises; ZKONG's own meaning for them is a matter outside this service's control.\n  2. The service's own local check, `{\"message\": \"Nothing to\n     update\"}` plus `localValidation`, returned when every item was\n     rejected before anything was sent to ZKONG so no ZKONG call was made at all. It has NO\n     `code`, because there was no upstream response to take one from.\nPresent whenever a push attempt completed, which is not the same as whenever one was attempted: a push that failed outright is an attempt that leaves no `pushResult` at all, and that is every 503 and 504 and the 502s on a push that failed outright. **It CAN accompany a 502**: the `vendor-unrecognised` 502 for a `success: true` answer this service cannot read completes, rather than failing outright, and is decided from `pushResult.zkongOutcome`, so it always carries one. It CAN accompany a 422: a request whose every item was dropped before anything was sent to ZKONG answers 422, and shape 2 is what it carries. `code` is consequently NOT required, because shape 2 has no `code`.",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "ZKONG's own success flag for the batch."
          },
          "code": {
            "type": "integer",
            "description": "e.g. 17002, 17050, 17051."
          },
          "message": {
            "type": "string",
            "description": "On shape 1, ZKONG's own status message for the batch. On shape 2, this service's own `Nothing to update`, which means no ZKONG call was made rather than that ZKONG had nothing to do; the reasons are in `localValidation.rejectedItems` and, at the top level, in `processingErrors`."
          },
          "data": {
            "type": [
              "object",
              "null"
            ],
            "description": "Upstream-defined shape; not enforced by this service. Relayed as ZKONG sent it, so it can be `null`: a `17002` answer carrying `data: null` is served with `data: null`. On a `17050` it is the reason-keyed map of barcode arrays that `partialFailures` below is derived from.",
            "additionalProperties": true
          },
          "zkongOutcome": {
            "type": "string",
            "enum": [
              "accepted",
              "partially-rejected",
              "unrecognised"
            ],
            "description": "This service's own reading of what ZKONG answered, not a vendor field. This service sets it after receiving the vendor body, so ZKONG cannot set it. Present on shape 1 and absent from shape 2, which never reached ZKONG. `accepted` is `success: true` with `17002`, `partially-rejected` is `success: true` with `17050`, and `unrecognised` is any other answer that lets the push complete: a `success` that counts as true whose pairing with `code` is neither of those two, such as `success: true` with a code this service does not know (the pair is read, not the flag). That one answers 502 as `vendor-unrecognised` with `outcomeUncertain: true`.\nTwo further outcome values, `rejected` and `throttled`, never appear here. An answer whose `success` does not count as true, including an absent one, fails the push outright on these operations rather than completing it, so it leaves no `pushResult`. These operations never produce `throttled`."
          },
          "partialFailureCount": {
            "type": "integer",
            "minimum": 0,
            "description": "Set by this service only when `zkongOutcome` is `partially-rejected`. How many distinct barcodes ZKONG reported as failed inside a batch it otherwise accepted, counted from `data`. On that outcome it equals the length of `partialFailures`, because this service sets both itself, so a same-named vendor value is overwritten. That holds because these operations never produce a paginated result, whose count is a per-page sum. On every other outcome, including `unrecognised`, this service sets neither field and does not derive a count from an answer it could not read. A same-named key in the vendor body is stripped on those outcomes, so no vendor value of this name is served. The same rejections are reported at the top level in `processingErrors` as per-item `vendor-rejected` entries, which is where a client should read them."
          },
          "partialFailures": {
            "type": "array",
            "description": "Set by this service only alongside `partialFailureCount`, when `zkongOutcome` is `partially-rejected`. One entry per distinct barcode, as the service builds them from `data`: a barcode ZKONG listed under more than one reason appears once, under the first reason it was listed under. The item shape below describes those entries. On every other outcome a same-named key in the vendor body is stripped, so no vendor value of this name is served. On `partially-rejected`, each entry is also reported as a `vendor-rejected` entry in `processingErrors`.",
            "items": {
              "type": "object",
              "required": [
                "barCode",
                "reason"
              ],
              "properties": {
                "barCode": {
                  "type": "string",
                  "description": "The barcode ZKONG reported, as a string."
                },
                "reason": {
                  "type": "string",
                  "description": "The key under `data` that ZKONG listed the barcode under, or the first such key where it was listed under several."
                }
              }
            }
          },
          "priceOmissions": {
            "type": "object",
            "description": "Present only when this request recovered at least one item whose promotional or member price was absent, null or zero. Such an item is sent on its `originalPrice` with the not-ready optional fields OMITTED, rather than being dropped whole and leaving the label showing a stale price. NOTE that omitting a field is destructive on this path, because it sends `emptyNeedDelete=1`: the previously stored value is cleared, which for a product with no promotional price is the intended outcome.",
            "properties": {
              "items": {
                "type": "integer",
                "description": "How many items were sent with an optional price omitted."
              },
              "omitted": {
                "type": "array",
                "description": "One entry per recovered item.",
                "items": {
                  "type": "object",
                  "properties": {
                    "barCode": {
                      "type": "string",
                      "description": "The recovered item's barcode."
                    },
                    "omittedFields": {
                      "type": "array",
                      "description": "Which optional price fields were dropped; a subset of `price` and `memberPrice`. `originalPrice` is never omitted, since it is the price a label must always carry.",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "localValidation": {
            "type": "object",
            "description": "Present only when the service rejected at least one item before anything was sent to ZKONG. The namespace this service attaches to the push result; not part of the upstream ZKONG body.",
            "properties": {
              "rejectedItems": {
                "type": "array",
                "description": "One entry per item rejected before anything was sent to ZKONG, each naming the `barcode`, `productCode`, `field`, `category` and `reason`. The same rejections are reported at the top level in `processingErrors`, which is where a client should read them.",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "FieldSupportResponse": {
        "description": "Field-support counts, as a standalone response schema wrapping `FieldSupport`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/FieldSupport"
          }
        ]
      },
      "CoreProductsRequest": {
        "type": "object",
        "description": "Request body for `POST /products` - the batch of products plus optional store scoping.",
        "required": [
          "products"
        ],
        "properties": {
          "products": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5000,
            "description": "The products to push (1-5000 per request).",
            "items": {
              "$ref": "#/components/schemas/ProductInput"
            }
          },
          "storeId": {
            "type": "string",
            "description": "Mutually exclusive with `store` (400 if both are given). Must match the authenticated token's store scope if the token is store-scoped."
          },
          "store": {
            "type": "object",
            "deprecated": true,
            "description": "Legacy. Mutually exclusive with `storeId` (400 if both are given). Accepted and type-checked, but has no effect.",
            "additionalProperties": true
          },
          "merchant": {
            "type": "object",
            "description": "Accepted but intentionally ignored for tenant scoping. Merchant (and agency) context always comes from the authenticated M2M token's client-to-merchant mapping, to prevent cross-tenant spoofing via the request body.",
            "additionalProperties": true
          }
        }
      },
      "ExtendedProductsRequest": {
        "type": "object",
        "description": "Request body for `POST /products/extended` - the batch of products, optional store scoping, and an optional client field-mapping hint.",
        "required": [
          "products"
        ],
        "properties": {
          "products": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "description": "The products to push (1-1000 per request; stricter cap than `/products` due to the larger per-item payload).",
            "items": {
              "$ref": "#/components/schemas/ProductInput"
            }
          },
          "storeId": {
            "type": "string",
            "description": "Mutually exclusive with `store` (400 if both are given)."
          },
          "store": {
            "type": "object",
            "deprecated": true,
            "description": "Legacy; see CoreProductsRequest.store.",
            "additionalProperties": true
          },
          "merchant": {
            "type": "object",
            "description": "Accepted but ignored for tenant scoping; see CoreProductsRequest.merchant.",
            "additionalProperties": true
          },
          "clientConfig": {
            "type": "object",
            "description": "Optional semantic field-mapping hint. Unrecognized `client` values fall back to generic mapping without error.",
            "properties": {
              "client": {
                "type": "string",
                "description": "Which client field-mapping profile to apply."
              }
            }
          }
        }
      },
      "CoreProductsResponse": {
        "type": "object",
        "description": "Response envelope for `POST /products`. Carried by this operation's product-processing responses: 200, 207 and 422, where the status reflects how many items were processed, and 502, 503 and 504, where it reflects how this service classified a push failure. The operation's other declared responses, 400 (validation), 401 (authentication), 403 (authorisation), 429 (rate limit) and 500 (internal error), are described by their own schemas, not this one. Where the push failed outright and ZKONG ANSWERED (a vendor refusal, a throttle, a 401 or 403, another 4xx), the counts describe what CONVERTED rather than what landed. Where the push got NO answer from the estate (a failed login, a 5xx, a response-less transport failure) `processed` is `0`, as it is on the `vendor-unrecognised` 502 for an unreadable `success: true` answer, which does not fail outright. See those responses for that distinction.",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Correlation id for this request (the `x-request-id` header, truncated to 200 characters, when supplied, otherwise a generated `req-<epoch-ms>`)."
          },
          "processed": {
            "type": "integer",
            "description": "How many products were converted AND not rejected by this service before anything was sent to ZKONG. This EXCLUDES items this service dropped locally, because nothing is sent for them. Each exclusion is reported in `processingErrors` with its `barcode` and `productIndex`. It is NOT a guarantee of delivery. If the outbound push itself fails, the outright failure is reported as a `processingErrors` entry with `productIndex: \"all\"` and the status reflects it. Where the push got NO answer from the estate (a failed login, a 5xx, a response-less transport failure) `processed` is `0`. Where ZKONG ANSWERED (a vendor refusal, a throttle, a 401 or 403, another 4xx) `processed` is not reduced, so a non-zero `processed` can accompany a wholly failed push. NOTE that `data` is deliberately NOT filtered to match, so `processed` can be lower than `data.length` (`processed: 0` with one `data` entry, when every item was dropped locally). The two count different populations on purpose: see `data`."
          },
          "errors": {
            "type": "integer",
            "description": "A count, not the error list itself. See `processingErrors`."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the response was built (ISO-8601)."
          },
          "data": {
            "type": "array",
            "description": "One entry per product that CONVERTED and passed field validation, carrying that product's converted payload and any applied defaults. Deliberately not filtered by whether the item then reached ZKONG: the applied-defaults record is what a client needs in order to see how its input was interpreted, and that is just as relevant for an item this service rejected. So this is a per-conversion record and `processed` is a per-push count, and where they differ the difference is enumerated in `processingErrors`. Entries are in request order but are NOT positionally aligned with the request `products` array, because a product that fails conversion is absent here; use `processingErrors[].productIndex`, which IS a request index, to attribute a failure.",
            "items": {
              "$ref": "#/components/schemas/ProductResultCore"
            }
          },
          "processingErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProcessingError"
            },
            "description": "Present only when errors > 0."
          },
          "pushResult": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PushResult"
              }
            ],
            "description": "Present when the push attempt completed, and absent when it failed outright. `pushResult` is assigned only when the push completes, on both product paths, so every response carrying a push that failed outright omits it: every 503 and 504, a 502 on a push that failed outright, and the 207 that a `vendor-rejected` verdict on a push that failed outright or an UNCLASSIFIED outright failure produces. **Not every 502 fails outright**: the `vendor-unrecognised` 502 for an unreadable `success: true` answer completes, is decided from `pushResult.zkongOutcome`, and carries it.\n**Do not infer it from `processed`.** A push that ZKONG answered but that failed outright leaves `processed` at the converted count with no `pushResult` beside it, and this service's own local check returns a `pushResult` having queued nothing at all."
          }
        },
        "required": [
          "requestId",
          "processed",
          "errors",
          "timestamp",
          "data"
        ]
      },
      "ExtendedProductsResponse": {
        "type": "object",
        "description": "Response envelope for `POST /products/extended`, including the deployment's `fieldSupport` counts. Carried by this operation's product-processing responses: 200, 207 and 422, and equally 502, 503 and 504, on the same terms as the `POST /products` envelope. This operation declares the same other responses as `POST /products`, 400, 401, 403, 429 and 500, and they are likewise described by their own schemas, not this one.",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "Correlation id for this request (the `x-request-id` header, truncated to 200 characters, when supplied, otherwise a generated `req-<epoch-ms>`)."
          },
          "processed": {
            "type": "integer",
            "description": "How many products were converted AND not rejected by this service before anything was sent to ZKONG. This EXCLUDES items this service dropped locally, because nothing is sent for them. Each exclusion is reported in `processingErrors` with its `barcode` and `productIndex`. It is NOT a guarantee of delivery. If the outbound push itself fails, the outright failure is reported as a `processingErrors` entry with `productIndex: \"all\"` and the status reflects it. Where the push got NO answer from the estate (a failed login, a 5xx, a response-less transport failure) `processed` is `0`. Where ZKONG ANSWERED (a vendor refusal, a throttle, a 401 or 403, another 4xx) `processed` is not reduced, so a non-zero `processed` can accompany a wholly failed push. NOTE that `data` is deliberately NOT filtered to match, so `processed` can be lower than `data.length` (`processed: 0` with one `data` entry, when every item was dropped locally). The two count different populations on purpose: see `data`."
          },
          "errors": {
            "type": "integer",
            "description": "A count, not the error list itself. See `processingErrors`."
          },
          "fieldSupport": {
            "$ref": "#/components/schemas/FieldSupport",
            "description": "The field-support counts this deployment enforces."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "Server time when the response was built (ISO-8601)."
          },
          "data": {
            "type": "array",
            "description": "One entry per product that CONVERTED and passed field validation, carrying that product's converted payload and any applied defaults. Deliberately not filtered by whether the item then reached ZKONG: the applied-defaults record is what a client needs in order to see how its input was interpreted, and that is just as relevant for an item this service rejected. So this is a per-conversion record and `processed` is a per-push count, and where they differ the difference is enumerated in `processingErrors`. Entries are in request order but are NOT positionally aligned with the request `products` array, because a product that fails conversion is absent here; use `processingErrors[].productIndex`, which IS a request index, to attribute a failure.",
            "items": {
              "$ref": "#/components/schemas/ProductResultExtended"
            }
          },
          "processingErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProcessingError"
            },
            "description": "Present only when errors > 0."
          },
          "pushResult": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PushResult"
              }
            ],
            "description": "Present when the push attempt completed, and absent when it failed outright. `pushResult` is assigned only when the push completes, on both product paths, so every response carrying a push that failed outright omits it: every 503 and 504, a 502 on a push that failed outright, and the 207 that a `vendor-rejected` verdict on a push that failed outright or an UNCLASSIFIED outright failure produces. **Not every 502 fails outright**: the `vendor-unrecognised` 502 for an unreadable `success: true` answer completes, is decided from `pushResult.zkongOutcome`, and carries it.\n**Do not infer it from `processed`.** A push that ZKONG answered but that failed outright leaves `processed` at the converted count with no `pushResult` beside it, and this service's own local check returns a `pushResult` having queued nothing at all."
          }
        },
        "required": [
          "requestId",
          "processed",
          "errors",
          "fieldSupport",
          "timestamp",
          "data"
        ]
      },
      "GenericConfig": {
        "type": "object",
        "description": "The default field-mapping configuration applied to all clients.",
        "properties": {
          "name": {
            "type": "string",
            "const": "Generic Configuration",
            "description": "Display name, always `Generic Configuration`."
          },
          "description": {
            "type": "string",
            "description": "Human-readable summary of the configuration."
          },
          "fields": {
            "$ref": "#/components/schemas/FieldSupport",
            "description": "Field-support counts for this configuration (23/50/73)."
          },
          "features": {
            "type": "array",
            "description": "Feature flags this configuration enables.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ConfigResponse": {
        "type": "object",
        "description": "Body of `GET /config/{clientId}` - the requested client's field-mapping configuration.",
        "properties": {
          "client": {
            "type": "string",
            "description": "The client key that was requested."
          },
          "configuration": {
            "description": "The resolved configuration for that client.",
            "type": "object"
          }
        }
      },
      "ConfigListResponse": {
        "type": "object",
        "description": "Body of `GET /config` - the configurations the CALLING client may use, plus the default client key. `generic` is always present; a specialised configuration appears only for the client it belongs to.",
        "properties": {
          "availableConfigurations": {
            "type": "object",
            "description": "Map of client key to its configuration.",
            "properties": {
              "generic": {
                "$ref": "#/components/schemas/GenericConfig",
                "description": "The generic (default) configuration."
              }
            }
          },
          "defaultClient": {
            "type": "string",
            "const": "generic",
            "description": "The client key applied when none is selected, always `generic`."
          }
        }
      }
    }
  },
  "x-zkong-field-support": {
    "core": 23,
    "extended": 50,
    "total": 73
  }
}