{ "Protocol": "AIXE", "Version": "1.0", "ProtocolReference": { "ProtocolHome": "http://aixeprotocol.com/", "CanonicalUsageContract": "http://aixeprotocol.com/usage/?", "Whitepaper": "http://aixeprotocol.com/whitepaper/full-spec.html", "Inventor": "Gregory Oglethorpe" }, "Endpoint": "/aixe/products/search-products", "Method": "GET, POST", "SupportedMethods": [ "GET", "POST" ], "DiscoveryRequest": "GET /aixe/products/search-products/?", "ContentType": "application/json", "AccessType": "Public", "Purpose": "Find available products across active IOD businesses near a search-center ZIP code, within a user-selected radius up to 1000 miles. Return a bounded page of matching products with the business name and phone so the human can find and contact a supplier.", "RequiredFields": { "Keyword": { "Type": "string", "Required": true, "SubmittedIn": "GET query string or POST JSON body", "Description": "Supply 1 to 10 comma-separated product words, each 1 to 80 characters; at most 1000 characters overall. Spaces around commas are trimmed. Empty entries and phrases are rejected. Include relevant variants or synonyms from the human's request; the server does not generate them. Any supplied word may match the product name, short/long descriptions, or ProductSearchTerms indexed words. Matching follows database collation; punctuation remains part of words and stop words are excluded. Business-name-only matches do not qualify.", "MaximumLength": 1000, "LengthLimit": "At most 1000 characters. Overlength submissions are rejected; they are never silently truncated." }, "ZipCode": { "Type": "string", "Required": true, "SubmittedIn": "GET query string or POST JSON body", "Description": "Exactly five ASCII digits identifying the human's search-center ZIP code. Required on every search; preserve leading zeros. Obtain the location from the human.", "MaximumLength": 5, "LengthLimit": "At most 5 characters. Overlength submissions are rejected; they are never silently truncated." } }, "OptionalFields": { "RadiusMiles": { "Type": "number", "Required": false, "SubmittedIn": "GET query string or POST JSON body", "Description": "Finite radius from 0.1 through 1000 miles, inclusive; defaults to 20. Use the human's selected distance, for example 5, 50, 500, or 1000." }, "MaximumResultCount": { "Type": "integer", "Required": false, "SubmittedIn": "GET query string or POST JSON body", "Description": "Number of individual product matches per page, from 1 through 100; defaults to 20. A business may appear more than once for different products." }, "Offset": { "Type": "integer", "Required": false, "SubmittedIn": "GET query string or POST JSON body", "Description": "Number of product matches to skip, from 0 through 2147483547; defaults to 0. Use NextOffset with unchanged search fields to continue." } }, "BusinessRules": [ "Public read-only search. No login, credentials, supervisor key, or BusinessKey is required. GET uses query parameters; POST uses a JSON body with identical search behavior. GET without parameters, with describe or aixe, or with an application/aixe+json or application/ai-contract+json Accept header returns the stored discovery contract.", "Only active businesses and active products qualify. A product is available when its start time is absent or has arrived, its end time is absent or is still in the future, and quantity on hand is absent or greater than zero. Times use UTC. Availability is current at search time and does not reserve inventory.", "Radius uses approximate straight-line distances between ZIP reference coordinates, not street addresses or driving distances. Business ZIP+4 uses its first five digits. Businesses without usable ZIP coordinates are excluded.", "Each business/product pair appears once. Results are ordered by matching product word occurrence count descending, then nearest ZIP distance, business name/key, and product name/key. Repeated search words do not multiply matches. Filtering, ordering and paging occur in the database.", "SUCCESS with empty Results means no available matching products on this page. This does not prove none exist outside the directory. Do not switch to business or industry matches or expand the radius without the human's direction.", "Product records include TagsNeedPrinting (boolean) and ProductInStoreAt (server-local arrival date and time, or null when no arrival is recorded). Present times to people in 12-hour AM/PM format." ], "InteractionGuidance": [ "Read this contract, obtain product words, search-center ZIP and desired radius, then start at Offset 0.", "Inspect SuccessCode before presenting results. Show business name and phone alongside each product name and price. Continue with NextOffset while HasMore is true and more matches are wanted.", "BusinessKey and ProductKey identify the supplier and product for subsequent discovery. Read https://internetofdoing.com/haixe/{BusinessKey}/aixe.ai before using that business's ordering capabilities; follow their authorization rules.", "Product and service records may include AlternatePurchaseURL, the business-provided HTTP or HTTPS link for another way to purchase the offering. When present, you may show it to the shopper as an alternate purchase link. Null means no alternate link is configured. The link alone does not confirm a price, availability, or completed purchase.", "Item details include ProductIsScratchAndDent (boolean) and ProductScratchAndDentDescription (damage reason or null). For invoice lines, the values come from the linked catalog product." ], "ExampleGetRequest": "GET /aixe/products/search-products?Keyword=cookie,cookies&ZipCode=77568&RadiusMiles=50&MaximumResultCount=20&Offset=0", "ExampleRequest": { "Keyword": "cookie,cookies", "ZipCode": "77568", "RadiusMiles": 1000, "MaximumResultCount": 20, "Offset": 0 }, "ResponseMeaning": { "Results": "One row per matching business/product pair: BusinessKey (public supplier key), BusinessName, BusinessPhone (may be null), and Product containing ProductKey (public item key), ProductName, and ProductPrice (listed fixed price), PriceRangeMin and PriceRangeMax (nullable estimated USD bounds), and ProductCallForQuote (always true when either bound exists; present Call For Quote with the estimate instead of treating ProductPrice as a final price). No internal numeric IDs or private account details are returned.", "Keyword": "Submitted product keywords, trimmed.", "ZipCode": "Search-center ZIP.", "RadiusMiles": "Requested radius in miles.", "Offset": "Current page offset.", "MaximumResultCount": "Requested page size.", "HasMore": "True when another matching product exists after this page.", "NextOffset": "Offset for the next page, or null when finished. Inventory may change between requests." }, "Errors": [ { "SuccessCode": "VALIDATION_FAILED", "Meaning": "Missing or invalid keywords or ZIP, unknown ZIP reference location, invalid radius or paging, or malformed request.", "Recovery": "Correct the indicated fields using this contract and retry. Do not treat validation errors as no matches." }, { "SuccessCode": "FAILED", "Meaning": "Search did not complete.", "Recovery": "Read the returned error; do not report no matches or success." } ], "ActionResponse": { "RequiredResponseFields": [ "SuccessCode" ], "SuccessCodes": [ "SUCCESS" ], "FailureCodes": [ "VALIDATION_FAILED", "FAILED" ], "MissingOrEmptyResponse": "Treat as FAILED. HTTP status alone does not declare success." }, "RequestFieldConstraints": { "Keyword": { "Type": "string", "MaximumLength": 1000, "LengthUnit": "UTF-16 code units (the server's string length)", "LengthLimit": "At most 1000 characters. Overlength submissions are rejected; they are never silently truncated." }, "ZipCode": { "Type": "string", "MaximumLength": 5, "LengthUnit": "UTF-16 code units (the server's string length)", "LengthLimit": "At most 5 characters. Overlength submissions are rejected; they are never silently truncated." } }, "FieldLengthValidation": { "Rule": "All supplied strings are checked before the action. Persisted strings are checked again against the mapped column limit before SQL execution. Overlength data is rejected, never truncated.", "Failure": "SuccessCode VALIDATION_FAILED, with Errors containing the exact submitted Field path, MaximumLength, ActualLength, and a corrective Message. Nested fields include their array index. No submitted values or credentials are echoed." } }