Skip to main content

Hello OAuth

Goal: Confirm your OAuth access token works and you know what an OAuth 401 looks like.
Prep time: ~1 minute

What you’ll use

  • GET /flynet/v1/users/me/wallets with Authorization: Bearer <access_token>
The subject is resolved from your token, with no member ID in the path. The token itself comes from the OAuth + PKCE flow — FlynetOAuth.exchangeCode() returns it. See OAuth for the full handshake.

With the SDK

FlynetMemberClient carries the bearer token and normalizes auth failures into a typed FlynetError — no header parsing.

Under the hood

The raw request, to see what an OAuth 401/403 looks like on the wire:
200 returns { "wallets": [...] } with one MEMBERSHIP and one SPENDING wallet. 401 returns an empty body with a WWW-Authenticate: Bearer header; the cause sits in that header, not in JSON. A 403 means your token is valid but lacks the read:wallets scope this route requires (error="insufficient_scope").
Don’t try to parse JSON on an OAuth 401/403; the body is empty. Inspect the WWW-Authenticate header for the reason, such as error="invalid_token" or error="insufficient_scope".
Next: Fetch a restaurant list: verify the API-key side of the credential model.