> ## 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 a payment transaction

> Create a payment transaction using the active account of the member. The transaction created is in waiting state, in order to complete the transaction use capture or cancel endpoints. The operation is idempotent.



## OpenAPI

````yaml openapi/bonus-v1.json POST /v1/members/{memberId}/payments
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}/payments:
    post:
      tags:
        - Service2Service
      summary: Create a payment transaction
      description: >-
        Create a payment transaction using the active account of the member. The
        transaction created is in waiting state, in order to complete the
        transaction use capture or cancel endpoints. The operation is
        idempotent.
      parameters:
        - name: memberId
          in: path
          description: The id of the member, max length 36.
          required: true
          schema:
            maxLength: 36
            type: string
      requestBody:
        description: Reservation operation details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentResponse
        '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
      deprecated: true
components:
  schemas:
    Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentRequest:
      required:
        - amount
        - operationId
        - reserveAvailable
      type: object
      properties:
        operationId:
          maxLength: 128
          minLength: 1
          type: string
          description: >-
            Unique identifier of reserve operation (should be same only for
            retries of the same operation).
        amount:
          type: number
          description: |-
            Amount to be reserved.
            Can be only positive.
          format: double
        reserveAvailable:
          type: boolean
          description: >-
            Indicates whether to reserve account's available balance if it is
            less than amount to reserve.
        metadata:
          type: object
          additionalProperties:
            nullable: true
          description: >-
            Set of key-value pairs that you can attach to a payment transaction.

            This can be useful for storing additional information about the
            transaction in a structured format.
          nullable: true
        accountType:
          type: string
          description: Account type to be used (optional)
          nullable: true
      additionalProperties: false
    Accounting.Api.Controllers.Service2Service.Models.CreateMemberPaymentResponse:
      required:
        - conversionRate
        - reservedAmount
        - transactionId
      type: object
      properties:
        transactionId:
          type: integer
          description: Unique transaction id of the reservation.
          format: int64
        reservedAmount:
          type: number
          description: Amount which has been reserved.
          format: double
        conversionRate:
          type: number
          description: Amount which has been reserved.
          format: double
      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

````