# New App Relationship Events — Shopify Partner

> Emit new events when new shops installs, uninstalls, subscribes or unsubscribes your app.

- Key: `shopify_partner-new-app-relationship-events`
- Type: Trigger (Polling)
- Version: 0.1.4
- App: Shopify Partner (`shopify_partner`) — https://pipedream.com/apps/shopify-partner.md
- This page (HTML): https://pipedream.com/apps/shopify-partner/triggers/new-app-relationship-events
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/shopify_partner/sources/new-app-relationship-events/new-app-relationship-events.mjs

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | API Polling Frequency |
| `appId` | `string` | Yes | Open your app in the partner portal, and look at the URL to find its ID. If your URL is https://partners.shopify.com/3027494/apps/51358007297/overview, enter 51358007297 here. |
| `occurredAtMin` | `string` | No | Only include events after this specific time (ISO timestamp) |
| `occurredAtMax` | `string` | No | Only include events up to this specific time (ISO timestamp) |
| `recordsPerRun` | `integer` | No | Number of records to retrieve per run |
| `paginationDirection` | `string` | Yes | Which direction to paginate through records. Forwards will only look into the future, whereas backwards will comb through all records. |

## Returns

Events emitted by Shopify Partner.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "shopify_partner-new-app-relationship-events",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shopify_partner: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    appId: "Shopify App ID",
  },
  webhookUrl: "https://example.com/webhooks/shopify-partner",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "shopify_partner-new-app-relationship-events",
    "webhook_url": "https://example.com/webhooks/shopify-partner",
    "configured_props": {
      "shopify_partner": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "appId": "Shopify App ID"
    }
  }'
```

**MCP**

MCP servers expose Shopify Partner actions as on-demand tools.

New App Relationship Events is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/shopify-partner.md · All apps: https://pipedream.com/apps
