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

> Capture a payment by it's paymentId. Having a payment that has been previously authorized is a prerequisite for capturing a payment.



## OpenAPI

````yaml openapi/payment-v1.json POST /v1/payments/{paymentId}/capture
openapi: 3.0.4
info:
  title: PaymentCoordinator.Api
  version: v1
servers:
  - url: https://{host}/payment
    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/payments/{paymentId}/capture:
    post:
      tags:
        - Service2Service
      summary: Capture payment
      description: >-
        Capture a payment by it's paymentId. Having a payment that has been
        previously authorized is a prerequisite for capturing a payment.
      parameters:
        - name: paymentId
          in: path
          description: The payment identifier
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/LoopFoundation.Commons.Contracts.WebServiceError
components:
  schemas:
    PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response:
      required:
        - paymentMethods
      type: object
      properties:
        paymentMethods:
          type: array
          items:
            $ref: >-
              #/components/schemas/PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response.PaymentMethod
          description: The collection of selected payment methods
      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
    PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response.PaymentMethod:
      required:
        - amount
        - type
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/PaymentCoordinator.Domain.Entities.TransactionEntryType
        amount:
          type: number
          description: The amount used to pay with that selected payment method
          format: double
        card:
          $ref: >-
            #/components/schemas/PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response.PaymentMethod.CardInfo
      additionalProperties: false
    PaymentCoordinator.Domain.Entities.TransactionEntryType:
      enum:
        - Bonus
        - Card
        - ExternalCard
        - LoyaltySubscription
      type: string
    PaymentCoordinator.Api.CQRS.Payment.Commands.Capture.Response.PaymentMethod.CardInfo:
      required:
        - pan
      type: object
      properties:
        pan:
          minLength: 1
          type: string
          description: The masked card pan
      additionalProperties: false
      description: The card information
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      name: Authorization
      in: header

````