> ## 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 Fee

> Estimate partner + Keette fee before starting a deposit.



## OpenAPI

````yaml /openapi.yaml post /payins/fee
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/fee:
    post:
      tags:
        - Payins
      summary: Payin Fee
      description: Estimate partner + Keette fee before starting a deposit.
      operationId: payinFee
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayinFeeRequest'
            examples:
              bank:
                value:
                  method: bank_transfer
                  target_currency: NGN
                  amount: 5000000
      responses:
        '200':
          description: Fee quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayinFee'
              examples:
                fee:
                  value:
                    object: payin_fee
                    currency: NGN
                    amount: 5000000
                    partner_fee: 0
                    margin: 5000
                    fee: 5000
                    credit_amount: 4995000
                    scale: 2
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PayinFeeRequest:
      type: object
      required:
        - target_currency
        - amount
      properties:
        method:
          type: string
          description: |
            Funding method. Accepted values: `bank_transfer`, `momo`, `interac`,
            `crypto`, `apple_pay`. `bank_details` / `bank` are aliases for
            `bank_transfer`. Provide `method` or `mode`.
          example: bank_transfer
        mode:
          type: string
          description: |
            Alternative to `method` using prepare modes (`bank_details`,
            `crypto_address`, `momo`, `interac`). Mapped to the matching method
            for pricing.
          example: bank_details
        target_currency:
          type: string
          description: Book currency that will be credited.
          example: NGN
        amount:
          type: integer
          description: >-
            Funding amount in Ledger minor units of `currency` (or target when
            omitted).
          example: 5000000
        currency:
          type: string
          description: >-
            Currency of `amount` for the fee quote; defaults to
            `target_currency`.
    PayinFee:
      type: object
      properties:
        object:
          type: string
          enum:
            - payin_fee
          description: Object type discriminator.
        currency:
          type: string
          description: Currency of the quoted amounts.
        amount:
          type: integer
          description: Requested funding amount in minor units.
        partner_fee:
          type: integer
          description: Partner rail cost in minor units.
        margin:
          type: integer
          description: Keette concession / margin in minor units.
        fee:
          type: integer
          description: Total fee charged to the payer (`partner_fee` + `margin`).
        credit_amount:
          type: integer
          description: Net amount expected to credit the book after fees.
        margin_source:
          type: string
          description: Pricing source for the margin line.
        product:
          type: string
          description: Internal pricing product key.
        scale:
          type: integer
          description: Decimal places for the 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.