name: Endpoints
description: ''
endpoints:
  -
    httpMethods:
      - POST
    uri: api/login
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: "Authentification de l'utilisateur via API."
      description: |-
        Valide les données reçues, vérifie les identifiants, génère un token d'authentification
        et renvoie les informations client avec le token.
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      email:
        name: email
        description: 'Must be a valid email address. Must not be greater than 255 characters.'
        required: true
        example: qkunze@example.com
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      password:
        name: password
        description: 'Must be at least 8 characters.'
        required: true
        example: 'Z5ij-e/dl4m{o,'
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanBodyParameters:
      email: qkunze@example.com
      password: 'Z5ij-e/dl4m{o,'
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/inscription
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Enregistre une nouvelle inscription client avec validation des données, création en base, et envoi de mail de vérification.'
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      type_client:
        name: type_client
        description: 'Type de client ("PARTICULIER", "ENTREPRISE", "REVENDEUR").'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      nom_client:
        name: nom_client
        description: 'Nom du client.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      prenom_client:
        name: prenom_client
        description: 'Prénom du client.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      email:
        name: email
        description: 'Email valide et unique.'
        required: true
        example: qkunze@example.com
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      tele:
        name: tele
        description: Téléphone.
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      motpasse_client:
        name: motpasse_client
        description: 'Mot de passe (minimum 8 caractères) avec confirmation.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      ville:
        name: ville
        description: Ville.
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      code_postal:
        name: code_postal
        description: 'Code postal.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      pays:
        name: pays
        description: Pays.
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      nom_rue:
        name: nom_rue
        description: 'Nom de la rue.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      motpasse_client_confirmation:
        name: motpasse_client_confirmation
        description: 'Confirmation du mot de passe.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      numero_rue:
        name: numero_rue
        description: 'Numéro de la rue.'
        required: false
        example: consequatur
        type: int|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      complement:
        name: complement
        description: "Complément d'adresse."
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      sex:
        name: sex
        description: 'Sexe ("M" ou "F"), défaut "M".'
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      societe:
        name: societe
        description: 'Société (pour entreprises).'
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      n_tva:
        name: n_tva
        description: 'Numéro de TVA.'
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      service:
        name: service
        description: Service.
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
      site_web:
        name: site_web
        description: 'Site web.'
        required: false
        example: consequatur
        type: string|null
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanBodyParameters:
      type_client: consequatur
      nom_client: consequatur
      prenom_client: consequatur
      email: qkunze@example.com
      tele: consequatur
      motpasse_client: consequatur
      ville: consequatur
      code_postal: consequatur
      pays: consequatur
      nom_rue: consequatur
      motpasse_client_confirmation: consequatur
      numero_rue: consequatur
      complement: consequatur
      sex: consequatur
      societe: consequatur
      n_tva: consequatur
      service: consequatur
      site_web: consequatur
    fileParameters: []
    responses:
      -
        status: 201
        content: |-
          {
            "status": "success",
            "message": "Inscription réussie. Un email de vérification a été envoyé à email@example.com",
            "client": {
              "id": 123,
              "email": "email@example.com",
              "name": "Prénom Nom"
            }
          }
        headers: []
        description: ''
        custom: []
      -
        status: 422
        content: |-
          {
            "status": "error",
            "errors": {
              "email": ["Cet email est déjà utilisé."],
              "motpasse_client": ["La confirmation du mot de passe ne correspond pas."]
            }
          }
        headers: []
        description: ''
        custom: []
      -
        status: 500
        content: |-
          {
            "status": "error",
            "message": "Erreur lors de l'inscription",
            "error": "Détails de l'erreur"
          }
        headers: []
        description: ''
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/send-verification-email
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: "Envoi d'un email de vérification à un client."
      description: |-
        Cette méthode valide l'email fourni dans la requête, vérifie que
        l'email existe bien dans la table `client`. Si le client n'a pas encore
        de token de vérification, elle en génère un nouveau.
        Ensuite, elle envoie un email de vérification à cette adresse.
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters:
      email:
        name: email
        description: 'Must be a valid email address. The <code>email</code> of an existing record in the client table.'
        required: true
        example: qkunze@example.com
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanBodyParameters:
      email: qkunze@example.com
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: 'api/verify-email/{token}'
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: "Vérifie le token de validation d'email et active le compte utilisateur."
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters:
      token:
        name: token
        description: 'Token unique de vérification envoyé par email.'
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanUrlParameters:
      token: consequatur
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 200
        content: |-
          {
            "status": "success",
            "message": "Email vérifié avec succès !",
            "client": {
              "n_compte": 123,
              "email": "email@example.com",
              "email_verified_at": "2025-05-17T14:00:00Z"
            }
          }
        headers: []
        description: ''
        custom: []
      -
        status: 200
        content: |-
          {
            "status": "info",
            "message": "Votre email a déjà été vérifié"
          }
        headers: []
        description: ''
        custom: []
      -
        status: 404
        content: |-
          {
            "status": "error",
            "message": "Lien de vérification invalide ou expiré"
          }
        headers: []
        description: ''
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: api/client
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: ''
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 302
        content: |-
          <!DOCTYPE html>
          <html>
              <head>
                  <meta charset="UTF-8" />
                  <meta http-equiv="refresh" content="0;url='https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'" />

                  <title>Redirecting to https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</title>
              </head>
              <body>
                  Redirecting to <a href="https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login">https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</a>.
              </body>
          </html>
        headers:
          cache-control: 'no-cache, private'
          location: 'https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'
          content-type: 'text/html; charset=utf-8'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: api/user
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: ''
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 302
        content: |-
          <!DOCTYPE html>
          <html>
              <head>
                  <meta charset="UTF-8" />
                  <meta http-equiv="refresh" content="0;url='https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'" />

                  <title>Redirecting to https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</title>
              </head>
              <body>
                  Redirecting to <a href="https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login">https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</a>.
              </body>
          </html>
        headers:
          cache-control: 'no-cache, private'
          location: 'https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'
          content-type: 'text/html; charset=utf-8'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/logout
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: "Déconnexion de l'utilisateur."
      description: "Révoque tous les tokens d'authentification pour l'utilisateur connecté."
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/personnalisations
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Créer une nouvelle personnalisation à partir des données reçues en POST.'
      description: |-
        Cette méthode reçoit les paramètres de personnalisation d'une commande,
        initialise les valeurs par défaut, met à jour les valeurs selon les entrées,
        puis crée un enregistrement en base de données.
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/payment
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Crée un paiement avec PayPlug et enregistre les informations dans la base.'
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: api/debug/auth-test
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: ''
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 302
        content: |-
          <!DOCTYPE html>
          <html>
              <head>
                  <meta charset="UTF-8" />
                  <meta http-equiv="refresh" content="0;url='https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'" />

                  <title>Redirecting to https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</title>
              </head>
              <body>
                  Redirecting to <a href="https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login">https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</a>.
              </body>
          </html>
        headers:
          cache-control: 'no-cache, private'
          location: 'https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'
          content-type: 'text/html; charset=utf-8'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: api/debug/auth-verify
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: ''
      description: ''
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 302
        content: |-
          <!DOCTYPE html>
          <html>
              <head>
                  <meta charset="UTF-8" />
                  <meta http-equiv="refresh" content="0;url='https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'" />

                  <title>Redirecting to https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</title>
              </head>
              <body>
                  Redirecting to <a href="https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login">https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login</a>.
              </body>
          </html>
        headers:
          cache-control: 'no-cache, private'
          location: 'https://fcf3-2a02-8429-19c2-4501-2061-9805-e176-254.ngrok-free.app/login'
          content-type: 'text/html; charset=utf-8'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - POST
    uri: api/payment/webhook
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Traitement des notifications webhook envoyées par PayPlug.'
      description: 'Met à jour le statut du paiement en fonction de la notification reçue.'
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters: []
    cleanUrlParameters: []
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: 'api/payment/success/{payment}'
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Gère la redirection après paiement réussi.'
      description: 'Met à jour le statut du paiement et de la commande dans la base.'
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters:
      payment:
        name: payment
        description: ''
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanUrlParameters:
      payment: consequatur
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 200
        content: |-
          <!DOCTYPE html>
          <html>
          <head>
              <title>Paiement réussi</title>
              <meta http-equiv="refresh" content="3;url=http://localhost:3000/" />
          </head>
          <body style="text-align: center; padding: 50px; font-family: Arial;">
              <h1>Paiement réussi !</h1>
              <p>Vous allez être redirigé vers la page d'accueil dans quelques instants...</p>
              <p>Si ce n'est pas le cas, <a href="http://localhost:3000/">cliquez ici</a>.</p>
          </body>
          </html>
        headers:
          content-type: 'text/html; charset=UTF-8'
          cache-control: 'no-cache, private'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
  -
    httpMethods:
      - GET
    uri: 'api/payment/cancel/{payment}'
    metadata:
      groupName: Endpoints
      groupDescription: ''
      subgroup: ''
      subgroupDescription: ''
      title: 'Gère la redirection après annulation du paiement.'
      description: 'Met à jour le statut du paiement en échec.'
      authenticated: false
      custom: []
    headers:
      Content-Type: application/json
      Accept: application/json
    urlParameters:
      payment:
        name: payment
        description: ''
        required: true
        example: consequatur
        type: string
        enumValues: []
        exampleWasSpecified: false
        nullable: false
        custom: []
    cleanUrlParameters:
      payment: consequatur
    queryParameters: []
    cleanQueryParameters: []
    bodyParameters: []
    cleanBodyParameters: []
    fileParameters: []
    responses:
      -
        status: 200
        content: |-
          <!DOCTYPE html>
          <html>
          <head>
              <title>Paiement annulé</title>
              <meta http-equiv="refresh" content="3;url=http://localhost:3000/order?error=payment_cancelled" />
          </head>
          <body style="text-align: center; padding: 50px; font-family: Arial;">
              <h1>❌ Paiement annulé</h1>
              <p>Vous allez être redirigé vers votre commande dans quelques instants...</p>
              <p>Si ce n'est pas le cas, <a href="http://localhost:3000/order?error=payment_cancelled">cliquez ici</a>.</p>
          </body>
          </html>
        headers:
          content-type: 'text/html; charset=UTF-8'
          cache-control: 'no-cache, private'
          vary: Origin
          x-ratelimit-limit: '60'
          x-ratelimit-remaining: '59'
        description: null
        custom: []
    responseFields: []
    auth: []
    controller: null
    method: null
    route: null
    custom: []
