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

# Create Payin

> Start a partner funding session (`bank_transfer`, momo, Interac,
Apple Pay, crypto checkout). Prefer `POST /payins/prepare` for static
bank / crypto address instructions. Requires `Idempotency-Key`.




## OpenAPI

````yaml /openapi.yaml post /payins
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:
    post:
      tags:
        - Payins
      summary: Create Payin
      description: |
        Start a partner funding session (`bank_transfer`, momo, Interac,
        Apple Pay, crypto checkout). Prefer `POST /payins/prepare` for static
        bank / crypto address instructions. Requires `Idempotency-Key`.
      operationId: createPayin
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: Client-generated key so retries return the same attempt.
          schema:
            type: string
            minLength: 1
            maxLength: 64
          example: payin-2026-10-27-001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePayinRequest'
            examples:
              bank_transfer:
                value:
                  method: bank_transfer
                  target_currency: GBP
                  amount: 10000
                  redirect_url: https://merchant.example/payins/return
      responses:
        '200':
          description: Funding attempt (may include checkout_url)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payin'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreatePayinRequest:
      type: object
      required:
        - method
        - target_currency
        - amount
      properties:
        method:
          type: string
          description: >-
            Funding method (`bank_transfer`, `momo`, `interac`, `crypto`,
            `apple_pay`, …).
          example: bank_transfer
        target_currency:
          type: string
          description: Book currency to credit.
          example: GBP
        amount:
          type: integer
          description: Amount in Ledger minor units (target, unless rail fields set).
          example: 10000
        rail_currency:
          type: string
          description: Optional rail currency when the payer pays in a different currency.
        rail_amount:
          type: integer
          description: Amount in `rail_currency` minor units when set.
        redirect_url:
          type: string
          format: uri
          description: >-
            Return URL after hosted checkout (required for open banking /
            Interac / crypto checkout).
        country_code:
          type: string
          description: ISO country hint.
        narration:
          type: string
          description: Optional payment memo.
        msisdn:
          type: string
          description: Mobile number for momo.
        channel:
          type: string
          description: Momo channel id.
        payer_name:
          type: string
          description: Optional payer name.
        payer_email:
          type: string
          format: email
          description: Optional payer email.
    Payin:
      type: object
      properties:
        object:
          type: string
          enum:
            - payin
          description: Object type discriminator.
        id:
          type: string
          format: uuid
          description: Payin attempt id.
        stan:
          type: string
          description: System trace / reference.
        method:
          type: string
          description: Funding method.
        target_currency:
          type: string
          description: Book currency to credit.
        rail_currency:
          type: string
          description: Currency on the payment rail when different.
        amount:
          type: integer
          description: Requested amount in target (or primary) minor units.
        rail_amount:
          type: integer
          description: Amount on the rail in rail minor units.
        target_amount:
          type: integer
          description: Expected credit to the target book in minor units.
        scale:
          type: integer
          description: Decimal places for `target_currency`.
        status:
          type: string
          description: >-
            Lifecycle status (`pending`, `processing`, `completed`, `failed`,
            …).
        checkout_url:
          type: string
          format: uri
          description: Hosted checkout URL when the method requires a redirect.
        redirect_url:
          type: string
          format: uri
          description: Return URL you supplied.
        source_kind:
          type: string
          description: Origin kind from prepare.
        collection_mode:
          type: string
          description: Prepare mode (`bank_details`, `crypto_address`, …).
        network:
          type: string
          description: Crypto network when applicable.
        instructions:
          type: object
          additionalProperties: true
          description: |
            Receive instructions for the payer (account number, bank name,
            wallet address, etc.). Shape depends on `collection_mode`.
        failure_reason:
          type: string
          description: Failure message when status is failed.
        created_at:
          type: string
          format: date-time
          description: Creation time (UTC).
        updated_at:
          type: string
          format: date-time
          description: Last status change (UTC).
        completed_at:
          type: string
          format: date-time
          description: When the deposit completed, if successful.
        livemode:
          type: boolean
          description: '`true` when created with a live key.'
        environment:
          type: string
          enum:
            - live
            - sandbox
          description: Environment of the creating API key.
    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.