Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ivorpad/mercadona-cli/llms.txt

Use this file to discover all available pages before exploring further.

mercadona whoami makes an authenticated request to verify your current session. It calls the Mercadona API and prints your customer ID on success. Use it after import-har, import-curl, or set-refresh to confirm authentication is working before issuing cart or checkout commands.

Synopsis

mercadona whoami [flags]

Flags

FlagDefaultDescription
--wh <code>config [defaults].warehouse, else mad1Warehouse code passed to the API request
--lang <code>config [defaults].lang, else esLanguage for the API response
--jsonfalseEmit raw customer JSON to stdout

Examples

# Check authentication status
mercadona whoami
# ok — authenticated. customer id=12345

# Emit the raw customer API response
mercadona whoami --json

When to Use

Run whoami any time you need to confirm a session is valid:
  • After import-har to verify the HAR was parsed correctly
  • After import-curl to confirm the Bearer token was captured
  • After set-refresh to confirm the refresh token auto-renewed successfully
  • When troubleshooting a 401 error on cart or checkout commands

Common Failure Messages

MessageCauseFix
not authenticated: …No usable session foundRun import-har or set-refresh to seed credentials
401 token_not_validAccess token expiredWith a refresh token the CLI auto-renews; if it still fails, the refresh token has also rotated — re-export a HAR or re-run set-refresh
a cookie alone does not authenticate the APIimport-curl captured a cookie but no Bearer tokenRe-copy a request that includes the authorization: Bearer … header
The customer ID is decoded from the JWT access token’s customer_uuid claim — you never need to know or track it manually. The literal me alias is rejected by the Mercadona API (returns 403), so the CLI always resolves and uses the numeric customer ID extracted from the token.

Build docs developers (and LLMs) love