BizCARE MyInvois
Shopify Integration/User Management

User Organizations

Retrieve all organizations associated with a specific user

User Organizations

Retrieve all organizations that a specific user is a member of, including their role and membership details.

Endpoint

GET /api/integrations/users/{id}/organizations

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the user

Response Format

{
  "data": [
    {
      "id": "org-123",
      "name": "Acme Corporation",
      "slug": "acme-corp",
      "logo": "https://example.com/logos/acme.png",
      "memberCount": 25,
      "premiumTier": {
        "id": "tier-premium",
        "name": "Premium",
        "features": ["advanced-reporting", "priority-support"]
      },
      "membership": {
        "id": "member-456",
        "role": "admin",
        "createdAt": "2024-01-15T10:30:00Z"
      },
      "createdAt": "2024-01-10T08:00:00Z"
    },
    {
      "id": "org-789",
      "name": "Tech Startup Inc",
      "slug": "tech-startup",
      "logo": null,
      "memberCount": 8,
      "premiumTier": null,
      "membership": {
        "id": "member-789",
        "role": "customer",
        "createdAt": "2024-01-20T14:15:00Z"
      },
      "createdAt": "2024-01-18T12:30:00Z"
    }
  ],
  "meta": {
    "total": 2,
    "count": 2
  }
}

Examples

Basic Request

curl -X GET "https://api.example.com/api/integrations/users/user-123/organizations" \
  -H "X-Invois-Key: your-api-key-here"

JavaScript Example

const response = await fetch('https://api.example.com/api/integrations/users/user-123/organizations', {
  method: 'GET',
  headers: {
    'X-Invois-Key': 'your-api-key-here',
    'Content-Type': 'application/json'
  }
});

const userOrganizations = await response.json();
console.log(`User belongs to ${userOrganizations.meta.total} organizations`);

Response Fields

Organization Fields

FieldTypeDescription
idstringUnique organization identifier
namestringOrganization name
slugstringURL-friendly organization identifier
logostringOrganization logo URL (nullable)
memberCountintegerTotal number of organization members
premiumTierobjectPremium tier information (nullable)
createdAtstringOrganization creation timestamp

Membership Fields

FieldTypeDescription
idstringUnique membership identifier
rolestringUser's role in the organization
createdAtstringMembership creation timestamp

Premium Tier Fields

FieldTypeDescription
idstringPremium tier identifier
namestringTier name
featuresarrayList of available features

Membership Roles

Users can have different roles within organizations:

  • admin - Administrative access to the organization
  • customer - Standard member access
  • owner - Full ownership and control (if applicable)

Error Responses

  • 401 Unauthorized - Invalid or missing API key
  • 404 Not Found - User not found
  • 429 Too Many Requests - Rate limit exceeded

Use Cases

This endpoint is useful for:

  • Displaying user's organization memberships
  • Checking user permissions across organizations
  • Understanding user's access levels
  • Building organization-based navigation

Next Steps