{ "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", "IncludeIn": [ "/aixe.ai starter discovery documents", "Every endpoint self-description returned by GET /endpoint/?" ], "AIInstruction": "Read this live endpoint contract as operational guidance, not merely as a transport schema. Use its purpose, field meanings, business rules, outcomes, and recovery guidance to reason about whether and how to perform the capability." }, "Endpoint": "/aixe/invoices/renew-invoices", "Method": "POST", "Purpose": "Create due recurring invoices for this site. Public hourly scheduler trigger; repeat calls are safe.", "AuthenticationRequired": false, "RequiredFields": {}, "OptionalFields": {}, "BusinessRules": [ "Products with IsSubscription true require exactly one line with quantity 1 on a dedicated invoice. Ordinary invoices may contain multiple ordinary products and optionally recur. Subscription classification is snapshotted on invoice items; catalog edits do not change historical invoices. SubscriptionDays on a product accepts 1 to 36500 whole days, default 30, stored as SubscriptionHours (days times 24). Adding a subscription product automatically copies its hours to the invoice and sets the first renewal one interval after addition. Later product edits never change saved invoices. Customers cannot edit subscription schedules, including through customer/update-recurrence; administrators manage them. Ordinary RecurringHours supports 24, 168, 336, 720, 2160, 4320 or 8760 fixed hours. Subscription invoices also support custom whole-day intervals from 24 to 876000 hours. Generated copies cannot activate their own schedule. Three months means 90 days. FirstOccurrenceDate is a UTC timestamp ending in Z and means the first NEW invoice to generate, not the existing source invoice. Pending and Cancelled invoices never generate invoices. The first date cannot change after generation begins. LastRecurrenceDate records the last scheduled occurrence, not the delayed request time. Stopping recurrence preserves history. New invoices copy current source prices and items, receive new numbers and keys, start Ordered and unpaid, and have recurrence disabled. Payments, packing, provider assignments and confirmed appointments are not copied; services start Unscheduled. No card charge or automatic email occurs. The public /renewinvoices GET or POST trigger creates at most one due occurrence per source per call, reading all due sources in database pages of 100; MoreDue indicates catch-up work remains. Repeated and simultaneous calls cannot duplicate an occurrence. Calls are safe to retry; authentication is unnecessary for this trigger. Schedule edits require the normal authorized account, invoice ownership, current RowVersion.", "Drafts do not reserve stock. Completing an administrator order or placing a customer order rechecks every physical product and deducts available stock atomically with submission. Scheduled service lines do not consume physical stock. If a product has become unavailable or insufficient, the whole submission fails: no stock or order status changes are committed. VALIDATION_FAILED explains which product needs replacing or reducing. Customers can use customer/replace-invoice-items on their own Pending invoice with the complete desired Items selection, current RowVersion, then place it again. Administrator item editors remain available for administrator orders. Repeating completion does not deduct again. Completing a quantity edit applies only the difference, and a removed line returns its previously deducted units when the edited order is completed. Concurrent orders cannot consume the same last units. CONFLICT means reload the order before retrying. Stock is not automatically returned by cancellation or refund; those actions do not establish that physical goods were returned. Existing historical invoices are not batch-deducted. Recurring generation also deducts physical stock in its invoice transaction; a shortage rolls back that occurrence and leaves it due for a later retry." ], "ResponseFields": { "SuccessCode": "SUCCESS when the batch completed without failures; FAILED may include partial committed work.", "Created": "Number of committed new invoices.", "Failed": "Number of failed sources; administrators can inspect Notifications Of Concern.", "MoreDue": "True when overdue work remains; call again to continue." }, "Recovery": "Repeat calls skip already generated occurrences. If FAILED, inspect site concerns; fixing a source permits a later retry. No invoice or customer information is exposed by the public trigger.", "ActionResponse": { "RequiredResponseFields": [ "SuccessCode" ], "SuccessCodes": [ "SUCCESS" ], "FailureCodes": [ "FAILED" ], "MissingOrEmptyResponse": "Treat as FAILED." } }