{
  "openapi": "3.1.0",
  "info": {
    "title": "ONVELS Import API",
    "version": "2026-11-16",
    "description": "Seller import API for reviewed structured products and public source links. JSON bodies are limited to 256 KiB and depth 32. Preview before importing. Single-host durable idempotency is available for keyed mutations; partial legacy database outcomes require reconciliation. Provider verification is respected. Legacy form bodies are also accepted, but JSON is recommended. This contract documents the stable import envelope; optional legacy variant and commerce fields remain extensible. Source identity reuse is separate from Idempotency-Key replay. For confirmed imports with a source URL, a durable single-host journal is scoped to the authenticated actor and store. Repeating a normalized exact source URL, or a sibling URL with the same complete family proven by the server, returns the existing owned product without creating, updating, publishing or charging it again. URL normalization lowercases the host, normalizes a default port and removes the fetch fragment; every query parameter and its order is retained. Variant query parameters are never blindly stripped. Family structural identifiers retain their fragments. Journal protection is prospective: it covers identities recorded by this release, not every historical catalog product. It does not scan, merge, purge or deduplicate historical catalog rows. An older exact-only receipt is never silently promoted to a complete family.",
    "x-extraction-release": "20261025-r3",
    "x-publication-release": "20261026-r5",
    "x-runtime-api-version": "1.1.1",
    "x-source-identity-release": "20261116-r1"
  },
  "servers": [
    {
      "url": "https://www.onvels.com/stores/browser-import"
    }
  ],
  "paths": {
    "/status": {
      "get": {
        "summary": "Read version, authentication, authorized store categories and recorded credits",
        "description": "Read-only. Anonymous responses contain no tenant data. Authenticated status returns the current recorded balance without granting credits.",
        "security": [
          {},
          {
            "importToken": []
          },
          {
            "sellerSession": []
          }
        ],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ]
            },
            "example": "json"
          }
        ],
        "responses": {
          "200": {
            "description": "Current status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/token": {
      "post": {
        "summary": "Create an import token from an authenticated seller session",
        "description": "Creates a secret bearer token; store it securely. This endpoint is not idempotent. Do not expose tokens in URLs or logs.",
        "security": [
          {
            "sellerSession": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token issued once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload larger than 256 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Token creation could not be confirmed; no usable token is returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/product": {
      "post": {
        "summary": "Preview or import reviewed structured product data",
        "description": "Set dry_run=1 for validation. A mutation normally costs one import credit. If requested publication has no successfully saved image, it becomes an uncharged draft. Publication and feed acknowledgement are distinct. Independent requests with different Idempotency-Key values may run concurrently within a bounded store capacity. The default is eight active operations per store, shared across authenticated actors; the server may configure 1–32. Legacy requests without a key remain exclusive. HTTP 429 import_capacity_busy does not reserve a new receipt: honor Retry-After and retry the identical request with the same key. A completed replay returns its original result without creating another product or debit. HTTP 409 import_outcome_unknown requires reconciliation, not a new key. An accepted request, preview, draft or pending product is not a completed publication. Confirm product.publication_status=published, approved=1, images_imported>0 and feed_status=recorded, and reconcile stored product/debit records when measuring completed work. Capacity is not a guarantee of throughput or source availability. Source identity reuse is separate from Idempotency-Key replay. For confirmed imports with a source URL, a durable single-host journal is scoped to the authenticated actor and store. Repeating a normalized exact source URL, or a sibling URL with the same complete family proven by the server, returns the existing owned product without creating, updating, publishing or charging it again. URL normalization lowercases the host, normalizes a default port and removes the fetch fragment; every query parameter and its order is retained. Variant query parameters are never blindly stripped. Family structural identifiers retain their fragments. Journal protection is prospective: it covers identities recorded by this release, not every historical catalog product. It does not scan, merge, purge or deduplicate historical catalog rows. An older exact-only receipt is never silently promoted to a complete family. A source reuse response has result=1, reused_existing=true, changes_applied=false, charged=0 and credit_cost=0. Its positive product.id identifies a product whose current actor/store ownership was rechecked; product fields and option/variant counts describe current catalog state. Requested edits, categories, prices, variants and publish flags are not applied. Use product.edit_url to review changes separately. Reuse is not a new publication and must not count toward newly saved or newly charged work. A later Idempotency-Key replay may return the stored snapshot of this response. The structured-product endpoint does not fetch the source and does not accept client-supplied family proof. A reviewed source_url enables exact-URL identity reuse. Providing the same source URL with new product data does not update an existing product. Without a source URL there is no source-identity journal claim; keyed request idempotency still applies.",
        "security": [
          {
            "importToken": []
          },
          {
            "sellerSession": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Use one stable key for an intended mutation. Matching repeats return the original response. A changed payload conflicts. Optional only for legacy compatibility; no replay guarantee without it. Source identity reuse is a distinct prospective safeguard and does not replace a stable request key. A source-layer rejection after admission may itself be stored: same-key replay returns that rejection without reevaluating its cause. Only confirmed retry_safe=1 outcomes permit a new explicit attempt after correcting the cause; uncertain outcomes require reconciliation.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview, newly completed import, or existing product reused without changes or charge; inspect the explicit reuse, publication and charge fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResponse"
                },
                "examples": {
                  "reusedExisting": {
                    "summary": "Illustrative existing product response: no new product, change or charge",
                    "value": {
                      "result": 1,
                      "reused_existing": true,
                      "changes_applied": false,
                      "charged": 0,
                      "credit_cost": 0,
                      "store": {
                        "id": 3
                      },
                      "product": {
                        "id": 135,
                        "name": "Reviewed coat",
                        "price": "79.50",
                        "sku": "COAT-1",
                        "status": "draft",
                        "publication_status": "draft",
                        "approved": 0,
                        "options_count": 1,
                        "variants_count": 2,
                        "options_imported": 1,
                        "variants_imported": 2,
                        "url": "https://www.onvels.com/stores/product/reviewed-coat-135",
                        "edit_url": "https://www.onvels.com/stores/manager/products/create/135"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when returning a stored response; balance is then the original snapshot"
              },
              "Source-Import-Reused": {
                "description": "Present with value true when this request resolves an existing source identity. An Idempotency-Key replay instead returns the stored body and Idempotency-Replayed header; do not require both headers.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient import credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Store/idempotency conflict, source identity currently in progress, conflicting source/family identities, changed product ownership/existence, or an uncertain previous outcome. Inspect error_code and retry_safe; never replace a reconciliation-required import with a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "source_identity_in_progress": {
                    "summary": "Another request holds this source/family identity. This request creates no product or charge. A keyed request can record this rejection: repeating its key returns the stored 409 and does not reevaluate the source. After the other operation resolves, a new explicitly requested attempt/key may reevaluate this retry_safe=1 rejection. Never switch keys for an uncertain or reconciliation-required outcome. This is not a completed reuse receipt.",
                    "value": {
                      "result": 0,
                      "message": "Another request holds this source/family identity. This request creates no product or charge. A keyed request can record this rejection: repeating its key returns the stored 409 and does not reevaluate the source. After the other operation resolves, a new explicitly requested attempt/key may reevaluate this retry_safe=1 rejection. Never switch keys for an uncertain or reconciliation-required outcome. This is not a completed reuse receipt.",
                      "error_code": "source_identity_in_progress",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "source_identity_outcome_unknown": {
                    "summary": "A started/product-bound/corrupt prior identity lacks a complete outcome. Reconcile the prior product and debit; never recreate it with a new key.",
                    "value": {
                      "result": 0,
                      "message": "A started/product-bound/corrupt prior identity lacks a complete outcome. Reconcile the prior product and debit; never recreate it with a new key.",
                      "error_code": "source_identity_outcome_unknown",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  },
                  "source_identity_conflict": {
                    "summary": "Conflicting family/product receipts, including attempted promotion of an exact-only receipt into a complete family. No automatic merge or replacement.",
                    "value": {
                      "result": 0,
                      "message": "Conflicting family/product receipts, including attempted promotion of an exact-only receipt into a complete family. No automatic merge or replacement.",
                      "error_code": "source_identity_conflict",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  },
                  "source_identity_product_changed": {
                    "summary": "The journaled product is absent or no longer belongs to this actor/store. Reconcile; no replacement product is created.",
                    "value": {
                      "result": 0,
                      "message": "The journaled product is absent or no longer belongs to this actor/store. Reconcile; no replacement product is created.",
                      "error_code": "source_identity_product_changed",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Payload larger than 256 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation or source review required, including incomplete family evidence or changed variant-combination coverage. No product/credit mutation is confirmed by this response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "variant_family_incomplete": {
                    "summary": "The source declares a family but the server could not verify every combination. Review/complete the source variants; do not treat a partial preview as publication authorization.",
                    "value": {
                      "result": 0,
                      "message": "The source declares a family but the server could not verify every combination. Review/complete the source variants; do not treat a partial preview as publication authorization.",
                      "error_code": "variant_family_incomplete",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "variant_family_changed": {
                    "summary": "The reviewed payload removed or changed the server-verified combination coverage. Preserve every combination and review again.",
                    "value": {
                      "result": 0,
                      "message": "The reviewed payload removed or changed the server-verified combination coverage. Preserve every combination and review again.",
                      "error_code": "variant_family_changed",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "invalid_source_identity": {
                    "summary": "Invalid source identity or conflicting-origin proof. The client cannot supply trusted family evidence.",
                    "value": {
                      "result": 0,
                      "message": "Invalid source identity or conflicting-origin proof. The client cannot supply trusted family evidence.",
                      "error_code": "invalid_source_identity",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Another import in the same authenticated store scope is running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Delay in seconds before retrying a capacity rejection",
                "schema": {
                  "type": "integer",
                  "enum": [
                    15
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Partial or uncertain result: reconcile before continuing A typed journal/storage failure after an observed product save or known debit returns HTTP500 import_outcome_unknown, outcome=unknown, reconciliation_required=1 and retry_safe=0. charged and credit_cost preserve the observed result: 0 before a debit, 1 after a confirmed debit, or null if debit acknowledgement is uncertain. A zero charge does not make a saved product safe to recreate. product.id and save_confirmed are included when known. Reconcile the existing record and charge instead of switching keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "savedBeforeDebit": {
                    "summary": "Illustrative uncertain journal outcome: not_charged",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": 0,
                      "credit_cost": 0,
                      "charge_status": "not_charged",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  },
                  "savedAndDebited": {
                    "summary": "Illustrative uncertain journal outcome: charged",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": 1,
                      "credit_cost": 1,
                      "charge_status": "charged",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  },
                  "debitAcknowledgementUnknown": {
                    "summary": "Illustrative uncertain journal outcome: unknown",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": null,
                      "credit_cost": null,
                      "charge_status": "unknown",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Required storage is unavailable, or import_maintenance pauses submissions during a verified deployment. Maintenance returns Retry-After and does not create an operation receipt or charge. Source identity storage failures also reject new imports; Retry-After is provided for import_maintenance only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "source_identity_storage_unavailable": {
                    "summary": "Before a catalog write or known debit, the source identity journal cannot be used safely and rejects admission without a new product or charge. A journal failure after observed writes instead returns HTTP500 import_outcome_unknown; reconcile even if its charge is zero.",
                    "value": {
                      "result": 0,
                      "message": "Before a catalog write or known debit, the source identity journal cannot be used safely and rejects admission without a new product or charge. A journal failure after observed writes instead returns HTTP500 import_outcome_unknown; reconcile even if its charge is zero.",
                      "error_code": "source_identity_storage_unavailable",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for import_maintenance; retry the identical body and Idempotency-Key after this many seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/link": {
      "post": {
        "summary": "Preview or import from a public product URL",
        "description": "Extract a product from any public HTTP(S) URL, without selecting a platform. Supported evidence includes JSON-LD and local graphs, ProductGroup variants, Microdata, RDFa, embedded JSON/hydration (including bounded React Router streams), Open Graph and scoped product HTML, and direct product JSON. The decoded document limit is 2 MiB. A complete HTML page for the same Amazon.com /dp/ASIN can use up to 3 MiB within the same eight-second fetch deadline. Product identity, offer ownership and price/currency consistency are checked. No arbitrary JavaScript execution, login session, CAPTCHA bypass or universal availability guarantee. A preview with ambiguous or absent price may return HTTP 200, product.price=null and extraction.review_required=true; result=1 in a preview is not authorization to publish. Confirm the price, currency, category and other required fields before mutation. A source_verification_required, source_product_ambiguous or source_product_not_found response has no product/credit mutation. dry_run=1 never creates a product or consumes credits. Independent requests with different Idempotency-Key values may run concurrently within a bounded store capacity. The default is eight active operations per store, shared across authenticated actors; the server may configure 1–32. Legacy requests without a key remain exclusive. HTTP 429 import_capacity_busy does not reserve a new receipt: honor Retry-After and retry the identical request with the same key. A completed replay returns its original result without creating another product or debit. HTTP 409 import_outcome_unknown requires reconciliation, not a new key. An accepted request, preview, draft or pending product is not a completed publication. Confirm product.publication_status=published, approved=1, images_imported>0 and feed_status=recorded, and reconcile stored product/debit records when measuring completed work. Capacity is not a guarantee of throughput or source availability. Source identity reuse is separate from Idempotency-Key replay. For confirmed imports with a source URL, a durable single-host journal is scoped to the authenticated actor and store. Repeating a normalized exact source URL, or a sibling URL with the same complete family proven by the server, returns the existing owned product without creating, updating, publishing or charging it again. URL normalization lowercases the host, normalizes a default port and removes the fetch fragment; every query parameter and its order is retained. Variant query parameters are never blindly stripped. Family structural identifiers retain their fragments. Journal protection is prospective: it covers identities recorded by this release, not every historical catalog product. It does not scan, merge, purge or deduplicate historical catalog rows. An older exact-only receipt is never silently promoted to a complete family. A source reuse response has result=1, reused_existing=true, changes_applied=false, charged=0 and credit_cost=0. Its positive product.id identifies a product whose current actor/store ownership was rechecked; product fields and option/variant counts describe current catalog state. Requested edits, categories, prices, variants and publish flags are not applied. Use product.edit_url to review changes separately. Reuse is not a new publication and must not count toward newly saved or newly charged work. A later Idempotency-Key replay may return the stored snapshot of this response. On each link request, family evidence is recomputed by the server from an explicit same-origin ProductGroup identifier (productGroupID or a stable group URL/@id) and at least two distinct, complete variant combinations. Supported family option dimensions are Color, Size, Material and Pattern. Each declared combination must have verified option values, price, a consistent currency and explicit supported availability; one selected variant, unresolved siblings, missing dimensions/prices/availability or ambiguous evidence do not prove a complete family. Client fields, matching titles/SKUs, similar URLs and stripped query parameters cannot supply that proof. The client may review prices and stock but must preserve every detected combination. When extraction reports family_variants_require_review, the partial family may be previewed with extraction.review_required=true, while mutation returns variant_family_incomplete. Declared ProductGroup data that is foreign, oversized, unresolved or otherwise incomplete requires review and receives no family alias. Standalone products without an explicit family declaration can still use exact-URL identity only. Removing or changing a verified combination returns variant_family_changed. Unsupported or protected URLs may still require manual review or an authorized integration.",
        "security": [
          {
            "importToken": []
          },
          {
            "sellerSession": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Use one stable key for an intended mutation. Matching repeats return the original response. A changed payload conflicts. Optional only for legacy compatibility; no replay guarantee without it. Source identity reuse is a distinct prospective safeguard and does not replace a stable request key. A source-layer rejection after admission may itself be stored: same-key replay returns that rejection without reevaluating its cause. Only confirmed retry_safe=1 outcomes permit a new explicit attempt after correcting the cause; uncertain outcomes require reconciliation.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkRequest"
              },
              "examples": {
                "preview": {
                  "summary": "Preview any public product URL without charging",
                  "value": {
                    "url": "https://shop.example/products/coat",
                    "dry_run": 1
                  }
                },
                "confirmed": {
                  "summary": "Import after checking preview and the authenticated store currency/category",
                  "value": {
                    "url": "https://shop.example/products/coat",
                    "dry_run": 0,
                    "publish": 0,
                    "expected_store_id": 3,
                    "name": "Reviewed coat",
                    "price": "79.50",
                    "currency": "USD",
                    "global_category_id": 1,
                    "idempotency_key": "replace-with-a-new-operation-id"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview, newly completed import, or existing product reused without changes or charge; inspect the explicit reuse, publication and charge fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResponse"
                },
                "examples": {
                  "reusedExisting": {
                    "summary": "Illustrative existing product response: no new product, change or charge",
                    "value": {
                      "result": 1,
                      "reused_existing": true,
                      "changes_applied": false,
                      "charged": 0,
                      "credit_cost": 0,
                      "store": {
                        "id": 3
                      },
                      "product": {
                        "id": 135,
                        "name": "Reviewed coat",
                        "price": "79.50",
                        "sku": "COAT-1",
                        "status": "draft",
                        "publication_status": "draft",
                        "approved": 0,
                        "options_count": 1,
                        "variants_count": 2,
                        "options_imported": 1,
                        "variants_imported": 2,
                        "url": "https://www.onvels.com/stores/product/reviewed-coat-135",
                        "edit_url": "https://www.onvels.com/stores/manager/products/create/135"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present only when returning a stored response; balance is then the original snapshot"
              },
              "Source-Import-Reused": {
                "description": "Present with value true when this request resolves an existing source identity. An Idempotency-Key replay instead returns the stored body and Idempotency-Replayed header; do not require both headers.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient import credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Store/idempotency conflict, source identity currently in progress, conflicting source/family identities, changed product ownership/existence, or an uncertain previous outcome. Inspect error_code and retry_safe; never replace a reconciliation-required import with a new key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "source_identity_in_progress": {
                    "summary": "Another request holds this source/family identity. This request creates no product or charge. A keyed request can record this rejection: repeating its key returns the stored 409 and does not reevaluate the source. After the other operation resolves, a new explicitly requested attempt/key may reevaluate this retry_safe=1 rejection. Never switch keys for an uncertain or reconciliation-required outcome. This is not a completed reuse receipt.",
                    "value": {
                      "result": 0,
                      "message": "Another request holds this source/family identity. This request creates no product or charge. A keyed request can record this rejection: repeating its key returns the stored 409 and does not reevaluate the source. After the other operation resolves, a new explicitly requested attempt/key may reevaluate this retry_safe=1 rejection. Never switch keys for an uncertain or reconciliation-required outcome. This is not a completed reuse receipt.",
                      "error_code": "source_identity_in_progress",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "source_identity_outcome_unknown": {
                    "summary": "A started/product-bound/corrupt prior identity lacks a complete outcome. Reconcile the prior product and debit; never recreate it with a new key.",
                    "value": {
                      "result": 0,
                      "message": "A started/product-bound/corrupt prior identity lacks a complete outcome. Reconcile the prior product and debit; never recreate it with a new key.",
                      "error_code": "source_identity_outcome_unknown",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  },
                  "source_identity_conflict": {
                    "summary": "Conflicting family/product receipts, including attempted promotion of an exact-only receipt into a complete family. No automatic merge or replacement.",
                    "value": {
                      "result": 0,
                      "message": "Conflicting family/product receipts, including attempted promotion of an exact-only receipt into a complete family. No automatic merge or replacement.",
                      "error_code": "source_identity_conflict",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  },
                  "source_identity_product_changed": {
                    "summary": "The journaled product is absent or no longer belongs to this actor/store. Reconcile; no replacement product is created.",
                    "value": {
                      "result": 0,
                      "message": "The journaled product is absent or no longer belongs to this actor/store. Reconcile; no replacement product is created.",
                      "error_code": "source_identity_product_changed",
                      "charged": null,
                      "credit_cost": null,
                      "retry_safe": 0,
                      "reconciliation_required": 1,
                      "outcome": "unknown"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Payload larger than 256 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation or source review required, including incomplete family evidence or changed variant-combination coverage. No product/credit mutation is confirmed by this response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "variant_family_incomplete": {
                    "summary": "The source declares a family but the server could not verify every combination. Review/complete the source variants; do not treat a partial preview as publication authorization.",
                    "value": {
                      "result": 0,
                      "message": "The source declares a family but the server could not verify every combination. Review/complete the source variants; do not treat a partial preview as publication authorization.",
                      "error_code": "variant_family_incomplete",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "variant_family_changed": {
                    "summary": "The reviewed payload removed or changed the server-verified combination coverage. Preserve every combination and review again.",
                    "value": {
                      "result": 0,
                      "message": "The reviewed payload removed or changed the server-verified combination coverage. Preserve every combination and review again.",
                      "error_code": "variant_family_changed",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "invalid_source_identity": {
                    "summary": "Invalid source identity or conflicting-origin proof. The client cannot supply trusted family evidence.",
                    "value": {
                      "result": 0,
                      "message": "Invalid source identity or conflicting-origin proof. The client cannot supply trusted family evidence.",
                      "error_code": "invalid_source_identity",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  },
                  "source_review_required": {
                    "summary": "Oversized-source preview can be completed manually; no charge",
                    "value": {
                      "result": 0,
                      "message": "Review the source and provide product data manually.",
                      "error_code": "source_review_required",
                      "dry_run": 1,
                      "charged": 0,
                      "credit_cost": 0,
                      "extraction": {
                        "status": "source_too_large",
                        "manual_entry_allowed": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Another import in the same authenticated store scope is running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Delay in seconds before retrying a capacity rejection",
                "schema": {
                  "type": "integer",
                  "enum": [
                    15
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Partial or uncertain result: reconcile before continuing A typed journal/storage failure after an observed product save or known debit returns HTTP500 import_outcome_unknown, outcome=unknown, reconciliation_required=1 and retry_safe=0. charged and credit_cost preserve the observed result: 0 before a debit, 1 after a confirmed debit, or null if debit acknowledgement is uncertain. A zero charge does not make a saved product safe to recreate. product.id and save_confirmed are included when known. Reconcile the existing record and charge instead of switching keys.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "savedBeforeDebit": {
                    "summary": "Illustrative uncertain journal outcome: not_charged",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": 0,
                      "credit_cost": 0,
                      "charge_status": "not_charged",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  },
                  "savedAndDebited": {
                    "summary": "Illustrative uncertain journal outcome: charged",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": 1,
                      "credit_cost": 1,
                      "charge_status": "charged",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  },
                  "debitAcknowledgementUnknown": {
                    "summary": "Illustrative uncertain journal outcome: unknown",
                    "value": {
                      "result": 0,
                      "message": "The import result requires reconciliation.",
                      "error_code": "import_outcome_unknown",
                      "outcome": "unknown",
                      "reconciliation_required": 1,
                      "retry_safe": 0,
                      "charged": null,
                      "credit_cost": null,
                      "charge_status": "unknown",
                      "product": {
                        "id": 135,
                        "save_confirmed": 1
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Required storage is unavailable, or import_maintenance pauses submissions during a verified deployment. Maintenance returns Retry-After and does not create an operation receipt or charge. Source identity storage failures also reject new imports; Retry-After is provided for import_maintenance only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "source_identity_storage_unavailable": {
                    "summary": "Before a catalog write or known debit, the source identity journal cannot be used safely and rejects admission without a new product or charge. A journal failure after observed writes instead returns HTTP500 import_outcome_unknown; reconcile even if its charge is zero.",
                    "value": {
                      "result": 0,
                      "message": "Before a catalog write or known debit, the source identity journal cannot be used safely and rejects admission without a new product or charge. A journal failure after observed writes instead returns HTTP500 import_outcome_unknown; reconcile even if its charge is zero.",
                      "error_code": "source_identity_storage_unavailable",
                      "charged": 0,
                      "credit_cost": 0,
                      "retry_safe": 1
                    }
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Present for import_maintenance; retry the identical body and Idempotency-Key after this many seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "importToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Token created from the seller session. Store scope is derived server-side."
      },
      "sellerSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "CAKEPHP",
        "description": "Existing same-origin ONVELS seller session; use credentials:same-origin in the manager."
      }
    },
    "schemas": {
      "ProductRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "expected_store_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Expected authenticated store ID from status; never selects a different store."
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
          },
          "dry_run": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              {
                "type": "string",
                "enum": [
                  "0",
                  "1"
                ]
              }
            ],
            "default": 0,
            "description": "1 previews without product creation or credit consumption. Explicitly set this for previews."
          },
          "publish": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              {
                "type": "string",
                "enum": [
                  "0",
                  "1"
                ]
              }
            ],
            "default": 0,
            "description": "1 requests publication; at least one saved image is required. Otherwise save a draft."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "price": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,8})(\\.[0-9]{1,2})?$",
            "example": "19.99"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "Must match import_currency from status. No implicit exchange conversion."
          },
          "global_category_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Allowed global category ID from status."
          },
          "store_category_id": {
            "type": "integer",
            "minimum": 0
          },
          "description": {
            "type": "string"
          },
          "brief": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "Reviewed public source reference. Confirmed imports use normalized exact-URL identity within the authenticated actor/store; this is not client authority to assert a product family or change a prior product."
          },
          "product_link": {
            "type": "string",
            "format": "uri"
          },
          "image_url": {
            "type": "string",
            "format": "uri"
          },
          "images": {
            "type": "array",
            "maxItems": 12,
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "At most 12 image URLs are retained. Public HTTP(S) IPv4 only; no credentials, custom ports or redirects."
          },
          "product_type": {
            "type": "string",
            "description": "Use external for a product linked to a supplier; physical and other legacy types remain subject to server validation."
          },
          "inventory_source": {
            "type": "string",
            "enum": ["seller_catalog"],
            "description": "Opt in to reviewed inventory for a simple item from the seller's catalog. For families, supply stock on the individual variants. Missing availability permits a draft only. Existing-product reuse never changes inventory."
          },
          "availability": {
            "type": ["string", "null"],
            "description": "With seller_catalog, use InStock, OutOfStock, SoldOut, Discontinued, their schema.org URLs, or null for unknown. The preview and initial receipt return the normalized declaration. InStock alone does not declare any quantity."
          },
          "stock_quantity": {
            "type": ["integer", "null"],
            "minimum": 0,
            "maximum": 2147483647,
            "description": "Optional exact on-hand count for a simple seller_catalog item. Null leaves the count unrecorded. If supplied with availability, a positive count must agree with InStock. An explicit zero records zero."
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Reviewed option definitions. Server-proven families must retain all detected option combinations; labels alone cannot prove shared family identity."
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Reviewed variants of one parent product, not requests to create separate parent products. For a server-proven complete family, every detected combination must remain present. Existing-product reuse returns current counts and applies none of these requested edits."
          },
          "image_metadata": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "commerce_capabilities": {
            "description": "Legacy commerce metadata; accepted shape and capabilities are available from status."
          }
        },
        "additionalProperties": true,
        "description": "Confirmed imports also require a valid store currency and category. Price validation and existing legacy defaults are enforced server-side; use the preview response before submission."
      },
      "LinkRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "verify_variants": {
            "type": "integer",
            "enum": [0, 1],
            "default": 0,
            "description": "Set to 1 on preview and save to verify up to four declared sibling SKU URLs on an Ulta size-family page. The importer retains a single product group and returns partial offers for review when a sibling price or availability cannot be confirmed."
          },
          "expected_store_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Expected authenticated store ID from status; never selects a different store."
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
          },
          "dry_run": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              {
                "type": "string",
                "enum": [
                  "0",
                  "1"
                ]
              }
            ],
            "default": 0,
            "description": "1 previews without product creation or credit consumption. Explicitly set this for previews."
          },
          "publish": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              {
                "type": "string",
                "enum": [
                  "0",
                  "1"
                ]
              }
            ],
            "default": 0,
            "description": "1 requests publication; at least one saved image is required. Otherwise save a draft."
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "price": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,8})(\\.[0-9]{1,2})?$",
            "example": "19.99"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "Must match import_currency from status. No implicit exchange conversion."
          },
          "global_category_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Allowed global category ID from status."
          },
          "store_category_id": {
            "type": "integer",
            "minimum": 0
          },
          "description": {
            "type": "string"
          },
          "brief": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri",
            "description": "Reviewed public source reference. Confirmed imports use normalized exact-URL identity within the authenticated actor/store; this is not client authority to assert a product family or change a prior product."
          },
          "product_link": {
            "type": "string",
            "format": "uri"
          },
          "image_url": {
            "type": "string",
            "format": "uri"
          },
          "images": {
            "type": "array",
            "maxItems": 12,
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "At most 12 image URLs are retained. Public HTTP(S) IPv4 only; no credentials, custom ports or redirects."
          },
          "product_type": {
            "type": "string",
            "description": "Use external for a product linked to a supplier; physical and other legacy types remain subject to server validation."
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Reviewed option definitions. Server-proven families must retain all detected option combinations; labels alone cannot prove shared family identity."
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Reviewed variants of one parent product, not requests to create separate parent products. For a server-proven complete family, every detected combination must remain present. Existing-product reuse returns current counts and applies none of these requested edits."
          },
          "image_metadata": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "commerce_capabilities": {
            "description": "Legacy commerce metadata; accepted shape and capabilities are available from status."
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "CreditBalance": {
        "type": "object",
        "properties": {
          "current_credits": {
            "type": "integer",
            "minimum": 0
          },
          "spent_credits": {
            "type": "integer",
            "minimum": 0
          },
          "lifetime_credits": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": true
      },
      "ImportResponse": {
        "type": "object",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "message": {
            "type": "string"
          },
          "dry_run": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "charged": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              0,
              1,
              null
            ],
            "description": "null means the debit result is uncertain, never zero."
          },
          "credit_cost": {
            "type": [
              "integer",
              "null"
            ]
          },
          "import_credit_cost": {
            "type": "integer"
          },
          "credit_balance": {
            "$ref": "#/components/schemas/CreditBalance"
          },
          "store": {
            "type": "object",
            "additionalProperties": true
          },
          "product": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1
              },
              "status": {
                "type": "string"
              },
              "publication_status": {
                "type": "string",
                "enum": [
                  "draft",
                  "pending",
                  "published"
                ]
              },
              "save_confirmed": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "price": {
                "type": [
                  "string",
                  "number",
                  "null"
                ],
                "description": "null on a detected link preview means no single price was confirmed; do not import without review."
              },
              "currency": {
                "type": "string",
                "description": "Empty when the source did not provide explicit currency. Never infer USD from a dollar symbol."
              },
              "category_review_required": {
                "type": "boolean",
                "description": "True when a category was defaulted or insufficiently supported; requires review."
              },
              "category_sources": {
                "type": "object",
                "properties": {
                  "global": {
                    "enum": [
                      "provided",
                      "inferred",
                      "default"
                    ]
                  },
                  "store": {
                    "enum": [
                      "provided",
                      "inferred",
                      "none"
                    ]
                  }
                }
              },
              "category_warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "images_imported": {
                "type": "integer",
                "minimum": 0,
                "maximum": 12,
                "description": "Images persisted by the import. Each source is bounded to 8 MiB compressed, 8192 pixels per side and 16777216 total pixels before decoding."
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "edit_url": {
                "type": "string",
                "format": "uri"
              },
              "options_count": {
                "type": "integer",
                "minimum": 0,
                "description": "On source reuse, the current count of owned product option records."
              },
              "variants_count": {
                "type": "integer",
                "minimum": 0,
                "description": "On source reuse, the current count of owned product variant records."
              },
              "options_imported": {
                "type": "integer",
                "minimum": 0,
                "description": "On a new import, saved options. On reuse, current existing count; not newly imported options."
              },
              "variants_imported": {
                "type": "integer",
                "minimum": 0,
                "description": "On a new import, saved variants. On reuse, current existing count; not newly imported variants."
              }
            },
            "additionalProperties": true
          },
          "warnings": {},
          "extraction": {
            "type": "object",
            "properties": {
              "strategy": {
                "type": "string",
                "examples": [
                  "json_ld",
                  "microdata",
                  "rdfa",
                  "embedded_json",
                  "html",
                  "json_document"
                ]
              },
              "review_required": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string",
                  "examples": [
                    "family_variants_require_review",
                    "family_single_variant_only",
                    "family_variants_incomplete"
                  ]
                }
              },
              "field_sources": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "variants_detected": {
                "type": "integer",
                "minimum": 0
              },
              "images_detected": {
                "type": "integer",
                "minimum": 0
              },
              "price_detected": {
                "type": [
                  "string",
                  "number",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "manual_entry_allowed": {
                "type": "integer",
                "const": 1,
                "description": "On a zero-cost preview that returns source_review_required, allows the seller to enter verified details. Supported extraction statuses are source_too_large, source_http_error, source_transport_failed, source_timeout and source_product_not_found. Normal store, category and confirmation checks still apply."
              }
            },
            "additionalProperties": true
          },
          "reused_existing": {
            "type": "boolean",
            "const": true,
            "description": "Present and true only when this source resolves to a previously journaled product in the current actor/store. Not a new save or publication."
          },
          "changes_applied": {
            "type": "boolean",
            "const": false,
            "description": "On reuse, false: submitted data and publish intent did not change the existing product."
          }
        },
        "additionalProperties": true,
        "allOf": [
          {
            "if": {
              "required": [
                "reused_existing"
              ],
              "properties": {
                "reused_existing": {
                  "const": true
                }
              }
            },
            "then": {
              "type": "object",
              "required": [
                "result",
                "reused_existing",
                "changes_applied",
                "charged",
                "credit_cost",
                "store",
                "product"
              ],
              "properties": {
                "result": {
                  "const": 1
                },
                "reused_existing": {
                  "const": true
                },
                "changes_applied": {
                  "const": false
                },
                "charged": {
                  "const": 0
                },
                "credit_cost": {
                  "const": 0
                },
                "store": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                },
                "product": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "result",
          "message"
        ],
        "properties": {
          "result": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "message": {
            "type": "string"
          },
          "error_code": {
            "type": "string",
            "examples": [
              "variant_family_incomplete",
              "variant_family_changed",
              "invalid_source_identity",
              "source_identity_in_progress",
              "source_identity_outcome_unknown",
              "source_identity_conflict",
              "source_identity_product_changed",
              "source_identity_storage_unavailable",
              "import_outcome_unknown",
              "source_review_required"
            ]
          },
          "code": {
            "type": "string"
          },
          "charged": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              0,
              1,
              null
            ]
          },
          "credit_cost": {
            "type": [
              "integer",
              "null"
            ]
          },
          "outcome": {
            "type": "string"
          },
          "retry_safe": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "reconciliation_required": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "product": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "save_confirmed": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            },
            "additionalProperties": true
          },
          "extraction": {
            "type": "object",
            "properties": {
              "strategy": {
                "type": "string",
                "examples": [
                  "json_ld",
                  "microdata",
                  "rdfa",
                  "embedded_json",
                  "html",
                  "json_document"
                ]
              },
              "review_required": {
                "type": "boolean"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string",
                  "examples": [
                    "family_variants_require_review",
                    "family_single_variant_only",
                    "family_variants_incomplete"
                  ]
                }
              },
              "field_sources": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "variants_detected": {
                "type": "integer",
                "minimum": 0
              },
              "images_detected": {
                "type": "integer",
                "minimum": 0
              },
              "price_detected": {
                "type": [
                  "string",
                  "number",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "manual_entry_allowed": {
                "type": "integer",
                "const": 1,
                "description": "On a zero-cost preview that returns source_review_required, allows the seller to enter verified details. Supported extraction statuses are source_too_large, source_http_error, source_transport_failed, source_timeout and source_product_not_found. Normal store, category and confirmation checks still apply."
              }
            },
            "additionalProperties": true
          },
          "charge_status": {
            "type": "string",
            "enum": [
              "not_charged",
              "charged",
              "unknown"
            ],
            "description": "Observed debit classification on an uncertain import outcome; unknown is never zero."
          }
        },
        "additionalProperties": true,
        "x-post-write-outcome": {
          "http_status": 500,
          "error_code": "import_outcome_unknown",
          "retry_safe": 0,
          "reconciliation_required": 1,
          "description": "A typed journal/storage failure after an observed product save or known debit returns HTTP500 import_outcome_unknown, outcome=unknown, reconciliation_required=1 and retry_safe=0. charged and credit_cost preserve the observed result: 0 before a debit, 1 after a confirmed debit, or null if debit acknowledgement is uncertain. A zero charge does not make a saved product safe to recreate. product.id and save_confirmed are included when known. Reconcile the existing record and charge instead of switching keys."
        },
        "x-source-identity-errors": {
          "variant_family_incomplete": {
            "http_status": 422,
            "retry_safe": 1,
            "charged": 0,
            "credit_cost": 0,
            "description": "The source declares a family but the server could not verify every combination. Review/complete the source variants; do not treat a partial preview as publication authorization."
          },
          "variant_family_changed": {
            "http_status": 422,
            "retry_safe": 1,
            "charged": 0,
            "credit_cost": 0,
            "description": "The reviewed payload removed or changed the server-verified combination coverage. Preserve every combination and review again."
          },
          "invalid_source_identity": {
            "http_status": 422,
            "retry_safe": 1,
            "charged": 0,
            "credit_cost": 0,
            "description": "Invalid source identity or conflicting-origin proof. The client cannot supply trusted family evidence."
          },
          "source_identity_in_progress": {
            "http_status": 409,
            "retry_safe": 1,
            "charged": 0,
            "credit_cost": 0,
            "description": "Another request holds this source/family identity. This request creates no product or charge. A keyed request can record this rejection: repeating its key returns the stored 409 and does not reevaluate the source. After the other operation resolves, a new explicitly requested attempt/key may reevaluate this retry_safe=1 rejection. Never switch keys for an uncertain or reconciliation-required outcome. This is not a completed reuse receipt."
          },
          "source_identity_outcome_unknown": {
            "http_status": 409,
            "retry_safe": 0,
            "charged": null,
            "credit_cost": null,
            "reconciliation_required": 1,
            "outcome": "unknown",
            "description": "A started/product-bound/corrupt prior identity lacks a complete outcome. Reconcile the prior product and debit; never recreate it with a new key."
          },
          "source_identity_conflict": {
            "http_status": 409,
            "retry_safe": 0,
            "charged": null,
            "credit_cost": null,
            "reconciliation_required": 1,
            "outcome": "unknown",
            "description": "Conflicting family/product receipts, including attempted promotion of an exact-only receipt into a complete family. No automatic merge or replacement."
          },
          "source_identity_product_changed": {
            "http_status": 409,
            "retry_safe": 0,
            "charged": null,
            "credit_cost": null,
            "reconciliation_required": 1,
            "outcome": "unknown",
            "description": "The journaled product is absent or no longer belongs to this actor/store. Reconcile; no replacement product is created."
          },
          "source_identity_storage_unavailable": {
            "http_status": 503,
            "retry_safe": 1,
            "charged": 0,
            "credit_cost": 0,
            "description": "Before a catalog write or known debit, the source identity journal cannot be used safely and rejects admission without a new product or charge. A journal failure after observed writes instead returns HTTP500 import_outcome_unknown; reconcile even if its charge is zero."
          }
        }
      },
      "StatusResponse": {
        "type": "object",
        "required": [
          "result",
          "api_online",
          "authenticated",
          "api_version"
        ],
        "properties": {
          "result": {
            "const": 1
          },
          "api_online": {
            "const": 1
          },
          "api_version": {
            "type": "string"
          },
          "authenticated": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "import_currency": {
            "type": "string"
          },
          "documentation_url": {
            "type": "string",
            "format": "uri"
          },
          "credit_balance": {
            "$ref": "#/components/schemas/CreditBalance"
          },
          "store": {
            "type": "object",
            "additionalProperties": true
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "idempotency": {
            "type": "object",
            "additionalProperties": true
          },
          "limits": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "result",
          "token",
          "token_type"
        ],
        "properties": {
          "result": {
            "const": 1
          },
          "token": {
            "type": "string",
            "readOnly": true
          },
          "token_type": {
            "const": "Bearer"
          }
        },
        "additionalProperties": true
      },
      "ReusedProductResponse": {
        "description": "A source reuse response has result=1, reused_existing=true, changes_applied=false, charged=0 and credit_cost=0. Its positive product.id identifies a product whose current actor/store ownership was rechecked; product fields and option/variant counts describe current catalog state. Requested edits, categories, prices, variants and publish flags are not applied. Use product.edit_url to review changes separately. Reuse is not a new publication and must not count toward newly saved or newly charged work. A later Idempotency-Key replay may return the stored snapshot of this response.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ImportResponse"
          },
          {
            "type": "object",
            "required": [
              "result",
              "reused_existing",
              "changes_applied",
              "charged",
              "credit_cost",
              "store",
              "product"
            ],
            "properties": {
              "result": {
                "const": 1
              },
              "reused_existing": {
                "const": true
              },
              "changes_applied": {
                "const": false
              },
              "charged": {
                "const": 0
              },
              "credit_cost": {
                "const": 0
              },
              "store": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              },
              "product": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        ]
      }
    }
  }
}
