> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Partner OAuth

> Connect a customer's Shoplist workspace to your partner app with authorization code and PKCE.

Partner OAuth lets a Shoplist user approve your app to call the REST API for their workspace. To get a confidential client, [contact Shoplist](mailto:support@shoplist.co) with your app name, exact HTTPS callback URLs, and required scopes. Store the client secret on your server.

## Connect a workspace

1. Redirect the user to `https://app.shoplist.co/api/auth/oauth2/authorize`. Send `response_type=code`, `client_id`, `redirect_uri`, `state`, the space-separated `scope`, `code_challenge`, `code_challenge_method=S256`, and `resource=https://api.shoplist.co/v1`.
2. When the user returns to your callback, verify `state`. Exchange the `code` with a form-encoded `POST` to `https://app.shoplist.co/api/auth/oauth2/token`. Send `grant_type=authorization_code`, the same `redirect_uri` and `resource`, and the original `code_verifier`. Authenticate the client with the registered method, `client_secret_post` or `client_secret_basic`.
3. Send the returned access token as `Authorization: Bearer …` to `https://api.shoplist.co/v1`. Access tokens last 300 seconds. Call `GET /v1/me` to confirm the workspace and granted API scopes.

If you requested `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

| Scope | Permission |
| - | - |
| `stores:read` | Look up, enrich, count, and search stores and read the store taxonomy. |
| `apps:read` | Look up and search Shopify apps. |
| `contacts:search` | Search masked contact previews. |
| `contacts:reveal` | Reveal full contact records for unlocked stores. |
| `exports:write` | Create and download store exports, which spend workspace credits. |
| `usage:read` | Read the workspace's API usage and allowance. |
| `offline_access` | Refresh your connection after the user's Shoplist sign-in ends. |

Use `exports:write` to create and read [store exports](/docs/exports.md). The person who approved the connection owns the export, and the workspace pays the credit cost.

## Errors and limits

* `401 unauthenticated` with `WWW-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_scope` means the caller lacks the scope required by the operation. `403 api_access_suspended` means the workspace's API access is suspended.
* `429 rate_limited` means 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. Follow `Retry-After` on `429` and `503 service_unavailable`.
* The authorization server returns `invalid_scope` for unregistered scopes and identity scopes such as `openid` and `email`. A mismatched `resource` returns `invalid_target`.

Clients can discover the resource at `https://api.shoplist.co/.well-known/oauth-protected-resource/v1`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.