> ## 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.

# Ajouter une IP autorisée

> Accepte une IPv4, une IPv6 ou une plage CIDR (ex. `41.207.12.0/24`). Maximum 20 entrées par marchand.



## OpenAPI

````yaml /openapi.yaml post /web-merchant/allowed-ips
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/allowed-ips:
    post:
      tags:
        - Sécurité
      summary: Ajouter une IP autorisée
      description: >-
        Accepte une IPv4, une IPv6 ou une plage CIDR (ex. `41.207.12.0/24`).
        Maximum 20 entrées par marchand.
      operationId: createAllowedIp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - merchant_reference
                - ipAddress
              properties:
                merchant_reference:
                  type: string
                  example: beautyshop
                ipAddress:
                  type: string
                  maxLength: 64
                  example: 41.207.12.34
                label:
                  type: string
                  maxLength: 100
                  example: Serveur de production
      responses:
        '201':
          description: IP ajoutée.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllowedIp'
        '400':
          description: IP invalide, déjà enregistrée, ou limite atteinte.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message: Cette adresse IP est déjà enregistrée
                error: Bad Request
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - MerchantToken: []
components:
  schemas:
    AllowedIp:
      type: object
      properties:
        id:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        ipAddress:
          type: string
          description: IPv4, IPv6 ou plage CIDR normalisée.
          example: 41.207.12.34
        label:
          type: string
          nullable: true
          example: Serveur de production
        createdAt:
          type: string
          format: date-time
    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`.

````