@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Class CompanyResource

    Company (B2B) endpoints.

    A customer may belong to several companies (e.g. a buyer purchasing on behalf of multiple clients). Every method takes an optional companyId to say which company to act on. When omitted, the API falls back to the sole membership; if the customer belongs to several and none is given, the API responds 400 (COMPANY_SELECTION_REQUIRED). Read the full list from auth.getMe().companies.

    Index
    • Add a shipping address

      Parameters

      • address: Address
      • OptionalcompanyId: string

      Returns Promise<Address>

    • Get the company the customer is acting for.

      Parameters

      • OptionalcompanyId: string

      Returns Promise<Company>

    • Get all members of the company. Owner or admin only.

      Parameters

      • OptionalcompanyId: string

      Returns Promise<CompanyMember[]>

    • List pending invites. Owner or admin only.

      Parameters

      • OptionalcompanyId: string

      Returns Promise<CompanyInvite[]>

    • Remove a member from the company. Owner or admin.

      Parameters

      • memberId: string
      • OptionalcompanyId: string

      Returns Promise<{ success: boolean }>

    • Remove a shipping address

      Parameters

      • addressId: string
      • OptionalcompanyId: string

      Returns Promise<{ success: boolean }>

    • Revoke a pending invite. Owner or admin.

      Parameters

      • inviteId: string
      • OptionalcompanyId: string

      Returns Promise<{ success: boolean }>

    • Send a company membership invite. Owner or admin.

      Parameters

      Returns Promise<{ inviteId: string; success: boolean }>

    • Update the company's billing address

      Parameters

      • billingAddress: Address
      • OptionalcompanyId: string

      Returns Promise<Company>

    • Update a member's role. Owner only.

      Parameters

      • memberId: string
      • role: string
      • OptionalcompanyId: string

      Returns Promise<{ memberId: string; role: string; success: boolean }>

    • Update a shipping address in place. Returns the updated address.

      Parameters

      • addressId: string
      • address: Partial<Address>
      • OptionalcompanyId: string

      Returns Promise<Address>