{"openapi":"3.0.1","info":{"title":"Miridia Global API","version":"v1","description":"The Global API of Miridia, the supply chain and automation platform. Read https://docs.miridia.io/developers for authentication and conventions."},"paths":{"/api/auth/login":{"post":{"tags":["Auth"],"operationId":"Login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AuthenticateRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfLoginResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLoginResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLoginResponse"}}}}}}},"/api/auth/select-organization":{"post":{"tags":["Auth"],"summary":"Requires the short-lived selection token `LoginAsync` returned for a multi-membership user.","operationId":"SelectOrganization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectOrganizationRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SelectOrganizationRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SelectOrganizationRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}}}}}}},"/api/auth/new-token":{"post":{"tags":["Auth"],"summary":"Refresh-token rotation. Reads the refresh cookie -- no request body.","operationId":"NewToken","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}}}}}}},"/api/auth/logout":{"post":{"tags":["Auth"],"operationId":"Logout","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/auth/reset-password":{"post":{"tags":["Auth"],"operationId":"ResetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/auth/ott":{"post":{"tags":["Auth"],"summary":"Mints a single-use SSO handoff token (60s TTL) for the current session.","operationId":"MintOneTimeToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintOneTimeTokenRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/MintOneTimeTokenRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/MintOneTimeTokenRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfOneTimeTokenResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfOneTimeTokenResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfOneTimeTokenResponse"}}}}}}},"/api/auth/ott/redeem":{"post":{"tags":["Auth"],"summary":"Redeems a one-time token minted by M:Dispatch.Global.API.Controllers.AuthController.MintOneTimeToken(Dispatch.Global.API.Contracts.MintOneTimeTokenRequest). Anonymous.","operationId":"RedeemOneTimeToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemOneTimeTokenRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/RedeemOneTimeTokenRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/RedeemOneTimeTokenRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSessionResponse"}}}}}}},"/api/auth/complete-invitation/{businessId}":{"post":{"tags":["Auth"],"summary":"Global part only: sets the password and marks the user verified. The businessId\r\nroute segment is kept for URL compatibility; org-side profile completion is a separate main-API call.","operationId":"CompleteInvitation","parameters":[{"name":"businessId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteInvitationRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/CompleteInvitationRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CompleteInvitationRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/auth/verify-by-token":{"get":{"tags":["Auth"],"operationId":"VerifyByToken","parameters":[{"name":"token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/api/auth/tokens":{"get":{"tags":["Auth"],"operationId":"GetAccessTokens","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/PagedResultOfAccessTokenResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfAccessTokenResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfAccessTokenResponse"}}}}}},"post":{"tags":["Auth"],"summary":"Requires the caller to be an owner of the token's organization.","operationId":"CreateApiToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfAccessTokenResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfAccessTokenResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfAccessTokenResponse"}}}}}}},"/api/auth/tokens/{id}":{"delete":{"tags":["Auth"],"summary":"Requires the caller to be an owner of the token's organization.","operationId":"RevokeAccessToken","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/auth/linked-accounts/codes":{"post":{"tags":["LinkedAccounts"],"operationId":"CreateCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkedAccountCodeRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateLinkedAccountCodeRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateLinkedAccountCodeRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountCodeResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountCodeResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountCodeResponse"}}}}}}},"/api/auth/linked-accounts":{"get":{"tags":["LinkedAccounts"],"operationId":"GetLinkedAccounts","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkedAccountResponse"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkedAccountResponse"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkedAccountResponse"}}}}}}}},"/api/auth/linked-accounts/{id}":{"patch":{"tags":["LinkedAccounts"],"operationId":"Rename","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkedAccountRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkedAccountRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateLinkedAccountRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfLinkedAccountResponse"}}}}}},"delete":{"tags":["LinkedAccounts"],"operationId":"Revoke","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/banners":{"get":{"tags":["Notification"],"operationId":"GetBannerMessages","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BannerResponse"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BannerResponse"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BannerResponse"}}}}}}}},"/api/organizations/soft-check":{"get":{"tags":["Organization"],"summary":"Pre-registration probe: does a global user with this email already exist?","operationId":"SoftCheck","parameters":[{"name":"emailAddress","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/organizations":{"post":{"tags":["Organization"],"summary":"An unauthorised call to register a new organization: writes the global rows, then drives\r\nthe org-side provisioning call (schema, migrations, first business, primary user).","operationId":"RegisterOrganization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterOrganizationRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/RegisterOrganizationRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/RegisterOrganizationRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfRegisterOrganizationBusinessResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfRegisterOrganizationBusinessResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfRegisterOrganizationBusinessResponse"}}}}}}},"/api/subscription/add-plan":{"post":{"tags":["Subscription"],"operationId":"AddPlan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SubscriptionPlanRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/subscription/save-billing-details":{"post":{"tags":["Subscription"],"operationId":"AddBillingDetails","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionBillingRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SubscriptionBillingRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SubscriptionBillingRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/subscription/billing-details/{subscriptionId}":{"get":{"tags":["Subscription"],"operationId":"GetBillingDetails","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionBillingResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionBillingResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionBillingResponse"}}}}}}},"/api/subscription/{subscriptionId}":{"get":{"tags":["Subscription"],"operationId":"GetSubscription","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfSubscriptionResponse"}}}}}}},"/api/subscriptions":{"get":{"tags":["Subscription"],"operationId":"GetSubscriptions","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/PagedResultOfSubscriptionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfSubscriptionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfSubscriptionResponse"}}}}}}},"/api/subscription/subscription-offers":{"get":{"tags":["Subscription"],"operationId":"GetSubscriptionOffers","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActionMessage"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActionMessage"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActionMessage"}}}}}}}},"/api/subscription/{subscriptionId}/toggle":{"post":{"tags":["Subscription"],"operationId":"ToggleSubscription","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleSubscriptionRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/ToggleSubscriptionRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/ToggleSubscriptionRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfRedirectAction"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfRedirectAction"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfRedirectAction"}}}}}}},"/api/subscription/redirect/{subscriptionId}":{"get":{"tags":["Subscription"],"summary":"Handles redirections to the payment provider. No security checks -- this is a plain redirect.","operationId":"HandleRedirect","parameters":[{"name":"subscriptionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/api/subscription/plans":{"get":{"tags":["Subscription"],"operationId":"GetPlans","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PricePlanGroupResponse"}}},"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PricePlanGroupResponse"}}},"text/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PricePlanGroupResponse"}}}}}}}},"/api/Support/tickets":{"get":{"tags":["Support"],"operationId":"SupportTickets","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/PagedResultOfSupportTicketResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfSupportTicketResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/PagedResultOfSupportTicketResponse"}}}}}}},"/api/Support":{"post":{"tags":["Support"],"operationId":"Submit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitSupportTicketRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SubmitSupportTicketRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SubmitSupportTicketRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/Support/{ticketId}":{"patch":{"tags":["Support"],"operationId":"UpdateTicket","parameters":[{"name":"ticketId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupportTicketRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateSupportTicketRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateSupportTicketRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/user/soft-check":{"get":{"tags":["User"],"summary":"Pre-registration probe: does a global user with this email already exist?","operationId":"SoftCheck","parameters":[{"name":"emailAddress","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/api/user/request-password-reset":{"post":{"tags":["User"],"operationId":"RequestPasswordReset","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPasswordResetRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/RequestPasswordResetRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/RequestPasswordResetRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"application/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}},"text/json":{"schema":{"$ref":"#/components/schemas/SingleResultOfBoolean"}}}}}}},"/.well-known/jwks.json":{"get":{"tags":["WellKnown"],"operationId":"GetJwks","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/JwksDocument"}},"application/json":{"schema":{"$ref":"#/components/schemas/JwksDocument"}},"text/json":{"schema":{"$ref":"#/components/schemas/JwksDocument"}}}}}}}},"components":{"schemas":{"AccessTokenResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"token":{"type":"string","nullable":true},"expiryDate":{"type":"string","format":"date-time"},"title":{"type":"string","nullable":true},"scopes":{"type":"string","nullable":true},"dateCreated":{"type":"string","format":"date-time","nullable":true},"lastUsedAt":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false},"ActionMessage":{"type":"object","properties":{"title":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"level":{"$ref":"#/components/schemas/NotificationLevel"},"icon":{"$ref":"#/components/schemas/MdiIcon"},"code":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Composite.ActionMessage`."},"AddOnResponse":{"type":"object","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"integer","format":"int32"},"hasQuantity":{"type":"boolean"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Global.AddOnResponse`."},"ApiKeyVerifyRequest":{"type":"object","properties":{"keyHash":{"type":"string","nullable":true}},"additionalProperties":false},"ApiKeyVerifyResult":{"type":"object","properties":{"active":{"type":"boolean"},"apiKeyId":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid","nullable":true},"scopes":{"type":"string","nullable":true}},"additionalProperties":false},"AuthenticateRequest":{"required":["email","password"],"type":"object","properties":{"email":{"minLength":1,"type":"string","format":"email"},"password":{"minLength":1,"type":"string"}},"additionalProperties":false},"BannerResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"$ref":"#/components/schemas/NotificationLevel"},"title":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"active":{"type":"boolean"},"countryCodeId":{"$ref":"#/components/schemas/CountryCode"},"dateToStart":{"type":"string","format":"date-time"},"dateToEnd":{"type":"string","format":"date-time"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Notifications.BannerResponse`."},"BillingAddressRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"placeId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"fullAddress":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"suburb":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"unit":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Addresses.UpdateAddressRequest`."},"BillingAddressResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"placeId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"fullAddress":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"suburb":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"unit":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Addresses.AddressResponse`."},"BillingBusinessRequest":{"type":"object","properties":{"registeredName":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"requiresOrderIntegration":{"type":"boolean"},"requiresOrderFulfillment":{"type":"boolean"},"requiresAccountingIntegration":{"type":"boolean"},"requiresDispatchBuilder":{"type":"boolean"}},"additionalProperties":false,"description":"Mirrors the fields of `Dispatch.Application.Contracts.Request.Businesses.CreateBusinessRequest`\r\nthis service can meaningfully use (see `Models.BillingBusinessSnapshot`)."},"BillingBusinessResponse":{"type":"object","properties":{"registeredName":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"requiresOrderIntegration":{"type":"boolean"},"requiresOrderFulfillment":{"type":"boolean"},"requiresAccountingIntegration":{"type":"boolean"},"requiresDispatchBuilder":{"type":"boolean"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Businesses.BusinessResponse`, restricted\r\nto the subset a Dispatch.Global.API.Models.BillingBusinessSnapshot can populate (no billing/shipping\r\naddress or current-user navigation -- the live org-side `Business` aggregate is out\r\nof reach here)."},"BillingCurrencyResponse":{"type":"object","properties":{"iso4217":{"type":"string","nullable":true},"utf8Symbol":{"type":"string","nullable":true},"currencyCode":{"$ref":"#/components/schemas/CurrencyCode"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Lookup.CurrencyResponse`."},"BillingCycle":{"enum":["Monthly","Annually"],"type":"string","description":"Native PostgreSQL enum type `billing_cycle`. Must mirror\r\n`Dispatch.Application.Enums.Entities.Billing.BillingCycle` member-for-member."},"BillingPrimitiveUserResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"displayName":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Auth.PrimitiveUserResponse`."},"BillingUserRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Auth.PrimitiveUserRequest`."},"CompleteInvitationRequest":{"required":["email","password"],"type":"object","properties":{"email":{"minLength":1,"type":"string","format":"email"},"password":{"minLength":8,"type":"string"},"acceptedTerms":{"type":"boolean"}},"additionalProperties":false},"CountryCode":{"enum":["Invalid","Global","FallbackZa","Be","De","Lu","Nl","Za","Zw","Gb","Us","Zm"],"type":"string","description":"Not a native PostgreSQL enum (`banners.country_code_id` / `price_plans.country_code_id`\r\nare plain integer columns). Mirrors\r\n`Dispatch.Application.Enums.Entities.Locales.CountryCode` member-for-member."},"CreateApiKeyRequest":{"required":["businessId"],"type":"object","properties":{"label":{"type":"string","nullable":true},"ttlMinutes":{"type":"integer","format":"int32","nullable":true},"businessId":{"type":"string","description":"The business the key acts for (`api_keys.business_id` is `NOT NULL`). The Global\r\nAPI has no business context of its own, so the caller must supply it explicitly.","format":"uuid"},"scopes":{"type":"string","description":"Optional raw permission grant, `{ \"ModuleName\": bitmaskInt }`, passed straight through\r\nto `api_keys.scopes`. There is no role-based derivation here: roles are org-side data\r\nthe Global API cannot resolve. Null/absent = unrestricted key.","nullable":true}},"additionalProperties":false},"CreateGlobalIdentityRequest":{"type":"object","properties":{"emailAddress":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"organizationId":{"type":"string","format":"uuid"}},"additionalProperties":false},"CreateGlobalIdentityResult":{"type":"object","properties":{"userId":{"type":"string","format":"uuid"},"alreadyExisted":{"type":"boolean"}},"additionalProperties":false},"CreateLinkedAccountCodeRequest":{"required":["businessId","channel","label"],"type":"object","properties":{"channel":{"$ref":"#/components/schemas/LinkedAccountChannel"},"businessId":{"type":"string","format":"uuid"},"label":{"minLength":1,"type":"string"}},"additionalProperties":false},"CurrencyCode":{"enum":["Invalid","Eur","Usd","Gbp","Zar","Zmw"],"type":"string","description":"Native PostgreSQL enum type `currency_code`. Mirrors\r\n`Dispatch.Application.Enums.Entities.Locales.CurrencyCode` member-for-member. JSON\r\nserialization uses the plain member name (`JsonStringEnumConverter(namingPolicy: null)`,\r\nsame as the main API) -- `[EnumMember]` values are not read by that converter and are not\r\nreproduced here."},"DiscountValidity":{"enum":["OneMonth","ThreeMonths","SixMonths","TwelveMonths"],"type":"string","description":"Native PostgreSQL enum type `discount_validity`."},"GlobalUserAccountSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"isActive":{"type":"boolean"},"acceptedTerms":{"type":"boolean"},"dateVerified":{"type":"string","format":"date-time","nullable":true}},"additionalProperties":false,"description":"The account-activation fields that live only on `cargopilot_global.users`\r\n(`IsActive`, `AcceptedTerms`, `DateVerified`), scoped to the three main-API\r\nhandlers that merge them onto an org-schema user profile: `GetMyAccountQueryHandler`,\r\n`GetEmployeeQueryHandler`, and `GetEmployeesQueryHandler`."},"GlobalUserSummariesRequest":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"nullable":true}},"additionalProperties":false},"JwksDocument":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/JwksKey"},"nullable":true}},"additionalProperties":false,"description":"Hand-shaped rather than serializing `Microsoft.IdentityModel.Tokens.JsonWebKeySet`\r\ndirectly — that type is not guaranteed System.Text.Json-serializable across versions. This\r\nshape is the standard RFC 7517 JWKS document, which is exactly what\r\n`Dispatch.Global.Contracts.Jwks.JwksKeyCache` parses on the consuming side\r\n(`new JsonWebKeySet(json)` reads the standard \"keys\"/\"kty\"/\"n\"/\"e\" property names)."},"JwksKey":{"type":"object","properties":{"kty":{"type":"string","nullable":true},"use":{"type":"string","nullable":true},"alg":{"type":"string","nullable":true},"kid":{"type":"string","nullable":true},"n":{"type":"string","nullable":true},"e":{"type":"string","nullable":true}},"additionalProperties":false},"LinkedAccountChannel":{"enum":["Telegram"],"type":"string","description":"Native PG enum `linked_account_channel`. Telegram only today; WhatsApp or another channel later."},"LinkedAccountCodeResponse":{"type":"object","properties":{"code":{"type":"string","nullable":true},"deepLink":{"type":"string","nullable":true},"expiresAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"LinkedAccountResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel":{"$ref":"#/components/schemas/LinkedAccountChannel"},"externalDisplayName":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"organizationId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid"},"dateCreated":{"type":"string","format":"date-time"},"lastUsedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","format":"date-time","nullable":true},"revokedReason":{"$ref":"#/components/schemas/LinkedAccountRevokedReason"},"status":{"$ref":"#/components/schemas/LinkedAccountStatus"}},"additionalProperties":false},"LinkedAccountRevokedReason":{"enum":["UserRemoved","ChatUnlink","Replaced","StampChanged","UserDeactivated","MembershipRemoved"],"type":"string","description":"Native PG enum `linked_account_revoked_reason`. Set together with `revoked_at`."},"LinkedAccountStatus":{"enum":["Active","Expired","Revoked"],"type":"string","description":"A presentation-only status, computed on the response DTO from `revoked_at` and\r\n`expires_at`. Not a stored column, so it has no native PG type and no entry in\r\nDispatch.Global.API.Database.GlobalEnumRegistry."},"LinkedAccountTokenRequest":{"required":["channel","externalUserId"],"type":"object","properties":{"channel":{"$ref":"#/components/schemas/LinkedAccountChannel"},"externalUserId":{"minLength":1,"type":"string"}},"additionalProperties":false},"LinkedAccountTokenResponse":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"expiresAtUtc":{"type":"string","format":"date-time"},"linkId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid"}},"additionalProperties":false},"LoginResponse":{"type":"object","properties":{"requiresOrganizationSelection":{"type":"boolean"},"session":{"$ref":"#/components/schemas/SessionResponse"},"selectionToken":{"type":"string","nullable":true},"selectionExpiresAtUtc":{"type":"string","format":"date-time","nullable":true},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationSummary"},"nullable":true}},"additionalProperties":false,"description":"Exactly one of the two shapes is populated:\r\na single membership yields Dispatch.Global.API.Contracts.LoginResponse.Session; more than one yields\r\nDispatch.Global.API.Contracts.LoginResponse.SelectionToken + Dispatch.Global.API.Contracts.LoginResponse.Organizations, and the client must call\r\n`POST /api/auth/select-organization` next."},"MdiIcon":{"enum":["None"],"type":"string","description":"Reduced local stand-in for `Dispatch.Application.Enums.Entities.Shared.MdiIcon` (a large\r\nMaterial Design Icons catalogue). This service's only reference to the type is\r\n`ActionMessage.Icon`, which the ported billing/support code paths never set away from its\r\ndefault -- so only Dispatch.Global.API.Models.Enums.MdiIcon.None is reproduced here. If a future Global-API feature needs\r\nto set a specific icon, copy the missing member name(s) from the source enum verbatim."},"MintOneTimeTokenRequest":{"required":["businessId","targetApp"],"type":"object","properties":{"targetApp":{"minLength":1,"type":"string"},"businessId":{"type":"string","description":"The business the handed-off session should land in. A Global-API-issued token carries no\r\nbusiness-id claim, so the caller must supply this explicitly.","format":"uuid"}},"additionalProperties":false},"NotificationLevel":{"enum":["Standard","Info","Warning","Error","Success","Recommendation"],"type":"string","description":"Native PostgreSQL enum type `notification_level`. Mirrors\r\n`Dispatch.Application.Enums.Entities.Notifications.NotificationLevel` member-for-member."},"OneTimeTokenResponse":{"type":"object","properties":{"token":{"type":"string","nullable":true},"expiresAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"OrganizationContext":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"additionalProperties":false},"OrganizationSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"isOwner":{"type":"boolean"}},"additionalProperties":false},"PagedResultOfAccessTokenResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AccessTokenResponse"},"nullable":true},"count":{"type":"integer","format":"int32","readOnly":true},"page":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalCount":{"type":"integer","format":"int32"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.PagedResult<T>`."},"PagedResultOfSubscriptionResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionResponse"},"nullable":true},"count":{"type":"integer","format":"int32","readOnly":true},"page":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalCount":{"type":"integer","format":"int32"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.PagedResult<T>`."},"PagedResultOfSupportTicketResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SupportTicketResponse"},"nullable":true},"count":{"type":"integer","format":"int32","readOnly":true},"page":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalCount":{"type":"integer","format":"int32"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.PagedResult<T>`."},"PaymentMethod":{"enum":["Unknown","Cash","Card","CashOnDelivery","CardOnDelivery","Eft","Crypto","Paypal","WireTransfer","DebitOrder"],"type":"string","description":"Native PostgreSQL enum type `payment_method`. NOTE: DO NOT CHANGE THE INTEGER VALUES."},"PlanCategory":{"enum":["Primary","ECommerce","Fulfillment","Accounting","Crm","OrderApi","RouteApi","ServiceBridge","Queue","Notification","RoutePlanning","Member","PointOfSale"],"type":"string","description":"Native PostgreSQL enum type `plan_category`."},"PlanGroup":{"enum":["ECommerce","Logistics","Retail","AddOn"],"type":"string","description":"Native PostgreSQL enum type `plan_group`."},"PricePlanGroupResponse":{"type":"object","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"planGroup":{"$ref":"#/components/schemas/PlanGroup"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/PricePlanResponse"},"nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Global.PricePlanGroupResponse`."},"PricePlanResponse":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"pricePerMonth":{"type":"number","format":"double"},"pricePerYear":{"type":"number","format":"double"},"discountPercentage":{"type":"number","format":"double"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"string"},"nullable":true},"addOns":{"type":"array","items":{"$ref":"#/components/schemas/AddOnResponse"},"nullable":true},"hasQuantity":{"type":"boolean"},"canAdd":{"type":"boolean"},"currentPlan":{"type":"boolean"},"showPrice":{"type":"boolean"},"activeSubscription":{"type":"boolean"},"planGroup":{"$ref":"#/components/schemas/PlanGroup"},"countryCodeId":{"$ref":"#/components/schemas/CountryCode"},"discountValidity":{"$ref":"#/components/schemas/DiscountValidity"},"currencyCode":{"type":"string","nullable":true},"currencySymbol":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Global.PricePlanResponse`."},"ProvisionApiKeyRequest":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid"},"label":{"type":"string","nullable":true},"ttlMinutes":{"type":"integer","format":"int32","nullable":true},"scopesJson":{"type":"string","nullable":true},"isEphemeral":{"type":"boolean"}},"additionalProperties":false,"description":"Mints an org-level service-principal API key on the Global API, used by the N8N-callback and\r\ncarrier-quotation-callback workflow steps in Dispatch.Workflow.API to obtain a callback key\r\nwithout a human in the loop. Dispatch.Global.Contracts.Dtos.ProvisionApiKeyRequest.ScopesJson carries the same\r\n`{ \"ModuleName\": bitmaskInt }` grant format `PermissionResolver.ParseScopes` reads;\r\nnull means unrestricted (the caller trusts the token holder with everything the organization can\r\ndo). Dispatch.Global.Contracts.Dtos.ProvisionApiKeyRequest.TtlMinutes null means long-lived (~5 years), matching the main API's\r\nuser-facing key minting."},"ProvisionApiKeyResult":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"token":{"type":"string","nullable":true}},"additionalProperties":false},"RedeemLinkedAccountRequest":{"required":["channel","code","externalUserId"],"type":"object","properties":{"channel":{"$ref":"#/components/schemas/LinkedAccountChannel"},"code":{"minLength":1,"type":"string"},"externalUserId":{"minLength":1,"type":"string"},"externalDisplayName":{"type":"string","nullable":true}},"additionalProperties":false},"RedeemLinkedAccountResponse":{"type":"object","properties":{"linkId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"businessId":{"type":"string","format":"uuid"},"label":{"type":"string","nullable":true}},"additionalProperties":false},"RedeemOneTimeTokenRequest":{"required":["token"],"type":"object","properties":{"token":{"minLength":1,"type":"string"}},"additionalProperties":false},"RedirectAction":{"type":"object","properties":{"redirect":{"type":"boolean"},"url":{"type":"string","nullable":true},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ActionMessage"},"nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Models.Primitives.RedirectAction`."},"RegisterOrganizationAddressRequest":{"required":["city","country","postcode","street"],"type":"object","properties":{"placeId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"fullAddress":{"type":"string","nullable":true},"street":{"minLength":1,"type":"string"},"suburb":{"type":"string","nullable":true},"city":{"minLength":1,"type":"string"},"country":{"minLength":1,"type":"string"},"postcode":{"minLength":1,"type":"string"},"unit":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Addresses.CreateAddressRequest`."},"RegisterOrganizationAddressResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"placeId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"fullAddress":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"suburb":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"postcode":{"type":"string","nullable":true},"unit":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"province":{"type":"string","nullable":true},"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Addresses.AddressResponse`."},"RegisterOrganizationBusinessRequest":{"required":["address","displayName","email","phoneNumber"],"type":"object","properties":{"registeredName":{"maxLength":100,"minLength":0,"type":"string","nullable":true},"displayName":{"maxLength":50,"minLength":0,"type":"string"},"phoneNumber":{"minLength":1,"type":"string"},"website":{"maxLength":100,"minLength":0,"type":"string","nullable":true},"email":{"minLength":1,"type":"string","format":"email"},"registrationNumber":{"maxLength":30,"minLength":0,"type":"string","nullable":true},"requiresOrderIntegration":{"type":"boolean"},"requiresOrderFulfillment":{"type":"boolean"},"requiresAccountingIntegration":{"type":"boolean"},"requiresDispatchBuilder":{"type":"boolean"},"multipleBranches":{"type":"boolean"},"address":{"$ref":"#/components/schemas/RegisterOrganizationAddressRequest"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Businesses.CreateBusinessRequest`."},"RegisterOrganizationBusinessResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"registeredName":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"displayName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"website":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"requiresOrderIntegration":{"type":"boolean"},"requiresOrderFulfillment":{"type":"boolean"},"requiresAccountingIntegration":{"type":"boolean"},"requiresDispatchBuilder":{"type":"boolean"},"billingAddress":{"$ref":"#/components/schemas/RegisterOrganizationAddressResponse"},"currentUser":{"$ref":"#/components/schemas/RegisterOrganizationUserSummary"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Businesses.BusinessResponse`."},"RegisterOrganizationRequest":{"required":["business","user"],"type":"object","properties":{"business":{"$ref":"#/components/schemas/RegisterOrganizationBusinessRequest"},"user":{"$ref":"#/components/schemas/RegisterOrganizationUserRequest"},"fulfillmentTypes":{"type":"array","items":{"type":"string"},"nullable":true},"addOns":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"This is the shape the Phoenix signup form posts to `POST /api/organizations` -- do not\r\nrename or restructure fields without updating that form."},"RegisterOrganizationUserRequest":{"required":["email","firstName","lastName","password"],"type":"object","properties":{"firstName":{"minLength":1,"type":"string"},"lastName":{"minLength":1,"type":"string"},"email":{"minLength":1,"type":"string","format":"email"},"phoneNumber":{"type":"string","nullable":true},"password":{"minLength":8,"type":"string"},"confirmPassword":{"type":"string","nullable":true},"acceptedTerms":{"type":"boolean"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Auth.RegisterRequest`."},"RegisterOrganizationUserSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"displayName":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Auth.PrimitiveUserResponse`."},"RequestPasswordResetRequest":{"required":["email"],"type":"object","properties":{"email":{"minLength":1,"type":"string","format":"email"}},"additionalProperties":false},"ResetPasswordRequest":{"required":["password","token"],"type":"object","properties":{"token":{"minLength":1,"type":"string"},"password":{"minLength":6,"type":"string"}},"additionalProperties":false},"SelectOrganizationRequest":{"required":["organizationId"],"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"}},"additionalProperties":false},"SessionResponse":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"expiresAtUtc":{"type":"string","format":"date-time"},"organization":{"$ref":"#/components/schemas/OrganizationContext"},"businessId":{"type":"string","format":"uuid","nullable":true}},"additionalProperties":false,"description":"BusinessId is set only for a session that comes from a one-time token."},"SingleResultOfAccessTokenResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccessTokenResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfBoolean":{"type":"object","properties":{"data":{"type":"boolean"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfLinkedAccountCodeResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedAccountCodeResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfLinkedAccountResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedAccountResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfLinkedAccountTokenResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedAccountTokenResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfLoginResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LoginResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfOneTimeTokenResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OneTimeTokenResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfRedeemLinkedAccountResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RedeemLinkedAccountResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfRedirectAction":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RedirectAction"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfRegisterOrganizationBusinessResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RegisterOrganizationBusinessResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfSessionResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SessionResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfSubscriptionBillingResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionBillingResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SingleResultOfSubscriptionResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SubscriptionResponse"},"statusCode":{"type":"integer","format":"int32"},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false,"description":"Minimal local copy of `Dispatch.Application.Models.Primitives.SingleResult<T>` —\r\nthis service does not reference `Dispatch.Application`, so the envelope shape (`data`\r\n/ `statusCode` / `messages`) is reproduced here to keep response bodies\r\nbyte-compatible with the equivalent main-API endpoints. `Messages` is a plain\r\nstring list rather than the main API's structured `ActionMessage`; it is always empty on\r\na successful call."},"SubmitSupportTicketRequest":{"type":"object","properties":{"email":{"type":"string","nullable":true},"tel":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"message":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors the body shape of `Dispatch.Application.Handlers.Commands.Support.SubmitSupportTicket.SubmitSupportTicketCommand`."},"SubscriptionBillingRequest":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/BillingUserRequest"},"business":{"$ref":"#/components/schemas/BillingBusinessRequest"},"address":{"$ref":"#/components/schemas/BillingAddressRequest"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"subscriptionId":{"type":"string","format":"uuid"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Businesses.SubscriptionBillingRequest`.\r\nDispatch.Global.API.Contracts.SubscriptionBillingRequest.Business is read for the billing-business snapshot (see\r\n`Models.SubscriptionMetadata`); its nested `Address` is accepted for wire\r\ncompatibility with what Phoenix already posts but is not read -- billing address comes from\r\nDispatch.Global.API.Contracts.SubscriptionBillingRequest.Address on this request instead."},"SubscriptionBillingResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/BillingPrimitiveUserResponse"},"business":{"$ref":"#/components/schemas/BillingBusinessResponse"},"address":{"$ref":"#/components/schemas/BillingAddressResponse"},"paymentMethod":{"$ref":"#/components/schemas/PaymentMethod"},"hasCompletedBillingDetails":{"type":"boolean"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Businesses.Subscription.SubscriptionBillingResponse`."},"SubscriptionItemResponse":{"type":"object","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"price":{"type":"number","format":"double"},"discount":{"type":"number","format":"double"},"quantity":{"type":"integer","format":"int32"},"id":{"type":"string","format":"uuid"},"currencyCode":{"$ref":"#/components/schemas/CurrencyCode"},"discountApplied":{"type":"string","format":"date-time","nullable":true},"discountExpiry":{"type":"string","format":"date-time","nullable":true},"planCategory":{"$ref":"#/components/schemas/PlanCategory"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Businesses.Subscription.SubscriptionItemResponse`."},"SubscriptionPlanRequest":{"required":["billingCycle","planId"],"type":"object","properties":{"planId":{"type":"integer","format":"int32"},"quantity":{"type":"integer","format":"int32"},"billingCycle":{"$ref":"#/components/schemas/BillingCycle"},"subscriptionId":{"type":"string","format":"uuid","nullable":true},"discountCode":{"type":"string","nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Businesses.SubscriptionPlanRequest`."},"SubscriptionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"billingCycle":{"$ref":"#/components/schemas/BillingCycle"},"active":{"type":"boolean"},"discount":{"type":"number","format":"double"},"subTotal":{"type":"number","format":"double"},"total":{"type":"number","format":"double"},"totalSuffix":{"type":"string","nullable":true},"currency":{"$ref":"#/components/schemas/BillingCurrencyResponse"},"items":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionItemResponse"},"nullable":true},"primaryPlan":{"$ref":"#/components/schemas/PricePlanResponse"},"planLimit":{"type":"integer","format":"int32"},"vehicleLimit":{"type":"integer","format":"int32"},"shipmentLimit":{"type":"integer","format":"int32"},"orderLimit":{"type":"integer","format":"int32"},"requestLimit":{"type":"integer","format":"int32"},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/ActionMessage"},"nullable":true}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Businesses.Subscription.SubscriptionResponse`."},"SupportTicketResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","nullable":true},"tel":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"message":{"type":"string","nullable":true},"hasRead":{"type":"boolean"},"ticketStatus":{"$ref":"#/components/schemas/TicketStatus"},"dateCreated":{"type":"string","format":"date-time"},"dateModified":{"type":"string","format":"date-time"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Response.Global.SupportTicketResponse`."},"TenantCatalogEntry":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"slug":{"type":"string","nullable":true},"schemaName":{"type":"string","nullable":true},"connectionString":{"type":"string","nullable":true},"isActive":{"type":"boolean"}},"additionalProperties":false},"TicketStatus":{"enum":["Open","Pending","Closed"],"type":"string","description":"Native PostgreSQL enum type `ticket_status`. Mirrors\r\n`Dispatch.Application.Enums.Entities.Support.TicketStatus` member-for-member."},"ToggleSubscriptionRequest":{"required":["mode"],"type":"object","properties":{"mode":{"minLength":1,"type":"string"}},"additionalProperties":false,"description":"Mirrors `Dispatch.Application.Contracts.Request.Businesses.ToggleSubscriptionRequest`."},"UnlinkLinkedAccountRequest":{"required":["channel","externalUserId"],"type":"object","properties":{"channel":{"$ref":"#/components/schemas/LinkedAccountChannel"},"externalUserId":{"minLength":1,"type":"string"}},"additionalProperties":false},"UpdateLinkedAccountRequest":{"required":["label"],"type":"object","properties":{"label":{"minLength":1,"type":"string"}},"additionalProperties":false},"UpdateSupportTicketRequest":{"type":"object","properties":{"message":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/TicketStatus"}},"additionalProperties":false,"description":"Mirrors the body shape of `Dispatch.Application.Handlers.Commands.Support.UpdateSupportTicket.UpdateSupportTicketCommand`."}}},"tags":[{"name":"Auth","description":"The global-side auth routes. There is no `switch-business` endpoint here: business\r\nselection is the `X-Business-Id` request header on the main API, not a session mutation."},{"name":"BotLinkedAccounts","description":"The bot-side linked-account routes: redeem a link code, exchange an external id for a session\r\ntoken, and unlink. Guarded by Dispatch.Global.API.Security.BotClientSecretFilter -- never a bearer-JWT route,\r\nand never guarded by Dispatch.Global.API.Security.ServiceSecretFilter or its secret."},{"name":"Internal","description":"The private endpoints the tenant services (Dispatch.API, Dispatch.Workflow.API,\r\nDispatch.EventSource.API) call on a cache miss: the tenant catalog lookup and API-key\r\nintrospection. Also carries the invitation identity endpoint. Guarded by\r\nDispatch.Global.API.Security.ServiceSecretFilter — never a public route."},{"name":"LinkedAccounts","description":"The user-side linked-account routes for the Telegram assistant: mint a link code, list, rename,\r\nand revoke the caller's own links. Bearer JWT, same as the other `api/auth/*` routes. The\r\nbot-side redeem/token/unlink routes are Dispatch.Global.API.Controllers.BotLinkedAccountsController."},{"name":"Notification","description":"Banners are platform-wide, not org data, so this endpoint is anonymous."},{"name":"Organization","description":"The soft-check probe and registration itself. The org-side half of registration (schema,\r\nmigrations, business, address, primary user) is a private call to the main API -- see\r\nDispatch.Global.API.Services.IOrganizationRegistrationService."},{"name":"Subscription","description":"Every read requires any membership in the organization; every mutation requires\r\n`is_owner` (see Dispatch.Global.API.Services.SubscriptionService). `HandleRedirect` is anonymous."},{"name":"Support","description":"Any authenticated member of the organization can submit or update a ticket; there is no\r\nownership check. Listing all tickets requires Dispatch.Global.API.Security.RequirePlatformAdminAttribute."},{"name":"User","description":"Both routes are anonymous, with no tenant resolved yet, so they check\r\n`cargopilot_global.users` directly rather than an org-scoped table."},{"name":"WellKnown","description":"Publishes the public half of the signing key(s) so every other service can validate a\r\nGlobal-API-issued JWT offline. Anonymous by design — a JWKS document\r\ncarries no secret."}],"servers":[{"url":"https://global.miridia.io"}]}