Picnic.Resources.User (Picnic v0.1.0)

Copy Markdown View Source

The account profile — address, contact details, and household settings.

{:ok, user} = Picnic.get_user(client)

This endpoint needs an authenticated client, which makes it the cheapest way to check whether a stored token is still good: an expired one comes back as %Picnic.Error{category: :auth, reason: :unauthorized}.

Summary

Functions

Fetches the logged-in user's profile. Pass as: :struct to decode into a Picnic.Schema.User.

Functions

get(client, opts \\ [])

@spec get(
  Picnic.Client.t(),
  keyword()
) :: {:ok, term()} | {:error, Picnic.Error.t()}

Fetches the logged-in user's profile. Pass as: :struct to decode into a Picnic.Schema.User.