Skip to main content

Get Airline Information

Returns the authenticated airline’s information (excluding the API token).

Headers

x-api-key
string
required
Your airline’s API token

Response

airlineId
string
Unique identifier for the airline
name
string
Airline name
Discord invite link for the airline
serverId
string
Discord server ID
createdAt
timestamp
When the airline was created
updatedAt
timestamp
When the airline was last updated

Example Request

curl -X GET https://api.skyteam.dev/airline \
  -H "x-api-key: your_api_key_here"

Example Response

{
  "airlineId": "skyteam",
  "name": "SkyTeam Airways",
  "inviteLink": "https://discord.gg/skyteam",
  "serverId": "1122953128703168532",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}
The API token is automatically excluded from the response for security purposes.

Get Airline Products

Returns all miles products available for purchase by passengers of this airline.

Headers

x-api-key
string
required
Your airline’s API token

Response

Returns an array of product objects:
productId
string
Unique identifier for the product (6-character alphanumeric)
airlineId
string
ID of the airline offering this product
name
string
Product name
description
string
Product description (optional)
priceMiles
integer
Price in miles required to purchase this product
active
boolean
Whether the product is currently available for purchase
createdAt
timestamp
When the product was created

Example Request

curl -X GET https://api.skyteam.dev/airline/fetchProductsData \
  -H "x-api-key: your_api_key_here"

Example Response

[
  {
    "productId": "a1b2c3",
    "airlineId": "skyteam",
    "name": "Priority Boarding",
    "description": "Board the aircraft before other passengers",
    "priceMiles": 500,
    "active": true,
    "createdAt": "2024-01-15T10:30:00.000Z"
  },
  {
    "productId": "d4e5f6",
    "airlineId": "skyteam",
    "name": "Extra Baggage",
    "description": "Add 20kg to your baggage allowance",
    "priceMiles": 1000,
    "active": true,
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
]

Implementation

Location: apps/api/src/routes/airline.ts:17
router.get("/airline/fetchProductsData", async (_req, res, next) => {
  try {
    const airline = res.locals.airline as { airlineId: string };
    const products = await fetchMilesProducts(airline.airlineId);
    res.json(products);
  } catch (err) {
    next(err);
  }
});

Build docs developers (and LLMs) love