Internal

Apply a Microsoft platform subscription's state to its organization (internal producers)

PUT
/v1/internal/platforms/microsoft/organizations/{orgId}/subscriptions/{subscriptionId}

Internal; default off, with the same flag and producer capability as provisionMicrosoftPlatformOrganization. Commerce sends each state its Microsoft lifecycle records for the subscription (plan change, Suspend, Reinstate, Unsubscribe), numbered by revision. Only the subscription the organization was created for is accepted. A higher revision applies: SUBSCRIBED grants the plan; SUSPENDED and UNSUBSCRIBED keep the plan with API access off, so decisions answer 402 until Reinstate. The same revision with the same state is replayed, an older one stale; neither changes anything. The organization's entitlement moves only while it is the default or this source's own (marketplace:microsoft:platform); otherwise the state is recorded and projected is false. 404 subscription_not_found when Core created no organization for this subscription; 409 subscription_conflict with reason subscription (another subscription), revision (the same revision with another state) or ended (a change after UNSUBSCRIBED); 422 plan_unknown for a plan code Core does not sell.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

An organization API key. Its scopes decide what it may call; decision:shadow is the narrowest: SHADOW evaluations through POST /v1/authority/grants or its alias POST /v1/authority/enforce-and-bind only (DECISION_SHADOW_MODE_DENIED in any other mode; DECISION_SHADOW_FIELD_DENIED for a body carrying context.decionis_policy, evidence or escalation), with no integration dispatch. A key whose only scope is decision:shadow (an AgentSafe hosted gateway's) reaches exactly those two, POST /v1/auth/credential-context, POST /v1/hosted-gateway/keys/confirm and POST /v1/hosted-gateway/keys/revoke-self; every other route answers 403 HOSTED_GATEWAY_KEY_PATH_DENIED. decision:enforce is an enforced hosted gateway's key: evaluations in SHADOW or ENFORCEMENT through POST /v1/authority/grants or its alias (400 DECISION_ENFORCE_FIELD_DENIED for a body carrying context.decionis_policy; it never holds policy:write), and the grants and managed escalations they bind. A key whose scopes are decision:enforce (with or without decision:shadow) reaches exactly POST /v1/authority/enforce-and-bind, POST /v1/authority/grants, GET /v1/authority/grants/{grant_id}, POST /v1/authority/grants/{grant_id}/claims, POST /v1/authority/grants/{grant_id}/receipts, POST /v1/authority/grants/{grant_id}/reconciliations, POST /v1/execution/verify-token, POST /v1/execution/claim-token, POST /v1/execution/consume-token, POST /v1/execution/finalize-token, GET /v1/authority/escalations/{escalation_id}, DELETE /v1/authority/escalations/{escalation_id}, POST /v1/auth/credential-context, POST /v1/hosted-gateway/keys/confirm and POST /v1/hosted-gateway/keys/revoke-self, each id a UUID; every other route answers 403 HOSTED_GATEWAY_KEY_PATH_DENIED.

In: header

Path Parameters

orgId*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
subscriptionId*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Request Body

application/json

core-microsoft-subscription-v1: one numbered state of a decionis-platform subscription. Commerce maps the Microsoft plan to plan_code by exact plan id in its registry; revision grows with every change it records for the subscription.

version*string
offer_id*string
Match^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$
plan_id*string
Match^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$
plan_code*string

A paid Core plan; any other code is 422 plan_unknown.

Value in

  • "build"
  • "starter"
  • "defence"
  • "premium"
  • "scale"
  • "enterprise"
status*string

Value in

  • "SUBSCRIBED"
  • "SUSPENDED"
  • "UNSUBSCRIBED"
revision*integer
Range1 <= value

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/internal/platforms/microsoft/organizations/string/subscriptions/string" \  -H "Content-Type: application/json" \  -d '{    "version": "core-microsoft-subscription-v1",    "offer_id": "string",    "plan_id": "string",    "plan_code": "build",    "status": "SUBSCRIBED",    "revision": 1  }'
{  "outcome": "applied",  "reason": "subscription",  "revision": 1,  "projected": true,  "entitlement": {    "plan_code": "string",    "decision_limit_monthly": 0,    "api_access": true,    "source": "string"  },  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "subscription_id": "aa11a4c2-a467-43db-b413-c4ab0f5cf627"}

Create the organization of a Microsoft platform purchase (internal producers) POST

Internal; default off (503 platform_workspaces_disabled until `DECIONIS_PLATFORM_WORKSPACES_ENABLED` is 1). Only a producer whose token (`DECIONIS_DELIVERY_PRODUCERS_JSON`) carries `platforms: ["microsoft"]` may call it: no token or an unknown one is 401 producer_required, any other producer 403 platform_not_allowed, and an organization key is never accepted. Commerce passes the workspace mapping Accounts signed for a `decionis-platform` purchase, with its evidence, verbatim. Core checks the version, platform, product and environment (400 otherwise); that the Accounts organization and workspace ids derive from source_org_id, that issued_at is within the last 10 minutes, and the Ed25519 signature over the canonical (sorted-key) mapping against the current Accounts JWKS (422 accounts_evidence_invalid with reason ids, stale or signature; 503 accounts_evidence_unavailable while the JWKS is unreachable). In one transaction it creates the organization with id = source_org_id, no Core owner, source product decionis and the production environment, its default entitlement, and the synchronized Accounts workspace reference, so the buyer's later Decionis sign-in to that workspace lands in this organization. The same reference again is 200 replayed; an existing organization with any other reference, a workspace already bound elsewhere, or an organization created for another subscription is 409 organization_conflict. No person, session or key is created. The optional `subscription` is the subscription's current state from Commerce's lifecycle, outside the signature: its paid plan becomes the organization's entitlement in the same transaction (422 plan_unknown for a plan code Core does not sell, before any write), and the answer reports what it did as `subscription`. Without it the organization gets the default entitlement.

Default off, broker only: redeem a TCP ticket into a lease POST

Internal broker only; excluded from public SDK methods. Default off. Check exact tenant, route, role, generation, credential, unconsumed ticket and current authorizing administrator/paid authority. Atomic admission limits are 128 live legs globally, 16 per organization and 8 per route. A consumed ticket remains consumed after broker restart. Compare every returned lease binding. Strict JSON, 4096-byte bodies, 2000 requests/minute.