Tutorial: Building a Cargo Bay Picker
Learn how to use the Fleet Operations API to show shippers which cargo bays have room, before they book a container.
Cargo bays open for booking 14 days before launch, at 08:00 station time.
1. Checking Availability
Section titled “1. Checking Availability”Before showing bay options to your users, fetch the bays that can hold their cargo’s temperature class:
GET /v2/cargo/bays?temperature=cryo HTTP/1.1Host: fleet.cosmocargo.devX-API-Key: YOUR_API_KEY[ { "id": "8f14e45f-ceea-4e67-a1b2-3c4d5e6f7a8b", "vesselId": "1c9e2a7b-4d3f-4b8a-9e6d-2f1a0b3c4d5e", "capacityTons": 5000, "usedTons": 3200, "temperature": "cryo" }]Free capacity is capacityTons - usedTons: 1,800 tons in this bay.
2. Temperature Classes
Section titled “2. Temperature Classes”| Temperature | Description | Best For |
|---|---|---|
| Ambient | Pressurized hold kept at 18–24 °C. | General freight and electronics |
| Cryo | Held below −150 °C for the whole voyage. | Vaccines, cryo-sleep pods, cultured cells |
| Plasma-shielded | Wrapped in a plasma field against radiation storms. | Reactive minerals and sensitive instruments |
3. Booking the Container
Section titled “3. Booking the Container”Once the shipper picks a bay, book the container with POST /containers/book (Cargo Container Specifications API). The booking confirmation and launch reminders go to the notification channels in the request.