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

# Send a top-up

> Debits your wallet and answers `202`. The top-up is sent in the background: poll `GET /flexy/status/{id}` until `final` is true. A failed top-up is refunded automatically. Send `idempotency_key` so a retry never charges twice.



## OpenAPI

````yaml /openapi.json post /flexy/topup
openapi: 3.0.3
info:
  title: Wasmou API
  version: 1.0.0
  description: >-
    Sell digital goods: catalog, purchase, delivery, game top-ups and per-client
    stock. All amounts are in DZD.
servers:
  - url: https://api.wasmou.net/api
    description: Production
security: []
paths:
  /flexy/topup:
    post:
      tags:
        - Flexy
      summary: Send a top-up
      description: >-
        Debits your wallet and answers `202`. The top-up is sent in the
        background: poll `GET /flexy/status/{id}` until `final` is true. A
        failed top-up is refunded automatically. Send `idempotency_key` so a
        retry never charges twice.
      operationId: flexyTopup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - target_number
                - amount
                - topup_type
              properties:
                target_number:
                  type: string
                  example: '0699123456'
                amount:
                  type: number
                  example: 500
                topup_type:
                  type: string
                  enum:
                    - prepaid
                    - offer
                    - facture
                    - international
                offer_id:
                  type: string
                offer_name:
                  type: string
                offer_category:
                  type: string
                menu_number:
                  type: string
                pay_debt:
                  type: boolean
                  description: 'Ooredoo only: pay the unpaid balance with this top-up'
                idempotency_key:
                  type: string
                  maxLength: 64
                expected_price:
                  type: number
                  description: 'Optional: refuse the order if your price changed'
      responses:
        '202':
          description: Submitted
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                      number:
                        type: string
                        example: '0699123456'
                      operator:
                        type: string
                        enum:
                          - mobilis
                          - ooredoo
                          - djezzy
                      type:
                        type: string
                        enum:
                          - prepaid
                          - offer
                          - facture
                          - international
                      amount:
                        type: number
                        description: What the recipient receives (DZD)
                      price:
                        type: number
                        description: What left your wallet (DZD)
                      offer:
                        type: string
                        nullable: true
                      status:
                        type: string
                        enum:
                          - processing
                          - success
                          - failed
                      final:
                        type: boolean
                      message:
                        type: string
                        nullable: true
                      created_at:
                        type: string
                      client_ref:
                        type: string
                        nullable: true
                        description: Your idempotency_key
                      balance:
                        type: number
        '402':
          description: Insufficient balance
        '422':
          description: Validation error
        '503':
          description: Flexy unavailable
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Your API key from the Wasmou app (API access).

````

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