Gestion de Bibliotique
Home
API
  • Client > Authentification
  • Client > Profile
  • Client > CRUD
  • Livres
  • Emprunts
  • Categories
Team
  • Nassim MZILI
  • Abderrahim El Ouali
Home
API
  • Client > Authentification
  • Client > Profile
  • Client > CRUD
  • Livres
  • Emprunts
  • Categories
Team
  • Nassim MZILI
  • Abderrahim El Ouali
GitHub
GitLab
  1. Emprunts
  • Get Started
  • API
    • Clients
      • Auth
        • Register a new client
        • Login a client
        • Logout a client
      • Profile
        • Update client profile
        • Update client password
        • Get client details
        • Get all emprunts for a client
      • CRUD (Admin)
        • Get all clients
        • Get a client by ID
        • Update a client
        • Delete a client
    • Livres
      • Get all books
      • Get a book by ID
      • Add a new book
      • Update a book
      • Delete a book
    • Emprunts
      • Create a new emprunt
        POST
      • Get emprunt by ID
        GET
      • Update an emprunt
        PUT
      • Delete an emprunt
        DELETE
      • Get all emprunts
        GET
      • Get all emprunts for a specific client
        GET
      • Return a book
        POST
    • Categories
      • Get all categories
      • Get a category by ID
      • Add a new category
      • Update a category
      • Delete a category
  1. Emprunts

Return a book

POST
https://gestion-bibliotique-pfe.netlify.app/api/emprunts/{id}/return
Maintainer:Nassim MZILI

@access Client#

Request

Path Params
id
string 
required
Example:
67b258ba718bc7b6a981601d
Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTkzNDY3MCwiZXhwIjoxNzQwMDIxMDcwfQ.x-VeV6245fmwrCkuy1sw8951XQnpzLFlGEbHAAt1DZA

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://gestion-bibliotique-pfe.netlify.app/api/emprunts/67b258ba718bc7b6a981601d/return' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjFjZmY2MWUzNTYzOGJlMTUyZGY1NyIsInJvbGUiOiJhZG1pbiIsImlhdCI6MTczOTkzNDY3MCwiZXhwIjoxNzQwMDIxMDcwfQ.x-VeV6245fmwrCkuy1sw8951XQnpzLFlGEbHAAt1DZA'

Responses

🟢200Success
application/json
Body
success
boolean 
required
message
string 
required
data
object 
required
emprunt
object (Emprunt) 
required
livre
object (Livre) 
required
Example
{
  "success": true,
  "message": "Book returned successfully!",
  "data": {
    "emprunt": {
      "_id": "JFNRSqCdmWmWkIp5czJix",
      "clientId": "Hp8Vzyzr3T3CZ3Om65eXF",
      "livreId": "PIWfXuZfLAJ8kuR-vJYs-",
      "dateRetourPrevu": "2026-01-05T21:31:53.596Z",
      "statut": "retourné",
      "dateEmprunt": "2025-02-19T04:43:52.534Z",
      "dateRetourEffectif": "2024-11-25T12:47:09.721Z"
    },
    "livre": {
      "_id": "KdhdFeYN9d7LQWSquOdzx",
      "isbn": "978-0-912253-51-0",
      "titre": "votum laudantium vulgus",
      "auteur": "Ms. Melody Gorczany",
      "editeur": "via cupressus rem",
      "langue": "Français",
      "description": "Odit uter candidus tui viscus repudiandae unde. Attero quisquam vix tergum theologus suffoco sustineo cavus cur. Canis super amoveo arca collum votum synagoga.",
      "quantite": 43,
      "anneePublication": 1925
    }
  }
}
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Previous
Get all emprunts for a specific client
Next
Get all categories
Built with