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

# Capture waiting transaction V2

> Captures the specified amount from the reserved amount of the transaction. In case the amount is not specified, the full reserved amount of the transaction is captured.
The operation is idempotent.



## OpenAPI

````yaml openapi/bonus-v1.json POST /v2/transactions/{id}/capture
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:
  /v2/transactions/{id}/capture:
    post:
      tags:
        - Service2Service
      summary: Capture waiting transaction V2
      description: >-
        Captures the specified amount from the reserved amount of the
        transaction. In case the amount is not specified, the full reserved
        amount of the transaction is captured.

        The operation is idempotent.
      parameters:
        - name: id
          in: path
          description: Unique transaction id.
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Capture operation details.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CaptureTransactionRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CaptureTransactionRequest
          application/*+json:
            schema:
              $ref: >-
                #/components/schemas/Accounting.Api.Controllers.Service2Service.Models.CaptureTransactionRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Accounting.Api.CQRS.Commands.CaptureTransactionV2.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.Models.CaptureTransactionRequest:
      required:
        - operationId
      type: object
      properties:
        amount:
          type: number
          description: Amount which should be captured.
          format: double
          nullable: true
        cancelRemainingAmount:
          type: boolean
          description: |-
            If set and some amount is left after capture it will be canceled
            and transaction will be automatically completed.
            Optional - default value is 'false'.
          default: false
          nullable: true
        operationId:
          maxLength: 128
          minLength: 1
          type: string
          description: >-
            Unique identifier of the capture operation (should be the same only
            for retries of the same operation).
        metadata:
          type: object
          additionalProperties:
            nullable: true
          description: >-
            Optional property to extend metadata of transaction after it was
            created

            Only new properties (keys) are supported
          nullable: true
      additionalProperties: false
    Accounting.Api.CQRS.Commands.CaptureTransactionV2.Response:
      required:
        - remainingReservedAmount
        - state
      type: object
      properties:
        state:
          $ref: '#/components/schemas/Accounting.Domain.Entities.TransactionState'
        remainingReservedAmount:
          type: number
          description: >-
            Reserved amount of the transaction remaining after the capture
            operation.

            If the remaining reserved amount is zero then the transaction is
            finalized.
          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
    Accounting.Domain.Entities.TransactionState:
      enum:
        - Waiting
        - Successful
        - Cancelled
      type: string
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````