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

# Post terminal operation

> Send a command to a payment terminal.

The response is returned immediately after the command is dispatched
to the terminal. The terminal's response is processed asynchronously.

scopes:
- admin:checkout
- write:checkout:/admin/terminals




## OpenAPI

````yaml /mintlify-docs/openapi/spec-payments-v2.yaml post /accounts/{aid}/payments/admin/terminals/operations
openapi: 3.0.0
info:
  title: Payments API v2
  contact:
    name: API Integration Support
    email: integration@dintero.com
  description: |
    Public endpoints for payments served under the account-scoped URL format
    `https://api.dintero.com/v1/accounts/{aid}/...`.
  version: LATEST
  license:
    name: UNLICENSED
    url: https://dintero.com
  x-logo:
    url: https://docs.dintero.com/img/dintero-dark-padded.svg
    altText: Dintero Logo
servers:
  - url: https://api.dintero.com/v1
security:
  - JWT: []
tags:
  - name: Transactions
    x-displayName: Transactions
    description: |
      View and perform operations on transactions
  - name: session
    x-displayName: Sessions
    description: |
      A Checkout Session relates to an order in your system.
      When an order has been placed you create a corresponding Checkout Session
      to receive payment for that order.
  - name: payment
    x-displayName: Payment
    description: |
      Resources used by the customer aka user to complete the payment of a
      session.
  - name: settlements
    x-displayName: Settlement reports
    description: Get settlement reports generated per payout
  - name: settlements.configuration
    x-displayName: Configuration
    description: Configure settlement reports
  - name: reports
    x-displayName: Reports
    description: List the generated monthly transaction reports
  - name: example-session-callbacks
    x-displayName: Callback
    description: |
      Example of recieved callbacks from Dintero's servers.
  - name: fund-transfers
    x-displayName: Fund Transfer
    description: Transfer funds between sellers
  - name: Sellers
    x-displayName: Sellers
    description: Manage the signup of a new Seller / Merchant account
  - name: example-session-callbacks
    x-displayName: Example Callbacks
    description: Example of callbacks delivered
  - name: v2-fund-transfers
    x-displayName: Fund Transfer
    description: Transfer funds between sellers
  - name: v2-config-payout-destinations
    x-displayName: Sellers
    description: Get payout data for sellers
paths:
  /accounts/{aid}/payments/admin/terminals/operations:
    parameters:
      - $ref: '#/components/parameters/accountId'
    post:
      tags:
        - terminals
      summary: admin_terminals_operations_post
      description: |
        Send a command to a payment terminal.

        The response is returned immediately after the command is dispatched
        to the terminal. The terminal's response is processed asynchronously.

        scopes:
        - admin:checkout
        - write:checkout:/admin/terminals
      operationId: admin_terminals_operations_post
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Optional idempotency key to ensure the operation is only executed
            once.
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminalOperationRequest'
        required: true
      responses:
        '200':
          description: Terminal operation created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalOperation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Operation already pending for terminal
          headers:
            Retry-After:
              description: |
                Indicates how many seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - JWT: []
components:
  parameters:
    accountId:
      name: aid
      description: |
        An id that uniquely identifies the account.
      in: path
      required: true
      schema:
        type: string
        format: ^[PT]{1}\d{8}$
        minLength: 9
        maxLength: 9
  schemas:
    TerminalOperationRequest:
      type: object
      discriminator:
        propertyName: operation
      required:
        - terminal_id
        - operation
      properties:
        terminal_id:
          type: string
          description: Terminal identifier
        operation:
          type: string
          enum:
            - end_of_day
            - send_logs
            - check_update
            - open_menu
    TerminalOperation:
      type: object
      discriminator:
        propertyName: operation
      description: Terminal operation. The shape depends on the operation field.
      required:
        - id
        - terminal_id
        - operation
        - status
        - created_at
        - created_by
        - updated_at
        - updated_by
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the terminal operation.
        account_id:
          type: string
          description: Account identifier the operation belongs to.
        terminal_id:
          type: string
          description: Identifier of the terminal the operation was sent to.
        operation:
          type: string
          enum:
            - end_of_day
            - send_logs
            - check_update
            - open_menu
        status:
          type: string
          description: >
            Status of the terminal operation.

            - `PENDING`: Operation has been dispatched to the terminal and is
            awaiting a response.

            - `COMPLETED`: Terminal has responded and the operation finished
            successfully.

            - `FAILED`: Terminal responded but reported a failure.

            - `TIMEOUT`: No response was received from the terminal within the
            timeout window. A new operation can be dispatched.
          enum:
            - PENDING
            - COMPLETED
            - FAILED
            - TIMEOUT
        created_at:
          type: string
          format: date-time
          description: When the operation was created.
        created_by:
          type: string
          description: Identity of the user or system that created the operation.
        updated_at:
          type: string
          format: date-time
          description: When the operation was last updated.
        updated_by:
          type: string
          description: Identity of the user or system that last updated the operation.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            code:
              type: string
              description: The code used to identify the error/warning
            errors:
              type: array
              description: The nested error(s) encountered during validation
              items:
                type: object
            message:
              type: string
              description: The human readable description of the error/warning
  responses:
    BadRequest:
      description: Bad / Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AccessForbidden:
      description: Access forbidden, invalid JWT token was used
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Unexpected Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    JWT:
      type: http
      description: >
        Bearer authentication (token authentication) should be used for
        accessing the API.


        Use [Get Token](/api-reference/authenticate/aid_auths_oauth_token_post)
        to get an access token for client credentials.

        Pass the token in the request header:

            Authorization: Bearer {access_token}

        where the **access_token** is JSON Web Tokens (JWT).
      scheme: bearer
      bearerFormat: JWT

````