N1Developer docsv1

Organisation · v1

MUTATION

createOrganization

Live

Create an organization and owner account

Public signup. Creates the organization and first owner, then returns access and refresh tokens. Anonymous requests must contain only this mutation root field, without aliases, fragments, batching, or other operations. SIGNUP_DISABLED, EMAIL_ALREADY_REGISTERED, PHONE_ALREADY_REGISTERED, RATE_LIMITED.

POST/graphqlapp audience

Who can call this. Public signup.

Headers

  • AuthorizationstringOptional

    Bearer <token>, issued for this endpoint's audience. The token decides the shop and roles; nothing in the request body can change them.

    Example: Bearer eyJhbGciOiJFZERTQSJ9…

  • Content-TypestringRequired

    Always application/json. Only POST is accepted.

    Example: application/json

  • X-N1-Public-OperationstringRequired

    Set to createOrganization to select the only unauthenticated GraphQL operation. The server rejects aliases, fragments, batching, multiple operations, and any other root field.

    Example: createOrganization

  • X-Request-IdstringOptional

    Your id for this request (8–128 characters of A–Z a–z 0–9 . _ : -). Echoed back in the response header and in every error, so you can quote it when reporting a problem. Core makes one if you send none.

    Example: app-7f3c2a9e-checkout

Arguments

  • The new shop and owner.

    Example: {"yourName":"Synthetic Owner","name":"Example Machine Works","businessEmail":"owner@example.test","phone":"+919876543210","gstin":"27QWERT1234M1ZO","password":"ExamplePass123","address":{"line1":"1 Synthetic Road","city":"Chennai","state":"Tamil Nadu","pincode":"600001"}}

    Show children
    • Registered address.

    • businessEmailString!Required

      Business email; it is the owner’s sign-in email.

    • gstinString!Required

      15-character GSTIN with a valid state, PAN, and checksum.

    • nameString!Required

      The organization or shop name.

    • passwordString!Required

      At least 10 characters, including letters and digits.

    • phoneString!Required

      Owner’s phone number in E.164 format.

    • yourNameString!Required

      Your full name.

Returns

  • createOrganizationCreateOrganizationPayload!Required

    Public signup. Creates the organization and first owner, then returns access and refresh tokens. Anonymous requests must contain only this mutation root field, without aliases, fragments, batching, or other operations. SIGNUP_DISABLED, EMAIL_ALREADY_REGISTERED, PHONE_ALREADY_REGISTERED, RATE_LIMITED.

    Show children
    • accessTokenString!Required

      Short-lived access token.

      Example: "example-jwt-access-token"

    • expiresInInt!Required

      Access-token lifetime in seconds.

      Example: 900

    • organizationCreatedOrganization!Required

      The newly created organization.

      Example: {"id":"0192f0c1-0000-7000-8000-00000000000a","code":"org-0123456789abcd","name":"Example Machine Works"}

      Show children
      • codeString!Required

        Server-generated organization code.

        Example: "org-0123456789abcd"

      • idID!Required

        Tenant id.

        Example: "0192f0c1-0000-7000-8000-00000000000a"

      • nameString!Required

        Organization name.

        Example: "Example Machine Works"

    • refreshExpiresInSecondsInt!Required

      Refresh-token lifetime in seconds.

      Example: 2592000

    • refreshTokenString!Required

      Rotating refresh token.

      Example: "example-refresh-token"

    • userIdID!Required

      The first owner’s user id.

      Example: "0192f0c1-0000-7000-8000-00000000000b"

Errors

CodeHTTPWhen
SIGNUP_DISABLED403Public organization creation is disabled for this environment.
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.

Every error has the same body. See Errors.

Rate limit tier

Tier: per IP. Over the limit you get RATE_LIMITED (HTTP 429) with a Retry-After header. See Response handling.

Search documentation

Search operations, types and errors from the generated contract.