Unavailabilities

Unavailabilities represent unavailabilities associated with a supplier. They store information about the unavailability of a supplier.

The Unavailability object

Properties

  • fromdate

    The date and time the unavailability starts.

  • idstring

    Unique identifier for the object.

  • reasonstring

    The reason for the unavailability.

  • todate

    The date and time the unavailability ends.

Unavailability object

{
 "from": "2024-09-30T22:00:00.000Z",
 "to": "2024-10-07T22:00:00.000Z",
 "reason": "Off",
 "id": "66fa9d4018c0028eabfe7ebd"       
}

GET/v2/suppliers/:id/unavailabilities

List all unavailabilities

This endpoint allows you to retrieve all the unavailabilities.

Request

GET
/v2/suppliers/:id
curl -G https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/unavailabilities \
  -u {key}: 

Response

{
  "currents": [
    {
      "from": "2024-09-30T22:00:00.000Z",
      "to": "2024-10-07T22:00:00.000Z",
      "reason": "Off",
      "id": "66fa9d4018c0028eabfe7ebd"
    }
  ],
  "old": []
}

POST/v2/suppliers/:id/unavailabilities

Create an unavailability

This endpoint allows you to add a new unavailability.

Parameters

  • fromstring

    The date and time the unavailability starts.

  • reasonstring,null

    The reason for the unavailability.

  • tostring

    The date and time the unavailability ends.

Request

POST
/v2/suppliers/:id/unavailabilities
curl https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/unavailabilities \
  -u {key}: \
  -d from="2024-09-30T22:00:00.000Z" \
  -d to="2024-10-07T22:00:00.000Z"

Response

{
  "id": "66fa9d4018c0028eabfe7ebd",
  "from": "2024-09-30T22:00:00.000Z",
  "to": "2024-10-07T22:00:00.000Z"
}


PUT/v2/suppliers/:id/unavailabilities/:unavailabilityId

Update an unavailability supplier

This endpoint allows you to perform an update on a unavailability. Any parameters not provided will be left unchanged.

Parameters

  • fromstring,null

    The date and time the unavailability starts.

  • reasonstring,null

    The reason for the unavailability.

  • tostring,null

    The date and time the unavailability ends.

Request

PUT
/v2/suppliers/:id/unavailabilities/:unavailabilityId
curl -X PUT https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/unavailabilities/66fa9d4018c0028eabfe7ebd \
  -u {key}: \
  -d reason="Off"

Response

{
  "id": "66fa9d4018c0028eabfe7ebd",
  "from": "2024-09-30T22:00:00.000Z",
  "to": "2024-10-07T22:00:00.000Z",
  "reason": "Off"
}

DELETE/v2/suppliers/:id/unavailabilities/:unavailabilityId

Delete an unavailability

This endpoint allows you to delete an unavailability.

Request

DELETE
/v2/suppliers/:id/unavailabilities/:unavailabilityId
curl -X DELETE https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/unavailabilities/66fa9d4018c0028eabfe7ebd \
  -u {key}: