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

# Générer un rapport

> Génère (ou regénère) le rapport d'un mois **écoulé**. Le mois en cours n'est pas disponible.



## OpenAPI

````yaml POST /web-merchant/reports/generate
openapi: 3.1.0
info:
  title: Djonanko Pay API
  version: 1.0.0
  description: >
    API de la passerelle de paiement mobile money **Djonanko Pay**.


    Deux modes d'authentification coexistent :


    - **Clé API** (`x-api-key` + `x-api-secret`) — pour l'intégration serveur à
    serveur :
      création de liens de paiement et de QR codes.
    - **Jeton marchand** (`authenticationtoken`) — un JWT obtenu via `POST
    /user/login-merchant`,
      utilisé par le dashboard marchand pour tout le reste (statut, solde, reversements, rapports…).

    Toutes les réponses sont en JSON. Les montants sont exprimés en **FCFA (XOF
    / XAF)** sans décimales.
  contact:
    name: Support Djonanko
    url: https://www.djonanko.ci/#contact
servers:
  - url: https://apidjonanko.tech
    description: Production
security: []
tags:
  - name: Authentification
  - name: Paiements
  - name: Solde & statistiques
  - name: Webhooks
  - name: Reversements
  - name: Sécurité
  - name: Rapports
  - name: Compte marchand
paths:
  /web-merchant/reports/generate:
    post:
      tags:
        - Rapports
      summary: Générer un rapport
      description: >-
        Génère (ou regénère) le rapport d'un mois **écoulé**. Le mois en cours
        n'est pas disponible.
      operationId: generateReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - merchant_reference
                - period
              properties:
                merchant_reference:
                  type: string
                  example: beautyshop
                period:
                  type: string
                  pattern: ^\d{4}-(0[1-9]|1[0-2])$
                  description: Mois au format `YYYY-MM`.
                  example: 2026-08
      responses:
        '201':
          description: Rapport généré.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          description: Période invalide ou mois non terminé.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message: >-
                  Le rapport d'un mois n'est disponible qu'une fois le mois
                  terminé
                error: Bad Request
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - MerchantToken: []
components:
  schemas:
    Report:
      type: object
      properties:
        id:
          type: string
          format: uuid
        period:
          type: string
          description: Mois couvert, au format `YYYY-MM`.
          example: 2026-08
        periodLabel:
          type: string
          example: Août 2026
        periodStart:
          type: string
          format: date-time
        periodEnd:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - PENDING
            - READY
            - FAILED
        filename:
          type: string
          nullable: true
          example: rapport-beautyshop-2026-08.pdf
        fileUrl:
          type: string
          format: uri
          nullable: true
        fileSize:
          type: integer
          nullable: true
        summary:
          type: object
          nullable: true
          description: >-
            Chiffres clés du mois (montant total, nombre de paiements,
            répartition par opérateur…).
        error:
          type: string
          nullable: true
        generatedAt:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 401
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Invalid API credentials
        error:
          type: string
          example: Unauthorized
  responses:
    Unauthorized:
      description: Identifiants manquants ou invalides.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Invalid API credentials
            error: Unauthorized
  securitySchemes:
    MerchantToken:
      type: apiKey
      in: header
      name: authenticationtoken
      description: >-
        JWT obtenu via `POST /user/login-merchant`. À passer tel quel, **sans**
        préfixe `Bearer`.

````