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

# Collect payment (Pay-In)

> Collect payment from a customer via mobile money. Requires Authorization: Bearer <jwt>. Also send service and operation headers. OTP is required only for OTP-required services such as OM CI, OM SN, and OM BF.



## OpenAPI

````yaml POST /payments/payin
openapi: 3.1.0
info:
  title: GetMiPay API
  description: >-
    GetMiPay - Your universal gateway to getmipay. API for processing payments,
    payouts, and virtual cards through GetMiPay gateway.
  contact:
    name: GetMiPay Support
    email: support@getmipay.com
  license:
    name: Proprietary
    url: https://getmipay.com/
  version: 1.1.0
servers:
  - url: https://sandbox.getmipay.com/api
    description: Sandbox server
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: API authentication and token management
  - name: Services
    description: Get available payment services
  - name: Currency
    description: API for converting amounts between different currencies.
  - name: Payments
    description: Collect payments from customers
  - name: Payouts
    description: Send money to customers
  - name: Transactions
    description: Check transaction status
  - name: Balance
    description: Account balance management
  - name: Virtual Cards
    description: Virtual card creation and management
  - name: Webhooks
    description: Webhook endpoints for payment notifications
paths:
  /payments/payin:
    post:
      tags:
        - Payments
      summary: Initiate PayIn
      description: >-
        Collect payment from a customer via mobile money. Requires
        Authorization: Bearer <jwt>. Also send service and operation headers.
        OTP is required only for OTP-required services such as OM CI, OM SN, and
        OM BF.
      parameters:
        - name: operation
          in: header
          description: Operation type - must be '2' for PayIn
          required: true
          schema:
            type: string
            enum:
              - '2'
            example: '2'
        - name: service
          in: header
          description: |-
            Service identifier for the payment method.

            **Services requiring OTP:**
            - `3` - OM CI (Orange Money CÃƒÂ´te d'Ivoire)
            - `4` - OM SN (Orange Money Senegal)
            - `5` - OM BF (Orange Money Burkina Faso)
          required: true
          schema:
            type: string
            example: '1'
        - name: otp
          in: header
          description: >-
            One-Time Password for Orange Money services.


            **Required only for:** OM CI (service: 3), OM SN (service: 4), OM BF
            (service: 5)

            **Format:** Maximum 8 characters/digits

            **Note:** This header is optional for services that don't require
            OTP
          required: false
          schema:
            type: string
            maxLength: 8
            example: '123456'
      requestBody:
        description: Payment details to collect from customer
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayInRequest'
        required: true
      responses:
        '200':
          description: Payment initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayInResponse'
        '401':
          description: Unauthorized - Missing, invalid, or expired bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    PayInRequest:
      type: object
      required:
        - amount
        - currency
        - wallet
        - description
        - customer_name
      properties:
        amount:
          type: number
          minimum: 100
          example: 1000
          description: Amount in smallest currency unit (100 XAF = 1Ã¢â€šÂ¬)
        currency:
          type: string
          enum:
            - XAF
            - XOF
          default: XAF
          example: XAF
        wallet:
          type: string
          description: Customer mobile money wallet number
          example: '690000000'
        description:
          type: string
          maxLength: 255
          example: 'Payment for Order #123'
        customer_name:
          type: string
          maxLength: 255
          example: John Doe
        customer_email:
          type: string
          format: email
          example: john@example.com
        callback_url:
          type: string
          format: uri
          description: URL to receive payment status updates
          example: https://yourapp.com/webhooks/payment
    PayInResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Payment initiated successfully
        data:
          type: object
          properties:
            transaction_reference:
              type: string
              example: MPAYIN_ABC123DEF456
            soleaspay_reference:
              type: string
              example: MLS690d472dd7ee7B
            amount:
              type: number
              example: 1000
            fee_amount:
              type: number
              example: 50
              description: Fee amount deducted
            net_amount:
              type: number
              example: 950
              description: Net amount credited to merchant
            currency:
              type: string
              example: XAF
            status:
              type: string
              example: pending
            service_used:
              type: string
              example: '3'
            service_name:
              type: string
              example: OM CI
            otp_required:
              type: boolean
              example: true
              description: Indicates if OTP was required for this service
            payment_url:
              type: string
              description: URL to redirect customer for payment (if applicable)
              example: 'null'
            webhook_urls:
              type: object
              properties:
                success:
                  type: string
                  example: https://getmipay.com/api/webhooks/success
                failure:
                  type: string
                  example: https://getmipay.com/api/webhooks/failure
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid KEY
        error_code:
          type: string
          example: INVALID_PUBLIC_KEY
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer token returned by POST /action/auth. Send protected requests
        with: Authorization: Bearer <jwt>. Tokens expire after 24 hours.

````