{ "Protocol": "AIXE", "Version": "1.0", "Endpoint": "/aixe/customer/place-order", "DiscoveryRequest": "GET /aixe/customer/place-order/?", "CanonicalHelpTrigger": "GET /aixe/customer/place-order/?", "ActionRequest": "POST /aixe/customer/place-order", "Method": "POST", "ContentType": "application/json; charset=utf-8", "Title": "Place My Pending Order", "AuthenticationRequired": true, "AccessType": "Customer", "Purpose": "Moves one customer-owned Pending order to Ordered and attempts customer and owner email notifications immediately after saving.", "RecurrenceRules": "Product and invoice-item responses include IsSubscription. Subscription items require one line with quantity exactly 1, with no mixed products. Invoice headers include RecurringHours (0 means stopped), FirstOccurrenceDate, LastRecurrenceDate and NextOccurrenceDate in UTC. Use owner/get-recurrence or customer/get-recurrence, then update-recurrence with a current RowVersion. SubscriptionDays on the product automatically sets new subscription invoice hours and the first renewal one interval after the item is added. Customers cannot change subscription schedules. Product changes affect new invoices only. Ordinary invoices can optionally repeat multiple products. Generation copies the source into a fresh Ordered, unpaid invoice with recurrence disabled. The public /renewinvoices trigger needs no authentication and never creates the same occurrence twice.", "InventoryRules": "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.", "ThingsYouCanAsk": [ "Place the order we just prepared.", "Submit my pending order.", "Everything looks right\u2014send the order." ], "DocumentationSource": "AIXEEndpointRegistry", "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." }, "UsageGuidance": { "Role": "Read the full Pending order and obtain the human\u0027s approval immediately before placing it.", "CorrectWorkflow": [ "Read the full Pending order and obtain the human\u0027s approval immediately before placing it.", "Explain that payment is arranged outside the website." ], "DoNotDo": [ "Do not send business variables, keys, filters, or action inputs in the URL or query string.", "Do not infer success from HTTP status alone." ] }, "AIUsageGuidance": { "ContractRole": "This live document teaches an AI what the capability means and how to use it; it is not merely a list of request fields.", "ReasoningInstruction": "Decide whether this capability serves the human\u0027s intent from Purpose and BusinessRules, gather values using each field\u0027s Description and constraints, then interpret the returned SuccessCode before reporting an outcome.", "FieldInstruction": "Field names are transport labels. Their Description, source, constraints, and business meaning explain what information the AI should obtain and why." }, "RequiredFields": { "PersonAuthenticationToken": { "Type": "string", "Description": "The active Customer token returned by Log In.", "Required": true, "SubmittedIn": "JSON body" }, "InvoiceKey": { "Type": "string", "Description": "The public key of the Pending order to place.", "Required": true, "SubmittedIn": "JSON body" } }, "OptionalFields": {}, "BusinessRules": [ "The caller must have the Customer role and own the order.", "Only a Pending order may be placed.", "No payment is collected online.", "Email delivery failures do not prevent placing an order. Failed notifications are logged internally without automatic retries." ], "ResponseFields": { "SuccessCode": { "Type": "string", "Description": "The authoritative action outcome.", "Required": true, "SubmittedIn": "Response body" }, "OrderPlaced": { "Type": "boolean", "Description": "True when the order moved to Ordered.", "Required": true, "SubmittedIn": "Response body" }, "InvoiceKey": { "Type": "string", "Description": "The order\u0027s public key.", "Required": true, "SubmittedIn": "Response body" }, "InvoiceNumber": { "Type": "string", "Description": "The human-readable order number.", "Required": true, "SubmittedIn": "Response body" }, "InvoiceStatus": { "Type": "string", "Description": "The saved order status.", "Required": true, "SubmittedIn": "Response body" } }, "Errors": [ { "SuccessCode": "VALIDATION_FAILED", "Meaning": "One or more required request values are missing or malformed.", "Recovery": "Use the field descriptions and constraints in this contract, correct the named fields, and retry the same capability.", "Recoverable": true }, { "SuccessCode": "UNAUTHORIZED", "Meaning": "The submitted identity or token does not authorize this capability or record scope.", "Recovery": "Use the correct active authentication token and confirm the required account role.", "Recoverable": true }, { "SuccessCode": "NOT_FOUND", "Meaning": "A submitted public key did not identify a record within this capability\u0027s declared scope.", "Recovery": "Re-check the key against a current list or creation response; do not treat this as a missing web route.", "Recoverable": true }, { "SuccessCode": "BUSINESS_RULE_FAILED", "Meaning": "The request was understood but a declared business or workflow rule was not satisfied.", "Recovery": "Explain the governing rule to the human and retry only after the required condition or decision changes.", "Recoverable": true }, { "SuccessCode": "FAILED", "Meaning": "The capability could not complete for an execution failure.", "Recovery": "Read the returned message and error detail. Retry only when the response identifies a recoverable condition.", "Recoverable": false } ], "ActionResponse": { "RequiredResponseFields": [ "SuccessCode" ], "SuccessCodes": [ "SUCCESS" ], "FailureCodes": [ "VALIDATION_FAILED", "UNAUTHORIZED", "NOT_FOUND", "BUSINESS_RULE_FAILED", "FAILED" ], "NonFinalCodes": [], "MissingOrEmptyResponse": "Treat as FAILED.", "Rule": "The endpoint response is authoritative. Only an exact SuccessCode value listed in SuccessCodes means the business action succeeded; HTTP status alone does not declare the AIXE outcome." } }