Connect a workspace
- Redirect the user to
https://app.shoplist.co/api/auth/oauth2/authorize. Sendresponse_type=code,client_id,redirect_uri,state, the space-separatedscope,code_challenge,code_challenge_method=S256, andresource=https://api.shoplist.co/v1. - When the user returns to your callback, verify
state. Exchange thecodewith a form-encodedPOSTtohttps://app.shoplist.co/api/auth/oauth2/token. Sendgrant_type=authorization_code, the sameredirect_uriandresource, and the originalcode_verifier. Authenticate the client with the registered method,client_secret_postorclient_secret_basic. - Send the returned access token as
Authorization: Bearer …tohttps://api.shoplist.co/v1. Access tokens last 300 seconds. CallGET /v1/meto confirm the workspace and granted API scopes.
offline_access, store the refresh token on your server. Refresh with grant_type=refresh_token, the latest refresh_token, and your client authentication at the same token URL. The refresh request can inherit the original resource. Save the replacement refresh token when the server rotates it. If the user revokes the connection, send them through authorization again.
Scopes
Use
exports:write to create and read store exports. The person who approved the connection owns the export, and the workspace pays the credit cost.
Errors and limits
401 unauthenticatedwithWWW-Authenticate: Bearer error="invalid_token"means the API could not authenticate the token. Refresh an expired token. If refresh fails, reconnect the workspace. Use the token at the REST API resource you requested. MCP has its own audience.403 insufficient_scopemeans the caller lacks the scope required by the operation.403 api_access_suspendedmeans the workspace’s API access is suspended.429 rate_limitedmeans you reached your connection’s 60 requests per minute or the workspace’s 5,000 requests per day. The daily counter includes team API keys. FollowRetry-Afteron429and503 service_unavailable.- The authorization server returns
invalid_scopefor unregistered scopes and identity scopes such asopenidandemail. A mismatchedresourcereturnsinvalid_target.
https://api.shoplist.co/.well-known/oauth-protected-resource/v1.