@nevermined-io/payments
    Preparing search index...

    Class OrganizationsAPI

    Hierarchy

    • BasePaymentsAPI
      • OrganizationsAPI
    Index

    Constructors

    Properties

    accountAddress: string
    appId?: string
    currentOrganizationId: string | null
    environment: EnvironmentInfo
    environmentName: EnvironmentName
    heliconeApiKey: string
    isBrowserInstance: boolean = true
    nvmApiKey: string
    returnUrl: string
    scheme: "nvm"
    version?: string

    Methods

    • Connect user with Stripe

      Parameters

      • userEmail: string

        The email of the user

      • userCountryCode: string

        The country code of the user

      • returnUrl: string

        The return URL after the Stripe connection is completed

      Returns Promise<StripeCheckoutResult>

      The Stripe checkout result including the stripe account link, stripe account id, user id, user country code, link created at and link expires at. The stripe account link is the link that the user needs to click to connect with Stripe.

    • Create a new member in the organization

      Parameters

      • userId: string

        The unique external ID of the new member

      • OptionaluserEmail: string

        The email of the new member

      • OptionaluserRole: OrganizationMemberRole

        The role of the new member

      Returns Promise<CreateUserResponse>

      The created member

    • It returns the account address associated with the NVM API Key used to initialize the Payments Library instance.

      Returns string | undefined

      The account address extracted from the NVM API Key

    • Internal

      Returns the HTTP options required to query the backend.

      Parameters

      • method: string

        HTTP method.

      • Optionalbody: any

        Optional request body.

      • OptionalextraHeaders: Record<string, string>

        Optional per-call header overrides. Use { 'X-Current-Org-Id': orgId } to target a specific workspace for one call without mutating the instance-level pin.

      Returns any

      HTTP options object.

    • Parameters

      • Optionalrole: OrganizationMemberRole

        The role of the members to get

      • OptionalisActive: boolean

        The active status of the members to get

      • page: number = 1

        The page of the members to get

      • offset: number = 100

        The number of members to get per page

      Returns Promise<OrganizationMembersResponse>

      The list of members

    • Lists every organization the authenticated user is an active member of, with their role and the organization's tier.

      Powers workspace pickers in third-party tools built on the SDK, and the "where will this publish?" UX when a user belongs to multiple orgs.

      Returns Promise<MyMembership[]>

      An array of MyMembership — empty when the user has no active memberships and operates as a personal account.

      const memberships = await payments.organizations.getMyMemberships()
      for (const m of memberships) {
      console.log(`${m.orgName}${m.role}`)
      }
    • Returns the current organization context applied to every authenticated backend request via the X-Current-Org-Id header.

      null means "no pinned workspace" — the backend falls back to the caller's API-key tag or most-recent active membership.

      Returns string | null

    • Internal

      Get HTTP options for public backend requests (no authorization header). Converts body keys from snake_case to camelCase for consistency.

      Parameters

      • method: string

        HTTP method

      • Optionalbody: any

        Optional request body (keys will be converted to camelCase)

      Returns {
          body?: string;
          headers: { Accept: string; "Content-Type": string };
          method: string;
      }

      HTTP options object

    • Parses the NVM API Key to extract the account address.

      Returns { accountAddress: string; heliconeApiKey: string }

      PaymentsError if the API key is invalid.

    • Sets the organization context applied to every subsequent authenticated backend request via the X-Current-Org-Id header.

      Pass null to clear the pin and fall back to the backend default.

      Parameters

      • organizationId: string | null

        Org ID (e.g. org-…) or null to clear.

      Returns void