> ## 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 an administrative command to a payment terminal. These commands do not start a payment.

The response is returned immediately after the command is dispatched to the terminal, with status PENDING. The terminal's response is processed asynchronously. Use [GET /admin/terminals/operations](/checkout-api/terminals/admin_terminals_operations_get) to see how the operation finished.

While another operation of the same type is pending on the terminal, 409 is returned.

Each operation also requires the terminal to be in a suitable status. The `operation` field below lists the status for each. The request is rejected with 400 when the status does not allow it.

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: 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-config-payout-destinations
    x-displayName: Sellers
    description: Get payout data for sellers
  - name: Card Tokens
    description: |
      Manage card tokens
  - name: terminals
    x-displayName: Terminals
    description: Terminal operations
  - name: v2-fund-transfers
    x-displayName: Fund transfers
    description: Transfer funds between sellers
  - name: payout-destinations
    x-displayName: payout destinations
    description: |
      Payout destinations
  - name: account-stores
    x-displayName: stores
    description: |
      Manage account stores
  - name: account-terminals
    x-displayName: terminals
    description: |
      Manage account terminals
  - name: report-configuration
    x-displayName: Report configuration
    description: Manage report configurations
  - name: kpi
    x-displayName: KPI
    description: Get KPI data
paths:
  /accounts/{aid}/payments/admin/terminals/operations:
    parameters:
      - $ref: '#/components/parameters/accountId'
    post:
      tags:
        - terminals
      summary: admin_terminals_operations_post
      description: >
        Send an administrative command to a payment terminal. These commands do
        not start a payment.


        The response is returned immediately after the command is dispatched to
        the terminal, with status PENDING. The terminal's response is processed
        asynchronously. Use [GET
        /admin/terminals/operations](/checkout-api/terminals/admin_terminals_operations_get)
        to see how the operation finished.


        While another operation of the same type is pending on the terminal, 409
        is returned.


        Each operation also requires the terminal to be in a suitable status.
        The `operation` field below lists the status for each. The request is
        rejected with 400 when the status does not allow it.


        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':
          description: |
            Invalid request, or the terminal's status does not allow the
            operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/AccessForbidden'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Operation of the same type already pending for the 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: []
        - apikey: []
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
          description: >
            The command to send to the terminal.

            - `end_of_day`: close the terminal's current batch and settle it
            with the acquirer. Run once per trading day, after the last payment.
            Requires the terminal to be `ACTIVE`.

            - `send_logs`: have the terminal upload its log files for
            troubleshooting. Requires the terminal to be `ACTIVE`.

            - `check_update`: have the terminal check for a software update and
            install one if available. The terminal can become unresponsive for a
            time while updating. Allowed when the terminal is `ACTIVE`,
            `PENDING` or `ACTION_REQUIRED`.

            - `open_menu`: open the settings menu on the terminal's own screen
            for an operator standing at the device. Allowed for any terminal
            status except `PENDING`.

            - `poll_terminal`: ping the terminal to see whether it is online and
            responding. Has no effect on the device and is allowed regardless of
            terminal status.

            - `print_text`: print lines on the terminal's printer. Dintero does
            not compose or check the content. Requires the terminal to be
            `ACTIVE`.

            - `print_receipt`: print a copy of the payment receipt of an
            in-person transaction. Requires the terminal to be `ACTIVE`.
          enum:
            - end_of_day
            - send_logs
            - check_update
            - open_menu
            - poll_terminal
            - print_text
            - print_receipt
        parameters:
          type: object
          description: >
            Parameters for the chosen `operation`.

            - `end_of_day`: optional. `operator_id` (string) is the operator
            that runs end of day. Default: the current active operator.

            - `print_text`: required. `lines` is an array of 1 to 255 lines.
            Each line has `text` (string, max 255 bytes), `size` (`small`,
            `medium` or `large`) and `align` (`left`, `center` or `right`). A
            line fits 29 characters at `small` and `medium`, and 15 at `large`.

            - `print_receipt`: required. `transaction_id` (string) is the
            transaction to print the receipt for. `type` is `customer` or
            `merchant`.

            - Other operations take no parameters.
    TerminalOperation:
      type: object
      discriminator:
        propertyName: operation
      description: |
        Terminal operation. The shape depends on the operation field. When
        present, the fields inside `result` are camelCase, unlike the rest of
        the operation.
      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
          description: >
            The command that was sent to the terminal.

            - `end_of_day`: close the terminal's current batch and settle it
            with the acquirer. Run once per trading day, after the last payment.

            - `send_logs`: have the terminal upload its log files for
            troubleshooting. The logs are not returned through this API.

            - `check_update`: have the terminal check for a software update and
            install one if available. May reboot the terminal.

            - `open_menu`: open the settings menu on the terminal's own screen
            for an operator standing at the device. The terminal cannot take
            payments while the menu is open.

            - `poll_terminal`: ping the terminal to see whether it is online and
            responding. Has no effect on the device.

            - `print_text`: print lines on the terminal's printer. Dintero does
            not compose or check the content.

            - `print_receipt`: print a copy of a transaction's payment receipt.
          enum:
            - end_of_day
            - send_logs
            - check_update
            - open_menu
            - poll_terminal
            - print_text
            - print_receipt
        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.


            Which statuses an operation can reach depends on the operation.
            `open_menu` and `poll_terminal` are never reported as `FAILED`,
            since the terminal does not report a failure for them - an
            unreachable terminal ends those operations as `TIMEOUT`.
            `end_of_day`, `send_logs`, `check_update`, `print_text` and
            `print_receipt` can be `FAILED` when the terminal answers but
            reports a problem; the `result` of the operation says what it was.
          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:
    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
    apikey:
      type: apiKey
      in: header
      description: >
        X-API-Key authentication for accessing regular endpoints. Use

        [Create api-key](/checkout-api/api-keys/admin_api_keys_post) to create a
        key.


        The content of the header should look like the following:

            x-api-key: {api_key}
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.