> ## 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.

# Create new member account

> Create a new account attached to a member



## OpenAPI

````yaml openapi/bonus-v1.json POST /v1/members/{memberId}/accounts
openapi: 3.0.4
info:
  title: Accounting.Api
  version: v1
servers:
  - url: https://{host}/bonus
    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/{memberId}/accounts:
    post:
      tags:
        - Service2Service
      summary: Create new member account
      description: Create a new account attached to a member
      parameters:
        - name: memberId
          in: path
          description: The id of the member, max length 36
          required: true
          schema:
            maxLength: 36
            type: string
        - name: Operation-Id
          in: header
          description: >-
            The operation id used for idempotency. Use this header to make sure
            the request is idempotent
          schema:
            type: string
      requestBody:
        description: Create account request
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.MemberController.CreateAccountRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.MemberController.CreateAccountRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.MemberController.CreateAccountRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Accounting.Api.CQRS.Commands.CreateMemberAccount.Response
        '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:
    Accounting.Api.Controllers.Service2Service.MemberController.CreateAccountRequest:
      required:
        - isActive
        - isAllowedToSpend
      type: object
      properties:
        isActive:
          type: boolean
        isAllowedToSpend:
          type: boolean
        accountType:
          type: string
          nullable: true
        externalId:
          maxLength: 60
          type: string
          nullable: true
      additionalProperties: false
    Accounting.Api.CQRS.Commands.CreateMemberAccount.Response:
      required:
        - accountId
      type: object
      properties:
        accountId:
          type: integer
          format: int64
      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
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````