---
"/clubs/{club_id}/holds":
  post:
    x-mojo-to: Clubs::Holds#add
    operationId: addClubHold
    tags:
      - clubs
    summary: Add a club hold
    parameters:
      - $ref: "../swagger.yaml#/parameters/club_id_pp"
      - name: body
        in: body
        description: A JSON object containing informations about the new hold
        required: true
        schema:
          type: object
          properties:
            biblio_id:
              description: Internal biblio identifier
              type:
                - integer
                - "null"
            item_id:
              description: Internal item identifier
              type:
                - integer
                - "null"
            pickup_library_id:
              description: Internal library identifier for the pickup library
              type: string
            expiration_date:
              description: Hold end date
              type:
                - string
                - "null"
              format: date
            notes:
              description: Notes related to this hold
              type:
                - string
                - "null"
            item_type:
              description: Limit hold on one itemtype (ignored for item-level holds)
              type:
                - string
                - "null"
            default_patron_home:
              description: For each patron, set pickup location to patron's home library if
                possible
              type: integer
          required:
            - pickup_library_id
          additionalProperties: false
    consumes:
      - application/json
    produces:
      - application/json
    responses:
      "201":
        description: Created club hold
        schema:
          $ref: "../definitions/club_hold.yaml"
      "400":
        description: Missing or wrong parameters
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "401":
        description: Authentication required
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "403":
        description: Hold not allowed
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "404":
        description: Club not found
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "409":
        description: Hold not allowed
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "500":
        description: |
          Internal server error. Possible `error_code` attribute values:

          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      "503":
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        reserveforothers: "1"
