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"
}
List all unavailabilities
This endpoint allows you to retrieve all the unavailabilities.
Request
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": []
}
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
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"
}
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
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 an unavailability
This endpoint allows you to delete an unavailability.
Request
curl -X DELETE https://api.lsp.expert/v2/suppliers/66f1313f9e477f90664d1ad8/unavailabilities/66fa9d4018c0028eabfe7ebd \
-u {key}: