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

# Mint a Tap-on-Phone access token

> Exchanges your API key for a short-lived access token for the Tap-on-Phone
SDK. Call this from your backend — the API key must never ship inside your
app — and pass the returned `access_token` to the SDK at initialization.

The token expires after `expires_in` seconds (default 15 minutes); mint a
fresh one when the SDK asks for a new token. The token's scope is limited to
the Tap-on-Phone surface: it cannot be used on any other API endpoint, and a
key that holds no Tap-on-Phone permission (`tap_on_phone.*`, or `*.*`)
cannot mint one.

Organizations may act for one of their own merchants by passing
`company_id`; the minted token is then bound to that merchant. A company
outside your scope answers 404.

Revoking the API key stops minting immediately; already-minted tokens stay
valid until they expire.




## OpenAPI

````yaml /api-spec.yaml post /v1/terminal/token
openapi: 3.1.0
info:
  title: Rinne API
  version: 1.0.0
  description: >
    **Rinne API** is a robust payment platform that offers integration with
    multiple payment providers.


    ## Authentication


    The API uses API Key authentication via the `x-api-key` header. Each company
    has a unique key to access resources.


    ## Response Format


    All responses follow a consistent format:

    - **Success**: Returns the requested data directly

    - **Error**: Returns an `error` object with detailed information


    ## Pagination


    Endpoints that return lists support pagination through parameters:

    - `page`: Page number (default: 1)

    - `limit`: Items per page (default: 20, maximum: 100)


    ## Supported Providers


    The API supports multiple payment providers:

    - **Rinne**: Internal provider

    - **Celcoin**: PIX integration and other financial services


    ## Raw Card Data (PCI Endpoints)


    Card credential fields (`card_data.number`, `card_data.cvv`,
    `card_data.network_token`,

    `card_data.cryptogram`, and the 3DS `card.number`) must always be sent
    encrypted —

    values start with the `ev:` prefix. Plaintext values are rejected with

    `400 VALIDATION_ERROR` on every host.


    There are two ways to send encrypted values:

    - **rinne-js**: card forms and wallet buttons (Apple Pay / Google Pay)
    encrypt
      credentials client-side before they leave the browser.
    - **PCI API host**: server-to-server integrations that handle raw card data
    must call
      `https://pci.api.rinne.com.br/core` (sandbox: `https://pci.api-sandbox.rinne.com.br/core`)
      instead of the regular host. This endpoint encrypts `number` and `cvv` in transit
      before the request reaches the API; all other fields pass through unchanged.

    The PCI host serves only transaction creation and 3DS session creation (both
    the

    self and merchant variants); use the regular host for everything else.
  contact:
    name: Rinne API Support
    email: suporte@rinne.com.br
servers:
  - url: https://api-sandbox.rinne.com.br/core
    description: Sandbox
  - url: https://api.rinne.com.br/core
    description: Production
security: []
tags:
  - name: System
    description: System and API health endpoints
  - name: Tap-on-Phone
    description: Access-token minting for the Tap-on-Phone SDK (called from your backend)
  - name: Authentication
    description: User authentication and authorization endpoints
  - name: Management
    description: >-
      Merchant management endpoints - create, list, get specific, overview,
      update
  - name: Transactions
    description: Transaction operations for merchants - create, list, overview, refunds
  - name: Affiliations
    description: Affiliation management for merchants
  - name: KYC
    description: KYC check history of your merchants
  - name: Banking
    description: Banking operations for merchants - balance, cashout, statements
  - name: Bank Accounts
    description: Bank account management for merchants
  - name: Pix Keys
    description: PIX key management for merchants
  - name: Company Transactions
    description: Direct transaction management and query endpoints for companies
  - name: Companies
    description: Company management
  - name: Company Affiliations
    description: Payment provider affiliation management
  - name: Company Banking
    description: Company banking endpoints (balance, etc.)
  - name: Company Pix
    description: Company PIX key management
  - name: Company Ledger
    description: Company ledger entry query endpoints
  - name: Company Disputes
    description: Company dispute query endpoints
  - name: Ledger
    description: Ledger entry query endpoints (company and merchants)
  - name: Disputes
    description: Dispute query endpoints for an organization's merchants
  - name: Cards
    description: Stored card management (self and merchant)
  - name: API Keys
    description: API key management - create, list, revoke (hashed, show-once)
  - name: Webhooks
    description: Endpoints for receiving webhooks from external providers
  - name: Pricing
    description: Fee and cost policy management for transaction pricing
  - name: Users
    description: User management endpoints
  - name: Roles
    description: Role management endpoints
  - name: Permissions
    description: Permission management endpoints
paths:
  /v1/terminal/token:
    post:
      tags:
        - Tap-on-Phone
      summary: Mint a Tap-on-Phone access token
      description: >
        Exchanges your API key for a short-lived access token for the
        Tap-on-Phone

        SDK. Call this from your backend — the API key must never ship inside
        your

        app — and pass the returned `access_token` to the SDK at initialization.


        The token expires after `expires_in` seconds (default 15 minutes); mint
        a

        fresh one when the SDK asks for a new token. The token's scope is
        limited to

        the Tap-on-Phone surface: it cannot be used on any other API endpoint,
        and a

        key that holds no Tap-on-Phone permission (`tap_on_phone.*`, or `*.*`)

        cannot mint one.


        Organizations may act for one of their own merchants by passing

        `company_id`; the minted token is then bound to that merchant. A company

        outside your scope answers 404.


        Revoking the API key stops minting immediately; already-minted tokens
        stay

        valid until they expire.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminalTokenRequest'
      responses:
        '200':
          description: The minted access token
          headers:
            Cache-Control:
              schema:
                type: string
                example: no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalTokenResponse'
        '401':
          description: Missing, unknown, revoked or expired API key, or company not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationErrorResponse'
        '403':
          description: The API key grants no Tap-on-Phone permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationErrorResponse'
        '404':
          description: The delegated `company_id` does not exist or is outside your scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TerminalTokenRequest:
      type: object
      properties:
        company_id:
          type: string
          format: uuid
          description: |
            Optional: an organization may mint a token for one of its own
            merchants by naming it here; omitted, the token is minted for the
            authenticated company itself. A company outside your scope answers
            404.
    TerminalTokenResponse:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
        - expires_at
        - scope
      properties:
        access_token:
          type: string
          description: Pass this to the Tap-on-Phone SDK at initialization.
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          description: Seconds until the token expires.
          example: 900
        expires_at:
          type: string
          format: date-time
        scope:
          type: string
          description: The Tap-on-Phone permissions the token carries.
          example: tap_on_phone.bootstrap tap_on_phone.config
    AuthenticationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: AUTHENTICATION_ERROR
            message:
              type: string
              example: Authentication required to access this resource
            status:
              type: integer
              example: 401
            details:
              type: object
              properties:
                reason:
                  type: string
                  example: Invalid API key
            path:
              type: string
              example: /companies/me
            timestamp:
              type: string
              format: date-time
              example: '2023-12-01T10:00:00.000Z'
            requestId:
              type: string
              example: req_123456789
    AuthorizationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: AUTHORIZATION_ERROR
            message:
              type: string
              example: You need 'admin' permissions to access this resource
            status:
              type: integer
              example: 403
            path:
              type: string
              example: /companies
            timestamp:
              type: string
              format: date-time
              example: '2023-12-01T10:00:00.000Z'
            requestId:
              type: string
              example: req_123456789
    NotFoundErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: RESOURCE_NOT_FOUND
            message:
              type: string
              example: Company with ID '123' not found
            status:
              type: integer
              example: 404
            path:
              type: string
              example: /companies/me
            timestamp:
              type: string
              format: date-time
              example: '2023-12-01T10:00:00.000Z'
            requestId:
              type: string
              example: req_123456789
    InternalServerErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: INTERNAL_SERVER_ERROR
            message:
              type: string
              example: An unexpected error occurred
            status:
              type: integer
              example: 500
            path:
              type: string
              example: /companies
            timestamp:
              type: string
              format: date-time
              example: '2023-12-01T10:00:00.000Z'
            requestId:
              type: string
              example: req_123456789
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Company API key for authentication

````