Skip to content

Onboarding and Billing

⚠️ Agents: do not create a Developer API account

Do NOT call /developers/api/v1/agents/register, and do NOT run letsfg register. That belongs to a separate, paid product for high-volume commercial integrations and creates a billing account you almost certainly do not want.

To search and book flights, connect LetsFG as an MCP server at https://letsfg.co/mcp. Approving it opens https://letsfg.co/connect: one tap, no card. A card is asked for at the first booking. See https://letsfg.co/for-agents.

Payments are Revolut, and every card payment goes through 3-D Secure. Register, then choose how bookings are paid: a card that approves by itself, approving each booking with your bank, or a prepaid balance (see 2b). A card is saved with POST /agents/connect-payment; nothing is charged to connect. The Stripe lanes were retired on 2026-09-08 and answer 410 Gone naming their replacement.

Onboarding

1. Register the developer account

curl -X POST https://letsfg.co/developers/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"agent_name": "my-agent", "email": "you@example.com", "owner_name": "My Team"}'
{
  "agent_id": "ag_123",
  "api_key": "letsfg_abc123",
  "payment_ready": false,
  "tier": "developer",
  "message": "Registration successful! Save your api_key ..."
}

Save api_key — it is shown once. No card is needed to register.

2. Connect a Revolut payment method

curl -X POST https://letsfg.co/developers/api/v1/agents/connect-payment \
  -H "X-API-Key: letsfg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"return_url": "https://example.com/account"}'
{
  "status": "connect_required",
  "connect_url": "https://letsfg.co/connect?dev=sess_abc123",
  "expires_in_seconds": 3600,
  "message": "Open connect_url in a browser to save a Revolut payment method ..."
}

Open connect_url in a browser — yourself, or hand it to whoever pays for this account. The page takes a card or Revolut Pay and saves it for merchant use with a zero-amount order: nothing is charged to connect. The link lasts one hour, and connecting again replaces the previous method.

Saving a card is needed for auto_card and approve_card. The balance set-up needs no card at all.

2b. Choose how bookings are paid

Every card payment goes through 3-D Secure. Pick one of three set-ups, on the portal or with the API:

modeForWhat a booking does
auto_cardA company or virtual card that approves online payments by itselfCharged automatically through 3-D Secure, nobody present. The card is checked once with a $1 hold, released at once. If the bank ever wants the card holder, that booking answers 402 approval_needed with an approve_url.
approve_cardA normal card, or if you only want to searchAnswers 202 with state: awaiting_your_approval and an approve_url. The card holder approves it with their bank and the booking starts by itself.
balanceAutomatic bookings when the card cannot approve by itselfPaid from the prepaid USD balance. Too little answers 402 balance_short with needed_cents and short_by_cents; nothing is taken.
curl -X POST https://letsfg.co/developers/api/v1/agents/payment-setup   -H "X-API-Key: letsfg_your_api_key"   -H "Content-Type: application/json"   -d '{"mode": "approve_card"}'

GET /agents/payment-setup reads the current set-up, your bank-transfer reference and our account details. A booking paid from the balance that fails goes back to the balance; a card booking that fails releases its hold.

3. Fund prepaid balance (only if you expect to exceed the free allowance)

The balance pays bookings in the balance set-up, and it always pays extra search blocks (search is free up to the look-to-book allowance below). It starts at 0. The public minimum is 500 cents. The answer carries checkout_url, a Revolut payment page (card, Apple Pay, Google Pay); the balance is credited once it is paid. Read it back with GET /agents/top-up/{order_id}. You can also send a bank transfer to the account details on the portal with your reference (LFG-XXXXXXXX); it is credited once it arrives. Auto-refill works only with auto_card.

curl -X POST https://letsfg.co/developers/api/v1/agents/top-up \
  -H "X-API-Key: letsfg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"amount_cents": 2500, "auto_refill_enabled": true, "auto_refill_amount_cents": 2500}'

4. Confirm the account is ready

curl https://letsfg.co/developers/api/v1/agents/me \
  -H "X-API-Key: letsfg_your_api_key"

Check these before you search:

  • payment.connected — true once a Revolut method is saved
  • developer_api.api_access_enabled
  • developer_api.flight_search.searches_remaining
"developer_api": {
  "flight_search": {
    "model": "look_to_book",
    "free_searches_per_booking": 200,
    "searches_since_booking": 12,
    "searches_remaining": 188,
    "blocks_purchased": 0,
    "block_size": 500,
    "block_price_cents": 500
  }
}

How flight search is billed: look-to-book

Not per search. 200 searches are free after every booking you make, and a completed booking resets the counter to zero. That includes a booking your user completes on letsfg.co through an offer's booking_url — no referral parameter needed. Past that, searches come in blocks of 500 for $5.00 ($0.01 each) taken from prepaid balance.

Two things never consume allowance: a search that returns no offers, and a search that fails because of an outage.

Running out answers 402:

{
  "error": "search_allowance_exhausted",
  "message": "You have used 200 searches since your last booking, past the 200 that come free with one. ...",
  "free_searches_per_booking": 200,
  "searches_since_booking": 200,
  "block_size": 500,
  "block_price_cents": 500
}

Either book a flight — which resets the allowance — or top up to buy the next block.

What you are charged for a flight

There is no booking fee and no transaction fee. The price on every offer the search returns is the amount charged. Nothing is added at checkout.

Booking holds the fare (on the card, or reserved from the balance) rather than taking it, and the hold is captured only once a real airline PNR exists. See Booking flights.

Ongoing billing operations

Update auto-refill settings

curl -X POST https://letsfg.co/developers/api/v1/agents/billing-settings \
  -H "X-API-Key: letsfg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"auto_refill_enabled": true, "auto_refill_amount_cents": 2500}'

Replace the connected card

Call POST /agents/connect-payment again and open the new link. The new method replaces the old one.

Rotate the API key

curl -X POST https://letsfg.co/developers/api/v1/agents/rotate-key \
  -H "X-API-Key: letsfg_your_api_key"

Update every client after key rotation. Old keys should be treated as revoked immediately.

Retired on 2026-09-08 with Stripe

These still answer, with 410 Gone and the replacement path, so an older integration is told what to do rather than getting a bare 404:

Retired Use instead
POST /agents/setup-payment POST /agents/connect-payment
POST /agents/hosted-checkout POST /agents/connect-payment
POST /agents/hosted-checkout/complete POST /agents/connect-payment
POST /agents/billing-portal GET /agents/me
POST /bookings/unlock nothing — there is no unlock step any more
POST /bookings/book POST /flights/book
Symptom Usual cause Fix
401 API key is required Missing or invalid key Register first or rotate to a fresh key
402 payment_method_required No set-up chosen and no card saved POST /agents/payment-setup, or POST /agents/connect-payment and open the link
402 balance_short The balance cannot cover the booking Top up by short_by_cents or more, then book again
402 approval_needed The bank wants the card holder for this payment Open approve_url
402 payment_setup_needed The old silent card charge has ended for this account Choose a set-up on the portal
402 search_allowance_exhausted Used the free allowance since your last booking Book a flight (resets it) or top up to buy a block
410 on setup-payment / hosted-checkout / billing-portal Stripe lane, retired Use POST /agents/connect-payment