{"ok":true,"data":{"imCoreOrderBridge":{"knife":{"total":72,"current":70,"remaining":2},"generatedAt":"2026-07-08T06:09:33.557Z","release":"8d59303","status":"im-core-order-bridge-ready","score":100,"readiness":{"done":10,"total":10,"percent":100,"blockers":[]},"service":"matrix-order","orderMode":"custom-only","imCore":{"repository":"https://gitea.reits.tech/reits/im-core.git","configured":false,"baseUrlConfigured":false,"authMode":"local-preview-email-login","authRoutes":[{"id":"send-email-code","method":"POST","path":"/app/api/auth/vcode/get-email-TKkjfBXmjauE5KoJqZKN"},{"id":"check-vcode","method":"POST","path":"/app/api/auth/vcode/check"},{"id":"login-user","method":"POST","path":"/app/api/auth/login-user"},{"id":"refresh-token","method":"POST","path":"/app/api/auth/token/refresh"}],"loginResponseMapping":[{"imCore":"uid","order":"member.externalUid"},{"imCore":"account_id","order":"member.accountId"},{"imCore":"access_token","order":"session.accessToken"},{"imCore":"refresh_token","order":"session.refreshToken"},{"imCore":"profile","order":"member.profile"}]},"customOrderContract":{"orderKind":"custom_order","categoryField":"customCategory","categories":[{"id":"appointment","label":"Appointment","description":"Calendar-backed custom booking, service slot, consultation, demo, or onboarding session."},{"id":"consumption","label":"Consumption","description":"Priced custom service or package request without opening a payment/order transaction module."},{"id":"quote_request","label":"Quote request","description":"Custom inquiry that needs merchant review before service scope or amount is confirmed."},{"id":"voting","label":"Voting","description":"Custom poll, preference, RSVP, or group decision request from an IM or community surface."},{"id":"internal_request","label":"Internal request","description":"Staff or operations request represented as a custom order category, not a separate internal order kind."},{"id":"commercial_candidate","label":"Commercial candidate","description":"Custom order with amount/duration signals that could later move into a finance-approved commerce flow."},{"id":"support","label":"Support","description":"Customer support, handoff, or follow-up request that should remain in the custom workflow."}],"endpoints":{"bridge":"/api/integrations/im-core/order","write":"/api/custom-orders","imCoreWrite":"/api/integrations/im-core/order","schema":"/api/orders/schema","adminView":"/api/ops/orders?orderKind=custom_order","export":"/api/ops/orders/export?orderKind=custom_order","writeOps":"/api/ops/custom-order-write-model","publicBooking":"/api/projects/:projectId/bookings","tenantPage":"/t/:publishHash","mini":"/mini","sdk":"/sdk.js"},"requestShape":{"orderKind":"custom_order","customCategory":"appointment | consumption | quote_request | voting | internal_request | commercial_candidate | support","projectId":"member project id or slug","publishHash":"optional tenant hash","itemIds":["price-item-id"],"date":"YYYY-MM-DD","startTime":"HH:mm","source":"im-core | opensdk | official | tenant-page | partner","customer":{"nickname":"display name","phone":"optional, stored only inside booking workflow","email":"optional, hashed in global order rows"},"intakeAnswers":{"field-1":"required goal text","field-2":"optional expected outcome"},"metadata":{"imConversationId":"optional","imMessageId":"optional","externalOrderRef":"optional idempotency reference"}},"responseShape":{"customOrder":"public-safe custom order record with merchant attribution","booking":"customer booking status payload","idempotency":"key, replayed, replayCount, status, bookingId","orderId":"booking/custom order id","orderKind":"custom_order","customCategory":"normalized custom category","status":"pending | approved | rejected | cancelled","merchant":"merchant/project attribution","publicStatusUrl":"/booking-status?token=..."},"partnerContract":{"status":"partner-contract-ready","version":"knife-67-partner-contract-auto-deploy","audience":["official-site","opensdk","im-core-mini-app","partner-page","merchant-hash-page"],"canonicalRequest":{"headers":{"Content-Type":"application/json","Idempotency-Key":"merchant-or-client-stable-operation-id"},"body":{"orderKind":"custom_order","customCategory":"appointment | consumption | quote_request | voting | internal_request | commercial_candidate | support","projectId":"matrix-public-appointment","itemIds":["price_product_demo"],"date":"YYYY-MM-DD","startTime":"HH:mm","source":"opensdk","productSurface":"im-mini-app | official-site | partner-page","customer":{"nickname":"display name","phone":"+1 555 0100","email":"customer@example.com"},"intakeAnswers":{"field-1":"Customer goal or request detail","field-2":"Optional expected outcome"},"metadata":{"externalOrderRef":"same value as Idempotency-Key when available"}}},"acceptedInputShapes":[{"id":"canonical-object","status":"recommended","description":"Use nested customer fields and intakeAnswers as a fieldId-to-value object."},{"id":"flat-customer","status":"supported","description":"Top-level nickname, phone, and email remain supported for legacy booking forms."},{"id":"array-intake","status":"supported","description":"intakeAnswers can also be an array of { fieldId, value } records or [fieldId, value] tuples."}],"retryPolicy":{"keyHeader":"Idempotency-Key","sameKeySamePayload":"returns the original booking/customOrder response with idempotency.replayed=true","sameKeyDifferentPayload":"returns 409 idempotency_conflict","missingKey":"POST /api/custom-orders and /api/integrations/im-core/order return 400 missing_idempotency_key","suggestedRetention":"Keep client keys for at least one user retry window; server keeps the latest 300 JSON-runtime keys before database cutover."},"errorMap":[{"code":"missing_idempotency_key","status":400,"action":"Generate a stable operation id and retry with Idempotency-Key."},{"code":"idempotency_conflict","status":409,"action":"Do not retry with the same key; fetch the original order or create a new key for a new intent."},{"code":"missing_intake_field","status":400,"action":"Fetch /api/projects or tenant page data and submit required intakeAnswers by field id."},{"code":"invalid_price_selection","status":400,"action":"Refresh project price items and submit active itemIds."},{"code":"outside_working_day","status":409,"action":"Use /api/projects/:projectId/availability before submitting."}],"deployAutomation":{"mode":"ec2-release-directory","appDir":"/opt/reits-order","sourceSymlink":"/opt/reits-order/source","releaseEnv":"/etc/systemd/system/reits-order.service.d/release.conf","healthCheck":"/api/health","runbook":"deploy/scripts/auto-deploy.sh"},"references":["Stripe idempotent requests: safe retries use a client-provided key and replay the first result.","Shopify idempotent requests: duplicate/conflict prevention for retrying API writes.","Microsoft Bookings: business/service/customer/appointment resources stay explicit.","Google Calendar Events: calendar fulfillment is event-shaped with request/status separation."]}},"globalOrders":{"status":"global-orders-ready","score":100,"orderCount":3,"filteredOrderCount":3,"customOrderCount":3,"customCategoryCount":2,"merchantCount":1,"byCustomCategory":[{"id":"quote_request","label":"Quote request","count":2},{"id":"appointment","label":"Appointment","count":1}]},"summary":{"headline":"IM Core order bridge is im-core-order-bridge-ready with 3 custom order row(s), 7 category definition(s), and 1 active merchant project(s).","orderMode":"custom-only","bridgeEndpoint":"/api/integrations/im-core/order","imCoreAuthMode":"local-preview","customOrderCount":3,"customCategoryCount":7,"activeMerchantCount":1,"writeModel":"custom-order-idempotent-write / lifecycle-callbacks-later","writeEndpoint":"/api/custom-orders","imCoreWriteEndpoint":"/api/integrations/im-core/order","writeRequestCount":2,"idempotentReplayCount":2},"integrationSteps":["IM Core calls its existing email verification and login routes to identify the user.","Host product or mini app discovers this bridge through /api/sdk/config and /api/integrations/im-core/order.","Order payloads always send orderKind=custom_order, one customCategory value, and an Idempotency-Key.","IM Core POSTs the same payload to /api/integrations/im-core/order; partner/OpenSDK hosts can POST to /api/custom-orders.","Order admin uses /api/ops/orders and /api/ops/orders/export to reconcile all merchants, with raw customer contact fields redacted.","Later knives can add lifecycle callbacks and provider-specific adapters without adding new top-level order kinds."],"guardrails":["Do not create commercial_order or internal_order as top-level kinds in this phase; model them with the customCategory field.","Do not send raw IM tokens, private links, phone numbers, or notes through the bridge discovery endpoint.","Do not process payments or collect card data; priced flows are consumption custom orders until a finance-approved commerce module exists.","Keep admin all-merchant order visibility behind owner/admin authentication.","Require Idempotency-Key for IM Core writes so app retries do not duplicate bookings.","Keep lifecycle callbacks explicit and signed before allowing downstream mutation."],"references":["Shopify Admin Orders: all-store order list, saved views, and merchant-operable order details.","Stripe PaymentIntents: lifecycle state separation before payment execution.","Microsoft Bookings: business/service/customer/appointment resources for scheduling data.","Google Calendar Events: time-bounded event resources and status fields for calendar-style fulfillment."]}}}