Skip to main content

User passport

Goal: Combine visit history with venue detail for a passport-style view of where a member has been.
Prep time: ~10 minutes

What you will use

  • GET /flynet/v1/users/me/check_ins - the authenticated member’s check-ins with embedded venue context
  • GET /flynet/v1/restaurants/{id} - only when you need fresh brand detail

Code

const base = "https://api.staging.blackbird.xyz/flynet/v1";

const checkInRes = await fetch(
  `${base}/users/me/check_ins?page=0&page_size=50`,
  { headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN!}` } }
);

const data = await checkInRes.json();

const passport = data.check_ins.map((checkIn) => ({
  visited_at: checkIn.created_at,
  brand: checkIn.location.restaurant.name,
  neighborhood: checkIn.location.neighborhood?.name,
  visit_number: checkIn.visit_number,
}));

console.log(passport);
From the kitchen - Use the embedded location.restaurant from check-ins first. Only fetch GET /restaurants/{id} when you need fields not present on the embedded restaurant.
Chef’s warning - Restaurant detail calls use X-API-Key, not the OAuth bearer token used for check-ins.
Next: Wallet badge - show wallet context alongside the passport.