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

# Request Payment

> Initiate a payment request that requires user approval in the mobile app. The payment request is stored in Redis and expires after 5 minutes. Users receive a real-time notification via WebSocket.

Initiate a payment request that requires user approval in the mobile app. The payment request is stored in Redis and expires after 5 minutes. Users receive a real-time notification via WebSocket.


## OpenAPI

````yaml POST /wallet/request-payment
openapi: 3.1.0
info:
  title: Changu External Wallet Charging API
  description: >-
    API for developers to charge user wallets through encrypted wallet IDs.
    Requires developer authentication using Bearer token with secret key.
  version: 1.0.0
servers:
  - url: https://api.changu.app/api/v1
    description: Production
  - url: http://localhost:9287/api/v1
    description: Development
security:
  - bearerAuth: []
paths:
  /wallet/request-payment:
    post:
      tags:
        - Wallet
      summary: Request Payment
      description: >-
        Initiate a payment request that requires user approval in the mobile
        app. The payment request is stored in Redis and expires after 5 minutes.
        Users receive a real-time notification via WebSocket.
      operationId: requestPayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
      responses:
        '200':
          description: Payment request created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequestResponse'
        '400':
          description: Bad request - Invalid input or wallet not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid secret key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Wallet not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PaymentRequest:
      type: object
      required:
        - walletId
        - amount
        - description
        - merchantName
      properties:
        walletId:
          type: string
          description: Wallet ID obtained from the get account endpoint
          example: wallet_id_here
        amount:
          type: number
          format: double
          minimum: 0.01
          description: Amount to charge (minimum 0.01)
          example: 1000
        description:
          type: string
          description: Description of the payment
          example: Payment for service XYZ
        merchantName:
          type: string
          description: Merchant/company name for display in the payment request
          example: ACME Corporation
    PaymentRequestResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Payment request sent to user for approval
        paymentRequestId:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        status:
          type: string
          enum:
            - PENDING
          example: PENDING
        expiresAt:
          type: string
          format: date-time
          example: '2026-01-22T17:30:00.000Z'
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
          example: Invalid encrypted wallet ID
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication using developer secret key. Format: Bearer
        sk_live_your_secret_key_here

````