{
  "components": {
    "securitySchemes": {
      "serviceDelegation": {
        "bearerFormat": "ezdg1",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "EzERP",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "health",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Process is alive"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "description": "Authenticated stateless MCP sharing the typed tool registry.",
        "operationId": "mcp",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "MCP JSON-RPC result"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ]
      }
    },
    "/readyz": {
      "get": {
        "operationId": "ready",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Database is reachable"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Database unavailable"
          }
        }
      }
    },
    "/v1/tools": {
      "get": {
        "operationId": "tools.discover",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Authorized task-scoped definitions"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ]
      }
    },
    "/v1/tools/allocations.find_mabang": {
      "post": {
        "description": "Find original-actor ready allocation observations by exact source, allocationCode reference and EzERP observation-time range. Repeated references are retained. Cursor is bound to these filters; live pages are neither current allocation state nor frozen/complete business coverage. Empty pages still require current API authority.",
        "operationId": "allocations.find_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string"
                  },
                  "source_allocation_reference": {
                    "type": "string",
                    "description": "Exact observed allocationCode, case and whitespace sensitive; not a canonical allocation ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not shipment, receipt or arrival date."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; output budget may shorten a page."
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "normalizer",
                  "source_allocation_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "allocations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "allocation": {
                            "type": "object",
                            "properties": {
                              "source_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "parent_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_start_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_target_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_mode": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "track_number": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "delivered_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "received_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "finished_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_delivery_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "expected_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "in_transit_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "received_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "quantity",
                                    "received_quantity",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_allocation_reference",
                              "parent_allocation_reference",
                              "business_id",
                              "source_start_warehouse_id",
                              "start_warehouse_code",
                              "start_warehouse_name",
                              "source_target_warehouse_id",
                              "target_warehouse_code",
                              "target_warehouse_name",
                              "status_code",
                              "source_state",
                              "type_code",
                              "transport_type_code",
                              "transport_mode",
                              "track_number",
                              "created_at_text",
                              "updated_at_text",
                              "delivered_at_text",
                              "received_at_text",
                              "finished_at_text",
                              "estimated_arrival_at_text",
                              "estimated_delivery_at_text",
                              "expected_arrival_at_text",
                              "source_updated_at",
                              "in_transit_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "allocation": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "allocation",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "allocation",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "allocations"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/allocations.find_mabang_sku": {
      "post": {
        "description": "Find original-actor ready allocation observations whose skuList lines contain an exact stockSku, by source and EzERP observation-time range. Each observation appears once with every matching line ordinal; shipped and received quantities are not netted into in-transit stock. Cursor is bound to these filters; live pages are neither current allocation state nor complete coverage. Empty pages still require current API authority.",
        "operationId": "allocations.find_mabang_sku",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string"
                  },
                  "sku_reference": {
                    "type": "string",
                    "description": "Exact observed skuList stockSku, case and whitespace sensitive; not a canonical SKU ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not shipment, receipt or arrival date."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20 allocation observations, default 10; output budget may shorten a page."
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "normalizer",
                  "sku_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "allocations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "allocation": {
                            "type": "object",
                            "properties": {
                              "source_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "parent_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_start_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_target_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_mode": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "track_number": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "delivered_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "received_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "finished_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_delivery_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "expected_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "in_transit_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "received_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "quantity",
                                    "received_quantity",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_allocation_reference",
                              "parent_allocation_reference",
                              "business_id",
                              "source_start_warehouse_id",
                              "start_warehouse_code",
                              "start_warehouse_name",
                              "source_target_warehouse_id",
                              "target_warehouse_code",
                              "target_warehouse_name",
                              "status_code",
                              "source_state",
                              "type_code",
                              "transport_type_code",
                              "transport_mode",
                              "track_number",
                              "created_at_text",
                              "updated_at_text",
                              "delivered_at_text",
                              "received_at_text",
                              "finished_at_text",
                              "estimated_arrival_at_text",
                              "estimated_delivery_at_text",
                              "expected_arrival_at_text",
                              "source_updated_at",
                              "in_transit_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "allocation": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "allocation",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          },
                          "matched_line_ordinals": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "integer"
                            },
                            "description": "One-based skuList occurrences whose stockSku equals the reference; duplicate lines are kept separate and never summed."
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "allocation",
                          "identity",
                          "identity_sha256",
                          "matched_line_ordinals"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "allocations"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/allocations.get_mabang": {
      "post": {
        "description": "Read one original-actor allocation observation from a fully projected API response. Verify original body, receipt, binding and normalized document; retain duplicate references/lines and null business IDs, dates, units and in-transit quantity; shipped and received quantities stay separate.",
        "operationId": "allocations.get_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.allocation.v1; no automatic interpretation-version upgrade."
                  },
                  "ordinal": {
                    "type": "integer",
                    "description": "One-based occurrence within the original response data array; not an allocation business ID."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "observation_id": {
                      "type": "string"
                    },
                    "ordinal": {
                      "type": "integer"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "record_pointer": {
                      "type": "string"
                    },
                    "document_sha256": {
                      "type": "string"
                    },
                    "api_read": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "binding_ref": {
                          "type": "string"
                        },
                        "binding_sha256": {
                          "type": "string"
                        },
                        "binding_json": {
                          "type": "string",
                          "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                        },
                        "api": {
                          "type": "string"
                        },
                        "request_data_json": {
                          "type": "string"
                        },
                        "request_sha256": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "attempts": {
                          "type": "integer"
                        },
                        "unknown_attempts": {
                          "type": "integer"
                        },
                        "receipt": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "version": {
                              "type": "string"
                            },
                            "attempt_id": {
                              "type": "string"
                            },
                            "connection_id": {
                              "type": "string"
                            },
                            "connection_revision": {
                              "type": "integer"
                            },
                            "api": {
                              "type": "string"
                            },
                            "call_version": {
                              "type": "string"
                            },
                            "request_data_sha256": {
                              "type": "string"
                            },
                            "request_body_sha256": {
                              "type": "string",
                              "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                            },
                            "response_body_sha256": {
                              "type": "string"
                            },
                            "http_status": {
                              "type": "integer"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "received_at": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "version",
                            "attempt_id",
                            "connection_id",
                            "connection_revision",
                            "api",
                            "call_version",
                            "request_data_sha256",
                            "request_body_sha256",
                            "response_body_sha256",
                            "http_status",
                            "started_at",
                            "received_at"
                          ],
                          "additionalProperties": false
                        },
                        "body_bytes": {
                          "type": "integer"
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "binding_ref",
                        "binding_sha256",
                        "binding_json",
                        "api",
                        "request_data_json",
                        "request_sha256",
                        "created_at",
                        "state",
                        "attempts",
                        "unknown_attempts",
                        "receipt",
                        "body_bytes",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "allocation": {
                      "type": "object",
                      "properties": {
                        "source_allocation_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "parent_allocation_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "business_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_start_warehouse_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "start_warehouse_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "start_warehouse_name": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_target_warehouse_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "target_warehouse_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "target_warehouse_name": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_state": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "type_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "transport_type_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "transport_mode": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "track_number": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "created_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "updated_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "delivered_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "received_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "finished_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "estimated_arrival_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "estimated_delivery_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "expected_arrival_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "in_transit_quantity": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "received_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity_unit": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "sku_reference",
                              "sku_business_id",
                              "quantity",
                              "received_quantity",
                              "quantity_unit"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "api": {
                              "type": "string"
                            },
                            "normalizer": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "api",
                            "normalizer",
                            "record_sha256",
                            "fields"
                          ],
                          "additionalProperties": false
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "source_allocation_reference",
                        "parent_allocation_reference",
                        "business_id",
                        "source_start_warehouse_id",
                        "start_warehouse_code",
                        "start_warehouse_name",
                        "source_target_warehouse_id",
                        "target_warehouse_code",
                        "target_warehouse_name",
                        "status_code",
                        "source_state",
                        "type_code",
                        "transport_type_code",
                        "transport_mode",
                        "track_number",
                        "created_at_text",
                        "updated_at_text",
                        "delivered_at_text",
                        "received_at_text",
                        "finished_at_text",
                        "estimated_arrival_at_text",
                        "estimated_delivery_at_text",
                        "expected_arrival_at_text",
                        "source_updated_at",
                        "in_transit_quantity",
                        "lines",
                        "evidence",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "observation_id": {
                          "type": "string"
                        },
                        "allocation": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": [
                                  "null",
                                  "integer"
                                ]
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "identity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "observation_id",
                        "allocation",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity_sha256": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "observation_id",
                    "ordinal",
                    "normalizer",
                    "response_contract",
                    "record_pointer",
                    "document_sha256",
                    "api_read",
                    "allocation",
                    "identity",
                    "identity_sha256"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/allocations.list_mabang": {
      "post": {
        "description": "Page original-actor allocation observations within one fully projected response. Revalidate all original evidence and current operation grant and stored connection, including end. Response end is not allocation, shipment or receipt coverage.",
        "operationId": "allocations.list_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.allocation.v1; no automatic interpretation-version upgrade."
                  },
                  "after_ordinal": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; response budget may shorten a page."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "after_ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "mirror": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "response_contract": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer",
                          "description": "Members in this one response array, never enterprise allocation coverage."
                        },
                        "projected_records": {
                          "type": "integer"
                        },
                        "reported_json": {
                          "type": "object",
                          "description": "Original JSON text of count, rowsPerPage and page when present; uninterpreted.",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "normalizer",
                        "response_contract",
                        "state",
                        "record_count",
                        "projected_records",
                        "reported_json",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "allocations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "allocation": {
                            "type": "object",
                            "properties": {
                              "source_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "parent_allocation_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_start_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "start_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_target_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "target_warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_type_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "transport_mode": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "track_number": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "delivered_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "received_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "finished_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_delivery_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "expected_arrival_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "in_transit_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "received_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "quantity",
                                    "received_quantity",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_allocation_reference",
                              "parent_allocation_reference",
                              "business_id",
                              "source_start_warehouse_id",
                              "start_warehouse_code",
                              "start_warehouse_name",
                              "source_target_warehouse_id",
                              "target_warehouse_code",
                              "target_warehouse_name",
                              "status_code",
                              "source_state",
                              "type_code",
                              "transport_type_code",
                              "transport_mode",
                              "track_number",
                              "created_at_text",
                              "updated_at_text",
                              "delivered_at_text",
                              "received_at_text",
                              "finished_at_text",
                              "estimated_arrival_at_text",
                              "estimated_delivery_at_text",
                              "expected_arrival_at_text",
                              "source_updated_at",
                              "in_transit_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "allocation": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "allocation",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "allocation",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_ordinal": {
                      "type": "integer"
                    },
                    "response_end": {
                      "type": "boolean",
                      "description": "Only the local response members ended; never business, shipment or receipt completeness."
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "mirror",
                    "allocations",
                    "next_ordinal",
                    "response_end"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/allocations.project_mabang": {
      "post": {
        "description": "Persist at most ten allocation observations from an already received hwc-get-allocation-warehouse-list response using the documented-response candidate contract and mabang.openapi.allocation.v1. Repeating advances the same durable projection; completed repeats are unchanged. No upstream read. Unreviewed request selectors, unrecognized envelopes and business error responses are rejected; warehouse client credentials in records are never projected. Production bindings remain disabled.",
        "operationId": "allocations.project_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.allocation.v1; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise allocation coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_json": {
                      "type": "object",
                      "description": "Original JSON text of count, rowsPerPage and page when present; uninterpreted.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/allocations.status_mabang": {
      "post": {
        "description": "Verify allocation projection progress against its original API response and fixed interpretation version. Ready means this response array was projected, never business completeness.",
        "operationId": "allocations.status_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.allocation.v1; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise allocation coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_json": {
                      "type": "object",
                      "description": "Original JSON text of count, rowsPerPage and page when present; uninterpreted.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.attempts": {
      "post": {
        "description": "Page at most 100 persisted attempts of the original API intent after an ordinal. Running with an expired lease is still an uncertain attempt until explicitly resumed. Unknown does not mean the upstream did not read. Current authority is required.",
        "operationId": "api_reads.attempts",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "after": {
                    "type": "integer",
                    "minimum": -2147483648,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "id",
                  "after"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          "id": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "started_at": {
                            "type": "string"
                          },
                          "lease_until": {
                            "type": "string"
                          },
                          "finished_at": {
                            "type": [
                              "null",
                              "string"
                            ]
                          },
                          "error_code": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        },
                        "required": [
                          "ordinal",
                          "id",
                          "state",
                          "started_at",
                          "lease_until",
                          "finished_at",
                          "error_code"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after": {
                      "type": "integer",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "attempts",
                    "next_after"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.begin": {
      "post": {
        "description": "Persist a Mabang API read intent for the tenant's stored enterprise API connection (binding_ref) and explicit operation grant. Same key and canonical parameters recover the original intent. Does not call the upstream API. Browser grants do not authorize it. Unavailable until the deployment configures a credential key.",
        "operationId": "api_reads.begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "binding_ref": {
                    "type": "string"
                  },
                  "api": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object"
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "binding_ref",
                  "api",
                  "data",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "binding_ref": {
                      "type": "string"
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "binding_json": {
                      "type": "string",
                      "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                    },
                    "api": {
                      "type": "string"
                    },
                    "request_data_json": {
                      "type": "string"
                    },
                    "request_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer"
                    },
                    "unknown_attempts": {
                      "type": "integer"
                    },
                    "receipt": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "version": {
                          "type": "string"
                        },
                        "attempt_id": {
                          "type": "string"
                        },
                        "connection_id": {
                          "type": "string"
                        },
                        "connection_revision": {
                          "type": "integer"
                        },
                        "api": {
                          "type": "string"
                        },
                        "call_version": {
                          "type": "string"
                        },
                        "request_data_sha256": {
                          "type": "string"
                        },
                        "request_body_sha256": {
                          "type": "string",
                          "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                        },
                        "response_body_sha256": {
                          "type": "string"
                        },
                        "http_status": {
                          "type": "integer"
                        },
                        "started_at": {
                          "type": "string"
                        },
                        "received_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "version",
                        "attempt_id",
                        "connection_id",
                        "connection_revision",
                        "api",
                        "call_version",
                        "request_data_sha256",
                        "request_body_sha256",
                        "response_body_sha256",
                        "http_status",
                        "started_at",
                        "received_at"
                      ],
                      "additionalProperties": false
                    },
                    "body_bytes": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "binding_ref",
                    "binding_sha256",
                    "binding_json",
                    "api",
                    "request_data_json",
                    "request_sha256",
                    "created_at",
                    "state",
                    "attempts",
                    "unknown_attempts",
                    "receipt",
                    "body_bytes",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.body": {
      "post": {
        "description": "Read up to 65536 original response bytes as base64 from an API observation. Rechecks the entire body hash and current authority even at end. Offset is a byte position, not a business page. End never means business completeness. Refused for operations whose documented records carry third-party credentials (allocation list); use api_reads.shape and the projections instead.",
        "operationId": "api_reads.body",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "offset": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id",
                  "offset"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "next_offset": {
                      "type": "integer"
                    },
                    "end": {
                      "type": "boolean"
                    },
                    "body_base64": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "sha256",
                    "offset",
                    "next_offset",
                    "end",
                    "body_base64"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.get": {
      "post": {
        "description": "Read the original member's API read metadata with the current operation grant, stored connection revision and full original response hash verification. HTTP received does not mean business success, parsed records or complete coverage.",
        "operationId": "api_reads.get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original local API read intent ID, never an upstream attempt ID or browser collection ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "binding_ref": {
                      "type": "string"
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "binding_json": {
                      "type": "string",
                      "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                    },
                    "api": {
                      "type": "string"
                    },
                    "request_data_json": {
                      "type": "string"
                    },
                    "request_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer"
                    },
                    "unknown_attempts": {
                      "type": "integer"
                    },
                    "receipt": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "version": {
                          "type": "string"
                        },
                        "attempt_id": {
                          "type": "string"
                        },
                        "connection_id": {
                          "type": "string"
                        },
                        "connection_revision": {
                          "type": "integer"
                        },
                        "api": {
                          "type": "string"
                        },
                        "call_version": {
                          "type": "string"
                        },
                        "request_data_sha256": {
                          "type": "string"
                        },
                        "request_body_sha256": {
                          "type": "string",
                          "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                        },
                        "response_body_sha256": {
                          "type": "string"
                        },
                        "http_status": {
                          "type": "integer"
                        },
                        "started_at": {
                          "type": "string"
                        },
                        "received_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "version",
                        "attempt_id",
                        "connection_id",
                        "connection_revision",
                        "api",
                        "call_version",
                        "request_data_sha256",
                        "request_body_sha256",
                        "response_body_sha256",
                        "http_status",
                        "started_at",
                        "received_at"
                      ],
                      "additionalProperties": false
                    },
                    "body_bytes": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "binding_ref",
                    "binding_sha256",
                    "binding_json",
                    "api",
                    "request_data_json",
                    "request_sha256",
                    "created_at",
                    "state",
                    "attempts",
                    "unknown_attempts",
                    "receipt",
                    "body_bytes",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.list": {
      "post": {
        "description": "Recover the original member's API read intent IDs by exact binding, operation and local creation window. Verifies returned and lookahead evidence in one snapshot, with the current operation grant and stored connection even for empty pages. Never creates an intent, expires an attempt or calls the business API. A live directory, not business coverage or a frozen selection.",
        "operationId": "api_reads.list",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "binding_ref": {
                    "type": "string",
                    "description": "Exact configured enterprise API binding; requires its current operation grant even for an empty directory."
                  },
                  "api": {
                    "type": "string",
                    "description": "Exact reviewed read operation; never a browser capability."
                  },
                  "created_from": {
                    "type": "string",
                    "description": "Inclusive local intent creation time, RFC3339 with at most microsecond precision; not a business or observation date."
                  },
                  "created_before": {
                    "type": "string",
                    "description": "Exclusive local intent creation time, RFC3339 with at most microsecond precision."
                  },
                  "after_id": {
                    "type": "string",
                    "description": "Continue after this intent ID with the same binding, operation and time filters. Live directory; restart to discover new intents."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20; omitted or zero means 10."
                  }
                },
                "required": [
                  "binding_ref",
                  "api",
                  "created_from",
                  "created_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "binding_ref": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    },
                    "reads": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "binding_ref": {
                            "type": "string"
                          },
                          "binding_sha256": {
                            "type": "string"
                          },
                          "binding_json": {
                            "type": "string",
                            "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                          },
                          "api": {
                            "type": "string"
                          },
                          "request_data_json": {
                            "type": "string"
                          },
                          "request_sha256": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer"
                          },
                          "unknown_attempts": {
                            "type": "integer"
                          },
                          "receipt": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "version": {
                                "type": "string"
                              },
                              "attempt_id": {
                                "type": "string"
                              },
                              "connection_id": {
                                "type": "string"
                              },
                              "connection_revision": {
                                "type": "integer"
                              },
                              "api": {
                                "type": "string"
                              },
                              "call_version": {
                                "type": "string"
                              },
                              "request_data_sha256": {
                                "type": "string"
                              },
                              "request_body_sha256": {
                                "type": "string",
                                "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                              },
                              "response_body_sha256": {
                                "type": "string"
                              },
                              "http_status": {
                                "type": "integer"
                              },
                              "started_at": {
                                "type": "string"
                              },
                              "received_at": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "version",
                              "attempt_id",
                              "connection_id",
                              "connection_revision",
                              "api",
                              "call_version",
                              "request_data_sha256",
                              "request_body_sha256",
                              "response_body_sha256",
                              "http_status",
                              "started_at",
                              "received_at"
                            ],
                            "additionalProperties": false
                          },
                          "body_bytes": {
                            "type": "integer"
                          },
                          "missing_fields": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "binding_ref",
                          "binding_sha256",
                          "binding_json",
                          "api",
                          "request_data_json",
                          "request_sha256",
                          "created_at",
                          "state",
                          "attempts",
                          "unknown_attempts",
                          "receipt",
                          "body_bytes",
                          "missing_fields"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "binding_ref",
                    "api",
                    "reads"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.resume": {
      "post": {
        "description": "Attempt one signed read-only request to Mabang for the original API intent. A received response is reused. After an unknown or expired attempt, explicitly resuming makes a NEW upstream observation, preserving the unknown attempt; lost bytes cannot be replayed. No automatic retries or completeness inference.",
        "operationId": "api_reads.resume",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original local API read intent ID, never an upstream attempt ID or browser collection ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "binding_ref": {
                      "type": "string"
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "binding_json": {
                      "type": "string",
                      "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                    },
                    "api": {
                      "type": "string"
                    },
                    "request_data_json": {
                      "type": "string"
                    },
                    "request_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer"
                    },
                    "unknown_attempts": {
                      "type": "integer"
                    },
                    "receipt": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "version": {
                          "type": "string"
                        },
                        "attempt_id": {
                          "type": "string"
                        },
                        "connection_id": {
                          "type": "string"
                        },
                        "connection_revision": {
                          "type": "integer"
                        },
                        "api": {
                          "type": "string"
                        },
                        "call_version": {
                          "type": "string"
                        },
                        "request_data_sha256": {
                          "type": "string"
                        },
                        "request_body_sha256": {
                          "type": "string",
                          "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                        },
                        "response_body_sha256": {
                          "type": "string"
                        },
                        "http_status": {
                          "type": "integer"
                        },
                        "started_at": {
                          "type": "string"
                        },
                        "received_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "version",
                        "attempt_id",
                        "connection_id",
                        "connection_revision",
                        "api",
                        "call_version",
                        "request_data_sha256",
                        "request_body_sha256",
                        "response_body_sha256",
                        "http_status",
                        "started_at",
                        "received_at"
                      ],
                      "additionalProperties": false
                    },
                    "body_bytes": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "binding_ref",
                    "binding_sha256",
                    "binding_json",
                    "api",
                    "request_data_json",
                    "request_sha256",
                    "created_at",
                    "state",
                    "attempts",
                    "unknown_attempts",
                    "receipt",
                    "body_bytes",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/api_reads.shape": {
      "post": {
        "description": "Describe the structure of a received API response without any value: JSON paths (array members as *, data-like keys as {key}), value kinds, counts and lengths, plus whether each fixed candidate envelope and interpreter accepts this request and body. For envelope calibration; a match is not production acceptance or business coverage. Rechecks the full body hash and current authority.",
        "operationId": "api_reads.shape",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original local API read intent ID, never an upstream attempt ID or browser collection ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "api": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "shape": {
                      "type": "object",
                      "properties": {
                        "root": {
                          "type": "string"
                        },
                        "paths": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "types": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                },
                                "description": "object, array, string, string_empty, string_numeric, integer, integer_unsafe, decimal, exponent, boolean, null."
                              },
                              "occurrences": {
                                "type": "integer"
                              },
                              "max_items": {
                                "type": "integer",
                                "description": "Largest array length or object member count seen at this path."
                              },
                              "max_runes": {
                                "type": "integer",
                                "description": "Longest string seen at this path, in Unicode code points."
                              },
                              "duplicate_keys": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "path",
                              "types",
                              "occurrences",
                              "max_items",
                              "max_runes",
                              "duplicate_keys"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "truncated": {
                          "type": "boolean",
                          "description": "True when more than 512 distinct paths or depth 32 were reached; the listed paths remain exact."
                        },
                        "invalid": {
                          "type": [
                            "null",
                            "string"
                          ],
                          "description": "Why the bytes are not one complete JSON value; paths then describe only the valid prefix."
                        },
                        "sizes": {
                          "type": "object",
                          "properties": {
                            "bytes": {
                              "type": "integer"
                            },
                            "values": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "bytes",
                            "values"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "root",
                        "paths",
                        "truncated",
                        "invalid",
                        "sizes"
                      ],
                      "additionalProperties": false
                    },
                    "candidates": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "response_contract": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "envelope_matched": {
                            "type": "boolean"
                          },
                          "envelope_error": {
                            "type": [
                              "null",
                              "string"
                            ]
                          },
                          "records": {
                            "type": "integer"
                          },
                          "records_accepted": {
                            "type": "integer",
                            "description": "Records the fixed interpreter accepts; never business validity or coverage."
                          },
                          "first_record_error": {
                            "type": [
                              "null",
                              "integer"
                            ],
                            "description": "Zero-based index of the first record the interpreter rejects."
                          }
                        },
                        "required": [
                          "response_contract",
                          "normalizer",
                          "envelope_matched",
                          "envelope_error",
                          "records",
                          "records_accepted",
                          "first_record_error"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Fixed candidate envelope/interpreter pairs for this operation; empty when none is defined yet."
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "api",
                    "sha256",
                    "shape",
                    "candidates"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/collections.begin": {
      "post": {
        "description": "Persist a read collection intent. Reuse the same idempotency key after an interrupted response; changed parameters conflict. Does not yet submit the remote task.",
        "operationId": "collections.begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "capability": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  },
                  "input": {
                    "type": "object"
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "capability",
                  "version",
                  "input",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "external_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "remote_updated_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "dataset": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "dataset_id": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "complete": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dataset_id",
                        "record_count",
                        "pages",
                        "complete",
                        "sha256"
                      ],
                      "additionalProperties": false
                    },
                    "import": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "staging or verified; verified is not a normalized business mirror."
                        },
                        "imported_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "imported_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "verified_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "state",
                        "imported_pages",
                        "pages",
                        "imported_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    },
                    "mirror": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "normalizer": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "description": "staging or ready; ready is a source observation, not a reconciled current order."
                        },
                        "completed_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "completed_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "completed_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "normalizer",
                        "state",
                        "completed_pages",
                        "pages",
                        "completed_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "source_id",
                    "capability",
                    "version",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/collections.get": {
      "post": {
        "description": "Read an authorized local collection and its upstream dataset receipt. A receipt is not proof that a local business mirror has been imported.",
        "operationId": "collections.get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original EzERP collection ID; never substitute an upstream execution ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "external_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "remote_updated_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "dataset": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "dataset_id": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "complete": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dataset_id",
                        "record_count",
                        "pages",
                        "complete",
                        "sha256"
                      ],
                      "additionalProperties": false
                    },
                    "import": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "staging or verified; verified is not a normalized business mirror."
                        },
                        "imported_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "imported_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "verified_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "state",
                        "imported_pages",
                        "pages",
                        "imported_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    },
                    "mirror": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "normalizer": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "description": "staging or ready; ready is a source observation, not a reconciled current order."
                        },
                        "completed_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "completed_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "completed_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "normalizer",
                        "state",
                        "completed_pages",
                        "pages",
                        "completed_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "source_id",
                    "capability",
                    "version",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/collections.ingest": {
      "post": {
        "description": "Fetch and verify the next original completed dataset page. Repeat with the same collection ID until import.state is verified. This does not invoke a browser or create a normalized business mirror.",
        "operationId": "collections.ingest",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original EzERP collection ID; never substitute an upstream execution ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "external_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "remote_updated_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "dataset": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "dataset_id": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "complete": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dataset_id",
                        "record_count",
                        "pages",
                        "complete",
                        "sha256"
                      ],
                      "additionalProperties": false
                    },
                    "import": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "staging or verified; verified is not a normalized business mirror."
                        },
                        "imported_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "imported_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "verified_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "state",
                        "imported_pages",
                        "pages",
                        "imported_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    },
                    "mirror": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "normalizer": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "description": "staging or ready; ready is a source observation, not a reconciled current order."
                        },
                        "completed_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "completed_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "completed_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "normalizer",
                        "state",
                        "completed_pages",
                        "pages",
                        "completed_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "source_id",
                    "capability",
                    "version",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/collections.normalize": {
      "post": {
        "description": "Normalize one page of an already verified dataset using a fixed source mapping. Continue the original collection until mirror.state is ready. No external business operation is invoked.",
        "operationId": "collections.normalize",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original EzERP collection ID; never substitute an upstream execution ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "external_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "remote_updated_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "dataset": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "dataset_id": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "complete": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dataset_id",
                        "record_count",
                        "pages",
                        "complete",
                        "sha256"
                      ],
                      "additionalProperties": false
                    },
                    "import": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "staging or verified; verified is not a normalized business mirror."
                        },
                        "imported_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "imported_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "verified_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "state",
                        "imported_pages",
                        "pages",
                        "imported_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    },
                    "mirror": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "normalizer": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "description": "staging or ready; ready is a source observation, not a reconciled current order."
                        },
                        "completed_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "completed_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "completed_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "normalizer",
                        "state",
                        "completed_pages",
                        "pages",
                        "completed_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "source_id",
                    "capability",
                    "version",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/collections.resume": {
      "post": {
        "description": "Submit or recover the original read intent. A known upstream execution is only polled; an unknown submission uses its original stored key. Never create a replacement intent to retry.",
        "operationId": "collections.resume",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The original EzERP collection ID; never substitute an upstream execution ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "external_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "remote_updated_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "last_error": {
                      "type": "string"
                    },
                    "dataset": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "dataset_id": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "complete": {
                          "type": "boolean"
                        },
                        "sha256": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "dataset_id",
                        "record_count",
                        "pages",
                        "complete",
                        "sha256"
                      ],
                      "additionalProperties": false
                    },
                    "import": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "staging or verified; verified is not a normalized business mirror."
                        },
                        "imported_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "imported_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "verified_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "state",
                        "imported_pages",
                        "pages",
                        "imported_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    },
                    "mirror": {
                      "type": [
                        "null",
                        "object"
                      ],
                      "properties": {
                        "normalizer": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "description": "staging or ready; ready is a source observation, not a reconciled current order."
                        },
                        "completed_pages": {
                          "type": "integer"
                        },
                        "pages": {
                          "type": "integer"
                        },
                        "completed_records": {
                          "type": "integer"
                        },
                        "record_count": {
                          "type": "integer"
                        },
                        "completed_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        }
                      },
                      "required": [
                        "normalizer",
                        "state",
                        "completed_pages",
                        "pages",
                        "completed_records",
                        "record_count"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "state",
                    "source_id",
                    "capability",
                    "version",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.orders_get": {
      "post": {
        "description": "Read one mirrored EzShop order with its lines, what shipped, and EzERP's shipments for it. Reads EzERP only.",
        "operationId": "ezshop.orders_get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "site_id": {
                    "type": "string"
                  },
                  "order_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "site_id",
                  "order_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site_id": {
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "number": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Minor unit of the currency."
                    },
                    "amount_paid": {
                      "type": "integer"
                    },
                    "amount_refunded": {
                      "type": "integer"
                    },
                    "subtotal": {
                      "type": "integer"
                    },
                    "shipping": {
                      "type": "integer"
                    },
                    "tax": {
                      "type": "integer"
                    },
                    "tax_included": {
                      "type": "boolean"
                    },
                    "discount": {
                      "type": "integer"
                    },
                    "shipping_option": {
                      "type": "string"
                    },
                    "test": {
                      "type": "boolean",
                      "description": "Placed with test payments: nothing was charged, do not ship."
                    },
                    "placed_by": {
                      "type": "string"
                    },
                    "placed_at": {
                      "type": "string"
                    },
                    "source_updated_at": {
                      "type": "string",
                      "description": "When the order last changed in EzShop, as of this mirror."
                    },
                    "observed_at": {
                      "type": "string"
                    },
                    "lines": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku_code": {
                            "type": "string"
                          },
                          "listing_id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "spec": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          "shipped": {
                            "type": "integer",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          "unit_amount": {
                            "type": "integer"
                          },
                          "line_total": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "sku_code",
                          "listing_id",
                          "title",
                          "spec",
                          "quantity",
                          "shipped",
                          "unit_amount",
                          "line_total"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "shipments": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "site_id": {
                            "type": "string"
                          },
                          "order_id": {
                            "type": "string"
                          },
                          "lines": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "sku_code": {
                                  "type": "string"
                                },
                                "quantity": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "sku_code",
                                "quantity"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Empty means everything not shipped when EzShop recorded it."
                          },
                          "state": {
                            "type": "string",
                            "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                          },
                          "idempotency_key": {
                            "type": "string",
                            "description": "The key EzShop keeps for this parcel."
                          },
                          "carrier": {
                            "type": "string"
                          },
                          "tracking_number": {
                            "type": "string"
                          },
                          "tracking_url": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer",
                            "description": "Calls to EzShop that did not settle the parcel.",
                            "minimum": -2147483648,
                            "maximum": 2147483647
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "order_status": {
                            "type": "string",
                            "description": "The EzShop order status after the parcel was recorded."
                          },
                          "revealed": {
                            "type": "boolean",
                            "description": "Shipping details were requested from EzShop for this shipment."
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "submitted_at": {
                            "type": [
                              "null",
                              "string"
                            ]
                          },
                          "finished_at": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "site_id",
                          "order_id",
                          "lines",
                          "state",
                          "idempotency_key",
                          "attempts",
                          "revealed",
                          "created_at"
                        ],
                        "additionalProperties": false
                      },
                      "description": "EzERP shipments for this order (orders_get only)."
                    }
                  },
                  "required": [
                    "site_id",
                    "order_id",
                    "number",
                    "status",
                    "currency",
                    "total",
                    "amount_paid",
                    "amount_refunded",
                    "subtotal",
                    "shipping",
                    "tax",
                    "tax_included",
                    "discount",
                    "shipping_option",
                    "test",
                    "placed_by",
                    "placed_at",
                    "source_updated_at",
                    "observed_at",
                    "lines"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.orders_list": {
      "post": {
        "description": "Page the local EzShop order mirror of one site by order number, optionally in one status such as paid. Reads EzERP only; the mirror is as current as the last ezshop.orders_sync.",
        "operationId": "ezshop.orders_list",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "site_id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "description": "Only orders in this EzShop status, such as paid."
                  },
                  "after": {
                    "type": "integer",
                    "description": "next_after of the previous page: an order number."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 100; default 50."
                  }
                },
                "required": [
                  "site_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "site_id": {
                            "type": "string"
                          },
                          "order_id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer",
                            "description": "Minor unit of the currency."
                          },
                          "amount_paid": {
                            "type": "integer"
                          },
                          "amount_refunded": {
                            "type": "integer"
                          },
                          "subtotal": {
                            "type": "integer"
                          },
                          "shipping": {
                            "type": "integer"
                          },
                          "tax": {
                            "type": "integer"
                          },
                          "tax_included": {
                            "type": "boolean"
                          },
                          "discount": {
                            "type": "integer"
                          },
                          "shipping_option": {
                            "type": "string"
                          },
                          "test": {
                            "type": "boolean",
                            "description": "Placed with test payments: nothing was charged, do not ship."
                          },
                          "placed_by": {
                            "type": "string"
                          },
                          "placed_at": {
                            "type": "string"
                          },
                          "source_updated_at": {
                            "type": "string",
                            "description": "When the order last changed in EzShop, as of this mirror."
                          },
                          "observed_at": {
                            "type": "string"
                          },
                          "lines": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "sku_code": {
                                  "type": "string"
                                },
                                "listing_id": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "spec": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "quantity": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "shipped": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "unit_amount": {
                                  "type": "integer"
                                },
                                "line_total": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "sku_code",
                                "listing_id",
                                "title",
                                "spec",
                                "quantity",
                                "shipped",
                                "unit_amount",
                                "line_total"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "shipments": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "site_id": {
                                  "type": "string"
                                },
                                "order_id": {
                                  "type": "string"
                                },
                                "lines": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "sku_code": {
                                        "type": "string"
                                      },
                                      "quantity": {
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "sku_code",
                                      "quantity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "description": "Empty means everything not shipped when EzShop recorded it."
                                },
                                "state": {
                                  "type": "string",
                                  "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                                },
                                "idempotency_key": {
                                  "type": "string",
                                  "description": "The key EzShop keeps for this parcel."
                                },
                                "carrier": {
                                  "type": "string"
                                },
                                "tracking_number": {
                                  "type": "string"
                                },
                                "tracking_url": {
                                  "type": "string"
                                },
                                "attempts": {
                                  "type": "integer",
                                  "description": "Calls to EzShop that did not settle the parcel.",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "error_code": {
                                  "type": "string"
                                },
                                "order_status": {
                                  "type": "string",
                                  "description": "The EzShop order status after the parcel was recorded."
                                },
                                "revealed": {
                                  "type": "boolean",
                                  "description": "Shipping details were requested from EzShop for this shipment."
                                },
                                "created_at": {
                                  "type": "string"
                                },
                                "submitted_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "finished_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "site_id",
                                "order_id",
                                "lines",
                                "state",
                                "idempotency_key",
                                "attempts",
                                "revealed",
                                "created_at"
                              ],
                              "additionalProperties": false
                            },
                            "description": "EzERP shipments for this order (orders_get only)."
                          }
                        },
                        "required": [
                          "site_id",
                          "order_id",
                          "number",
                          "status",
                          "currency",
                          "total",
                          "amount_paid",
                          "amount_refunded",
                          "subtotal",
                          "shipping",
                          "tax",
                          "tax_included",
                          "discount",
                          "shipping_option",
                          "test",
                          "placed_by",
                          "placed_at",
                          "source_updated_at",
                          "observed_at",
                          "lines"
                        ],
                        "additionalProperties": false
                      },
                      "description": "By order number."
                    },
                    "next_after": {
                      "type": "integer",
                      "description": "Present when the page was full."
                    }
                  },
                  "required": [
                    "site_id",
                    "orders"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.orders_sync": {
      "post": {
        "description": "Mirror one page of an EzShop site's order changes after the stored cursor (orders.changes, then orders.get for each), without the shopper's contact or address, and store EzShop's next cursor. Needs the caller's EzShop fulfiller delegation in X-EzShop-Delegation. Repeat while more is true; an empty page changes nothing.",
        "operationId": "ezshop.orders_sync",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "site_id": {
                    "type": "string",
                    "description": "The EzShop site to follow."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Changed orders to read on this page, 1 to 100; default 50."
                  }
                },
                "required": [
                  "site_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "site_id": {
                            "type": "string"
                          },
                          "order_id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer",
                            "description": "Minor unit of the currency."
                          },
                          "amount_paid": {
                            "type": "integer"
                          },
                          "amount_refunded": {
                            "type": "integer"
                          },
                          "subtotal": {
                            "type": "integer"
                          },
                          "shipping": {
                            "type": "integer"
                          },
                          "tax": {
                            "type": "integer"
                          },
                          "tax_included": {
                            "type": "boolean"
                          },
                          "discount": {
                            "type": "integer"
                          },
                          "shipping_option": {
                            "type": "string"
                          },
                          "test": {
                            "type": "boolean",
                            "description": "Placed with test payments: nothing was charged, do not ship."
                          },
                          "placed_by": {
                            "type": "string"
                          },
                          "placed_at": {
                            "type": "string"
                          },
                          "source_updated_at": {
                            "type": "string",
                            "description": "When the order last changed in EzShop, as of this mirror."
                          },
                          "observed_at": {
                            "type": "string"
                          },
                          "lines": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "sku_code": {
                                  "type": "string"
                                },
                                "listing_id": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "spec": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                "quantity": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "shipped": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "unit_amount": {
                                  "type": "integer"
                                },
                                "line_total": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "sku_code",
                                "listing_id",
                                "title",
                                "spec",
                                "quantity",
                                "shipped",
                                "unit_amount",
                                "line_total"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "shipments": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "site_id": {
                                  "type": "string"
                                },
                                "order_id": {
                                  "type": "string"
                                },
                                "lines": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "sku_code": {
                                        "type": "string"
                                      },
                                      "quantity": {
                                        "type": "integer"
                                      }
                                    },
                                    "required": [
                                      "sku_code",
                                      "quantity"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "description": "Empty means everything not shipped when EzShop recorded it."
                                },
                                "state": {
                                  "type": "string",
                                  "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                                },
                                "idempotency_key": {
                                  "type": "string",
                                  "description": "The key EzShop keeps for this parcel."
                                },
                                "carrier": {
                                  "type": "string"
                                },
                                "tracking_number": {
                                  "type": "string"
                                },
                                "tracking_url": {
                                  "type": "string"
                                },
                                "attempts": {
                                  "type": "integer",
                                  "description": "Calls to EzShop that did not settle the parcel.",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "error_code": {
                                  "type": "string"
                                },
                                "order_status": {
                                  "type": "string",
                                  "description": "The EzShop order status after the parcel was recorded."
                                },
                                "revealed": {
                                  "type": "boolean",
                                  "description": "Shipping details were requested from EzShop for this shipment."
                                },
                                "created_at": {
                                  "type": "string"
                                },
                                "submitted_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "finished_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "site_id",
                                "order_id",
                                "lines",
                                "state",
                                "idempotency_key",
                                "attempts",
                                "revealed",
                                "created_at"
                              ],
                              "additionalProperties": false
                            },
                            "description": "EzERP shipments for this order (orders_get only)."
                          }
                        },
                        "required": [
                          "site_id",
                          "order_id",
                          "number",
                          "status",
                          "currency",
                          "total",
                          "amount_paid",
                          "amount_refunded",
                          "subtotal",
                          "shipping",
                          "tax",
                          "tax_included",
                          "discount",
                          "shipping_option",
                          "test",
                          "placed_by",
                          "placed_at",
                          "source_updated_at",
                          "observed_at",
                          "lines"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Orders mirrored from this page, oldest change first; without the shopper's contact or address."
                    },
                    "next_after": {
                      "type": "string",
                      "description": "EzShop's cursor now stored for this site."
                    },
                    "more": {
                      "type": "boolean",
                      "description": "The page was full: call again for later changes."
                    }
                  },
                  "required": [
                    "site_id",
                    "orders",
                    "next_after",
                    "more"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.shipments_fulfill": {
      "post": {
        "description": "Write a prepared shipment back to EzShop (orders.fulfill) with carrier, tracking number and optional https tracking link; the shopper then sees them. The parcel is recorded first and sent with the key ezerp:shipment:\u003cid\u003e. When state stays pending the result is unknown: call again with the same ID and parcel, never a new shipment. A conflict is a defect to report, not to retry.",
        "operationId": "ezshop.shipments_fulfill",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The EzERP shipment ID."
                  },
                  "carrier": {
                    "type": "string",
                    "description": "At most 60 characters."
                  },
                  "tracking_number": {
                    "type": "string",
                    "description": "At most 80 characters."
                  },
                  "tracking_url": {
                    "type": "string",
                    "description": "https only, at most 500 characters."
                  }
                },
                "required": [
                  "id",
                  "carrier",
                  "tracking_number"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "site_id": {
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "lines": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku_code": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "sku_code",
                          "quantity"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Empty means everything not shipped when EzShop recorded it."
                    },
                    "state": {
                      "type": "string",
                      "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                    },
                    "idempotency_key": {
                      "type": "string",
                      "description": "The key EzShop keeps for this parcel."
                    },
                    "carrier": {
                      "type": "string"
                    },
                    "tracking_number": {
                      "type": "string"
                    },
                    "tracking_url": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer",
                      "description": "Calls to EzShop that did not settle the parcel.",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "order_status": {
                      "type": "string",
                      "description": "The EzShop order status after the parcel was recorded."
                    },
                    "revealed": {
                      "type": "boolean",
                      "description": "Shipping details were requested from EzShop for this shipment."
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "submitted_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "finished_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "order_id",
                    "lines",
                    "state",
                    "idempotency_key",
                    "attempts",
                    "revealed",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "execute"
      }
    },
    "/v1/tools/ezshop.shipments_get": {
      "post": {
        "description": "Read one of the caller's EzShop shipments and where its write-back stands. Reads EzERP only.",
        "operationId": "ezshop.shipments_get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The EzERP shipment ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "site_id": {
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "lines": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku_code": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "sku_code",
                          "quantity"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Empty means everything not shipped when EzShop recorded it."
                    },
                    "state": {
                      "type": "string",
                      "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                    },
                    "idempotency_key": {
                      "type": "string",
                      "description": "The key EzShop keeps for this parcel."
                    },
                    "carrier": {
                      "type": "string"
                    },
                    "tracking_number": {
                      "type": "string"
                    },
                    "tracking_url": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer",
                      "description": "Calls to EzShop that did not settle the parcel.",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "order_status": {
                      "type": "string",
                      "description": "The EzShop order status after the parcel was recorded."
                    },
                    "revealed": {
                      "type": "boolean",
                      "description": "Shipping details were requested from EzShop for this shipment."
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "submitted_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "finished_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "order_id",
                    "lines",
                    "state",
                    "idempotency_key",
                    "attempts",
                    "revealed",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.shipments_prepare": {
      "post": {
        "description": "Record a parcel being prepared for a mirrored, paid, non-test EzShop order: which lines (none: everything not shipped yet). Calls nothing in EzShop. The same idempotency key recovers the shipment; other contents conflict. Needs the EzShop fulfiller delegation.",
        "operationId": "ezshop.shipments_prepare",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "site_id": {
                    "type": "string"
                  },
                  "order_id": {
                    "type": "string"
                  },
                  "lines": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "type": "object",
                      "properties": {
                        "sku_code": {
                          "type": "string"
                        },
                        "quantity": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "sku_code",
                        "quantity"
                      ],
                      "additionalProperties": false
                    },
                    "description": "What the parcel holds; empty ships everything not shipped yet."
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Reuse after an interrupted response; the same key with other contents conflicts."
                  }
                },
                "required": [
                  "site_id",
                  "order_id",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "site_id": {
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "lines": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku_code": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "sku_code",
                          "quantity"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Empty means everything not shipped when EzShop recorded it."
                    },
                    "state": {
                      "type": "string",
                      "description": "preparing, pending (sent or about to be sent; call fulfill again with the same ID), succeeded, failed or conflict."
                    },
                    "idempotency_key": {
                      "type": "string",
                      "description": "The key EzShop keeps for this parcel."
                    },
                    "carrier": {
                      "type": "string"
                    },
                    "tracking_number": {
                      "type": "string"
                    },
                    "tracking_url": {
                      "type": "string"
                    },
                    "attempts": {
                      "type": "integer",
                      "description": "Calls to EzShop that did not settle the parcel.",
                      "minimum": -2147483648,
                      "maximum": 2147483647
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "order_status": {
                      "type": "string",
                      "description": "The EzShop order status after the parcel was recorded."
                    },
                    "revealed": {
                      "type": "boolean",
                      "description": "Shipping details were requested from EzShop for this shipment."
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "submitted_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "finished_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "order_id",
                    "lines",
                    "state",
                    "idempotency_key",
                    "attempts",
                    "revealed",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/ezshop.shipping_reveal": {
      "post": {
        "description": "Read the shopper's name, phone and full address for the label of a shipment still being prepared (orders.reveal_shipping). EzShop audits every call as a disclosure; EzERP stores none of it. Call only when the label is being made.",
        "operationId": "ezshop.shipping_reveal",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The EzERP shipment ID."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shipment_id": {
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "order_number": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "address": {
                      "type": "object",
                      "properties": {
                        "country": {
                          "type": "string"
                        },
                        "postal_code": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "city": {
                          "type": "string"
                        },
                        "district": {
                          "type": "string"
                        },
                        "line1": {
                          "type": "string"
                        },
                        "number": {
                          "type": "string"
                        },
                        "line2": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "postal_code",
                        "state",
                        "city",
                        "line1"
                      ],
                      "additionalProperties": false
                    },
                    "shipping_option": {
                      "type": "string",
                      "description": "The shipping method the shopper chose."
                    }
                  },
                  "required": [
                    "shipment_id",
                    "order_id",
                    "order_number",
                    "name",
                    "address",
                    "shipping_option"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/mabang_connections.create": {
      "post": {
        "description": "Store a Mabang open-platform app key and secret for this tenant under a new binding_ref, encrypted at rest, limited to an explicit subset of the five reviewed read operations. Intended for the owner's credential entry, not for an agent to relay. Does not call Mabang, so the credential is unverified until a read is received. A ref with a usable connection conflicts; after a lost response read it back with mabang_connections.get instead of retrying.",
        "operationId": "mabang_connections.create",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Tenant-chosen binding_ref for api_reads.*; at most one usable connection per ref."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display label, at most 80 characters. Not an enterprise identity."
                  },
                  "operations": {
                    "type": [
                      "null",
                      "array"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Non-empty subset of the five reviewed read operations this connection may be used for. Fixed for the life of the connection."
                  },
                  "scope_acknowledgement": {
                    "type": "string",
                    "description": "Must be exactly all_data_visible_to_api_credential: the credential, not EzERP, decides which enterprise data is visible."
                  },
                  "app_key": {
                    "type": "string",
                    "description": "Mabang open-platform app key. Never a login name."
                  },
                  "app_secret": {
                    "type": "string",
                    "description": "Mabang open-platform app secret. Never a login password. Stored encrypted; never returned."
                  }
                },
                "required": [
                  "ref",
                  "name",
                  "operations",
                  "scope_acknowledgement",
                  "app_key",
                  "app_secret"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ref": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "operations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string",
                      "description": "active or revoked. Active means stored and unrevoked, not that Mabang accepts the credential."
                    },
                    "api_source_id": {
                      "type": "string",
                      "description": "Source derived from the current revision's binding; it exists in SQL only after the first api_reads.begin."
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "events": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "action": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "actor_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "action",
                          "revision",
                          "actor_id",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "ref",
                    "name",
                    "scope",
                    "operations",
                    "revision",
                    "state",
                    "api_source_id",
                    "binding_sha256",
                    "created_at",
                    "updated_at",
                    "revoked_at",
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/mabang_connections.get": {
      "post": {
        "description": "Read the usable connection of a binding_ref, or its newest revoked one: revision, state, operations, derived API source and the create/rotate/revoke history. Never returns credentials. Active means stored and unrevoked, not accepted by Mabang.",
        "operationId": "mabang_connections.get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ref": {
                    "type": "string",
                    "description": "Exact binding_ref."
                  }
                },
                "required": [
                  "ref"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ref": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "operations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string",
                      "description": "active or revoked. Active means stored and unrevoked, not that Mabang accepts the credential."
                    },
                    "api_source_id": {
                      "type": "string",
                      "description": "Source derived from the current revision's binding; it exists in SQL only after the first api_reads.begin."
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "events": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "action": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "actor_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "action",
                          "revision",
                          "actor_id",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "ref",
                    "name",
                    "scope",
                    "operations",
                    "revision",
                    "state",
                    "api_source_id",
                    "binding_sha256",
                    "created_at",
                    "updated_at",
                    "revoked_at",
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/mabang_connections.revoke": {
      "post": {
        "description": "Irreversibly revoke a connection and destroy its stored ciphertext. In-flight reads fail before they are recorded; existing observations stay stored but are no longer readable. Repeating returns the revoked connection. The ref may then be used by a new connection, which is a new source. Does not revoke anything at Mabang.",
        "operationId": "mabang_connections.revoke",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The connection ID returned by mabang_connections.create or get."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ref": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "operations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string",
                      "description": "active or revoked. Active means stored and unrevoked, not that Mabang accepts the credential."
                    },
                    "api_source_id": {
                      "type": "string",
                      "description": "Source derived from the current revision's binding; it exists in SQL only after the first api_reads.begin."
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "events": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "action": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "actor_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "action",
                          "revision",
                          "actor_id",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "ref",
                    "name",
                    "scope",
                    "operations",
                    "revision",
                    "state",
                    "api_source_id",
                    "binding_sha256",
                    "created_at",
                    "updated_at",
                    "revoked_at",
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/mabang_connections.rotate": {
      "post": {
        "description": "Replace the stored credential of a connection and advance its revision. The new revision is a new API source: reads and projections of the previous revision are refused, never re-attributed, because a different credential may see a different enterprise. expected_revision guards against a concurrent change. Does not call Mabang.",
        "operationId": "mabang_connections.rotate",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "expected_revision": {
                    "type": "integer",
                    "description": "The revision being replaced; a concurrent rotation or revocation conflicts."
                  },
                  "app_key": {
                    "type": "string"
                  },
                  "app_secret": {
                    "type": "string",
                    "description": "Stored encrypted; never returned."
                  }
                },
                "required": [
                  "id",
                  "expected_revision",
                  "app_key",
                  "app_secret"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ref": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "operations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "state": {
                      "type": "string",
                      "description": "active or revoked. Active means stored and unrevoked, not that Mabang accepts the credential."
                    },
                    "api_source_id": {
                      "type": "string",
                      "description": "Source derived from the current revision's binding; it exists in SQL only after the first api_reads.begin."
                    },
                    "binding_sha256": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "revoked_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "events": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "action": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "actor_id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "action",
                          "revision",
                          "actor_id",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "ref",
                    "name",
                    "scope",
                    "operations",
                    "revision",
                    "state",
                    "api_source_id",
                    "binding_sha256",
                    "created_at",
                    "updated_at",
                    "revoked_at",
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.batch_begin": {
      "post": {
        "description": "Begin or recover local order-model.v1 materialization for your original shared frozen export. The export and model version are the durable retry key; no new selection or external task is created. Missing identity, date, status and coverage remain explicit, including empty selections.",
        "operationId": "models.batch_begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "export_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "description": "Local materializing or materialized state only; not business completeness or evidence revalidation of prior pages."
                    },
                    "observed_from": {
                      "type": "string",
                      "description": "Original frozen observation window, inclusive; not a sale date or completeness watermark."
                    },
                    "observed_before": {
                      "type": "string",
                      "description": "Original frozen observation window, exclusive."
                    },
                    "selected_count": {
                      "type": "integer"
                    },
                    "after": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "export_id",
                    "source_id",
                    "model_version",
                    "state",
                    "observed_from",
                    "observed_before",
                    "selected_count",
                    "after",
                    "missing_fields",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.batch_get": {
      "post": {
        "description": "Read materialization progress or resume at most ten frozen observations with models, membership and checkpoint committed together. Reuse the original batch ID after interruption. Checks current reader and original target authority; progress is not revalidation of earlier pages, business completeness or a synchronization watermark.",
        "operationId": "models.batch_get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "description": "Local materializing or materialized state only; not business completeness or evidence revalidation of prior pages."
                    },
                    "observed_from": {
                      "type": "string",
                      "description": "Original frozen observation window, inclusive; not a sale date or completeness watermark."
                    },
                    "observed_before": {
                      "type": "string",
                      "description": "Original frozen observation window, exclusive."
                    },
                    "selected_count": {
                      "type": "integer"
                    },
                    "after": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "export_id",
                    "source_id",
                    "model_version",
                    "state",
                    "observed_from",
                    "observed_before",
                    "selected_count",
                    "after",
                    "missing_fields",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.batch_read": {
      "post": {
        "description": "Read up to five models from a fully materialized frozen batch. Revalidates original evidence, stored graph, exact frozen membership and current source authority. End of batch is only a position; it never proves business completeness or prior consumption.",
        "operationId": "models.batch_read",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "after": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 5; omitted or zero means 1. Reads an already materialized batch."
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "models": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "collection_id": {
                            "type": "string"
                          },
                          "model_version": {
                            "type": "string"
                          },
                          "observation": {
                            "type": "object",
                            "properties": {
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "model_version": {
                                    "type": "string"
                                  },
                                  "order": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "relations": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "line_ordinal": {
                                          "type": "integer"
                                        },
                                        "identity": {
                                          "type": "object",
                                          "properties": {
                                            "entity_type": {
                                              "type": "string"
                                            },
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "namespace": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "business_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "contract": {
                                              "type": "string"
                                            },
                                            "evidence_field": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "entity_type",
                                            "source_id",
                                            "namespace",
                                            "value",
                                            "business_id",
                                            "contract",
                                            "evidence_field"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "line_ordinal",
                                        "identity"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "model_version",
                                  "order",
                                  "relations",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "collection_id": {
                                "type": "string"
                              },
                              "normalizer": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "reference_type": {
                                    "type": "string"
                                  },
                                  "reference": {
                                    "type": "string"
                                  },
                                  "atomic_order_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "status_text": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "sold_at_text": {
                                    "type": "string"
                                  },
                                  "sold_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "currency": {
                                    "type": "string"
                                  },
                                  "paid_total_minor": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "lines": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "ordinal": {
                                          "type": "integer"
                                        },
                                        "source_line_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "listing_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "title": {
                                          "type": "string"
                                        },
                                        "sku": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity": {
                                          "type": "integer"
                                        },
                                        "display_price_minor": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "ordinal",
                                        "source_line_id",
                                        "listing_id",
                                        "title",
                                        "sku",
                                        "quantity",
                                        "display_price_minor"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "reference_type",
                                  "reference",
                                  "atomic_order_id",
                                  "status_text",
                                  "status",
                                  "sold_at_text",
                                  "sold_at",
                                  "currency",
                                  "paid_total_minor",
                                  "lines",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "source": {
                                "type": "object",
                                "properties": {
                                  "snapshot_id": {
                                    "type": "string"
                                  },
                                  "source_instance_id": {
                                    "type": "string"
                                  },
                                  "adapter": {
                                    "type": "string"
                                  },
                                  "adapter_version": {
                                    "type": "string"
                                  },
                                  "descriptor_sha256": {
                                    "type": "string"
                                  },
                                  "channel": {
                                    "type": "string"
                                  },
                                  "source_record_id": {
                                    "type": "string"
                                  },
                                  "observed_at": {
                                    "type": "string"
                                  },
                                  "source_updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "execution_id": {
                                    "type": "string"
                                  },
                                  "receipt_sha256": {
                                    "type": "string"
                                  },
                                  "dataset": {
                                    "type": "object",
                                    "properties": {
                                      "dataset_id": {
                                        "type": "string"
                                      },
                                      "record_count": {
                                        "type": "integer"
                                      },
                                      "pages": {
                                        "type": "integer"
                                      },
                                      "complete": {
                                        "type": "boolean"
                                      },
                                      "sha256": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "dataset_id",
                                      "record_count",
                                      "pages",
                                      "complete",
                                      "sha256"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "page": {
                                    "type": "integer"
                                  },
                                  "ordinal": {
                                    "type": "integer",
                                    "minimum": -2147483648,
                                    "maximum": 2147483647
                                  },
                                  "page_sha256": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "implementation": {
                                        "type": "string"
                                      },
                                      "profile_sha256": {
                                        "type": "string"
                                      },
                                      "platform": {
                                        "type": "string"
                                      },
                                      "market": {
                                        "type": "string"
                                      },
                                      "timezone": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "started_at": {
                                        "type": "string"
                                      },
                                      "finished_at": {
                                        "type": "string"
                                      },
                                      "resource": {
                                        "type": [
                                          "null",
                                          "object"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string"
                                          },
                                          "parent_target": {
                                            "type": "string"
                                          },
                                          "shop_identity": {
                                            "type": "string"
                                          },
                                          "shop_name": {
                                            "type": "string"
                                          },
                                          "shop_platform": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "kind",
                                          "parent_target",
                                          "shop_identity",
                                          "shop_name",
                                          "shop_platform"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "implementation",
                                      "profile_sha256",
                                      "platform",
                                      "market",
                                      "timezone",
                                      "shop_identity",
                                      "started_at",
                                      "finished_at"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "snapshot_id",
                                  "source_instance_id",
                                  "adapter",
                                  "adapter_version",
                                  "descriptor_sha256",
                                  "channel",
                                  "source_record_id",
                                  "observed_at",
                                  "source_updated_at",
                                  "execution_id",
                                  "receipt_sha256",
                                  "dataset",
                                  "page",
                                  "ordinal",
                                  "page_sha256",
                                  "record_sha256",
                                  "provenance"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "identity",
                              "collection_id",
                              "normalizer",
                              "order",
                              "source"
                            ],
                            "additionalProperties": false
                          },
                          "nodes": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "ordinal": {
                                  "type": "integer"
                                },
                                "identity": {
                                  "type": "object",
                                  "properties": {
                                    "entity_type": {
                                      "type": "string"
                                    },
                                    "source_id": {
                                      "type": "string"
                                    },
                                    "namespace": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "contract": {
                                      "type": "string"
                                    },
                                    "evidence_field": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "entity_type",
                                    "source_id",
                                    "namespace",
                                    "value",
                                    "business_id",
                                    "contract",
                                    "evidence_field"
                                  ],
                                  "additionalProperties": false
                                },
                                "line": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "ordinal",
                                "identity",
                                "line"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "relations": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string"
                                },
                                "line_ordinal": {
                                  "type": "integer"
                                },
                                "from_ordinal": {
                                  "type": "integer"
                                },
                                "to_ordinal": {
                                  "type": "integer"
                                }
                              },
                              "required": [
                                "kind",
                                "line_ordinal",
                                "from_ordinal",
                                "to_ordinal"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "missing_fields": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "collection_id",
                          "model_version",
                          "observation",
                          "nodes",
                          "relations",
                          "missing_fields"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after": {
                      "type": "integer"
                    },
                    "end_of_batch": {
                      "type": "boolean",
                      "description": "End of frozen membership, never proof of business completeness or prior consumption."
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "export_id",
                    "source_id",
                    "models",
                    "end_of_batch",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.batch_resume": {
      "post": {
        "description": "Read materialization progress or resume at most ten frozen observations with models, membership and checkpoint committed together. Reuse the original batch ID after interruption. Checks current reader and original target authority; progress is not revalidation of earlier pages, business completeness or a synchronization watermark.",
        "operationId": "models.batch_resume",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "description": "Local materializing or materialized state only; not business completeness or evidence revalidation of prior pages."
                    },
                    "observed_from": {
                      "type": "string",
                      "description": "Original frozen observation window, inclusive; not a sale date or completeness watermark."
                    },
                    "observed_before": {
                      "type": "string",
                      "description": "Original frozen observation window, exclusive."
                    },
                    "selected_count": {
                      "type": "integer"
                    },
                    "after": {
                      "type": "integer"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "export_id",
                    "source_id",
                    "model_version",
                    "state",
                    "observed_from",
                    "observed_before",
                    "selected_count",
                    "after",
                    "missing_fields",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.batches": {
      "post": {
        "description": "Find your original model materialization batches by source and optional workflow state. Returns frozen observation windows, original IDs, checkpoints and gaps; checks current source authority including empty pages and lookahead. Does not create selections, materialize models or revalidate prior graphs. Completed state is not business completeness.",
        "operationId": "models.batches",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string",
                    "description": "Exact source ID; current shared-read authority is required even for an empty directory."
                  },
                  "state": {
                    "type": "string",
                    "description": "Optional materializing or materialized filter; empty includes both local workflow states."
                  },
                  "after_id": {
                    "type": "string",
                    "description": "Continue after this batch ID with the same source and state. Live directory, not a frozen snapshot; restart to discover newly inserted batches."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  }
                },
                "required": [
                  "source_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "batches": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "export_id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "model_version": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string",
                            "description": "Local materializing or materialized state only; not business completeness or evidence revalidation of prior pages."
                          },
                          "observed_from": {
                            "type": "string",
                            "description": "Original frozen observation window, inclusive; not a sale date or completeness watermark."
                          },
                          "observed_before": {
                            "type": "string",
                            "description": "Original frozen observation window, exclusive."
                          },
                          "selected_count": {
                            "type": "integer"
                          },
                          "after": {
                            "type": "integer"
                          },
                          "missing_fields": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "string"
                            }
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "export_id",
                          "source_id",
                          "model_version",
                          "state",
                          "observed_from",
                          "observed_before",
                          "selected_count",
                          "after",
                          "missing_fields",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "batches"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.get_mabang_order": {
      "post": {
        "description": "Persist or read an original verified Mabang candidate observation model. Keeps the ERP record key, order reference and transaction reference as distinct nodes linked only by their occurrence in one source record. References are not aliases or cross-system business identities. Revalidates original evidence, stored graph and current authority; retry the original collection and record. Unloaded lines stay null; no sales facts or completeness claim. Production adapter remains disabled.",
        "operationId": "models.get_mabang_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "references": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "references",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "erp_record_key": {
                              "type": "string"
                            },
                            "order_number_text": {
                              "type": "string"
                            },
                            "transaction_number_text": {
                              "type": "string"
                            },
                            "shop_name": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "erp_status_text": {
                              "type": "string"
                            },
                            "platform_status_text": {
                              "type": "string"
                            },
                            "invoice_status_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_at_text": {
                              "type": "string"
                            },
                            "paid_at": {
                              "type": "string"
                            },
                            "paid_at_precision": {
                              "type": "string"
                            },
                            "source_timezone": {
                              "type": "string"
                            },
                            "platform_dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "erp_record_key",
                            "order_number_text",
                            "transaction_number_text",
                            "shop_name",
                            "platform",
                            "erp_status_text",
                            "platform_status_text",
                            "invoice_status_text",
                            "paid_at_text",
                            "paid_at",
                            "paid_at_precision",
                            "source_timezone",
                            "platform_dispatch_at_text",
                            "dispatch_at_text",
                            "atomic_order_id",
                            "status",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "collection_id",
                        "normalizer",
                        "identity",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.get_node": {
      "post": {
        "description": "Trace an exact snapshot, model version and node ordinal to its complete persisted model and original verified observation. Root 0 and individual SKU lines stay distinct; this locator is not a stable business ID. Revalidates the original receipt, page, record and graph with current source authority. Does not materialize a missing model or infer another version.",
        "operationId": "models.get_node",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "snapshot_id": {
                    "type": "string"
                  },
                  "model_version": {
                    "type": "string",
                    "description": "The explicitly received model version; currently only order-model.v1."
                  },
                  "ordinal": {
                    "type": [
                      "null",
                      "integer"
                    ],
                    "description": "Required observation-local node ordinal: 0 is the order, 1 to 50 are exact original SKU lines. Equal display SKUs remain distinct nodes."
                  }
                },
                "required": [
                  "snapshot_id",
                  "model_version",
                  "ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "node": {
                      "type": "object",
                      "properties": {
                        "ordinal": {
                          "type": "integer"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "line": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "ordinal": {
                              "type": "integer"
                            },
                            "source_line_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "listing_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "title": {
                              "type": "string"
                            },
                            "sku": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "quantity": {
                              "type": "integer"
                            },
                            "display_price_minor": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "ordinal",
                            "source_line_id",
                            "listing_id",
                            "title",
                            "sku",
                            "quantity",
                            "display_price_minor"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "ordinal",
                        "identity",
                        "line"
                      ],
                      "additionalProperties": false
                    },
                    "model": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "model_version": {
                          "type": "string"
                        },
                        "observation": {
                          "type": "object",
                          "properties": {
                            "identity": {
                              "type": "object",
                              "properties": {
                                "model_version": {
                                  "type": "string"
                                },
                                "order": {
                                  "type": "object",
                                  "properties": {
                                    "entity_type": {
                                      "type": "string"
                                    },
                                    "source_id": {
                                      "type": "string"
                                    },
                                    "namespace": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "contract": {
                                      "type": "string"
                                    },
                                    "evidence_field": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "entity_type",
                                    "source_id",
                                    "namespace",
                                    "value",
                                    "business_id",
                                    "contract",
                                    "evidence_field"
                                  ],
                                  "additionalProperties": false
                                },
                                "relations": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "line_ordinal": {
                                        "type": "integer"
                                      },
                                      "identity": {
                                        "type": "object",
                                        "properties": {
                                          "entity_type": {
                                            "type": "string"
                                          },
                                          "source_id": {
                                            "type": "string"
                                          },
                                          "namespace": {
                                            "type": "string"
                                          },
                                          "value": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "business_id": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "contract": {
                                            "type": "string"
                                          },
                                          "evidence_field": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "entity_type",
                                          "source_id",
                                          "namespace",
                                          "value",
                                          "business_id",
                                          "contract",
                                          "evidence_field"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "line_ordinal",
                                      "identity"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "missing_fields": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "model_version",
                                "order",
                                "relations",
                                "missing_fields"
                              ],
                              "additionalProperties": false
                            },
                            "collection_id": {
                              "type": "string"
                            },
                            "normalizer": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "reference_type": {
                                  "type": "string"
                                },
                                "reference": {
                                  "type": "string"
                                },
                                "atomic_order_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "status_text": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "sold_at_text": {
                                  "type": "string"
                                },
                                "sold_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                },
                                "paid_total_minor": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "lines": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "ordinal": {
                                        "type": "integer"
                                      },
                                      "source_line_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "listing_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "sku": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "quantity": {
                                        "type": "integer"
                                      },
                                      "display_price_minor": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "ordinal",
                                      "source_line_id",
                                      "listing_id",
                                      "title",
                                      "sku",
                                      "quantity",
                                      "display_price_minor"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "missing_fields": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "reference_type",
                                "reference",
                                "atomic_order_id",
                                "status_text",
                                "status",
                                "sold_at_text",
                                "sold_at",
                                "currency",
                                "paid_total_minor",
                                "lines",
                                "missing_fields"
                              ],
                              "additionalProperties": false
                            },
                            "source": {
                              "type": "object",
                              "properties": {
                                "snapshot_id": {
                                  "type": "string"
                                },
                                "source_instance_id": {
                                  "type": "string"
                                },
                                "adapter": {
                                  "type": "string"
                                },
                                "adapter_version": {
                                  "type": "string"
                                },
                                "descriptor_sha256": {
                                  "type": "string"
                                },
                                "channel": {
                                  "type": "string"
                                },
                                "source_record_id": {
                                  "type": "string"
                                },
                                "observed_at": {
                                  "type": "string"
                                },
                                "source_updated_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "execution_id": {
                                  "type": "string"
                                },
                                "receipt_sha256": {
                                  "type": "string"
                                },
                                "dataset": {
                                  "type": "object",
                                  "properties": {
                                    "dataset_id": {
                                      "type": "string"
                                    },
                                    "record_count": {
                                      "type": "integer"
                                    },
                                    "pages": {
                                      "type": "integer"
                                    },
                                    "complete": {
                                      "type": "boolean"
                                    },
                                    "sha256": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "dataset_id",
                                    "record_count",
                                    "pages",
                                    "complete",
                                    "sha256"
                                  ],
                                  "additionalProperties": false
                                },
                                "page": {
                                  "type": "integer"
                                },
                                "ordinal": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "page_sha256": {
                                  "type": "string"
                                },
                                "record_sha256": {
                                  "type": "string"
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "implementation": {
                                      "type": "string"
                                    },
                                    "profile_sha256": {
                                      "type": "string"
                                    },
                                    "platform": {
                                      "type": "string"
                                    },
                                    "market": {
                                      "type": "string"
                                    },
                                    "timezone": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "started_at": {
                                      "type": "string"
                                    },
                                    "finished_at": {
                                      "type": "string"
                                    },
                                    "resource": {
                                      "type": [
                                        "null",
                                        "object"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "parent_target": {
                                          "type": "string"
                                        },
                                        "shop_identity": {
                                          "type": "string"
                                        },
                                        "shop_name": {
                                          "type": "string"
                                        },
                                        "shop_platform": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "parent_target",
                                        "shop_identity",
                                        "shop_name",
                                        "shop_platform"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "implementation",
                                    "profile_sha256",
                                    "platform",
                                    "market",
                                    "timezone",
                                    "shop_identity",
                                    "started_at",
                                    "finished_at"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "snapshot_id",
                                "source_instance_id",
                                "adapter",
                                "adapter_version",
                                "descriptor_sha256",
                                "channel",
                                "source_record_id",
                                "observed_at",
                                "source_updated_at",
                                "execution_id",
                                "receipt_sha256",
                                "dataset",
                                "page",
                                "ordinal",
                                "page_sha256",
                                "record_sha256",
                                "provenance"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "identity",
                            "collection_id",
                            "normalizer",
                            "order",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        "nodes": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "line": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "ordinal",
                              "identity",
                              "line"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": "integer"
                              },
                              "from_ordinal": {
                                "type": "integer"
                              },
                              "to_ordinal": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "from_ordinal",
                              "to_ordinal"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "Complete original model and observation evidence. This local graph does not establish cross-source business identity, revision order or completeness.",
                      "required": [
                        "collection_id",
                        "model_version",
                        "observation",
                        "nodes",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "collection_id",
                    "node",
                    "model"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.get_order": {
      "post": {
        "description": "Read or materialize a versioned local order/SKU observation model from its original verified evidence. Reuse the original collection and source record after interruption. Node ordinals are local observation locators, not stable business IDs; display SKUs do not establish cross-source matches. Missing warehouse, inventory and purchase data stay explicit gaps. Current source authority is rechecked; no external operation is invoked.",
        "operationId": "models.get_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "relations": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "line_ordinal": {
                                    "type": "integer"
                                  },
                                  "identity": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "line_ordinal",
                                  "identity"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "relations",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "reference_type": {
                              "type": "string"
                            },
                            "reference": {
                              "type": "string"
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status_text": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at_text": {
                              "type": "string"
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": "string"
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "reference_type",
                            "reference",
                            "atomic_order_id",
                            "status_text",
                            "status",
                            "sold_at_text",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "identity",
                        "collection_id",
                        "normalizer",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "line_ordinal": {
                            "type": "integer"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "line_ordinal",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.project_mabang_order": {
      "post": {
        "description": "Persist or read an original verified Mabang candidate observation model. Keeps the ERP record key, order reference and transaction reference as distinct nodes linked only by their occurrence in one source record. References are not aliases or cross-system business identities. Revalidates original evidence, stored graph and current authority; retry the original collection and record. Unloaded lines stay null; no sales facts or completeness claim. Production adapter remains disabled.",
        "operationId": "models.project_mabang_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "references": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "references",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "erp_record_key": {
                              "type": "string"
                            },
                            "order_number_text": {
                              "type": "string"
                            },
                            "transaction_number_text": {
                              "type": "string"
                            },
                            "shop_name": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "erp_status_text": {
                              "type": "string"
                            },
                            "platform_status_text": {
                              "type": "string"
                            },
                            "invoice_status_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_at_text": {
                              "type": "string"
                            },
                            "paid_at": {
                              "type": "string"
                            },
                            "paid_at_precision": {
                              "type": "string"
                            },
                            "source_timezone": {
                              "type": "string"
                            },
                            "platform_dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "erp_record_key",
                            "order_number_text",
                            "transaction_number_text",
                            "shop_name",
                            "platform",
                            "erp_status_text",
                            "platform_status_text",
                            "invoice_status_text",
                            "paid_at_text",
                            "paid_at",
                            "paid_at_precision",
                            "source_timezone",
                            "platform_dispatch_at_text",
                            "dispatch_at_text",
                            "atomic_order_id",
                            "status",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "collection_id",
                        "normalizer",
                        "identity",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.project_order": {
      "post": {
        "description": "Read or materialize a versioned local order/SKU observation model from its original verified evidence. Reuse the original collection and source record after interruption. Node ordinals are local observation locators, not stable business IDs; display SKUs do not establish cross-source matches. Missing warehouse, inventory and purchase data stay explicit gaps. Current source authority is rechecked; no external operation is invoked.",
        "operationId": "models.project_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "relations": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "line_ordinal": {
                                    "type": "integer"
                                  },
                                  "identity": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "line_ordinal",
                                  "identity"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "relations",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "reference_type": {
                              "type": "string"
                            },
                            "reference": {
                              "type": "string"
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status_text": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at_text": {
                              "type": "string"
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": "string"
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "reference_type",
                            "reference",
                            "atomic_order_id",
                            "status_text",
                            "status",
                            "sold_at_text",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "identity",
                        "collection_id",
                        "normalizer",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "line_ordinal": {
                            "type": "integer"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "line_ordinal",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.shared_get_mabang_order": {
      "post": {
        "description": "Persist or read an original verified Mabang candidate observation model. Keeps the ERP record key, order reference and transaction reference as distinct nodes linked only by their occurrence in one source record. References are not aliases or cross-system business identities. Revalidates original evidence, stored graph and current authority; retry the original collection and record. Unloaded lines stay null; no sales facts or completeness claim. Production adapter remains disabled.",
        "operationId": "models.shared_get_mabang_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "references": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "references",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "erp_record_key": {
                              "type": "string"
                            },
                            "order_number_text": {
                              "type": "string"
                            },
                            "transaction_number_text": {
                              "type": "string"
                            },
                            "shop_name": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "erp_status_text": {
                              "type": "string"
                            },
                            "platform_status_text": {
                              "type": "string"
                            },
                            "invoice_status_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_at_text": {
                              "type": "string"
                            },
                            "paid_at": {
                              "type": "string"
                            },
                            "paid_at_precision": {
                              "type": "string"
                            },
                            "source_timezone": {
                              "type": "string"
                            },
                            "platform_dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "erp_record_key",
                            "order_number_text",
                            "transaction_number_text",
                            "shop_name",
                            "platform",
                            "erp_status_text",
                            "platform_status_text",
                            "invoice_status_text",
                            "paid_at_text",
                            "paid_at",
                            "paid_at_precision",
                            "source_timezone",
                            "platform_dispatch_at_text",
                            "dispatch_at_text",
                            "atomic_order_id",
                            "status",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "collection_id",
                        "normalizer",
                        "identity",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.shared_get_node": {
      "post": {
        "description": "Trace an exact snapshot, model version and node ordinal to its complete persisted model and original verified observation. Root 0 and individual SKU lines stay distinct; this locator is not a stable business ID. Revalidates the original receipt, page, record and graph with current source authority. Does not materialize a missing model or infer another version.",
        "operationId": "models.shared_get_node",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "snapshot_id": {
                    "type": "string"
                  },
                  "model_version": {
                    "type": "string",
                    "description": "The explicitly received model version; currently only order-model.v1."
                  },
                  "ordinal": {
                    "type": [
                      "null",
                      "integer"
                    ],
                    "description": "Required observation-local node ordinal: 0 is the order, 1 to 50 are exact original SKU lines. Equal display SKUs remain distinct nodes."
                  }
                },
                "required": [
                  "snapshot_id",
                  "model_version",
                  "ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "node": {
                      "type": "object",
                      "properties": {
                        "ordinal": {
                          "type": "integer"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "line": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "ordinal": {
                              "type": "integer"
                            },
                            "source_line_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "listing_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "title": {
                              "type": "string"
                            },
                            "sku": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "quantity": {
                              "type": "integer"
                            },
                            "display_price_minor": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "ordinal",
                            "source_line_id",
                            "listing_id",
                            "title",
                            "sku",
                            "quantity",
                            "display_price_minor"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "ordinal",
                        "identity",
                        "line"
                      ],
                      "additionalProperties": false
                    },
                    "model": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "model_version": {
                          "type": "string"
                        },
                        "observation": {
                          "type": "object",
                          "properties": {
                            "identity": {
                              "type": "object",
                              "properties": {
                                "model_version": {
                                  "type": "string"
                                },
                                "order": {
                                  "type": "object",
                                  "properties": {
                                    "entity_type": {
                                      "type": "string"
                                    },
                                    "source_id": {
                                      "type": "string"
                                    },
                                    "namespace": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "contract": {
                                      "type": "string"
                                    },
                                    "evidence_field": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "entity_type",
                                    "source_id",
                                    "namespace",
                                    "value",
                                    "business_id",
                                    "contract",
                                    "evidence_field"
                                  ],
                                  "additionalProperties": false
                                },
                                "relations": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "line_ordinal": {
                                        "type": "integer"
                                      },
                                      "identity": {
                                        "type": "object",
                                        "properties": {
                                          "entity_type": {
                                            "type": "string"
                                          },
                                          "source_id": {
                                            "type": "string"
                                          },
                                          "namespace": {
                                            "type": "string"
                                          },
                                          "value": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "business_id": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "contract": {
                                            "type": "string"
                                          },
                                          "evidence_field": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "entity_type",
                                          "source_id",
                                          "namespace",
                                          "value",
                                          "business_id",
                                          "contract",
                                          "evidence_field"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "line_ordinal",
                                      "identity"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "missing_fields": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "model_version",
                                "order",
                                "relations",
                                "missing_fields"
                              ],
                              "additionalProperties": false
                            },
                            "collection_id": {
                              "type": "string"
                            },
                            "normalizer": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "reference_type": {
                                  "type": "string"
                                },
                                "reference": {
                                  "type": "string"
                                },
                                "atomic_order_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "status_text": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "sold_at_text": {
                                  "type": "string"
                                },
                                "sold_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                },
                                "paid_total_minor": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "lines": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "ordinal": {
                                        "type": "integer"
                                      },
                                      "source_line_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "listing_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "sku": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "quantity": {
                                        "type": "integer"
                                      },
                                      "display_price_minor": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "ordinal",
                                      "source_line_id",
                                      "listing_id",
                                      "title",
                                      "sku",
                                      "quantity",
                                      "display_price_minor"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "missing_fields": {
                                  "type": [
                                    "null",
                                    "array"
                                  ],
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "reference_type",
                                "reference",
                                "atomic_order_id",
                                "status_text",
                                "status",
                                "sold_at_text",
                                "sold_at",
                                "currency",
                                "paid_total_minor",
                                "lines",
                                "missing_fields"
                              ],
                              "additionalProperties": false
                            },
                            "source": {
                              "type": "object",
                              "properties": {
                                "snapshot_id": {
                                  "type": "string"
                                },
                                "source_instance_id": {
                                  "type": "string"
                                },
                                "adapter": {
                                  "type": "string"
                                },
                                "adapter_version": {
                                  "type": "string"
                                },
                                "descriptor_sha256": {
                                  "type": "string"
                                },
                                "channel": {
                                  "type": "string"
                                },
                                "source_record_id": {
                                  "type": "string"
                                },
                                "observed_at": {
                                  "type": "string"
                                },
                                "source_updated_at": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "execution_id": {
                                  "type": "string"
                                },
                                "receipt_sha256": {
                                  "type": "string"
                                },
                                "dataset": {
                                  "type": "object",
                                  "properties": {
                                    "dataset_id": {
                                      "type": "string"
                                    },
                                    "record_count": {
                                      "type": "integer"
                                    },
                                    "pages": {
                                      "type": "integer"
                                    },
                                    "complete": {
                                      "type": "boolean"
                                    },
                                    "sha256": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "dataset_id",
                                    "record_count",
                                    "pages",
                                    "complete",
                                    "sha256"
                                  ],
                                  "additionalProperties": false
                                },
                                "page": {
                                  "type": "integer"
                                },
                                "ordinal": {
                                  "type": "integer",
                                  "minimum": -2147483648,
                                  "maximum": 2147483647
                                },
                                "page_sha256": {
                                  "type": "string"
                                },
                                "record_sha256": {
                                  "type": "string"
                                },
                                "provenance": {
                                  "type": "object",
                                  "properties": {
                                    "implementation": {
                                      "type": "string"
                                    },
                                    "profile_sha256": {
                                      "type": "string"
                                    },
                                    "platform": {
                                      "type": "string"
                                    },
                                    "market": {
                                      "type": "string"
                                    },
                                    "timezone": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "started_at": {
                                      "type": "string"
                                    },
                                    "finished_at": {
                                      "type": "string"
                                    },
                                    "resource": {
                                      "type": [
                                        "null",
                                        "object"
                                      ],
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "parent_target": {
                                          "type": "string"
                                        },
                                        "shop_identity": {
                                          "type": "string"
                                        },
                                        "shop_name": {
                                          "type": "string"
                                        },
                                        "shop_platform": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "parent_target",
                                        "shop_identity",
                                        "shop_name",
                                        "shop_platform"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "implementation",
                                    "profile_sha256",
                                    "platform",
                                    "market",
                                    "timezone",
                                    "shop_identity",
                                    "started_at",
                                    "finished_at"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "snapshot_id",
                                "source_instance_id",
                                "adapter",
                                "adapter_version",
                                "descriptor_sha256",
                                "channel",
                                "source_record_id",
                                "observed_at",
                                "source_updated_at",
                                "execution_id",
                                "receipt_sha256",
                                "dataset",
                                "page",
                                "ordinal",
                                "page_sha256",
                                "record_sha256",
                                "provenance"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "identity",
                            "collection_id",
                            "normalizer",
                            "order",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        "nodes": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "line": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "ordinal",
                              "identity",
                              "line"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": "integer"
                              },
                              "from_ordinal": {
                                "type": "integer"
                              },
                              "to_ordinal": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "from_ordinal",
                              "to_ordinal"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "Complete original model and observation evidence. This local graph does not establish cross-source business identity, revision order or completeness.",
                      "required": [
                        "collection_id",
                        "model_version",
                        "observation",
                        "nodes",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "collection_id",
                    "node",
                    "model"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.shared_get_order": {
      "post": {
        "description": "Read or materialize a versioned local order/SKU observation model from its original verified evidence. Reuse the original collection and source record after interruption. Node ordinals are local observation locators, not stable business IDs; display SKUs do not establish cross-source matches. Missing warehouse, inventory and purchase data stay explicit gaps. Current source authority is rechecked; no external operation is invoked.",
        "operationId": "models.shared_get_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "relations": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "line_ordinal": {
                                    "type": "integer"
                                  },
                                  "identity": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "line_ordinal",
                                  "identity"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "relations",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "reference_type": {
                              "type": "string"
                            },
                            "reference": {
                              "type": "string"
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status_text": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at_text": {
                              "type": "string"
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": "string"
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "reference_type",
                            "reference",
                            "atomic_order_id",
                            "status_text",
                            "status",
                            "sold_at_text",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "identity",
                        "collection_id",
                        "normalizer",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "line_ordinal": {
                            "type": "integer"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "line_ordinal",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.shared_project_mabang_order": {
      "post": {
        "description": "Persist or read an original verified Mabang candidate observation model. Keeps the ERP record key, order reference and transaction reference as distinct nodes linked only by their occurrence in one source record. References are not aliases or cross-system business identities. Revalidates original evidence, stored graph and current authority; retry the original collection and record. Unloaded lines stay null; no sales facts or completeness claim. Production adapter remains disabled.",
        "operationId": "models.shared_project_mabang_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "references": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "references",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "erp_record_key": {
                              "type": "string"
                            },
                            "order_number_text": {
                              "type": "string"
                            },
                            "transaction_number_text": {
                              "type": "string"
                            },
                            "shop_name": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "erp_status_text": {
                              "type": "string"
                            },
                            "platform_status_text": {
                              "type": "string"
                            },
                            "invoice_status_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_at_text": {
                              "type": "string"
                            },
                            "paid_at": {
                              "type": "string"
                            },
                            "paid_at_precision": {
                              "type": "string"
                            },
                            "source_timezone": {
                              "type": "string"
                            },
                            "platform_dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "dispatch_at_text": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "erp_record_key",
                            "order_number_text",
                            "transaction_number_text",
                            "shop_name",
                            "platform",
                            "erp_status_text",
                            "platform_status_text",
                            "invoice_status_text",
                            "paid_at_text",
                            "paid_at",
                            "paid_at_precision",
                            "source_timezone",
                            "platform_dispatch_at_text",
                            "dispatch_at_text",
                            "atomic_order_id",
                            "status",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "collection_id",
                        "normalizer",
                        "identity",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/models.shared_project_order": {
      "post": {
        "description": "Read or materialize a versioned local order/SKU observation model from its original verified evidence. Reuse the original collection and source record after interruption. Node ordinals are local observation locators, not stable business IDs; display SKUs do not establish cross-source matches. Missing warehouse, inventory and purchase data stay explicit gaps. Current source authority is rechecked; no external operation is invoked.",
        "operationId": "models.shared_project_order",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "model_version": {
                      "type": "string"
                    },
                    "observation": {
                      "type": "object",
                      "properties": {
                        "identity": {
                          "type": "object",
                          "properties": {
                            "model_version": {
                              "type": "string"
                            },
                            "order": {
                              "type": "object",
                              "properties": {
                                "entity_type": {
                                  "type": "string"
                                },
                                "source_id": {
                                  "type": "string"
                                },
                                "namespace": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "business_id": {
                                  "type": [
                                    "null",
                                    "string"
                                  ]
                                },
                                "contract": {
                                  "type": "string"
                                },
                                "evidence_field": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "entity_type",
                                "source_id",
                                "namespace",
                                "value",
                                "business_id",
                                "contract",
                                "evidence_field"
                              ],
                              "additionalProperties": false
                            },
                            "relations": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string"
                                  },
                                  "line_ordinal": {
                                    "type": "integer"
                                  },
                                  "identity": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "kind",
                                  "line_ordinal",
                                  "identity"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "model_version",
                            "order",
                            "relations",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "collection_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "reference_type": {
                              "type": "string"
                            },
                            "reference": {
                              "type": "string"
                            },
                            "atomic_order_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "status_text": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "sold_at_text": {
                              "type": "string"
                            },
                            "sold_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "currency": {
                              "type": "string"
                            },
                            "paid_total_minor": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "lines": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "object",
                                "properties": {
                                  "ordinal": {
                                    "type": "integer"
                                  },
                                  "source_line_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "listing_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "display_price_minor": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "ordinal",
                                  "source_line_id",
                                  "listing_id",
                                  "title",
                                  "sku",
                                  "quantity",
                                  "display_price_minor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "missing_fields": {
                              "type": [
                                "null",
                                "array"
                              ],
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "reference_type",
                            "reference",
                            "atomic_order_id",
                            "status_text",
                            "status",
                            "sold_at_text",
                            "sold_at",
                            "currency",
                            "paid_total_minor",
                            "lines",
                            "missing_fields"
                          ],
                          "additionalProperties": false
                        },
                        "source": {
                          "type": "object",
                          "properties": {
                            "snapshot_id": {
                              "type": "string"
                            },
                            "source_instance_id": {
                              "type": "string"
                            },
                            "adapter": {
                              "type": "string"
                            },
                            "adapter_version": {
                              "type": "string"
                            },
                            "descriptor_sha256": {
                              "type": "string"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "source_record_id": {
                              "type": "string"
                            },
                            "observed_at": {
                              "type": "string"
                            },
                            "source_updated_at": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "execution_id": {
                              "type": "string"
                            },
                            "receipt_sha256": {
                              "type": "string"
                            },
                            "dataset": {
                              "type": "object",
                              "properties": {
                                "dataset_id": {
                                  "type": "string"
                                },
                                "record_count": {
                                  "type": "integer"
                                },
                                "pages": {
                                  "type": "integer"
                                },
                                "complete": {
                                  "type": "boolean"
                                },
                                "sha256": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "dataset_id",
                                "record_count",
                                "pages",
                                "complete",
                                "sha256"
                              ],
                              "additionalProperties": false
                            },
                            "page": {
                              "type": "integer"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": -2147483648,
                              "maximum": 2147483647
                            },
                            "page_sha256": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "provenance": {
                              "type": "object",
                              "properties": {
                                "implementation": {
                                  "type": "string"
                                },
                                "profile_sha256": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "market": {
                                  "type": "string"
                                },
                                "timezone": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "started_at": {
                                  "type": "string"
                                },
                                "finished_at": {
                                  "type": "string"
                                },
                                "resource": {
                                  "type": [
                                    "null",
                                    "object"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "parent_target": {
                                      "type": "string"
                                    },
                                    "shop_identity": {
                                      "type": "string"
                                    },
                                    "shop_name": {
                                      "type": "string"
                                    },
                                    "shop_platform": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "parent_target",
                                    "shop_identity",
                                    "shop_name",
                                    "shop_platform"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "implementation",
                                "profile_sha256",
                                "platform",
                                "market",
                                "timezone",
                                "shop_identity",
                                "started_at",
                                "finished_at"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "snapshot_id",
                            "source_instance_id",
                            "adapter",
                            "adapter_version",
                            "descriptor_sha256",
                            "channel",
                            "source_record_id",
                            "observed_at",
                            "source_updated_at",
                            "execution_id",
                            "receipt_sha256",
                            "dataset",
                            "page",
                            "ordinal",
                            "page_sha256",
                            "record_sha256",
                            "provenance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "identity",
                        "collection_id",
                        "normalizer",
                        "order",
                        "source"
                      ],
                      "additionalProperties": false
                    },
                    "nodes": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "ordinal": {
                            "type": "integer"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          },
                          "line": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "ordinal",
                          "identity",
                          "line"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string"
                          },
                          "line_ordinal": {
                            "type": "integer"
                          },
                          "from_ordinal": {
                            "type": "integer"
                          },
                          "to_ordinal": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "kind",
                          "line_ordinal",
                          "from_ordinal",
                          "to_ordinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "collection_id",
                    "model_version",
                    "observation",
                    "nodes",
                    "relations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.export_begin": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected before capture. Persist a frozen selection of currently ready observations from one source/time range. Reuse the key after interruption; a new key captures a new batch. A local manifest is created, without external operations. Shared mode is selected only by the explicitly shared tool. The count is not business completeness; each read still verifies original evidence and current authority. A selection above 10000 observations is rejected whole as order_export_too_large and saves nothing; narrow the time range.",
        "operationId": "orders.export_begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string"
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Reuse after interruption; a new key captures a new selection. Never include credentials."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "observed_from": {
                      "type": "string"
                    },
                    "observed_before": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "selected_count": {
                      "type": "integer",
                      "description": "Frozen membership count from mirrors ready at capture. Each page still verifies evidence and authority; not unique orders or business completeness."
                    }
                  },
                  "required": [
                    "export_id",
                    "source_id",
                    "observed_from",
                    "observed_before",
                    "created_at",
                    "selected_count"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.export_read": {
      "post": {
        "description": "Rechecks the original source contract even for historical empty batches and terminal positions. Read a page from a frozen observation selection owned by the current reader, using its original visibility mode. Rechecks current authority on all original targets and validates every returned observation against captured evidence. End position is not proof of complete business coverage or prior page consumption.",
        "operationId": "orders.export_read",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "type": "string"
                  },
                  "after": {
                    "type": "integer",
                    "description": "Start after this ordinal; zero begins. A position is not authorization or proof that previous pages were consumed."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  }
                },
                "required": [
                  "export_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "selected_count": {
                      "type": "integer"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": "integer"
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "reference_type": {
                                "type": "string"
                              },
                              "reference": {
                                "type": "string"
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_text": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at_text": {
                                "type": "string"
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": "string"
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "reference_type",
                              "reference",
                              "atomic_order_id",
                              "status_text",
                              "status",
                              "sold_at_text",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "identity",
                          "collection_id",
                          "normalizer",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "item_lines": {
                          "type": "integer"
                        },
                        "missing_sku_lines": {
                          "type": "integer",
                          "description": "Returned item lines whose normalized SKU is null; count lines, not quantity or distinct products."
                        }
                      },
                      "required": [
                        "order_observations",
                        "item_lines",
                        "missing_sku_lines"
                      ],
                      "additionalProperties": false
                    },
                    "next_after": {
                      "type": "integer"
                    },
                    "end_of_export": {
                      "type": "boolean",
                      "description": "This page reaches the frozen selection's end. Does not establish business completeness or that earlier pages were read."
                    }
                  },
                  "required": [
                    "export_id",
                    "source_id",
                    "selected_count",
                    "orders",
                    "page_stats",
                    "end_of_export"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.get": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected, including empty results. Read one source order observation from a fully normalized collection, with missing fields and evidence lineage. This is an observation at its collection time, not a reconciled current order. Sales references may represent combined orders; displayed prices are not paid totals.",
        "operationId": "orders.get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": "integer"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "identity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "order",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "collection_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "reference_type": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "atomic_order_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status_text": {
                          "type": "string"
                        },
                        "status": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "sold_at_text": {
                          "type": "string"
                        },
                        "sold_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "currency": {
                          "type": "string"
                        },
                        "paid_total_minor": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "reference_type",
                        "reference",
                        "atomic_order_id",
                        "status_text",
                        "status",
                        "sold_at_text",
                        "sold_at",
                        "currency",
                        "paid_total_minor",
                        "lines",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string"
                        },
                        "source_instance_id": {
                          "type": "string"
                        },
                        "adapter": {
                          "type": "string"
                        },
                        "adapter_version": {
                          "type": "string"
                        },
                        "descriptor_sha256": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "source_record_id": {
                          "type": "string"
                        },
                        "observed_at": {
                          "type": "string"
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "execution_id": {
                          "type": "string"
                        },
                        "receipt_sha256": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "object",
                          "properties": {
                            "dataset_id": {
                              "type": "string"
                            },
                            "record_count": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "complete": {
                              "type": "boolean"
                            },
                            "sha256": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "dataset_id",
                            "record_count",
                            "pages",
                            "complete",
                            "sha256"
                          ],
                          "additionalProperties": false
                        },
                        "page": {
                          "type": "integer"
                        },
                        "ordinal": {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        "page_sha256": {
                          "type": "string"
                        },
                        "record_sha256": {
                          "type": "string"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "implementation": {
                              "type": "string"
                            },
                            "profile_sha256": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "market": {
                              "type": "string"
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "shop_identity": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": "string"
                            },
                            "resource": {
                              "type": [
                                "null",
                                "object"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string"
                                },
                                "parent_target": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "shop_name": {
                                  "type": "string"
                                },
                                "shop_platform": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "parent_target",
                                "shop_identity",
                                "shop_name",
                                "shop_platform"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "implementation",
                            "profile_sha256",
                            "platform",
                            "market",
                            "timezone",
                            "shop_identity",
                            "started_at",
                            "finished_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "source_instance_id",
                        "adapter",
                        "adapter_version",
                        "descriptor_sha256",
                        "channel",
                        "source_record_id",
                        "observed_at",
                        "source_updated_at",
                        "execution_id",
                        "receipt_sha256",
                        "dataset",
                        "page",
                        "ordinal",
                        "page_sha256",
                        "record_sha256",
                        "provenance"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "identity",
                    "collection_id",
                    "normalizer",
                    "order",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.get_mabang": {
      "post": {
        "description": "Read one ready Mabang candidate observation with original source evidence and current authority. Requires an explicitly compiled adapter mapping; production erp-mabang remains disabled pending real-store acceptance. Keeps ERP key, displayed order/transaction references, statuses and source-local paid time distinct. Unloaded lines and sales facts remain unknown; this is not a complete sales feed.",
        "operationId": "orders.get_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "references": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "order",
                        "references",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "erp_record_key": {
                          "type": "string"
                        },
                        "order_number_text": {
                          "type": "string"
                        },
                        "transaction_number_text": {
                          "type": "string"
                        },
                        "shop_name": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "erp_status_text": {
                          "type": "string"
                        },
                        "platform_status_text": {
                          "type": "string"
                        },
                        "invoice_status_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "paid_at_text": {
                          "type": "string"
                        },
                        "paid_at": {
                          "type": "string"
                        },
                        "paid_at_precision": {
                          "type": "string"
                        },
                        "source_timezone": {
                          "type": "string"
                        },
                        "platform_dispatch_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "dispatch_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "atomic_order_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "sold_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "currency": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "paid_total_minor": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "erp_record_key",
                        "order_number_text",
                        "transaction_number_text",
                        "shop_name",
                        "platform",
                        "erp_status_text",
                        "platform_status_text",
                        "invoice_status_text",
                        "paid_at_text",
                        "paid_at",
                        "paid_at_precision",
                        "source_timezone",
                        "platform_dispatch_at_text",
                        "dispatch_at_text",
                        "atomic_order_id",
                        "status",
                        "sold_at",
                        "currency",
                        "paid_total_minor",
                        "lines",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string"
                        },
                        "source_instance_id": {
                          "type": "string"
                        },
                        "adapter": {
                          "type": "string"
                        },
                        "adapter_version": {
                          "type": "string"
                        },
                        "descriptor_sha256": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "source_record_id": {
                          "type": "string"
                        },
                        "observed_at": {
                          "type": "string"
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "execution_id": {
                          "type": "string"
                        },
                        "receipt_sha256": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "object",
                          "properties": {
                            "dataset_id": {
                              "type": "string"
                            },
                            "record_count": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "complete": {
                              "type": "boolean"
                            },
                            "sha256": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "dataset_id",
                            "record_count",
                            "pages",
                            "complete",
                            "sha256"
                          ],
                          "additionalProperties": false
                        },
                        "page": {
                          "type": "integer"
                        },
                        "ordinal": {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        "page_sha256": {
                          "type": "string"
                        },
                        "record_sha256": {
                          "type": "string"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "implementation": {
                              "type": "string"
                            },
                            "profile_sha256": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "market": {
                              "type": "string"
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "shop_identity": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": "string"
                            },
                            "resource": {
                              "type": [
                                "null",
                                "object"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string"
                                },
                                "parent_target": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "shop_name": {
                                  "type": "string"
                                },
                                "shop_platform": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "parent_target",
                                "shop_identity",
                                "shop_name",
                                "shop_platform"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "implementation",
                            "profile_sha256",
                            "platform",
                            "market",
                            "timezone",
                            "shop_identity",
                            "started_at",
                            "finished_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "source_instance_id",
                        "adapter",
                        "adapter_version",
                        "descriptor_sha256",
                        "channel",
                        "source_record_id",
                        "observed_at",
                        "source_updated_at",
                        "execution_id",
                        "receipt_sha256",
                        "dataset",
                        "page",
                        "ordinal",
                        "page_sha256",
                        "record_sha256",
                        "provenance"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "collection_id",
                    "normalizer",
                    "identity",
                    "order",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.list": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected, including empty results. Page original-actor ready order observations from one source and an observation-time range, optionally matching an exact source record ID and/or observed SKU. Preserves evidence, missing fields and all lines of each matched observation. Each page reflects currently ready mirrors; new imports can appear behind a cursor, so this is not a frozen export or a current-order list. Empty results do not establish business completeness.",
        "operationId": "orders.list",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive observation time in RFC3339, at most microsecond precision; not the sale date."
                  },
                  "observed_before": {
                    "type": "string",
                    "description": "Exclusive observation time in RFC3339, at most microsecond precision."
                  },
                  "source_record_id": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Optional exact source record identifier, not an inferred atomic order ID. Omit or null disables this filter; empty is invalid. Combined with sku using AND."
                  },
                  "sku": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Optional exact observed SKU, case and whitespace sensitive; no title or identity inference. Omit or null disables this filter; blank is invalid. Selects observations containing a matching line but returns all their lines."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Page size from 1 to 50; omitted or zero means 25."
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue with the returned cursor and unchanged source, time, source_record_id and sku filters. Each page reads currently ready observations; this is not a frozen multi-page export."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": "integer"
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "reference_type": {
                                "type": "string"
                              },
                              "reference": {
                                "type": "string"
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_text": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at_text": {
                                "type": "string"
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": "string"
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "reference_type",
                              "reference",
                              "atomic_order_id",
                              "status_text",
                              "status",
                              "sold_at_text",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "identity",
                          "collection_id",
                          "normalizer",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "item_lines": {
                          "type": "integer"
                        },
                        "missing_sku_lines": {
                          "type": "integer",
                          "description": "Returned item lines whose normalized SKU is null; count lines, not quantity or distinct products."
                        }
                      },
                      "description": "Counts only the returned observations and their item lines, excluding lookahead. Not unique orders, quantities sold, or source completeness.",
                      "required": [
                        "order_observations",
                        "item_lines",
                        "missing_sku_lines"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "source_id",
                    "orders",
                    "page_stats"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.list_mabang": {
      "post": {
        "description": "Trace ready Mabang candidate observations by source, observation-time window and optionally one exact source-reference namespace/value. Preserves every collection and original evidence; does not choose latest, infer cross-system identity, known item counts or business completeness. Empty pages and lookahead recheck current authority. Production mapping remains disabled.",
        "operationId": "orders.list_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive observation time, at most microsecond precision; not a paid or sales date."
                  },
                  "observed_before": {
                    "type": "string",
                    "description": "Exclusive observation time, at most microsecond precision."
                  },
                  "reference": {
                    "type": [
                      "null",
                      "object"
                    ],
                    "properties": {
                      "namespace": {
                        "type": "string",
                        "description": "One of erp_record_key, erp_order_number_text, erp_transaction_number_text. Equal values in different namespaces are not aliases."
                      },
                      "value": {
                        "type": "string",
                        "description": "Exact positive decimal source reference, up to 30 digits; no leading zero, trimming, fuzzy match or business identity inference."
                      }
                    },
                    "description": "Optional exact reference within one explicit namespace. Omit or null returns all ready observations in the source window.",
                    "required": [
                      "namespace",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue the same source, observation window and reference query; page size may change. This is a live observation list, not a frozen export."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "references": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "entity_type": {
                                      "type": "string"
                                    },
                                    "source_id": {
                                      "type": "string"
                                    },
                                    "namespace": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "contract": {
                                      "type": "string"
                                    },
                                    "evidence_field": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "entity_type",
                                    "source_id",
                                    "namespace",
                                    "value",
                                    "business_id",
                                    "contract",
                                    "evidence_field"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "references",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "erp_record_key": {
                                "type": "string"
                              },
                              "order_number_text": {
                                "type": "string"
                              },
                              "transaction_number_text": {
                                "type": "string"
                              },
                              "shop_name": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "erp_status_text": {
                                "type": "string"
                              },
                              "platform_status_text": {
                                "type": "string"
                              },
                              "invoice_status_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "paid_at_text": {
                                "type": "string"
                              },
                              "paid_at": {
                                "type": "string"
                              },
                              "paid_at_precision": {
                                "type": "string"
                              },
                              "source_timezone": {
                                "type": "string"
                              },
                              "platform_dispatch_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "dispatch_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "erp_record_key",
                              "order_number_text",
                              "transaction_number_text",
                              "shop_name",
                              "platform",
                              "erp_status_text",
                              "platform_status_text",
                              "invoice_status_text",
                              "paid_at_text",
                              "paid_at",
                              "paid_at_precision",
                              "source_timezone",
                              "platform_dispatch_at_text",
                              "dispatch_at_text",
                              "atomic_order_id",
                              "status",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "collection_id",
                          "normalizer",
                          "identity",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "unknown_lines_observations": {
                          "type": "integer",
                          "description": "Returned observations whose item lines are unknown. Never interpret these as zero items or zero sales."
                        }
                      },
                      "required": [
                        "order_observations",
                        "unknown_lines_observations"
                      ],
                      "additionalProperties": false
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      },
                      "description": "Business completeness and domain gaps remain present even on an empty page."
                    }
                  },
                  "required": [
                    "source_id",
                    "orders",
                    "page_stats",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_export_begin": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected before capture. Persist a frozen selection of currently ready observations from one source/time range. Reuse the key after interruption; a new key captures a new batch. A local manifest is created, without external operations. Shared mode is selected only by the explicitly shared tool. The count is not business completeness; each read still verifies original evidence and current authority. A selection above 10000 observations is rejected whole as order_export_too_large and saves nothing; narrow the time range.",
        "operationId": "orders.shared_export_begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string"
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Reuse after interruption; a new key captures a new selection. Never include credentials."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "observed_from": {
                      "type": "string"
                    },
                    "observed_before": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "selected_count": {
                      "type": "integer",
                      "description": "Frozen membership count from mirrors ready at capture. Each page still verifies evidence and authority; not unique orders or business completeness."
                    }
                  },
                  "required": [
                    "export_id",
                    "source_id",
                    "observed_from",
                    "observed_before",
                    "created_at",
                    "selected_count"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_export_read": {
      "post": {
        "description": "Rechecks the original source contract even for historical empty batches and terminal positions. Read a page from a frozen observation selection owned by the current reader, using its original visibility mode. Rechecks current authority on all original targets and validates every returned observation against captured evidence. End position is not proof of complete business coverage or prior page consumption.",
        "operationId": "orders.shared_export_read",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "export_id": {
                    "type": "string"
                  },
                  "after": {
                    "type": "integer",
                    "description": "Start after this ordinal; zero begins. A position is not authorization or proof that previous pages were consumed."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  }
                },
                "required": [
                  "export_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export_id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "selected_count": {
                      "type": "integer"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": "integer"
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "reference_type": {
                                "type": "string"
                              },
                              "reference": {
                                "type": "string"
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_text": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at_text": {
                                "type": "string"
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": "string"
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "reference_type",
                              "reference",
                              "atomic_order_id",
                              "status_text",
                              "status",
                              "sold_at_text",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "identity",
                          "collection_id",
                          "normalizer",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "item_lines": {
                          "type": "integer"
                        },
                        "missing_sku_lines": {
                          "type": "integer",
                          "description": "Returned item lines whose normalized SKU is null; count lines, not quantity or distinct products."
                        }
                      },
                      "required": [
                        "order_observations",
                        "item_lines",
                        "missing_sku_lines"
                      ],
                      "additionalProperties": false
                    },
                    "next_after": {
                      "type": "integer"
                    },
                    "end_of_export": {
                      "type": "boolean",
                      "description": "This page reaches the frozen selection's end. Does not establish business completeness or that earlier pages were read."
                    }
                  },
                  "required": [
                    "export_id",
                    "source_id",
                    "selected_count",
                    "orders",
                    "page_stats",
                    "end_of_export"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_get": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected, including empty results. Read a ready order observation collected by another member of the same tenant, only with explicit shared-order scope and current authority on its original target. Does not expose raw datasets, allow normalization or alter ordinary original-actor tools.",
        "operationId": "orders.shared_get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": "integer"
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "identity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "order",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "collection_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "reference_type": {
                          "type": "string"
                        },
                        "reference": {
                          "type": "string"
                        },
                        "atomic_order_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status_text": {
                          "type": "string"
                        },
                        "status": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "sold_at_text": {
                          "type": "string"
                        },
                        "sold_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "currency": {
                          "type": "string"
                        },
                        "paid_total_minor": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "reference_type",
                        "reference",
                        "atomic_order_id",
                        "status_text",
                        "status",
                        "sold_at_text",
                        "sold_at",
                        "currency",
                        "paid_total_minor",
                        "lines",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string"
                        },
                        "source_instance_id": {
                          "type": "string"
                        },
                        "adapter": {
                          "type": "string"
                        },
                        "adapter_version": {
                          "type": "string"
                        },
                        "descriptor_sha256": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "source_record_id": {
                          "type": "string"
                        },
                        "observed_at": {
                          "type": "string"
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "execution_id": {
                          "type": "string"
                        },
                        "receipt_sha256": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "object",
                          "properties": {
                            "dataset_id": {
                              "type": "string"
                            },
                            "record_count": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "complete": {
                              "type": "boolean"
                            },
                            "sha256": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "dataset_id",
                            "record_count",
                            "pages",
                            "complete",
                            "sha256"
                          ],
                          "additionalProperties": false
                        },
                        "page": {
                          "type": "integer"
                        },
                        "ordinal": {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        "page_sha256": {
                          "type": "string"
                        },
                        "record_sha256": {
                          "type": "string"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "implementation": {
                              "type": "string"
                            },
                            "profile_sha256": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "market": {
                              "type": "string"
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "shop_identity": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": "string"
                            },
                            "resource": {
                              "type": [
                                "null",
                                "object"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string"
                                },
                                "parent_target": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "shop_name": {
                                  "type": "string"
                                },
                                "shop_platform": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "parent_target",
                                "shop_identity",
                                "shop_name",
                                "shop_platform"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "implementation",
                            "profile_sha256",
                            "platform",
                            "market",
                            "timezone",
                            "shop_identity",
                            "started_at",
                            "finished_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "source_instance_id",
                        "adapter",
                        "adapter_version",
                        "descriptor_sha256",
                        "channel",
                        "source_record_id",
                        "observed_at",
                        "source_updated_at",
                        "execution_id",
                        "receipt_sha256",
                        "dataset",
                        "page",
                        "ordinal",
                        "page_sha256",
                        "record_sha256",
                        "provenance"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "identity",
                    "collection_id",
                    "normalizer",
                    "order",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_get_mabang": {
      "post": {
        "description": "Read one ready Mabang candidate observation with original source evidence and current authority. Requires an explicitly compiled adapter mapping; production erp-mabang remains disabled pending real-store acceptance. Keeps ERP key, displayed order/transaction references, statuses and source-local paid time distinct. Unloaded lines and sales facts remain unknown; this is not a complete sales feed.",
        "operationId": "orders.shared_get_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collection_id": {
                    "type": "string"
                  },
                  "source_record_id": {
                    "type": "string",
                    "description": "Original identifier in this collection; a sales reference is not necessarily an atomic order ID."
                  }
                },
                "required": [
                  "collection_id",
                  "source_record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "collection_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "order": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "references": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "entity_type": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "namespace": {
                                "type": "string"
                              },
                              "value": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "contract": {
                                "type": "string"
                              },
                              "evidence_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "entity_type",
                              "source_id",
                              "namespace",
                              "value",
                              "business_id",
                              "contract",
                              "evidence_field"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "order",
                        "references",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "erp_record_key": {
                          "type": "string"
                        },
                        "order_number_text": {
                          "type": "string"
                        },
                        "transaction_number_text": {
                          "type": "string"
                        },
                        "shop_name": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "erp_status_text": {
                          "type": "string"
                        },
                        "platform_status_text": {
                          "type": "string"
                        },
                        "invoice_status_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "paid_at_text": {
                          "type": "string"
                        },
                        "paid_at": {
                          "type": "string"
                        },
                        "paid_at_precision": {
                          "type": "string"
                        },
                        "source_timezone": {
                          "type": "string"
                        },
                        "platform_dispatch_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "dispatch_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "atomic_order_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "sold_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "currency": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "paid_total_minor": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "listing_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "sku": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity": {
                                "type": "integer"
                              },
                              "display_price_minor": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "listing_id",
                              "title",
                              "sku",
                              "quantity",
                              "display_price_minor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "erp_record_key",
                        "order_number_text",
                        "transaction_number_text",
                        "shop_name",
                        "platform",
                        "erp_status_text",
                        "platform_status_text",
                        "invoice_status_text",
                        "paid_at_text",
                        "paid_at",
                        "paid_at_precision",
                        "source_timezone",
                        "platform_dispatch_at_text",
                        "dispatch_at_text",
                        "atomic_order_id",
                        "status",
                        "sold_at",
                        "currency",
                        "paid_total_minor",
                        "lines",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string"
                        },
                        "source_instance_id": {
                          "type": "string"
                        },
                        "adapter": {
                          "type": "string"
                        },
                        "adapter_version": {
                          "type": "string"
                        },
                        "descriptor_sha256": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "source_record_id": {
                          "type": "string"
                        },
                        "observed_at": {
                          "type": "string"
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "execution_id": {
                          "type": "string"
                        },
                        "receipt_sha256": {
                          "type": "string"
                        },
                        "dataset": {
                          "type": "object",
                          "properties": {
                            "dataset_id": {
                              "type": "string"
                            },
                            "record_count": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "complete": {
                              "type": "boolean"
                            },
                            "sha256": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "dataset_id",
                            "record_count",
                            "pages",
                            "complete",
                            "sha256"
                          ],
                          "additionalProperties": false
                        },
                        "page": {
                          "type": "integer"
                        },
                        "ordinal": {
                          "type": "integer",
                          "minimum": -2147483648,
                          "maximum": 2147483647
                        },
                        "page_sha256": {
                          "type": "string"
                        },
                        "record_sha256": {
                          "type": "string"
                        },
                        "provenance": {
                          "type": "object",
                          "properties": {
                            "implementation": {
                              "type": "string"
                            },
                            "profile_sha256": {
                              "type": "string"
                            },
                            "platform": {
                              "type": "string"
                            },
                            "market": {
                              "type": "string"
                            },
                            "timezone": {
                              "type": "string"
                            },
                            "shop_identity": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": "string"
                            },
                            "resource": {
                              "type": [
                                "null",
                                "object"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string"
                                },
                                "parent_target": {
                                  "type": "string"
                                },
                                "shop_identity": {
                                  "type": "string"
                                },
                                "shop_name": {
                                  "type": "string"
                                },
                                "shop_platform": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "kind",
                                "parent_target",
                                "shop_identity",
                                "shop_name",
                                "shop_platform"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "implementation",
                            "profile_sha256",
                            "platform",
                            "market",
                            "timezone",
                            "shop_identity",
                            "started_at",
                            "finished_at"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "source_instance_id",
                        "adapter",
                        "adapter_version",
                        "descriptor_sha256",
                        "channel",
                        "source_record_id",
                        "observed_at",
                        "source_updated_at",
                        "execution_id",
                        "receipt_sha256",
                        "dataset",
                        "page",
                        "ordinal",
                        "page_sha256",
                        "record_sha256",
                        "provenance"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "collection_id",
                    "normalizer",
                    "identity",
                    "order",
                    "source"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_list": {
      "post": {
        "description": "Only the Mercado Libre sales observation contract is supported; other source domains are rejected, including empty results. Page same-tenant ready historical order observations from one source/time range, optionally matching an exact source record ID and/or observed SKU, including other collectors with explicit shared-order scope and current original-target authority. Returns all lines of each matched observation. Each page is live, not a frozen export or a business completeness claim.",
        "operationId": "orders.shared_list",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive observation time in RFC3339, at most microsecond precision; not the sale date."
                  },
                  "observed_before": {
                    "type": "string",
                    "description": "Exclusive observation time in RFC3339, at most microsecond precision."
                  },
                  "source_record_id": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Optional exact source record identifier, not an inferred atomic order ID. Omit or null disables this filter; empty is invalid. Combined with sku using AND."
                  },
                  "sku": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "Optional exact observed SKU, case and whitespace sensitive; no title or identity inference. Omit or null disables this filter; blank is invalid. Selects observations containing a matching line but returns all their lines."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Page size from 1 to 50; omitted or zero means 25."
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue with the returned cursor and unchanged source, time, source_record_id and sku filters. Each page reads currently ready observations; this is not a frozen multi-page export."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": "integer"
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "reference_type": {
                                "type": "string"
                              },
                              "reference": {
                                "type": "string"
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_text": {
                                "type": "string"
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at_text": {
                                "type": "string"
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": "string"
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "reference_type",
                              "reference",
                              "atomic_order_id",
                              "status_text",
                              "status",
                              "sold_at_text",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "identity",
                          "collection_id",
                          "normalizer",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "item_lines": {
                          "type": "integer"
                        },
                        "missing_sku_lines": {
                          "type": "integer",
                          "description": "Returned item lines whose normalized SKU is null; count lines, not quantity or distinct products."
                        }
                      },
                      "description": "Counts only the returned observations and their item lines, excluding lookahead. Not unique orders, quantities sold, or source completeness.",
                      "required": [
                        "order_observations",
                        "item_lines",
                        "missing_sku_lines"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "source_id",
                    "orders",
                    "page_stats"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/orders.shared_list_mabang": {
      "post": {
        "description": "Trace ready Mabang candidate observations by source, observation-time window and optionally one exact source-reference namespace/value. Preserves every collection and original evidence; does not choose latest, infer cross-system identity, known item counts or business completeness. Empty pages and lookahead recheck current authority. Production mapping remains disabled.",
        "operationId": "orders.shared_list_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive observation time, at most microsecond precision; not a paid or sales date."
                  },
                  "observed_before": {
                    "type": "string",
                    "description": "Exclusive observation time, at most microsecond precision."
                  },
                  "reference": {
                    "type": [
                      "null",
                      "object"
                    ],
                    "properties": {
                      "namespace": {
                        "type": "string",
                        "description": "One of erp_record_key, erp_order_number_text, erp_transaction_number_text. Equal values in different namespaces are not aliases."
                      },
                      "value": {
                        "type": "string",
                        "description": "Exact positive decimal source reference, up to 30 digits; no leading zero, trimming, fuzzy match or business identity inference."
                      }
                    },
                    "description": "Optional exact reference within one explicit namespace. Omit or null returns all ready observations in the source window.",
                    "required": [
                      "namespace",
                      "value"
                    ],
                    "additionalProperties": false
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue the same source, observation window and reference query; page size may change. This is a live observation list, not a frozen export."
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "orders": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "collection_id": {
                            "type": "string"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "references": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "entity_type": {
                                      "type": "string"
                                    },
                                    "source_id": {
                                      "type": "string"
                                    },
                                    "namespace": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "contract": {
                                      "type": "string"
                                    },
                                    "evidence_field": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "entity_type",
                                    "source_id",
                                    "namespace",
                                    "value",
                                    "business_id",
                                    "contract",
                                    "evidence_field"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "order",
                              "references",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "erp_record_key": {
                                "type": "string"
                              },
                              "order_number_text": {
                                "type": "string"
                              },
                              "transaction_number_text": {
                                "type": "string"
                              },
                              "shop_name": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "erp_status_text": {
                                "type": "string"
                              },
                              "platform_status_text": {
                                "type": "string"
                              },
                              "invoice_status_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "paid_at_text": {
                                "type": "string"
                              },
                              "paid_at": {
                                "type": "string"
                              },
                              "paid_at_precision": {
                                "type": "string"
                              },
                              "source_timezone": {
                                "type": "string"
                              },
                              "platform_dispatch_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "dispatch_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "atomic_order_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sold_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "currency": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "paid_total_minor": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "listing_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "title": {
                                      "type": "string"
                                    },
                                    "sku": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity": {
                                      "type": "integer"
                                    },
                                    "display_price_minor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "listing_id",
                                    "title",
                                    "sku",
                                    "quantity",
                                    "display_price_minor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "erp_record_key",
                              "order_number_text",
                              "transaction_number_text",
                              "shop_name",
                              "platform",
                              "erp_status_text",
                              "platform_status_text",
                              "invoice_status_text",
                              "paid_at_text",
                              "paid_at",
                              "paid_at_precision",
                              "source_timezone",
                              "platform_dispatch_at_text",
                              "dispatch_at_text",
                              "atomic_order_id",
                              "status",
                              "sold_at",
                              "currency",
                              "paid_total_minor",
                              "lines",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "snapshot_id": {
                                "type": "string"
                              },
                              "source_instance_id": {
                                "type": "string"
                              },
                              "adapter": {
                                "type": "string"
                              },
                              "adapter_version": {
                                "type": "string"
                              },
                              "descriptor_sha256": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "source_record_id": {
                                "type": "string"
                              },
                              "observed_at": {
                                "type": "string"
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "execution_id": {
                                "type": "string"
                              },
                              "receipt_sha256": {
                                "type": "string"
                              },
                              "dataset": {
                                "type": "object",
                                "properties": {
                                  "dataset_id": {
                                    "type": "string"
                                  },
                                  "record_count": {
                                    "type": "integer"
                                  },
                                  "pages": {
                                    "type": "integer"
                                  },
                                  "complete": {
                                    "type": "boolean"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "dataset_id",
                                  "record_count",
                                  "pages",
                                  "complete",
                                  "sha256"
                                ],
                                "additionalProperties": false
                              },
                              "page": {
                                "type": "integer"
                              },
                              "ordinal": {
                                "type": "integer",
                                "minimum": -2147483648,
                                "maximum": 2147483647
                              },
                              "page_sha256": {
                                "type": "string"
                              },
                              "record_sha256": {
                                "type": "string"
                              },
                              "provenance": {
                                "type": "object",
                                "properties": {
                                  "implementation": {
                                    "type": "string"
                                  },
                                  "profile_sha256": {
                                    "type": "string"
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "market": {
                                    "type": "string"
                                  },
                                  "timezone": {
                                    "type": "string"
                                  },
                                  "shop_identity": {
                                    "type": "string"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "finished_at": {
                                    "type": "string"
                                  },
                                  "resource": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "kind": {
                                        "type": "string"
                                      },
                                      "parent_target": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "shop_name": {
                                        "type": "string"
                                      },
                                      "shop_platform": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "kind",
                                      "parent_target",
                                      "shop_identity",
                                      "shop_name",
                                      "shop_platform"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "implementation",
                                  "profile_sha256",
                                  "platform",
                                  "market",
                                  "timezone",
                                  "shop_identity",
                                  "started_at",
                                  "finished_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "snapshot_id",
                              "source_instance_id",
                              "adapter",
                              "adapter_version",
                              "descriptor_sha256",
                              "channel",
                              "source_record_id",
                              "observed_at",
                              "source_updated_at",
                              "execution_id",
                              "receipt_sha256",
                              "dataset",
                              "page",
                              "ordinal",
                              "page_sha256",
                              "record_sha256",
                              "provenance"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "collection_id",
                          "normalizer",
                          "identity",
                          "order",
                          "source"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "page_stats": {
                      "type": "object",
                      "properties": {
                        "order_observations": {
                          "type": "integer"
                        },
                        "unknown_lines_observations": {
                          "type": "integer",
                          "description": "Returned observations whose item lines are unknown. Never interpret these as zero items or zero sales."
                        }
                      },
                      "required": [
                        "order_observations",
                        "unknown_lines_observations"
                      ],
                      "additionalProperties": false
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      },
                      "description": "Business completeness and domain gaps remain present even on an empty page."
                    }
                  },
                  "required": [
                    "source_id",
                    "orders",
                    "page_stats",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.find_mabang": {
      "post": {
        "description": "Find original-actor ready purchase observations by exact source, groupId reference and EzERP observation-time range. Repeated references are retained. Cursor is bound to these filters; live pages are neither current purchase state nor frozen/complete business coverage. Empty pages still require current API authority.",
        "operationId": "purchases.find_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string"
                  },
                  "source_purchase_reference": {
                    "type": "string",
                    "description": "Exact observed groupId, case and whitespace sensitive; not a canonical purchase ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not purchase or arrival date."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; output budget may shorten a page."
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "normalizer",
                  "source_purchase_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "purchases": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "purchase": {
                            "type": "object",
                            "properties": {
                              "source_purchase_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "custom_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "associated_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_supplier_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound": {
                                "type": [
                                  "null",
                                  "boolean"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "last_storage_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "inbound_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "purchased_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "arrived_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "confirmed_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "returned_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "incoming_status_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "purchased_quantity",
                                    "arrived_quantity",
                                    "confirmed_quantity",
                                    "returned_quantity",
                                    "incoming_status_code",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_purchase_reference",
                              "custom_order_reference",
                              "associated_order_reference",
                              "business_id",
                              "source_supplier_id",
                              "source_warehouse_id",
                              "warehouse_name",
                              "status_code",
                              "source_state",
                              "calculate_inbound_code",
                              "calculate_inbound",
                              "created_at_text",
                              "updated_at_text",
                              "estimated_at_text",
                              "last_storage_at_text",
                              "source_updated_at",
                              "estimated_at",
                              "inbound_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "purchase": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "purchase",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "purchase",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "purchases"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.find_mabang_sku": {
      "post": {
        "description": "Find original-actor ready purchase observations whose Item lines contain an exact stockSku, by source and EzERP observation-time range. Each observation appears once with every matching line ordinal; quantities are not netted into inbound stock. Cursor is bound to these filters; live pages are neither current purchase state nor complete coverage. Empty pages still require current API authority.",
        "operationId": "purchases.find_mabang_sku",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string"
                  },
                  "sku_reference": {
                    "type": "string",
                    "description": "Exact observed line stockSku, case and whitespace sensitive; not a canonical SKU ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not purchase or arrival date."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20 purchase observations, default 10; output budget may shorten a page."
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "normalizer",
                  "sku_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "purchases": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "purchase": {
                            "type": "object",
                            "properties": {
                              "source_purchase_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "custom_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "associated_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_supplier_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound": {
                                "type": [
                                  "null",
                                  "boolean"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "last_storage_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "inbound_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "purchased_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "arrived_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "confirmed_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "returned_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "incoming_status_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "purchased_quantity",
                                    "arrived_quantity",
                                    "confirmed_quantity",
                                    "returned_quantity",
                                    "incoming_status_code",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_purchase_reference",
                              "custom_order_reference",
                              "associated_order_reference",
                              "business_id",
                              "source_supplier_id",
                              "source_warehouse_id",
                              "warehouse_name",
                              "status_code",
                              "source_state",
                              "calculate_inbound_code",
                              "calculate_inbound",
                              "created_at_text",
                              "updated_at_text",
                              "estimated_at_text",
                              "last_storage_at_text",
                              "source_updated_at",
                              "estimated_at",
                              "inbound_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "purchase": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "purchase",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          },
                          "matched_line_ordinals": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "integer"
                            },
                            "description": "One-based Item occurrences whose stockSku equals the reference; duplicate lines are kept separate and never summed."
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "purchase",
                          "identity",
                          "identity_sha256",
                          "matched_line_ordinals"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "purchases"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.get_mabang": {
      "post": {
        "description": "Read one original-actor purchase observation from a fully projected API response. Verify original body, receipt, binding and normalized document; retain duplicate references/lines and null business IDs, dates, units and inbound quantity.",
        "operationId": "purchases.get_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.purchase.v2; no automatic interpretation-version upgrade."
                  },
                  "ordinal": {
                    "type": "integer",
                    "description": "One-based occurrence within the original response data array; not a purchase business ID."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "observation_id": {
                      "type": "string"
                    },
                    "ordinal": {
                      "type": "integer"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "record_pointer": {
                      "type": "string"
                    },
                    "document_sha256": {
                      "type": "string"
                    },
                    "api_read": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "binding_ref": {
                          "type": "string"
                        },
                        "binding_sha256": {
                          "type": "string"
                        },
                        "binding_json": {
                          "type": "string",
                          "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                        },
                        "api": {
                          "type": "string"
                        },
                        "request_data_json": {
                          "type": "string"
                        },
                        "request_sha256": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "attempts": {
                          "type": "integer"
                        },
                        "unknown_attempts": {
                          "type": "integer"
                        },
                        "receipt": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "version": {
                              "type": "string"
                            },
                            "attempt_id": {
                              "type": "string"
                            },
                            "connection_id": {
                              "type": "string"
                            },
                            "connection_revision": {
                              "type": "integer"
                            },
                            "api": {
                              "type": "string"
                            },
                            "call_version": {
                              "type": "string"
                            },
                            "request_data_sha256": {
                              "type": "string"
                            },
                            "request_body_sha256": {
                              "type": "string",
                              "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                            },
                            "response_body_sha256": {
                              "type": "string"
                            },
                            "http_status": {
                              "type": "integer"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "received_at": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "version",
                            "attempt_id",
                            "connection_id",
                            "connection_revision",
                            "api",
                            "call_version",
                            "request_data_sha256",
                            "request_body_sha256",
                            "response_body_sha256",
                            "http_status",
                            "started_at",
                            "received_at"
                          ],
                          "additionalProperties": false
                        },
                        "body_bytes": {
                          "type": "integer"
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "binding_ref",
                        "binding_sha256",
                        "binding_json",
                        "api",
                        "request_data_json",
                        "request_sha256",
                        "created_at",
                        "state",
                        "attempts",
                        "unknown_attempts",
                        "receipt",
                        "body_bytes",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "purchase": {
                      "type": "object",
                      "properties": {
                        "source_purchase_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "custom_order_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "associated_order_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "business_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_supplier_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_warehouse_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "warehouse_name": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_state": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "calculate_inbound_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "calculate_inbound": {
                          "type": [
                            "null",
                            "boolean"
                          ]
                        },
                        "created_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "updated_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "estimated_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "last_storage_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "estimated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "inbound_quantity": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "lines": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_line_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "purchased_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "arrived_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "confirmed_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "returned_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "incoming_status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity_unit": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_line_id",
                              "sku_reference",
                              "sku_business_id",
                              "purchased_quantity",
                              "arrived_quantity",
                              "confirmed_quantity",
                              "returned_quantity",
                              "incoming_status_code",
                              "quantity_unit"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "api": {
                              "type": "string"
                            },
                            "normalizer": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "api",
                            "normalizer",
                            "record_sha256",
                            "fields"
                          ],
                          "additionalProperties": false
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "source_purchase_reference",
                        "custom_order_reference",
                        "associated_order_reference",
                        "business_id",
                        "source_supplier_id",
                        "source_warehouse_id",
                        "warehouse_name",
                        "status_code",
                        "source_state",
                        "calculate_inbound_code",
                        "calculate_inbound",
                        "created_at_text",
                        "updated_at_text",
                        "estimated_at_text",
                        "last_storage_at_text",
                        "source_updated_at",
                        "estimated_at",
                        "inbound_quantity",
                        "lines",
                        "evidence",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "observation_id": {
                          "type": "string"
                        },
                        "purchase": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "line_ordinal": {
                                "type": [
                                  "null",
                                  "integer"
                                ]
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "line_ordinal",
                              "identity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "observation_id",
                        "purchase",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity_sha256": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "observation_id",
                    "ordinal",
                    "normalizer",
                    "response_contract",
                    "record_pointer",
                    "document_sha256",
                    "api_read",
                    "purchase",
                    "identity",
                    "identity_sha256"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.list_mabang": {
      "post": {
        "description": "Page original-actor purchase observations within one fully projected response. Revalidate all original evidence and current operation grant and stored connection, including end. Response end is not purchase or inbound coverage.",
        "operationId": "purchases.list_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.purchase.v2; no automatic interpretation-version upgrade."
                  },
                  "after_ordinal": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; response budget may shorten a page."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "after_ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "mirror": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "response_contract": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer",
                          "description": "Members in this one response array, never enterprise purchase coverage."
                        },
                        "projected_records": {
                          "type": "integer"
                        },
                        "reported_page_count_json": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "reported_data_count_json": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "normalizer",
                        "response_contract",
                        "state",
                        "record_count",
                        "projected_records",
                        "reported_page_count_json",
                        "reported_data_count_json",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "purchases": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "purchase": {
                            "type": "object",
                            "properties": {
                              "source_purchase_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "custom_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "associated_order_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_supplier_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "calculate_inbound": {
                                "type": [
                                  "null",
                                  "boolean"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "updated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "last_storage_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "estimated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "inbound_quantity": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "lines": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_line_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_reference": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "sku_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "purchased_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "arrived_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "confirmed_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "returned_quantity": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "incoming_status_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_line_id",
                                    "sku_reference",
                                    "sku_business_id",
                                    "purchased_quantity",
                                    "arrived_quantity",
                                    "confirmed_quantity",
                                    "returned_quantity",
                                    "incoming_status_code",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_purchase_reference",
                              "custom_order_reference",
                              "associated_order_reference",
                              "business_id",
                              "source_supplier_id",
                              "source_warehouse_id",
                              "warehouse_name",
                              "status_code",
                              "source_state",
                              "calculate_inbound_code",
                              "calculate_inbound",
                              "created_at_text",
                              "updated_at_text",
                              "estimated_at_text",
                              "last_storage_at_text",
                              "source_updated_at",
                              "estimated_at",
                              "inbound_quantity",
                              "lines",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "purchase": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "line_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "line_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "purchase",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "purchase",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_ordinal": {
                      "type": "integer"
                    },
                    "response_end": {
                      "type": "boolean",
                      "description": "Only the local response members ended; never business or inbound completeness."
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "mirror",
                    "purchases",
                    "next_ordinal",
                    "response_end"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.project_mabang": {
      "post": {
        "description": "Persist at most ten purchase observations from an already received pur-get-purchase-list response using the documented-response candidate contract and mabang.openapi.purchase.v2. Repeating advances the same durable projection; completed repeats are unchanged. No upstream read. Explicit purchase-plan flags, unrecognized envelopes and business error responses are rejected. Production bindings remain disabled.",
        "operationId": "purchases.project_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.purchase.v2; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise purchase coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_page_count_json": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "reported_data_count_json": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_page_count_json",
                    "reported_data_count_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/purchases.status_mabang": {
      "post": {
        "description": "Verify purchase projection progress against its original API response and fixed interpretation version. Ready means this response array was projected, never business completeness.",
        "operationId": "purchases.status_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.purchase.v2; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise purchase coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_page_count_json": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "reported_data_count_json": {
                      "type": [
                        "null",
                        "string"
                      ]
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_page_count_json",
                    "reported_data_count_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.begin": {
      "post": {
        "description": "Persist a readiness check over two distinct-source shared frozen exports owned by this reader. The export pair and rule are the retry key. This rule only records inability to reconcile; frozen completion never establishes business completeness.",
        "operationId": "reconciliations.begin",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "left_export_id": {
                    "type": "string"
                  },
                  "right_export_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "left_export_id",
                  "right_export_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "rule_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "left_export_id": {
                      "type": "string"
                    },
                    "right_export_id": {
                      "type": "string"
                    },
                    "left_after": {
                      "type": "integer"
                    },
                    "right_after": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "rule_version",
                    "state",
                    "left_export_id",
                    "right_export_id",
                    "left_after",
                    "right_after",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.get": {
      "post": {
        "description": "Read or resume the original durable readiness run with current authorization on both sources. Resume verifies at most 50 original observations and saves findings and progress atomically. Missing identities and unproven coverage are unable_to_reconcile, never missing orders or agreement.",
        "operationId": "reconciliations.get",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "rule_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "left_export_id": {
                      "type": "string"
                    },
                    "right_export_id": {
                      "type": "string"
                    },
                    "left_after": {
                      "type": "integer"
                    },
                    "right_after": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "rule_version",
                    "state",
                    "left_export_id",
                    "right_export_id",
                    "left_after",
                    "right_after",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.inbox": {
      "post": {
        "description": "Page a completed readiness run's persistent gap findings, including original observations and revalidated evidence. Duplicate scans reuse findings. No external remediation is performed.",
        "operationId": "reconciliations.inbox",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "after_id": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "findings": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "review": {
                            "type": "object",
                            "properties": {
                              "state": {
                                "type": "string"
                              },
                              "revision": {
                                "type": "integer"
                              },
                              "updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              }
                            },
                            "required": [
                              "state",
                              "revision",
                              "updated_at"
                            ],
                            "additionalProperties": false
                          },
                          "selection": {
                            "type": "object",
                            "properties": {
                              "export_id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "observed_from": {
                                "type": "string"
                              },
                              "observed_before": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "selected_count": {
                                "type": "integer",
                                "description": "Frozen membership count from mirrors ready at capture. Each page still verifies evidence and authority; not unique orders or business completeness."
                              }
                            },
                            "required": [
                              "export_id",
                              "source_id",
                              "observed_from",
                              "observed_before",
                              "created_at",
                              "selected_count"
                            ],
                            "additionalProperties": false
                          },
                          "id": {
                            "type": "string"
                          },
                          "rule_version": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "export_id": {
                            "type": "string"
                          },
                          "missing_fields": {
                            "type": [
                              "null",
                              "array"
                            ],
                            "items": {
                              "type": "string"
                            }
                          },
                          "observation": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "model_version": {
                                    "type": "string"
                                  },
                                  "order": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "relations": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "line_ordinal": {
                                          "type": "integer"
                                        },
                                        "identity": {
                                          "type": "object",
                                          "properties": {
                                            "entity_type": {
                                              "type": "string"
                                            },
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "namespace": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "business_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "contract": {
                                              "type": "string"
                                            },
                                            "evidence_field": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "entity_type",
                                            "source_id",
                                            "namespace",
                                            "value",
                                            "business_id",
                                            "contract",
                                            "evidence_field"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "line_ordinal",
                                        "identity"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "model_version",
                                  "order",
                                  "relations",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "collection_id": {
                                "type": "string"
                              },
                              "normalizer": {
                                "type": "string"
                              },
                              "order": {
                                "type": "object",
                                "properties": {
                                  "reference_type": {
                                    "type": "string"
                                  },
                                  "reference": {
                                    "type": "string"
                                  },
                                  "atomic_order_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "status_text": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "sold_at_text": {
                                    "type": "string"
                                  },
                                  "sold_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "currency": {
                                    "type": "string"
                                  },
                                  "paid_total_minor": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "lines": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "ordinal": {
                                          "type": "integer"
                                        },
                                        "source_line_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "listing_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "title": {
                                          "type": "string"
                                        },
                                        "sku": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity": {
                                          "type": "integer"
                                        },
                                        "display_price_minor": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "ordinal",
                                        "source_line_id",
                                        "listing_id",
                                        "title",
                                        "sku",
                                        "quantity",
                                        "display_price_minor"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "reference_type",
                                  "reference",
                                  "atomic_order_id",
                                  "status_text",
                                  "status",
                                  "sold_at_text",
                                  "sold_at",
                                  "currency",
                                  "paid_total_minor",
                                  "lines",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "source": {
                                "type": "object",
                                "properties": {
                                  "snapshot_id": {
                                    "type": "string"
                                  },
                                  "source_instance_id": {
                                    "type": "string"
                                  },
                                  "adapter": {
                                    "type": "string"
                                  },
                                  "adapter_version": {
                                    "type": "string"
                                  },
                                  "descriptor_sha256": {
                                    "type": "string"
                                  },
                                  "channel": {
                                    "type": "string"
                                  },
                                  "source_record_id": {
                                    "type": "string"
                                  },
                                  "observed_at": {
                                    "type": "string"
                                  },
                                  "source_updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "execution_id": {
                                    "type": "string"
                                  },
                                  "receipt_sha256": {
                                    "type": "string"
                                  },
                                  "dataset": {
                                    "type": "object",
                                    "properties": {
                                      "dataset_id": {
                                        "type": "string"
                                      },
                                      "record_count": {
                                        "type": "integer"
                                      },
                                      "pages": {
                                        "type": "integer"
                                      },
                                      "complete": {
                                        "type": "boolean"
                                      },
                                      "sha256": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "dataset_id",
                                      "record_count",
                                      "pages",
                                      "complete",
                                      "sha256"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "page": {
                                    "type": "integer"
                                  },
                                  "ordinal": {
                                    "type": "integer",
                                    "minimum": -2147483648,
                                    "maximum": 2147483647
                                  },
                                  "page_sha256": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "provenance": {
                                    "type": "object",
                                    "properties": {
                                      "implementation": {
                                        "type": "string"
                                      },
                                      "profile_sha256": {
                                        "type": "string"
                                      },
                                      "platform": {
                                        "type": "string"
                                      },
                                      "market": {
                                        "type": "string"
                                      },
                                      "timezone": {
                                        "type": "string"
                                      },
                                      "shop_identity": {
                                        "type": "string"
                                      },
                                      "started_at": {
                                        "type": "string"
                                      },
                                      "finished_at": {
                                        "type": "string"
                                      },
                                      "resource": {
                                        "type": [
                                          "null",
                                          "object"
                                        ],
                                        "properties": {
                                          "kind": {
                                            "type": "string"
                                          },
                                          "parent_target": {
                                            "type": "string"
                                          },
                                          "shop_identity": {
                                            "type": "string"
                                          },
                                          "shop_name": {
                                            "type": "string"
                                          },
                                          "shop_platform": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "kind",
                                          "parent_target",
                                          "shop_identity",
                                          "shop_name",
                                          "shop_platform"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "implementation",
                                      "profile_sha256",
                                      "platform",
                                      "market",
                                      "timezone",
                                      "shop_identity",
                                      "started_at",
                                      "finished_at"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "snapshot_id",
                                  "source_instance_id",
                                  "adapter",
                                  "adapter_version",
                                  "descriptor_sha256",
                                  "channel",
                                  "source_record_id",
                                  "observed_at",
                                  "source_updated_at",
                                  "execution_id",
                                  "receipt_sha256",
                                  "dataset",
                                  "page",
                                  "ordinal",
                                  "page_sha256",
                                  "record_sha256",
                                  "provenance"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "identity",
                              "collection_id",
                              "normalizer",
                              "order",
                              "source"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "review",
                          "selection",
                          "id",
                          "rule_version",
                          "code",
                          "export_id",
                          "missing_fields",
                          "observation"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "findings"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.list": {
      "post": {
        "description": "Recover this reader's existing readiness runs for an exact pair of sources, optionally filtered by workflow state. Reads stored progress without creating exports or claiming business comparability; use the original run ID to resume or read its evidence inbox. Both sources and all returned/lookahead export grants require current authority, including an empty page.",
        "operationId": "reconciliations.list",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_a": {
                    "type": "string",
                    "description": "One exact source ID of the pair; order of the two sources does not matter."
                  },
                  "source_b": {
                    "type": "string",
                    "description": "A distinct source ID. Both sources require current shared-read authority, even for an empty page."
                  },
                  "state": {
                    "type": "string",
                    "description": "Optional scanning or unable_to_reconcile filter. An empty string includes both."
                  },
                  "after_id": {
                    "type": "string",
                    "description": "Continue after this run ID with the same source pair and state filter. This is a live directory, not a frozen snapshot; restart from the beginning to discover newly inserted runs."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  }
                },
                "required": [
                  "source_a",
                  "source_b"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "runs": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "rule_version": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "left_export_id": {
                            "type": "string"
                          },
                          "right_export_id": {
                            "type": "string"
                          },
                          "left_after": {
                            "type": "integer"
                          },
                          "right_after": {
                            "type": "integer"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "completed_at": {
                            "type": [
                              "null",
                              "string"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "rule_version",
                          "state",
                          "left_export_id",
                          "right_export_id",
                          "left_after",
                          "right_after",
                          "created_at",
                          "completed_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "runs"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.resume": {
      "post": {
        "description": "Read or resume the original durable readiness run with current authorization on both sources. Resume verifies at most 50 original observations and saves findings and progress atomically. Missing identities and unproven coverage are unable_to_reconcile, never missing orders or agreement.",
        "operationId": "reconciliations.resume",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "rule_version": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "left_export_id": {
                      "type": "string"
                    },
                    "right_export_id": {
                      "type": "string"
                    },
                    "left_after": {
                      "type": "integer"
                    },
                    "right_after": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "completed_at": {
                      "type": [
                        "null",
                        "string"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "rule_version",
                    "state",
                    "left_export_id",
                    "right_export_id",
                    "left_after",
                    "right_after",
                    "created_at",
                    "completed_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.review": {
      "post": {
        "description": "Acknowledge or reopen a local gap finding using its expected review revision and a stable retry key. This records attention only; it never resolves a gap or changes unable_to_reconcile. A retried key returns its original event, even after later reviews. Current source authorization and original evidence are rechecked.",
        "operationId": "reconciliations.review",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "finding_id": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "description": "acknowledge or reopen; only records local attention, never resolves evidence gaps."
                  },
                  "expected_revision": {
                    "type": "integer"
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "finding_id",
                  "action",
                  "expected_revision",
                  "idempotency_key"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "finding_id": {
                      "type": "string"
                    },
                    "action": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "finding_id",
                    "action",
                    "state",
                    "revision",
                    "created_at"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.review_history": {
      "post": {
        "description": "Read the append-only local attention history of a gap finding, ordered by revision. History persists across overlapping runs and does not change the evidence or rule outcome. Current authorization and original evidence are required.",
        "operationId": "reconciliations.review_history",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "finding_id": {
                    "type": "string"
                  },
                  "after_revision": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id",
                  "finding_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "finding_id": {
                      "type": "string"
                    },
                    "reviews": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "finding_id": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "finding_id",
                          "action",
                          "state",
                          "revision",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_revision": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "finding_id",
                    "reviews"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/reconciliations.source_inbox": {
      "post": {
        "description": "Read this reader's distinct persistent findings across completed readiness runs for an exact source pair. Filter local attention or gap kind; revalidate both sources, chosen runs and original evidence including lookahead. Returns one usable run ID per finding. Live pagination requires rescanning for changes; empty or acknowledged results never establish business agreement or completeness.",
        "operationId": "reconciliations.source_inbox",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_a": {
                    "type": "string",
                    "description": "One exact source ID; order of the two sources does not matter."
                  },
                  "source_b": {
                    "type": "string",
                    "description": "A distinct source ID. Both sources require current shared-read authority, including empty results."
                  },
                  "review_state": {
                    "type": "string",
                    "description": "Optional open or acknowledged attention filter; omitted includes both. Acknowledgment never resolves a gap."
                  },
                  "code": {
                    "type": "string",
                    "description": "Optional identity_unproven or coverage_unproven filter."
                  },
                  "after_id": {
                    "type": "string",
                    "description": "Continue after a finding ID with the same pair and filters. This live inbox is not a frozen snapshot; rescan from the beginning for newly completed runs or changed attention state."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 50; omitted or zero means 25."
                  }
                },
                "required": [
                  "source_a",
                  "source_b"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "findings": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "run_id": {
                            "type": "string",
                            "description": "One completed run linking this finding for this source pair; usable with review and review_history. Not a count of runs or proof of business completeness."
                          },
                          "finding": {
                            "type": "object",
                            "properties": {
                              "review": {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string"
                                  },
                                  "revision": {
                                    "type": "integer"
                                  },
                                  "updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  }
                                },
                                "required": [
                                  "state",
                                  "revision",
                                  "updated_at"
                                ],
                                "additionalProperties": false
                              },
                              "selection": {
                                "type": "object",
                                "properties": {
                                  "export_id": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "observed_from": {
                                    "type": "string"
                                  },
                                  "observed_before": {
                                    "type": "string"
                                  },
                                  "created_at": {
                                    "type": "string"
                                  },
                                  "selected_count": {
                                    "type": "integer",
                                    "description": "Frozen membership count from mirrors ready at capture. Each page still verifies evidence and authority; not unique orders or business completeness."
                                  }
                                },
                                "required": [
                                  "export_id",
                                  "source_id",
                                  "observed_from",
                                  "observed_before",
                                  "created_at",
                                  "selected_count"
                                ],
                                "additionalProperties": false
                              },
                              "id": {
                                "type": "string"
                              },
                              "rule_version": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "export_id": {
                                "type": "string"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              },
                              "observation": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "identity": {
                                    "type": "object",
                                    "properties": {
                                      "model_version": {
                                        "type": "string"
                                      },
                                      "order": {
                                        "type": "object",
                                        "properties": {
                                          "entity_type": {
                                            "type": "string"
                                          },
                                          "source_id": {
                                            "type": "string"
                                          },
                                          "namespace": {
                                            "type": "string"
                                          },
                                          "value": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "business_id": {
                                            "type": [
                                              "null",
                                              "string"
                                            ]
                                          },
                                          "contract": {
                                            "type": "string"
                                          },
                                          "evidence_field": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "entity_type",
                                          "source_id",
                                          "namespace",
                                          "value",
                                          "business_id",
                                          "contract",
                                          "evidence_field"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "relations": {
                                        "type": [
                                          "null",
                                          "array"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string"
                                            },
                                            "line_ordinal": {
                                              "type": "integer"
                                            },
                                            "identity": {
                                              "type": "object",
                                              "properties": {
                                                "entity_type": {
                                                  "type": "string"
                                                },
                                                "source_id": {
                                                  "type": "string"
                                                },
                                                "namespace": {
                                                  "type": "string"
                                                },
                                                "value": {
                                                  "type": [
                                                    "null",
                                                    "string"
                                                  ]
                                                },
                                                "business_id": {
                                                  "type": [
                                                    "null",
                                                    "string"
                                                  ]
                                                },
                                                "contract": {
                                                  "type": "string"
                                                },
                                                "evidence_field": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "entity_type",
                                                "source_id",
                                                "namespace",
                                                "value",
                                                "business_id",
                                                "contract",
                                                "evidence_field"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "line_ordinal",
                                            "identity"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "missing_fields": {
                                        "type": [
                                          "null",
                                          "array"
                                        ],
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "model_version",
                                      "order",
                                      "relations",
                                      "missing_fields"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "collection_id": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "order": {
                                    "type": "object",
                                    "properties": {
                                      "reference_type": {
                                        "type": "string"
                                      },
                                      "reference": {
                                        "type": "string"
                                      },
                                      "atomic_order_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "status_text": {
                                        "type": "string"
                                      },
                                      "status": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "sold_at_text": {
                                        "type": "string"
                                      },
                                      "sold_at": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "currency": {
                                        "type": "string"
                                      },
                                      "paid_total_minor": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "lines": {
                                        "type": [
                                          "null",
                                          "array"
                                        ],
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "ordinal": {
                                              "type": "integer"
                                            },
                                            "source_line_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "listing_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "title": {
                                              "type": "string"
                                            },
                                            "sku": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "quantity": {
                                              "type": "integer"
                                            },
                                            "display_price_minor": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "ordinal",
                                            "source_line_id",
                                            "listing_id",
                                            "title",
                                            "sku",
                                            "quantity",
                                            "display_price_minor"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "missing_fields": {
                                        "type": [
                                          "null",
                                          "array"
                                        ],
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "reference_type",
                                      "reference",
                                      "atomic_order_id",
                                      "status_text",
                                      "status",
                                      "sold_at_text",
                                      "sold_at",
                                      "currency",
                                      "paid_total_minor",
                                      "lines",
                                      "missing_fields"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "source": {
                                    "type": "object",
                                    "properties": {
                                      "snapshot_id": {
                                        "type": "string"
                                      },
                                      "source_instance_id": {
                                        "type": "string"
                                      },
                                      "adapter": {
                                        "type": "string"
                                      },
                                      "adapter_version": {
                                        "type": "string"
                                      },
                                      "descriptor_sha256": {
                                        "type": "string"
                                      },
                                      "channel": {
                                        "type": "string"
                                      },
                                      "source_record_id": {
                                        "type": "string"
                                      },
                                      "observed_at": {
                                        "type": "string"
                                      },
                                      "source_updated_at": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "execution_id": {
                                        "type": "string"
                                      },
                                      "receipt_sha256": {
                                        "type": "string"
                                      },
                                      "dataset": {
                                        "type": "object",
                                        "properties": {
                                          "dataset_id": {
                                            "type": "string"
                                          },
                                          "record_count": {
                                            "type": "integer"
                                          },
                                          "pages": {
                                            "type": "integer"
                                          },
                                          "complete": {
                                            "type": "boolean"
                                          },
                                          "sha256": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "dataset_id",
                                          "record_count",
                                          "pages",
                                          "complete",
                                          "sha256"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "page": {
                                        "type": "integer"
                                      },
                                      "ordinal": {
                                        "type": "integer",
                                        "minimum": -2147483648,
                                        "maximum": 2147483647
                                      },
                                      "page_sha256": {
                                        "type": "string"
                                      },
                                      "record_sha256": {
                                        "type": "string"
                                      },
                                      "provenance": {
                                        "type": "object",
                                        "properties": {
                                          "implementation": {
                                            "type": "string"
                                          },
                                          "profile_sha256": {
                                            "type": "string"
                                          },
                                          "platform": {
                                            "type": "string"
                                          },
                                          "market": {
                                            "type": "string"
                                          },
                                          "timezone": {
                                            "type": "string"
                                          },
                                          "shop_identity": {
                                            "type": "string"
                                          },
                                          "started_at": {
                                            "type": "string"
                                          },
                                          "finished_at": {
                                            "type": "string"
                                          },
                                          "resource": {
                                            "type": [
                                              "null",
                                              "object"
                                            ],
                                            "properties": {
                                              "kind": {
                                                "type": "string"
                                              },
                                              "parent_target": {
                                                "type": "string"
                                              },
                                              "shop_identity": {
                                                "type": "string"
                                              },
                                              "shop_name": {
                                                "type": "string"
                                              },
                                              "shop_platform": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "kind",
                                              "parent_target",
                                              "shop_identity",
                                              "shop_name",
                                              "shop_platform"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "implementation",
                                          "profile_sha256",
                                          "platform",
                                          "market",
                                          "timezone",
                                          "shop_identity",
                                          "started_at",
                                          "finished_at"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "required": [
                                      "snapshot_id",
                                      "source_instance_id",
                                      "adapter",
                                      "adapter_version",
                                      "descriptor_sha256",
                                      "channel",
                                      "source_record_id",
                                      "observed_at",
                                      "source_updated_at",
                                      "execution_id",
                                      "receipt_sha256",
                                      "dataset",
                                      "page",
                                      "ordinal",
                                      "page_sha256",
                                      "record_sha256",
                                      "provenance"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "identity",
                                  "collection_id",
                                  "normalizer",
                                  "order",
                                  "source"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "review",
                              "selection",
                              "id",
                              "rule_version",
                              "code",
                              "export_id",
                              "missing_fields",
                              "observation"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "run_id",
                          "finding"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_after_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "findings"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "orders:read_shared",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.find_mabang": {
      "post": {
        "description": "Find original-actor ready inventory-SKU observations by exact source, stockSku reference and EzERP observation-time range. Repeated references are retained. Cursor is bound to these filters; live pages are neither current catalog state nor frozen/complete coverage. Empty pages still require current API authority.",
        "operationId": "skus.find_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string"
                  },
                  "source_sku_reference": {
                    "type": "string",
                    "description": "Exact observed stockSku, case and whitespace sensitive; not a canonical SKU ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not SKU creation or modification time."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; output budget may shorten a page."
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "normalizer",
                  "source_sku_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "skus": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "sku": {
                            "type": "object",
                            "properties": {
                              "source_sku_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "main_sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "name_cn": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "name_en": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "declaration_unit_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity_unit": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "modified_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "last_time_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_bindings": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_warehouse_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "warehouse_name": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "warehouse_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "status_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "binding_enabled": {
                                      "type": [
                                        "null",
                                        "boolean"
                                      ]
                                    },
                                    "default_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "is_sku_default": {
                                      "type": [
                                        "null",
                                        "boolean"
                                      ]
                                    },
                                    "default_grid_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_warehouse_id",
                                    "warehouse_name",
                                    "warehouse_business_id",
                                    "status_code",
                                    "binding_enabled",
                                    "default_code",
                                    "is_sku_default",
                                    "default_grid_code",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_sku_id",
                              "sku_reference",
                              "main_sku_reference",
                              "business_id",
                              "name_cn",
                              "name_en",
                              "status_code",
                              "source_state",
                              "declaration_unit_id",
                              "quantity_unit",
                              "created_at_text",
                              "modified_at_text",
                              "last_time_text",
                              "source_updated_at",
                              "warehouse_bindings",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "sku": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "binding_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "binding_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "sku",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "sku",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "source_id",
                    "skus"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.gaps_mabang": {
      "post": {
        "description": "Plan inventory-SKU catalog reads: list exact stockSku references used by ready purchase or allocation lines in one source and observation window that have no ready SKU catalog observation there, plus stock-do-search-sku-list-new request data of at most 50 SKUs each. A planning aid from lookup indexes, never evidence that the ERP lacks a SKU; nothing is read automatically. Requires current authority for every bound operation.",
        "operationId": "skus.gaps_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time for both line and SKU observations; not a business date."
                  },
                  "observed_before": {
                    "type": "string"
                  },
                  "cursor": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "model_version": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "unresolved": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "sku_reference": {
                            "type": "string"
                          },
                          "purchase_lines": {
                            "type": "integer"
                          },
                          "allocation_lines": {
                            "type": "integer"
                          },
                          "batchable": {
                            "type": "boolean",
                            "description": "False when the reference contains a comma and cannot be sent in a comma-separated stockSkuList."
                          }
                        },
                        "required": [
                          "sku_reference",
                          "purchase_lines",
                          "allocation_lines",
                          "batchable"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "suggested_requests": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": [
                          "null",
                          "array"
                        ],
                        "items": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 255
                        }
                      },
                      "description": "Request data for stock-do-search-sku-list-new, at most 50 SKUs each; pass to api_reads.begin yourself. Nothing is read automatically."
                    },
                    "next_cursor": {
                      "type": "string"
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "model_version",
                    "source_id",
                    "unresolved",
                    "suggested_requests",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.get_mabang": {
      "post": {
        "description": "Read one original-actor inventory-SKU observation from a fully projected API response. Verify original body, receipt, binding and normalized document; retain duplicate references and warehouse bindings, null business IDs, units and source timezone.",
        "operationId": "skus.get_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.sku.v2; no automatic interpretation-version upgrade."
                  },
                  "ordinal": {
                    "type": "integer",
                    "description": "One-based occurrence within the original response data array; not a SKU business ID."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "observation_id": {
                      "type": "string"
                    },
                    "ordinal": {
                      "type": "integer"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "record_pointer": {
                      "type": "string"
                    },
                    "document_sha256": {
                      "type": "string"
                    },
                    "api_read": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "binding_ref": {
                          "type": "string"
                        },
                        "binding_sha256": {
                          "type": "string"
                        },
                        "binding_json": {
                          "type": "string",
                          "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                        },
                        "api": {
                          "type": "string"
                        },
                        "request_data_json": {
                          "type": "string"
                        },
                        "request_sha256": {
                          "type": "string"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "attempts": {
                          "type": "integer"
                        },
                        "unknown_attempts": {
                          "type": "integer"
                        },
                        "receipt": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "version": {
                              "type": "string"
                            },
                            "attempt_id": {
                              "type": "string"
                            },
                            "connection_id": {
                              "type": "string"
                            },
                            "connection_revision": {
                              "type": "integer"
                            },
                            "api": {
                              "type": "string"
                            },
                            "call_version": {
                              "type": "string"
                            },
                            "request_data_sha256": {
                              "type": "string"
                            },
                            "request_body_sha256": {
                              "type": "string",
                              "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                            },
                            "response_body_sha256": {
                              "type": "string"
                            },
                            "http_status": {
                              "type": "integer"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "received_at": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "version",
                            "attempt_id",
                            "connection_id",
                            "connection_revision",
                            "api",
                            "call_version",
                            "request_data_sha256",
                            "request_body_sha256",
                            "response_body_sha256",
                            "http_status",
                            "started_at",
                            "received_at"
                          ],
                          "additionalProperties": false
                        },
                        "body_bytes": {
                          "type": "integer"
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "binding_ref",
                        "binding_sha256",
                        "binding_json",
                        "api",
                        "request_data_json",
                        "request_sha256",
                        "created_at",
                        "state",
                        "attempts",
                        "unknown_attempts",
                        "receipt",
                        "body_bytes",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "sku": {
                      "type": "object",
                      "properties": {
                        "source_sku_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "sku_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "main_sku_reference": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "business_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "name_cn": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "name_en": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "status_code": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_state": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "declaration_unit_id": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "quantity_unit": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "created_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "modified_at_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "last_time_text": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "source_updated_at": {
                          "type": [
                            "null",
                            "string"
                          ]
                        },
                        "warehouse_bindings": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "ordinal": {
                                "type": "integer"
                              },
                              "source_warehouse_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_name": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "binding_enabled": {
                                "type": [
                                  "null",
                                  "boolean"
                                ]
                              },
                              "default_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "is_sku_default": {
                                "type": [
                                  "null",
                                  "boolean"
                                ]
                              },
                              "default_grid_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity_unit": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              }
                            },
                            "required": [
                              "ordinal",
                              "source_warehouse_id",
                              "warehouse_name",
                              "warehouse_business_id",
                              "status_code",
                              "binding_enabled",
                              "default_code",
                              "is_sku_default",
                              "default_grid_code",
                              "quantity_unit"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "evidence": {
                          "type": "object",
                          "properties": {
                            "api": {
                              "type": "string"
                            },
                            "normalizer": {
                              "type": "string"
                            },
                            "record_sha256": {
                              "type": "string"
                            },
                            "fields": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "api",
                            "normalizer",
                            "record_sha256",
                            "fields"
                          ],
                          "additionalProperties": false
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "source_sku_id",
                        "sku_reference",
                        "main_sku_reference",
                        "business_id",
                        "name_cn",
                        "name_en",
                        "status_code",
                        "source_state",
                        "declaration_unit_id",
                        "quantity_unit",
                        "created_at_text",
                        "modified_at_text",
                        "last_time_text",
                        "source_updated_at",
                        "warehouse_bindings",
                        "evidence",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity": {
                      "type": "object",
                      "properties": {
                        "model_version": {
                          "type": "string"
                        },
                        "observation_id": {
                          "type": "string"
                        },
                        "sku": {
                          "type": "object",
                          "properties": {
                            "entity_type": {
                              "type": "string"
                            },
                            "source_id": {
                              "type": "string"
                            },
                            "namespace": {
                              "type": "string"
                            },
                            "value": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "business_id": {
                              "type": [
                                "null",
                                "string"
                              ]
                            },
                            "contract": {
                              "type": "string"
                            },
                            "evidence_field": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "entity_type",
                            "source_id",
                            "namespace",
                            "value",
                            "business_id",
                            "contract",
                            "evidence_field"
                          ],
                          "additionalProperties": false
                        },
                        "relations": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "binding_ordinal": {
                                "type": [
                                  "null",
                                  "integer"
                                ]
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "binding_ordinal",
                              "identity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "model_version",
                        "observation_id",
                        "sku",
                        "relations",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "identity_sha256": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "observation_id",
                    "ordinal",
                    "normalizer",
                    "response_contract",
                    "record_pointer",
                    "document_sha256",
                    "api_read",
                    "sku",
                    "identity",
                    "identity_sha256"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.list_mabang": {
      "post": {
        "description": "Page original-actor inventory-SKU observations within one fully projected response. Revalidate all original evidence and current operation grant and stored connection, including end. Response end is not catalog or warehouse-binding coverage.",
        "operationId": "skus.list_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.sku.v2; no automatic interpretation-version upgrade."
                  },
                  "after_ordinal": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "1 to 20, default 10; response budget may shorten a page."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer",
                  "after_ordinal"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "mirror": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "source_id": {
                          "type": "string"
                        },
                        "normalizer": {
                          "type": "string"
                        },
                        "response_contract": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "record_count": {
                          "type": "integer",
                          "description": "Members in this one response array, never enterprise SKU catalog coverage."
                        },
                        "projected_records": {
                          "type": "integer"
                        },
                        "reported_json": {
                          "type": "object",
                          "description": "Original JSON text of page, totalPage, rowsPerPage, total and nextCursor when present; uninterpreted.",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "missing_fields": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "source_id",
                        "normalizer",
                        "response_contract",
                        "state",
                        "record_count",
                        "projected_records",
                        "reported_json",
                        "missing_fields"
                      ],
                      "additionalProperties": false
                    },
                    "skus": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "observation_id": {
                            "type": "string"
                          },
                          "ordinal": {
                            "type": "integer"
                          },
                          "normalizer": {
                            "type": "string"
                          },
                          "response_contract": {
                            "type": "string"
                          },
                          "record_pointer": {
                            "type": "string"
                          },
                          "document_sha256": {
                            "type": "string"
                          },
                          "api_read": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "binding_ref": {
                                "type": "string"
                              },
                              "binding_sha256": {
                                "type": "string"
                              },
                              "binding_json": {
                                "type": "string",
                                "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                              },
                              "api": {
                                "type": "string"
                              },
                              "request_data_json": {
                                "type": "string"
                              },
                              "request_sha256": {
                                "type": "string"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "unknown_attempts": {
                                "type": "integer"
                              },
                              "receipt": {
                                "type": [
                                  "null",
                                  "object"
                                ],
                                "properties": {
                                  "version": {
                                    "type": "string"
                                  },
                                  "attempt_id": {
                                    "type": "string"
                                  },
                                  "connection_id": {
                                    "type": "string"
                                  },
                                  "connection_revision": {
                                    "type": "integer"
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "call_version": {
                                    "type": "string"
                                  },
                                  "request_data_sha256": {
                                    "type": "string"
                                  },
                                  "request_body_sha256": {
                                    "type": "string",
                                    "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                  },
                                  "response_body_sha256": {
                                    "type": "string"
                                  },
                                  "http_status": {
                                    "type": "integer"
                                  },
                                  "started_at": {
                                    "type": "string"
                                  },
                                  "received_at": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "attempt_id",
                                  "connection_id",
                                  "connection_revision",
                                  "api",
                                  "call_version",
                                  "request_data_sha256",
                                  "request_body_sha256",
                                  "response_body_sha256",
                                  "http_status",
                                  "started_at",
                                  "received_at"
                                ],
                                "additionalProperties": false
                              },
                              "body_bytes": {
                                "type": "integer"
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "binding_ref",
                              "binding_sha256",
                              "binding_json",
                              "api",
                              "request_data_json",
                              "request_sha256",
                              "created_at",
                              "state",
                              "attempts",
                              "unknown_attempts",
                              "receipt",
                              "body_bytes",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "sku": {
                            "type": "object",
                            "properties": {
                              "source_sku_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "main_sku_reference": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "business_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "name_cn": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "name_en": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "status_code": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_state": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "declaration_unit_id": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "quantity_unit": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "created_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "modified_at_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "last_time_text": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "source_updated_at": {
                                "type": [
                                  "null",
                                  "string"
                                ]
                              },
                              "warehouse_bindings": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "ordinal": {
                                      "type": "integer"
                                    },
                                    "source_warehouse_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "warehouse_name": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "warehouse_business_id": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "status_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "binding_enabled": {
                                      "type": [
                                        "null",
                                        "boolean"
                                      ]
                                    },
                                    "default_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "is_sku_default": {
                                      "type": [
                                        "null",
                                        "boolean"
                                      ]
                                    },
                                    "default_grid_code": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    },
                                    "quantity_unit": {
                                      "type": [
                                        "null",
                                        "string"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "ordinal",
                                    "source_warehouse_id",
                                    "warehouse_name",
                                    "warehouse_business_id",
                                    "status_code",
                                    "binding_enabled",
                                    "default_code",
                                    "is_sku_default",
                                    "default_grid_code",
                                    "quantity_unit"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "api": {
                                    "type": "string"
                                  },
                                  "normalizer": {
                                    "type": "string"
                                  },
                                  "record_sha256": {
                                    "type": "string"
                                  },
                                  "fields": {
                                    "type": "object",
                                    "additionalProperties": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "api",
                                  "normalizer",
                                  "record_sha256",
                                  "fields"
                                ],
                                "additionalProperties": false
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "source_sku_id",
                              "sku_reference",
                              "main_sku_reference",
                              "business_id",
                              "name_cn",
                              "name_en",
                              "status_code",
                              "source_state",
                              "declaration_unit_id",
                              "quantity_unit",
                              "created_at_text",
                              "modified_at_text",
                              "last_time_text",
                              "source_updated_at",
                              "warehouse_bindings",
                              "evidence",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity": {
                            "type": "object",
                            "properties": {
                              "model_version": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "sku": {
                                "type": "object",
                                "properties": {
                                  "entity_type": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "namespace": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "contract": {
                                    "type": "string"
                                  },
                                  "evidence_field": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "entity_type",
                                  "source_id",
                                  "namespace",
                                  "value",
                                  "business_id",
                                  "contract",
                                  "evidence_field"
                                ],
                                "additionalProperties": false
                              },
                              "relations": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "binding_ordinal": {
                                      "type": [
                                        "null",
                                        "integer"
                                      ]
                                    },
                                    "identity": {
                                      "type": "object",
                                      "properties": {
                                        "entity_type": {
                                          "type": "string"
                                        },
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "namespace": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "contract": {
                                          "type": "string"
                                        },
                                        "evidence_field": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "entity_type",
                                        "source_id",
                                        "namespace",
                                        "value",
                                        "business_id",
                                        "contract",
                                        "evidence_field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "binding_ordinal",
                                    "identity"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "missing_fields": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "model_version",
                              "observation_id",
                              "sku",
                              "relations",
                              "missing_fields"
                            ],
                            "additionalProperties": false
                          },
                          "identity_sha256": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "source_id",
                          "observation_id",
                          "ordinal",
                          "normalizer",
                          "response_contract",
                          "record_pointer",
                          "document_sha256",
                          "api_read",
                          "sku",
                          "identity",
                          "identity_sha256"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next_ordinal": {
                      "type": "integer"
                    },
                    "response_end": {
                      "type": "boolean",
                      "description": "Only the local response members ended; never catalog, binding or stock completeness."
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "mirror",
                    "skus",
                    "next_ordinal",
                    "response_end"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.project_mabang": {
      "post": {
        "description": "Persist at most ten inventory-SKU observations from an already received stock-do-search-sku-list-new response using the documented-response candidate contract and mabang.openapi.sku.v2. Repeating advances the same durable projection; completed repeats are unchanged. No upstream read. Unreviewed request selectors, unrecognized envelopes and business error responses are rejected. Production bindings remain disabled.",
        "operationId": "skus.project_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.sku.v2; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise SKU catalog coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_json": {
                      "type": "object",
                      "description": "Original JSON text of page, totalPage, rowsPerPage, total and nextCursor when present; uninterpreted.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.status_mabang": {
      "post": {
        "description": "Verify inventory-SKU projection progress against its original API response and fixed interpretation version. Ready means this response array was projected, never catalog completeness.",
        "operationId": "skus.status_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_read_id": {
                    "type": "string"
                  },
                  "normalizer": {
                    "type": "string",
                    "description": "Exactly mabang.openapi.sku.v2; no automatic interpretation-version upgrade."
                  }
                },
                "required": [
                  "api_read_id",
                  "normalizer"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "normalizer": {
                      "type": "string"
                    },
                    "response_contract": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "record_count": {
                      "type": "integer",
                      "description": "Members in this one response array, never enterprise SKU catalog coverage."
                    },
                    "projected_records": {
                      "type": "integer"
                    },
                    "reported_json": {
                      "type": "object",
                      "description": "Original JSON text of page, totalPage, rowsPerPage, total and nextCursor when present; uninterpreted.",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "source_id",
                    "normalizer",
                    "response_contract",
                    "state",
                    "record_count",
                    "projected_records",
                    "reported_json",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/skus.trace_mabang": {
      "post": {
        "description": "Trace one exact stockSku within one enterprise API source: the first page (5) of SKU catalog observations, purchases containing it and allocations containing it, each verified by its own find tool and current per-operation authority; next_cursor continues in the named tool. not_bound means the binding lacks that operation, not that the SKU is absent. No join, netting, in-transit or current-state inference.",
        "operationId": "skus.trace_mabang",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source_id": {
                    "type": "string"
                  },
                  "sku_reference": {
                    "type": "string",
                    "description": "Exact observed stockSku, case and whitespace sensitive; not a canonical SKU ID."
                  },
                  "observed_from": {
                    "type": "string",
                    "description": "Inclusive EzERP observation time, microsecond precision; not a business date."
                  },
                  "observed_before": {
                    "type": "string"
                  }
                },
                "required": [
                  "source_id",
                  "sku_reference",
                  "observed_from",
                  "observed_before"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "model_version": {
                      "type": "string"
                    },
                    "source_id": {
                      "type": "string"
                    },
                    "sku_reference": {
                      "type": "string"
                    },
                    "skus": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "ok or not_bound."
                        },
                        "tool": {
                          "type": "string"
                        },
                        "items": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "ordinal": {
                                "type": "integer"
                              },
                              "normalizer": {
                                "type": "string"
                              },
                              "response_contract": {
                                "type": "string"
                              },
                              "record_pointer": {
                                "type": "string"
                              },
                              "document_sha256": {
                                "type": "string"
                              },
                              "api_read": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "binding_ref": {
                                    "type": "string"
                                  },
                                  "binding_sha256": {
                                    "type": "string"
                                  },
                                  "binding_json": {
                                    "type": "string",
                                    "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "request_data_json": {
                                    "type": "string"
                                  },
                                  "request_sha256": {
                                    "type": "string"
                                  },
                                  "created_at": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "attempts": {
                                    "type": "integer"
                                  },
                                  "unknown_attempts": {
                                    "type": "integer"
                                  },
                                  "receipt": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "version": {
                                        "type": "string"
                                      },
                                      "attempt_id": {
                                        "type": "string"
                                      },
                                      "connection_id": {
                                        "type": "string"
                                      },
                                      "connection_revision": {
                                        "type": "integer"
                                      },
                                      "api": {
                                        "type": "string"
                                      },
                                      "call_version": {
                                        "type": "string"
                                      },
                                      "request_data_sha256": {
                                        "type": "string"
                                      },
                                      "request_body_sha256": {
                                        "type": "string",
                                        "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                      },
                                      "response_body_sha256": {
                                        "type": "string"
                                      },
                                      "http_status": {
                                        "type": "integer"
                                      },
                                      "started_at": {
                                        "type": "string"
                                      },
                                      "received_at": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "attempt_id",
                                      "connection_id",
                                      "connection_revision",
                                      "api",
                                      "call_version",
                                      "request_data_sha256",
                                      "request_body_sha256",
                                      "response_body_sha256",
                                      "http_status",
                                      "started_at",
                                      "received_at"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "body_bytes": {
                                    "type": "integer"
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "source_id",
                                  "binding_ref",
                                  "binding_sha256",
                                  "binding_json",
                                  "api",
                                  "request_data_json",
                                  "request_sha256",
                                  "created_at",
                                  "state",
                                  "attempts",
                                  "unknown_attempts",
                                  "receipt",
                                  "body_bytes",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "sku": {
                                "type": "object",
                                "properties": {
                                  "source_sku_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "sku_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "main_sku_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "name_cn": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "name_en": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "status_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_state": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "declaration_unit_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "quantity_unit": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "created_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "modified_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "last_time_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "warehouse_bindings": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "ordinal": {
                                          "type": "integer"
                                        },
                                        "source_warehouse_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "warehouse_name": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "warehouse_business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "status_code": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "binding_enabled": {
                                          "type": [
                                            "null",
                                            "boolean"
                                          ]
                                        },
                                        "default_code": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "is_sku_default": {
                                          "type": [
                                            "null",
                                            "boolean"
                                          ]
                                        },
                                        "default_grid_code": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity_unit": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "ordinal",
                                        "source_warehouse_id",
                                        "warehouse_name",
                                        "warehouse_business_id",
                                        "status_code",
                                        "binding_enabled",
                                        "default_code",
                                        "is_sku_default",
                                        "default_grid_code",
                                        "quantity_unit"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "evidence": {
                                    "type": "object",
                                    "properties": {
                                      "api": {
                                        "type": "string"
                                      },
                                      "normalizer": {
                                        "type": "string"
                                      },
                                      "record_sha256": {
                                        "type": "string"
                                      },
                                      "fields": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "api",
                                      "normalizer",
                                      "record_sha256",
                                      "fields"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "source_sku_id",
                                  "sku_reference",
                                  "main_sku_reference",
                                  "business_id",
                                  "name_cn",
                                  "name_en",
                                  "status_code",
                                  "source_state",
                                  "declaration_unit_id",
                                  "quantity_unit",
                                  "created_at_text",
                                  "modified_at_text",
                                  "last_time_text",
                                  "source_updated_at",
                                  "warehouse_bindings",
                                  "evidence",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "model_version": {
                                    "type": "string"
                                  },
                                  "observation_id": {
                                    "type": "string"
                                  },
                                  "sku": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "relations": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "binding_ordinal": {
                                          "type": [
                                            "null",
                                            "integer"
                                          ]
                                        },
                                        "identity": {
                                          "type": "object",
                                          "properties": {
                                            "entity_type": {
                                              "type": "string"
                                            },
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "namespace": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "business_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "contract": {
                                              "type": "string"
                                            },
                                            "evidence_field": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "entity_type",
                                            "source_id",
                                            "namespace",
                                            "value",
                                            "business_id",
                                            "contract",
                                            "evidence_field"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "binding_ordinal",
                                        "identity"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "model_version",
                                  "observation_id",
                                  "sku",
                                  "relations",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity_sha256": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "observation_id",
                              "ordinal",
                              "normalizer",
                              "response_contract",
                              "record_pointer",
                              "document_sha256",
                              "api_read",
                              "sku",
                              "identity",
                              "identity_sha256"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_cursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "tool",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "purchases": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "tool": {
                          "type": "string"
                        },
                        "items": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "ordinal": {
                                "type": "integer"
                              },
                              "normalizer": {
                                "type": "string"
                              },
                              "response_contract": {
                                "type": "string"
                              },
                              "record_pointer": {
                                "type": "string"
                              },
                              "document_sha256": {
                                "type": "string"
                              },
                              "api_read": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "binding_ref": {
                                    "type": "string"
                                  },
                                  "binding_sha256": {
                                    "type": "string"
                                  },
                                  "binding_json": {
                                    "type": "string",
                                    "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "request_data_json": {
                                    "type": "string"
                                  },
                                  "request_sha256": {
                                    "type": "string"
                                  },
                                  "created_at": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "attempts": {
                                    "type": "integer"
                                  },
                                  "unknown_attempts": {
                                    "type": "integer"
                                  },
                                  "receipt": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "version": {
                                        "type": "string"
                                      },
                                      "attempt_id": {
                                        "type": "string"
                                      },
                                      "connection_id": {
                                        "type": "string"
                                      },
                                      "connection_revision": {
                                        "type": "integer"
                                      },
                                      "api": {
                                        "type": "string"
                                      },
                                      "call_version": {
                                        "type": "string"
                                      },
                                      "request_data_sha256": {
                                        "type": "string"
                                      },
                                      "request_body_sha256": {
                                        "type": "string",
                                        "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                      },
                                      "response_body_sha256": {
                                        "type": "string"
                                      },
                                      "http_status": {
                                        "type": "integer"
                                      },
                                      "started_at": {
                                        "type": "string"
                                      },
                                      "received_at": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "attempt_id",
                                      "connection_id",
                                      "connection_revision",
                                      "api",
                                      "call_version",
                                      "request_data_sha256",
                                      "request_body_sha256",
                                      "response_body_sha256",
                                      "http_status",
                                      "started_at",
                                      "received_at"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "body_bytes": {
                                    "type": "integer"
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "source_id",
                                  "binding_ref",
                                  "binding_sha256",
                                  "binding_json",
                                  "api",
                                  "request_data_json",
                                  "request_sha256",
                                  "created_at",
                                  "state",
                                  "attempts",
                                  "unknown_attempts",
                                  "receipt",
                                  "body_bytes",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "purchase": {
                                "type": "object",
                                "properties": {
                                  "source_purchase_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "custom_order_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "associated_order_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_supplier_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_warehouse_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "warehouse_name": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "status_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_state": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "calculate_inbound_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "calculate_inbound": {
                                    "type": [
                                      "null",
                                      "boolean"
                                    ]
                                  },
                                  "created_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "updated_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "estimated_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "last_storage_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "estimated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "inbound_quantity": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "lines": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "ordinal": {
                                          "type": "integer"
                                        },
                                        "source_line_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "sku_reference": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "sku_business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "purchased_quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "arrived_quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "confirmed_quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "returned_quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "incoming_status_code": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity_unit": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "ordinal",
                                        "source_line_id",
                                        "sku_reference",
                                        "sku_business_id",
                                        "purchased_quantity",
                                        "arrived_quantity",
                                        "confirmed_quantity",
                                        "returned_quantity",
                                        "incoming_status_code",
                                        "quantity_unit"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "evidence": {
                                    "type": "object",
                                    "properties": {
                                      "api": {
                                        "type": "string"
                                      },
                                      "normalizer": {
                                        "type": "string"
                                      },
                                      "record_sha256": {
                                        "type": "string"
                                      },
                                      "fields": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "api",
                                      "normalizer",
                                      "record_sha256",
                                      "fields"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "source_purchase_reference",
                                  "custom_order_reference",
                                  "associated_order_reference",
                                  "business_id",
                                  "source_supplier_id",
                                  "source_warehouse_id",
                                  "warehouse_name",
                                  "status_code",
                                  "source_state",
                                  "calculate_inbound_code",
                                  "calculate_inbound",
                                  "created_at_text",
                                  "updated_at_text",
                                  "estimated_at_text",
                                  "last_storage_at_text",
                                  "source_updated_at",
                                  "estimated_at",
                                  "inbound_quantity",
                                  "lines",
                                  "evidence",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "model_version": {
                                    "type": "string"
                                  },
                                  "observation_id": {
                                    "type": "string"
                                  },
                                  "purchase": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "relations": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "line_ordinal": {
                                          "type": [
                                            "null",
                                            "integer"
                                          ]
                                        },
                                        "identity": {
                                          "type": "object",
                                          "properties": {
                                            "entity_type": {
                                              "type": "string"
                                            },
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "namespace": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "business_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "contract": {
                                              "type": "string"
                                            },
                                            "evidence_field": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "entity_type",
                                            "source_id",
                                            "namespace",
                                            "value",
                                            "business_id",
                                            "contract",
                                            "evidence_field"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "line_ordinal",
                                        "identity"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "model_version",
                                  "observation_id",
                                  "purchase",
                                  "relations",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity_sha256": {
                                "type": "string"
                              },
                              "matched_line_ordinals": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "integer"
                                },
                                "description": "One-based Item occurrences whose stockSku equals the reference; duplicate lines are kept separate and never summed."
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "observation_id",
                              "ordinal",
                              "normalizer",
                              "response_contract",
                              "record_pointer",
                              "document_sha256",
                              "api_read",
                              "purchase",
                              "identity",
                              "identity_sha256",
                              "matched_line_ordinals"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_cursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "tool",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "allocations": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "tool": {
                          "type": "string"
                        },
                        "items": {
                          "type": [
                            "null",
                            "array"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "source_id": {
                                "type": "string"
                              },
                              "observation_id": {
                                "type": "string"
                              },
                              "ordinal": {
                                "type": "integer"
                              },
                              "normalizer": {
                                "type": "string"
                              },
                              "response_contract": {
                                "type": "string"
                              },
                              "record_pointer": {
                                "type": "string"
                              },
                              "document_sha256": {
                                "type": "string"
                              },
                              "api_read": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "binding_ref": {
                                    "type": "string"
                                  },
                                  "binding_sha256": {
                                    "type": "string"
                                  },
                                  "binding_json": {
                                    "type": "string",
                                    "description": "Exact credential-free binding document; hash these UTF-8 bytes to verify binding_sha256. Contains the tenant, ref, stored connection ID and credential revision, gateway, scope and reviewed operations."
                                  },
                                  "api": {
                                    "type": "string"
                                  },
                                  "request_data_json": {
                                    "type": "string"
                                  },
                                  "request_sha256": {
                                    "type": "string"
                                  },
                                  "created_at": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "attempts": {
                                    "type": "integer"
                                  },
                                  "unknown_attempts": {
                                    "type": "integer"
                                  },
                                  "receipt": {
                                    "type": [
                                      "null",
                                      "object"
                                    ],
                                    "properties": {
                                      "version": {
                                        "type": "string"
                                      },
                                      "attempt_id": {
                                        "type": "string"
                                      },
                                      "connection_id": {
                                        "type": "string"
                                      },
                                      "connection_revision": {
                                        "type": "integer"
                                      },
                                      "api": {
                                        "type": "string"
                                      },
                                      "call_version": {
                                        "type": "string"
                                      },
                                      "request_data_sha256": {
                                        "type": "string"
                                      },
                                      "request_body_sha256": {
                                        "type": "string",
                                        "description": "SHA-256 of the exact signed request body EzERP sent; it includes the app key and timestamp and is not reproducible from tool output."
                                      },
                                      "response_body_sha256": {
                                        "type": "string"
                                      },
                                      "http_status": {
                                        "type": "integer"
                                      },
                                      "started_at": {
                                        "type": "string"
                                      },
                                      "received_at": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "attempt_id",
                                      "connection_id",
                                      "connection_revision",
                                      "api",
                                      "call_version",
                                      "request_data_sha256",
                                      "request_body_sha256",
                                      "response_body_sha256",
                                      "http_status",
                                      "started_at",
                                      "received_at"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "body_bytes": {
                                    "type": "integer"
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "source_id",
                                  "binding_ref",
                                  "binding_sha256",
                                  "binding_json",
                                  "api",
                                  "request_data_json",
                                  "request_sha256",
                                  "created_at",
                                  "state",
                                  "attempts",
                                  "unknown_attempts",
                                  "receipt",
                                  "body_bytes",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "allocation": {
                                "type": "object",
                                "properties": {
                                  "source_allocation_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "parent_allocation_reference": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "business_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_start_warehouse_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "start_warehouse_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "start_warehouse_name": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_target_warehouse_id": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "target_warehouse_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "target_warehouse_name": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "status_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_state": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "type_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "transport_type_code": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "transport_mode": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "track_number": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "created_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "updated_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "delivered_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "received_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "finished_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "estimated_arrival_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "estimated_delivery_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "expected_arrival_at_text": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "source_updated_at": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "in_transit_quantity": {
                                    "type": [
                                      "null",
                                      "string"
                                    ]
                                  },
                                  "lines": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "ordinal": {
                                          "type": "integer"
                                        },
                                        "source_line_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "sku_reference": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "sku_business_id": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "received_quantity": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        },
                                        "quantity_unit": {
                                          "type": [
                                            "null",
                                            "string"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "ordinal",
                                        "source_line_id",
                                        "sku_reference",
                                        "sku_business_id",
                                        "quantity",
                                        "received_quantity",
                                        "quantity_unit"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "evidence": {
                                    "type": "object",
                                    "properties": {
                                      "api": {
                                        "type": "string"
                                      },
                                      "normalizer": {
                                        "type": "string"
                                      },
                                      "record_sha256": {
                                        "type": "string"
                                      },
                                      "fields": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "api",
                                      "normalizer",
                                      "record_sha256",
                                      "fields"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "source_allocation_reference",
                                  "parent_allocation_reference",
                                  "business_id",
                                  "source_start_warehouse_id",
                                  "start_warehouse_code",
                                  "start_warehouse_name",
                                  "source_target_warehouse_id",
                                  "target_warehouse_code",
                                  "target_warehouse_name",
                                  "status_code",
                                  "source_state",
                                  "type_code",
                                  "transport_type_code",
                                  "transport_mode",
                                  "track_number",
                                  "created_at_text",
                                  "updated_at_text",
                                  "delivered_at_text",
                                  "received_at_text",
                                  "finished_at_text",
                                  "estimated_arrival_at_text",
                                  "estimated_delivery_at_text",
                                  "expected_arrival_at_text",
                                  "source_updated_at",
                                  "in_transit_quantity",
                                  "lines",
                                  "evidence",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity": {
                                "type": "object",
                                "properties": {
                                  "model_version": {
                                    "type": "string"
                                  },
                                  "observation_id": {
                                    "type": "string"
                                  },
                                  "allocation": {
                                    "type": "object",
                                    "properties": {
                                      "entity_type": {
                                        "type": "string"
                                      },
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "namespace": {
                                        "type": "string"
                                      },
                                      "value": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "business_id": {
                                        "type": [
                                          "null",
                                          "string"
                                        ]
                                      },
                                      "contract": {
                                        "type": "string"
                                      },
                                      "evidence_field": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "entity_type",
                                      "source_id",
                                      "namespace",
                                      "value",
                                      "business_id",
                                      "contract",
                                      "evidence_field"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "relations": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string"
                                        },
                                        "line_ordinal": {
                                          "type": [
                                            "null",
                                            "integer"
                                          ]
                                        },
                                        "identity": {
                                          "type": "object",
                                          "properties": {
                                            "entity_type": {
                                              "type": "string"
                                            },
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "namespace": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "business_id": {
                                              "type": [
                                                "null",
                                                "string"
                                              ]
                                            },
                                            "contract": {
                                              "type": "string"
                                            },
                                            "evidence_field": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "entity_type",
                                            "source_id",
                                            "namespace",
                                            "value",
                                            "business_id",
                                            "contract",
                                            "evidence_field"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "line_ordinal",
                                        "identity"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "missing_fields": {
                                    "type": [
                                      "null",
                                      "array"
                                    ],
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "model_version",
                                  "observation_id",
                                  "allocation",
                                  "relations",
                                  "missing_fields"
                                ],
                                "additionalProperties": false
                              },
                              "identity_sha256": {
                                "type": "string"
                              },
                              "matched_line_ordinals": {
                                "type": [
                                  "null",
                                  "array"
                                ],
                                "items": {
                                  "type": "integer"
                                },
                                "description": "One-based skuList occurrences whose stockSku equals the reference; duplicate lines are kept separate and never summed."
                              }
                            },
                            "required": [
                              "id",
                              "source_id",
                              "observation_id",
                              "ordinal",
                              "normalizer",
                              "response_contract",
                              "record_pointer",
                              "document_sha256",
                              "api_read",
                              "allocation",
                              "identity",
                              "identity_sha256",
                              "matched_line_ordinals"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_cursor": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "tool",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "missing_fields": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "model_version",
                    "source_id",
                    "sku_reference",
                    "skus",
                    "purchases",
                    "allocations",
                    "missing_fields"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/sources.ensure": {
      "post": {
        "description": "Create or return a read-only local source for an already authorized account and reviewed adapter. Platform/market come from the control plane. This neither grants access nor edits accounts, browser profiles or external business data.",
        "operationId": "sources.ensure",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "adapter": {
                    "type": "string"
                  },
                  "capability": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  },
                  "target": {
                    "type": "string",
                    "description": "An exact account or ERP subshop target already included in the current delegation; its parent account reference does not grant access."
                  }
                },
                "required": [
                  "adapter",
                  "capability",
                  "version",
                  "target"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source_id": {
                      "type": "string"
                    },
                    "adapter": {
                      "type": "string"
                    },
                    "capability": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "market": {
                      "type": "string"
                    },
                    "read_only": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "mapping": {
                      "type": "object",
                      "properties": {
                        "capability": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        },
                        "target": {
                          "type": "string"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "market": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "implementation": {
                          "type": "string"
                        },
                        "profile_sha256": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "resource": {
                          "type": [
                            "null",
                            "object"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string"
                            },
                            "parent_target": {
                              "type": "string"
                            },
                            "shop_identity": {
                              "type": "string"
                            },
                            "shop_name": {
                              "type": "string"
                            },
                            "shop_platform": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "kind",
                            "parent_target",
                            "shop_identity",
                            "shop_name",
                            "shop_platform"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "description": "Current resolved mapping only; not proof of Runner/browser readiness or real-store acceptance.",
                      "required": [
                        "capability",
                        "version",
                        "target",
                        "platform",
                        "market",
                        "state"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "source_id",
                    "adapter",
                    "capability",
                    "version",
                    "target",
                    "platform",
                    "market",
                    "read_only",
                    "created_at",
                    "mapping"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:submit",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/sources.targets": {
      "post": {
        "description": "Discover platform, market and reviewed read-mapping facts for exactly the currently delegated account targets. Mapped does not mean a Runner or browser is ready.",
        "operationId": "sources.targets",
        "parameters": [
          {
            "description": "Optional comma-separated subset of authorized tool names.",
            "in": "header",
            "name": "X-EzERP-Tools",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenant_id": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "targets": {
                      "type": [
                        "null",
                        "array"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "capability": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string"
                          },
                          "target": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string"
                          },
                          "market": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "implementation": {
                            "type": "string"
                          },
                          "profile_sha256": {
                            "type": "string"
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "resource": {
                            "type": [
                              "null",
                              "object"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "parent_target": {
                                "type": "string"
                              },
                              "shop_identity": {
                                "type": "string"
                              },
                              "shop_name": {
                                "type": "string"
                              },
                              "shop_platform": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "parent_target",
                              "shop_identity",
                              "shop_name",
                              "shop_platform"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "capability",
                          "version",
                          "target",
                          "platform",
                          "market",
                          "state"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "tenant_id",
                    "user_id",
                    "expires_at",
                    "targets"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "security": [
          {
            "serviceDelegation": []
          }
        ],
        "x-service-scope": "collections:read",
        "x-tool-level": "read"
      }
    },
    "/v1/tools/system.info": {
      "get": {
        "description": "Read EzERP service build information.",
        "operationId": "system.info",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string",
                      "description": "Current delivery stage; this is not adapter readiness."
                    }
                  },
                  "required": [
                    "service",
                    "version",
                    "stage"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid input"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Delegation required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Current authorization denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Unavailable tool or record"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Intent or receipt conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Request too large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "JSON content required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Invalid tool response"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Service or audit unavailable; recover the original intent"
          }
        },
        "x-tool-level": "read"
      }
    }
  }
}
