# How to register an OAuth app for Shopify (Public App)

Shopify's Public App connector uses the OAuth 2.0 authorization code grant, allowing your merchants to connect their Shopify stores without creating their own app credentials. You register one Shopify Partners app, and all merchants connect via a standard OAuth installation flow.

## 1. Create a Shopify Partners App

1. Log in to the [Shopify Partners dashboard](https://partners.shopify.com).
2. Navigate to **Apps** and click **Create app**.
3. Choose **Create app manually** and enter your app name.
4. Note the **Client ID** (API key) and **Client secret** — you'll need these later.

## 2. Configure the Redirect URL

In your Shopify Partners app settings, add the Apideck callback URL as an allowed redirect URL:

```
https://unify.apideck.com/vault/callback
```

## 3. Configure API Scopes

In the app configuration, request the following Admin API access scopes:

| Scope                              | Description                      |
| ---------------------------------- | -------------------------------- |
| `read_orders`                      | Read orders                      |
| `read_products`                    | Read products                    |
| `read_customers`                   | Read customers                   |
| `read_inventory`                   | Read inventory                   |
| `read_locations`                   | Read locations                   |
| `read_fulfillments`                | Read fulfillments                |
| `read_assigned_fulfillment_orders` | Read assigned fulfillment orders |
| `read_draft_orders`                | Read draft orders                |
| `read_discounts`                   | Read discounts                   |
| `read_gift_cards`                  | Read gift cards                  |
| `read_returns`                     | Read returns                     |
| `read_shipping`                    | Read shipping                    |
| `read_product_listings`            | Read product listings            |
| `read_locales`                     | Read locales                     |
| `read_metaobjects`                 | Read metaobjects                 |
| `write_webhooks`                   | Manage webhooks                  |

## 4. Configure Shopify in Apideck

1. Go to the [Apideck Dashboard](https://platform.apideck.com/configuration/ecommerce/shopify-public-app)
2. Enter your Shopify Partners app **Client ID** and **Client secret**
3. Review the scopes to ensure they match your Shopify Partners app configuration
4. Click **Save settings**

## Test your integration

After a merchant connects their Shopify store through [Vault](https://platform.apideck.com/vault), you can test the integration using the Apideck Unified APIs.

To retrieve orders from a connected Shopify store:

```bash
curl --location --request GET 'https://unify.apideck.com/ecommerce/orders' \
--header 'x-apideck-consumer-id: test-consumer' \
--header 'x-apideck-app-id: {APIDECK_APP_ID}' \
--header 'x-apideck-service-id: shopify-public-app' \
--header 'Authorization: Bearer {APIDECK_API_KEY}'
```

## Start building with the Shopify API

Learn what else you can [build with the Shopify API](https://shopify.dev/docs) or explore the [Apideck Ecommerce API documentation](https://developers.apideck.com/apis/ecommerce/reference).

## Troubleshooting

### Error: Invalid redirect_uri

Ensure that the redirect URI `https://unify.apideck.com/vault/callback` is added to your Shopify Partners app's allowed redirect URLs.

### Error: OAuth credentials not found

This means the Client ID and Client secret have not been configured at the Integration level in the Apideck Dashboard. Follow [step 4](#4-configure-shopify-in-apideck) above.

### Error: Insufficient scopes

If merchants receive permission errors, verify that the scopes configured in your Shopify Partners app match the scopes listed in [step 3](#3-configure-api-scopes).
