> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Imports or updates members.

> This endpoint will handle adding new members or updating existing members based on the provided data.



## OpenAPI

````yaml openapi/member-v1.json POST /v1/members/import
openapi: 3.0.4
info:
  title: MemberService.Api
  version: v1
servers:
  - url: https://{host}/member
    description: Your Lobyco environment
    variables:
      host:
        default: your-environment.lobyco.net
        description: >-
          The API host for your Lobyco environment. Replace it with the host you
          were given — this placeholder does not resolve.
security:
  - Bearer: []
paths:
  /v1/members/import:
    post:
      tags:
        - Service2Service
      summary: Imports or updates members.
      description: >-
        This endpoint will handle adding new members or updating existing
        members based on the provided data.
      requestBody:
        description: Members to import or update
        content:
          application/json:
            schema:
              minItems: 1
              type: array
              items:
                $ref: >-
                  #/components/schemas/MemberService.Api.CQRS.Models.UpsertMemberRequest
          text/json:
            schema:
              minItems: 1
              type: array
              items:
                $ref: >-
                  #/components/schemas/MemberService.Api.CQRS.Models.UpsertMemberRequest
          application/*+json:
            schema:
              minItems: 1
              type: array
              items:
                $ref: >-
                  #/components/schemas/MemberService.Api.CQRS.Models.UpsertMemberRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/MemberService.Api.CQRS.Models.UpsertMembersResult
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    MemberService.Api.CQRS.Models.UpsertMemberRequest:
      required:
        - createdAt
        - isActive
        - memberId
      type: object
      properties:
        memberId:
          maxLength: 36
          minLength: 1
          type: string
          description: Member ID
        email:
          maxLength: 256
          type: string
          description: Member's email address
          nullable: true
        firstName:
          maxLength: 64
          type: string
          description: Member's first name
          nullable: true
        lastName:
          maxLength: 64
          type: string
          description: Member's last name
          nullable: true
        phone:
          maxLength: 32
          type: string
          description: Member's phone number
          nullable: true
        birthdate:
          type: string
          description: Member's birthdate in ISO 8601 format (e.g., "2012-03-19T07:22Z")
          format: date-time
          nullable: true
        address:
          $ref: '#/components/schemas/MemberService.Api.Controllers.DTOs.AddressDto'
        isActive:
          type: boolean
          description: Indicates whether the member account is active
        createdAt:
          type: string
          description: >-
            Date and time when the member account was created in ISO 8601 format
            (e.g., "2012-03-19T07:22Z")
          format: date-time
        genderId:
          type: string
          description: Member's gender identifier
          nullable: true
        selectedStoreId:
          maxLength: 64
          type: string
          description: ID of the member's preferred store
          nullable: true
        loyaltyProgram:
          maxLength: 64
          type: string
          description: Loyalty program or tier (e.g., Silver, Gold, Freemium)
          nullable: true
        isEmployee:
          type: boolean
          description: Indicates whether the member is an employee
        nationality:
          maxLength: 64
          type: string
          description: Member's nationality
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Additional metadata associated with the member
          nullable: true
        deceased:
          type: boolean
          description: Indicates whether the member is deceased
          nullable: true
        homeTelephone:
          maxLength: 32
          type: string
          description: Member's home telephone number
          nullable: true
        isMembershipFeePaid:
          type: boolean
          description: Indicates whether the membership fee has been paid
          nullable: true
        customProperties:
          type: object
          additionalProperties:
            nullable: true
          description: Custom typed properties to assign to the member
          nullable: true
      additionalProperties: false
    MemberService.Api.CQRS.Models.UpsertMembersResult:
      type: object
      properties:
        importedCount:
          type: integer
          format: int32
        updatedCount:
          type: integer
          format: int32
        skipped:
          type: array
          items:
            $ref: >-
              #/components/schemas/MemberService.Api.CQRS.Models.UpsertMembersResult.SkippedEntry
          nullable: true
      additionalProperties: false
    LoopFoundation.Commons.Contracts.WebServiceError:
      required:
        - message
        - name
      type: object
      properties:
        name:
          minLength: 1
          type: string
        message:
          minLength: 1
          type: string
        details:
          nullable: true
      additionalProperties: false
    MemberService.Api.Controllers.DTOs.AddressDto:
      type: object
      properties:
        zipCode:
          maxLength: 8
          type: string
          description: Postal code of the member's address
          nullable: true
        city:
          maxLength: 32
          type: string
          description: City where the member lives
          nullable: true
        addressLine1:
          maxLength: 128
          type: string
          description: Street name and street number
          nullable: true
        addressLine2:
          maxLength: 64
          type: string
          description: Apartment number
          nullable: true
        region:
          maxLength: 32
          type: string
          description: Region where the member lives
          nullable: true
        countryCode:
          maxLength: 2
          type: string
          description: Code of country where the member lives
          nullable: true
      additionalProperties: false
    MemberService.Api.CQRS.Models.UpsertMembersResult.SkippedEntry:
      type: object
      properties:
        memberId:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````