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

# Capture transaction

> Resource used to capture a transaction.



## OpenAPI

````yaml /openapi/legacy/payments/payment-provider-to-bango/openapi.yaml put /transaction/{transactionId}
openapi: 3.0.0
info:
  title: Bango Payment Provider API
  description: |
    Changelog
    * 1.0.1: Initial release
  version: 1.0.1
servers:
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/BangoProducts/payment-provider_api/1.0.1
security:
  - oAuth2ClientCredentials: []
paths:
  /transaction/{transactionId}:
    put:
      tags:
        - Transaction
      summary: Capture transaction
      description: Resource used to capture a transaction.
      operationId: CaptureTransaction
      parameters:
        - name: transactionId
          in: path
          required: true
          schema:
            type: string
        - name: X-RequestIdentifier
          in: header
          required: false
          description: >-
            Request unique identifier. If present, this id will be used for
            idempotency.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionRequest'
      responses:
        '200':
          description: Transaction captured successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        '202':
          description: Request accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
              examples:
                DECLINED:
                  value:
                    responseCode: DECLINED
                    responseMessage: Payment request declined.
                SPEED_LIMIT:
                  value:
                    responseCode: SPEED_LIMIT
                    responseMessage: Request too soon after the previous one for this user.
                USER_BARRED:
                  value:
                    responseCode: USER_BARRED
                    responseMessage: The user is not allowed to use this payment method.
                USER_NOT_ENABLED:
                  value:
                    responseCode: USER_NOT_ENABLED
                    responseMessage: User is not enabled for payments.
                USER_SPEND_LIMIT:
                  value:
                    responseCode: USER_SPEND_LIMIT
                    responseMessage: The user has hit a spend limit.
                USER_SUSPENDED:
                  value:
                    responseCode: USER_SUSPENDED
                    responseMessage: >-
                      The user is temporarily not allowed to use this payment
                      method.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
              examples:
                BAD_REQUEST:
                  value:
                    responseCode: BAD_REQUEST
                    responseMessage: Invalid request.
                INVALID_USER:
                  value:
                    responseCode: INVALID_USER
                    responseMessage: Invalid User.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
              example:
                responseCode: UNAUTHORIZED
                responseMessage: Invalid access credentials.
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
              example:
                responseCode: NOT_FOUND
                responseMessage: Invalid transaction id.
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
              examples:
                INTERNAL_ERROR:
                  value:
                    responseCode: INTERNAL_ERROR
                    responseMessage: The server encountered an unexpected condition.
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
              example:
                responseCode: SERVICE_UNAVAILABLE
                responseMessage: The server is undergoing maintenance.
components:
  schemas:
    TransactionRequest:
      required:
        - userIdentifier
        - paymentItem
        - paymentMethods
      type: object
      properties:
        userIdentifier:
          type: string
          example: '987654321'
        paymentMethods:
          type: array
          items:
            type: string
            example: OPERATORBILLING
        externalTransactionId:
          type: string
          example: my-tx-id-12345
        paymentItem:
          $ref: '#/components/schemas/PaymentItem'
        extensionData:
          $ref: '#/components/schemas/ExtensionData'
    TransactionResponse:
      required:
        - responseCode
        - responseMessage
      allOf:
        - $ref: '#/components/schemas/Response'
        - type: object
          properties:
            transactionId:
              type: string
              example: 123456789
    Response:
      required:
        - responseCode
        - responseMessage
      type: object
      properties:
        responseCode:
          type: string
          example: OK
        responseMessage:
          type: string
          example: Success.
    PaymentItem:
      type: object
      properties:
        itemName:
          type: string
          example: My item
        itemDescription:
          type: string
          example: My item description
        itemCategory:
          type: string
          example: '1'
        externalPaymentItemId:
          type: string
          example: abcd-1234
        price:
          $ref: '#/components/schemas/Price'
    ExtensionData:
      type: object
      properties:
        some:
          type: string
          example: 123-456-789
        some1:
          type: string
          example: 123-456-789
    Price:
      type: object
      properties:
        grossAmount:
          type: string
          example: '3.99'
        currencyIso3:
          type: string
          example: USD
        financialBreakdown:
          $ref: '#/components/schemas/FinancialBreakdown'
    FinancialBreakdown:
      type: object
      properties:
        taxAmount:
          type: string
          example: '0'
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      description: This API uses OAuth 2 with clientCredentials.
      flows:
        clientCredentials:
          tokenUrl: https://api.network.com/oauth2/token/
          scopes: {}

````