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

# Provider Health

> Real-time health status for each Mobile Money provider, including failure rate over the last hour.

<Note>
  Check this endpoint before initiating a payment if you want to route around a degraded provider. A `failure_rate_1h` above `0.10` (10%) indicates instability.
</Note>

The `status` field reflects the provider's current feature flag state (`operational` or `degraded`). winam-payments also monitors this internally to route around failing providers automatically.


## OpenAPI

````yaml GET /api/v1/{country}/providers/status
openapi: 3.1.0
info:
  title: Winam Payments API
  description: >

    ## winam-payments — Mobile Money API


    Payment abstraction layer between your **sportsbook or frontend platform**
    and Mobile Money providers in Cameroon (MTN MoMo, Orange Money).


    ### Deposit flow

    1. Your platform calls `POST /api/v1/deposits` with a unique `reference`

    2. winam-payments triggers a USSD collection on the merchant SIM

    3. The player receives a notification on their phone and confirms with their
    PIN

    4. The confirmation SMS is received → transaction `succeeded`

    5. Webhook sent to your `callback_url`


    ### Withdrawal flow

    1. Your platform calls `POST /api/v1/withdrawals`

    2. A Winam operator approves manually

    3. winam-payments sends the USSD transfer

    4. Result webhook sent to your `callback_url`


    ### Authentication

    All requests to `/deposits` and `/withdrawals` must include the header:

    ```

    X-API-Key: <your_api_key>

    ```

    In development (`SPORTSBOOK_API_KEY` empty), authentication is disabled.


    ### Full documentation

    See [docs.winampay.de](https://docs.winampay.de) for the complete public
    documentation with guides, examples, and interactive playground.
  contact:
    name: Eins Innovativ
    email: support@eins-innovativ.de
  version: 0.1.0
servers: []
security: []
tags:
  - name: deposits
    description: >-
      Initiate Mobile Money deposits. The player receives a USSD notification on
      their phone to confirm payment.
  - name: withdrawals
    description: >-
      Initiate Mobile Money withdrawals. Requires manual approval from a Winam
      operator before execution.
  - name: transactions
    description: >-
      Query and manage existing transactions. Use for status polling or incident
      recovery.
  - name: providers
    description: >-
      List available providers and detect the operator from an MSISDN. Use to
      populate payment options in your player interface.
  - name: security
    description: >-
      Public key endpoint for verifying JWT signatures on outbound webhooks.
      Fetch this key once and cache it.
paths:
  /api/v1/{country}/providers/status:
    get:
      tags:
        - providers
      summary: Real-time provider status
      operationId: providers_status_api_v1__country__providers_status_get
      parameters:
        - name: country
          in: path
          required: true
          schema:
            type: string
            title: Country
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ProviderStatusResponse:
      properties:
        country_code:
          type: string
          title: Country Code
        checked_at:
          type: string
          format: date-time
          title: Checked At
        providers:
          items:
            $ref: '#/components/schemas/ProviderStatusItem'
          type: array
          title: Providers
      type: object
      required:
        - country_code
        - checked_at
        - providers
      title: ProviderStatusResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProviderStatusItem:
      properties:
        provider_id:
          type: string
          title: Provider Id
          examples:
            - sim_gateway_mtn
        display_name:
          type: string
          title: Display Name
          examples:
            - MTN Mobile Money
        status:
          type: string
          title: Status
          description: 'Real-time status: `"active"` | `"degraded"` | `"unavailable"`'
          examples:
            - active
        is_feature_flag_enabled:
          type: boolean
          title: Is Feature Flag Enabled
          description: Whether the provider is enabled via feature flag
        failure_rate_1h:
          anyOf:
            - type: number
            - type: 'null'
          title: Failure Rate 1H
          description: >-
            Failure rate over the last hour (0.0–1.0). Null if no transactions
            in the window.
          examples:
            - 0.02
        tx_count_1h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tx Count 1H
          description: Number of transactions in the last hour
          examples:
            - 47
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Human-readable status message
      type: object
      required:
        - provider_id
        - display_name
        - status
        - is_feature_flag_enabled
        - failure_rate_1h
        - tx_count_1h
      title: ProviderStatusItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````