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

# Payin Preview

> Fee + indicative FX before `POST /payins/prepare`. Use the same `mode`
and currencies you will send to prepare.




## OpenAPI

````yaml /openapi.yaml post /payins/preview
openapi: 3.1.0
info:
  title: Keette API
  version: 1.0.0
  description: |
    Public HTTP API for Keette workspaces. One base URL — live vs sandbox is
    selected by your API key (`sk_live_…` / `sk_test_…`).

    Endpoints are added as each implementation phase ships.
  contact:
    name: Keette Support
    email: talk@keette.com
servers:
  - url: https://20b9-41-90-209-232.ngrok-free.app/v1
    description: Local (ngrok)
  - url: https://api.keette.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Identity for the authenticating API key
  - name: Balances
    description: Wallet books
  - name: Beneficiaries
    description: Payout recipients
  - name: Transactions
    description: Unified transaction index
  - name: FX
    description: Indicative rates and firm quotes
  - name: Catalog
    description: Payout corridors and relationships
  - name: Payouts
    description: Send money to a beneficiary
  - name: Payins
    description: Collect money into your books
  - name: Swaps
    description: FX between your own books
  - name: Events
    description: Durable event log for webhook polling
paths:
  /payins/preview:
    post:
      tags:
        - Payins
      summary: Payin Preview
      description: |
        Fee + indicative FX before `POST /payins/prepare`. Use the same `mode`
        and currencies you will send to prepare.
      operationId: payinPreview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayinPreviewRequest'
            examples:
              bank_details:
                value:
                  target_currency: NGN
                  mode: bank_details
                  amount: 5000000
      responses:
        '200':
          description: Preview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinPreview'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PayinPreviewRequest:
      type: object
      required:
        - target_currency
        - mode
        - amount
      properties:
        target_currency:
          type: string
          description: Book currency to credit.
          example: NGN
        source_currency:
          type: string
          description: Currency the payer funds in; defaults to `target_currency`.
        mode:
          type: string
          enum:
            - bank_details
            - crypto_address
            - momo
            - interac
          description: Collection mode (same values as prepare).
          example: bank_details
        amount:
          type: integer
          description: What the payer sends in `source_currency` minor units.
          example: 5000000
        channel:
          type: string
          description: Momo channel id when `mode` is `momo` (e.g. `KE-MPESA`).
        network:
          type: string
          description: Crypto network when `mode` is `crypto_address` (e.g. `base`).
    PayinPreview:
      type: object
      properties:
        object:
          type: string
          enum:
            - payin_preview
          description: Object type discriminator.
        target_currency:
          type: string
          description: Book currency that will be credited.
        source_currency:
          type: string
          description: Currency the payer funds in.
        mode:
          type: string
          description: Collection mode used for the estimate.
        method:
          type: string
          description: Start-compatible method string for `POST /payins`.
        pay_amount:
          type: integer
          description: Amount the payer should send (source minor units).
        fee:
          type: integer
          description: Total fee in `fee_currency` minor units.
        fee_currency:
          type: string
          description: Currency of the fee line.
        partner_fee:
          type: integer
          description: Partner portion of the fee.
        margin:
          type: integer
          description: Keette margin portion of the fee.
        credit_amount:
          type: integer
          description: Expected net credit to the target book.
        target_gross:
          type: integer
          description: Target-side amount before fee (after FX when cross-currency).
        rate:
          type: string
          description: Indicative FX rate when currencies differ.
        rate_as_of:
          type: string
          format: date-time
          description: When the indicative rate was observed.
        indicative:
          type: boolean
          description: '`true` when FX is not a firm locked quote.'
        product:
          type: string
          description: Pricing product key.
        channel:
          type: string
          description: Echo of momo channel when set.
        network:
          type: string
          description: Echo of crypto network when set.
        scale_source:
          type: integer
          description: Decimal places for `source_currency`.
        scale_target:
          type: integer
          description: Decimal places for `target_currency`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              description: Broad error class for client handling.
              enum:
                - invalid_request
                - authentication_error
                - permission_error
                - rate_limit
                - api_error
            code:
              type: string
              description: Stable machine-readable code (e.g. `parameter_invalid`).
            message:
              type: string
              description: Human-readable explanation safe to show developers.
            param:
              type: string
              description: Request field that failed validation, when applicable.
            doc_url:
              type: string
              format: uri
              description: Optional link to docs for this error.
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: authentication_error
              code: invalid_api_key
              message: Invalid API key provided.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        Secret API key from **Settings → Developers → API keys**.
        Example: `Authorization: Bearer sk_test_…`

````

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