On this page
createOrganization
mutation · in the family Organization structure
What it does
Create a new organization — one store or business unit in your group at your organization.
Create an Organization + its ENTIRE min-1 facility chain in the caller's org group — the CostCentre + the org + the first PF (referencing an EXISTING active PFL, tenant-scoped server-side) + first LF + first Zone + first Bin, in ONE atomic operation; requires the unrestricted capability.
Who may call it
Capability area: Organization structure — Opening and closing organizations and facilities — the legal and physical structure of your group.
- Owner
- System Administrator
- An API key whose scope allows
api:createOrganization
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | NewOrganizationInput NewOrganizationInput! | yes | No further notes. |
Returns
OrganizationCreation OrganizationCreation! — The composite org-create result — the org + its whole min-1 chain, ALL born in ONE atomic operation. The CostCentre rides organization.costCentre as its sysId.
Example request
mutation ExampleCreateOrganization($input: NewOrganizationInput!) {
createOrganization(input: $input) {
organization {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
jurisdiction
code
legalName
brandName
operatingAsName
owners
costCentre
primaryPhysicalFacility
defaultCurrency
stripeAccountRef
stripeChargesEnabled
stripeDetailsSubmitted
}
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"jurisdiction": "<jurisdiction>",
"code": "BJ-001",
"legalName": "Blue jeans",
"physicalFacility": {
"caption": "Blue jeans",
"physicalFacilityLocationId": "01900000-0000-7000-8000-4ff696030000"
},
"logicalFacility": {
"caption": "Blue jeans",
"classification": "<classification>"
},
"zone": {
"caption": "Blue jeans"
},
"bin": {
"caption": "Blue jeans",
"coordinates": "<coordinates>"
}
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createOrganization": {
"organization": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "OR-EXMP-0000-000F",
"type": "Organization",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"jurisdiction": "<jurisdiction>",
"code": "BJ-001",
"legalName": "Blue jeans",
"brandName": "Blue jeans",
"operatingAsName": "Blue jeans",
"owners": [
"01900000-0000-7000-8000-f89daae50000"
],
"costCentre": "<cost centre>",
"primaryPhysicalFacility": "01900000-0000-7000-8000-925e35910000",
"defaultCurrency": "<default currency>",
"stripeAccountRef": "<stripe account ref>",
"stripeChargesEnabled": true,
"stripeDetailsSubmitted": true
}
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. (VALIDATION)