Historical events
The events query and all supporting types are available in the 2026-07 release candidate and unstable.
The events query and all supporting types are available in the 2026-07 release candidate and unstable.
Use the root events query on the Partner API to retrieve a timeline of historical events for the authenticated partner. The connection returns a union of event types, including Relationship, Charge, Earning, SubscriptionStatus, and Credit. These cover installs and uninstalls, billing, payouts, subscription state changes, and credits.
The query returns a PartnerEventConnection with cursor-based pagination. The maximum page size is 250. Requests with first greater than 250 return an error:
Anchor to Access requirementsAccess requirements
- The API client must have the Manage apps permission. See Create a Partner API client.
Anchor to FilteringFiltering
Events are filtered with the EventFilterInput type:
| Field | Type | Description |
|---|---|---|
shopId | ID | Filter to events for a single shop. Example: gid://shopify/Shop/1234. |
subjectType | SubjectType | Filter by subject product type. Currently only APP is supported. |
subjectId | ID | Filter to a single app. Example: gid://shopify/App/1234. |
eventTypes | [EventType!] | Filter to one or more event types (see Event types). |
occurredAtMin | DateTime | Include events on or after this timestamp. |
occurredAtMax | DateTime | Include events on or before this timestamp. |
Anchor to ConstraintsConstraints
- If
shopIdis provided,subjectIdis required. OmittingsubjectIdwhenshopIdis set returns an error. - If
subjectTypeis not provided, the query returns onlyAPPevents.
Anchor to Date range behaviorDate range behavior
- If neither
occurredAtMinnoroccurredAtMaxis provided, the API returns events from the last 30 days. - If only
occurredAtMinis provided,occurredAtMaxdefaults to the earlier ofoccurredAtMin + 30 daysor now. - If only
occurredAtMaxis provided,occurredAtMindefaults tooccurredAtMax - 30 days. - The maximum range between
occurredAtMinandoccurredAtMaxis 365 days. Queries exceeding this range return an error.
Anchor to OrderingOrdering
Results are ordered by occurredAt using the EventOrder argument:
OCCURRED_AT_DESC(default): Newest firstOCCURRED_AT_ASC: Oldest first
Anchor to Event typesEvent types
Every event implements the PartnerEvent interface and exposes id, occurredAt, eventType, subject (the App the event applies to), and shop. The concrete type depends on eventType:
| Concrete type | EventType values | Description |
|---|---|---|
Relationship | RELATIONSHIP_INSTALLED, RELATIONSHIP_UNINSTALLED, RELATIONSHIP_DEACTIVATED, RELATIONSHIP_REACTIVATED | Install, uninstall, or billing-account state change for an app. |
SubscriptionStatus | SUBSCRIPTION_CREATED, SUBSCRIPTION_UPDATED, SUBSCRIPTION_CANCELED, SUBSCRIPTION_CANCELLATION_SCHEDULED, SUBSCRIPTION_FROZEN, SUBSCRIPTION_UNFROZEN | Creation, update, cancellation, or freeze/unfreeze of a subscription. |
Charge | CHARGE_ONE_TIME, CHARGE_RECURRING, CHARGE_USAGE | The merchant was billed. |
Earning | EARNING_CHARGE_ONE_TIME, EARNING_CHARGE_RECURRING, EARNING_CHARGE_USAGE, EARNING_REFUND, EARNING_ADJUSTMENT, EARNING_CREDIT | The Partner received (or refunded) payment. |
Credit | CREDIT_PENDING, CREDIT_APPLIED, CREDIT_FAILED | A credit was issued, applied, or failed. |
Use inline fragments to select fields on each concrete type.
Anchor to ExampleExample
Historical events
Query: All event types
query HistoricalEvents($filter: EventFilterInput, $cursor: String) {
events(filter: $filter, orderBy: OCCURRED_AT_DESC, first: 100, after: $cursor) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
id
occurredAt
eventType
shop {
id
myshopifyDomain
}
subject {
... on AppReference {
id
name
apiKey
}
}
... on Relationship {
state
reason
reasonDescription
}
... on SubscriptionStatus {
state
cancelEffectiveOn
plan {
handle
billingPeriod
trialDays
trialDaysRemaining
prices {
__typename
currencyCode
... on FlatRatePlanPrice {
amount
}
... on TieredPlanPrice {
tiersMode
tiers {
upTo
amountPerUnit
amount
}
}
}
}
}
... on Charge {
chargeId
chargeType
amount {
amount
currencyCode
}
usageQuantity
planHandle
balanceUsed
description
metadata {
legacyChargeId
}
}
... on Earning {
earningType
chargeId
grossAmount {
amount
currencyCode
}
netAmount {
amount
currencyCode
}
shopifyFee {
amount
currencyCode
}
settlementDate
description
}
... on Credit {
status
money {
amount
currencyCode
}
description
}
}
}
}
}Variables — charges for a single app this month
{
"filter": {
"subjectType": "APP",
"subjectId": "gid://shopify/App/1234",
"eventTypes": ["CHARGE_ONE_TIME", "CHARGE_RECURRING", "CHARGE_USAGE"],
"occurredAtMin": "2026-04-01T00:00:00Z",
"occurredAtMax": "2026-04-30T23:59:59Z"
},
"cursor": null
}Variables — installs and uninstalls for one app on one shop
{
"filter": {
"subjectId": "gid://shopify/App/1234",
"shopId": "gid://shopify/Shop/5678",
"eventTypes": ["RELATIONSHIP_INSTALLED", "RELATIONSHIP_UNINSTALLED"]
}
}Anchor to PaginationPagination
Use cursor-based pagination with first and after (forward) or last and before (backward). The maximum page size is 250. The pageInfo object exposes hasNextPage, hasPreviousPage, startCursor, and endCursor.
Requests with first greater than 250 return an error. Use after: $cursor with the endCursor from pageInfo to page through large result sets.
Requests with first greater than 250 return an error. Use after: $cursor with the endCursor from pageInfo to page through large result sets.
Anchor to Backfilled eventsBackfilled events
Some events represent charges that were originally created through the legacy Billing API and later backfilled into the historical events system. For these events, the metadata.legacyChargeId field on Charge and Earning exposes the original billing record ID so you can reconcile against prior reports.
Anchor to Error handlingError handling
| Condition | Behavior |
|---|---|
| Date range exceeds 365 days | Returns a GraphQL execution error |
| Feature not enabled for the organization | Returns a GraphQL execution error |
first greater than 250 | Returns a GraphQL execution error |
shopId provided without subjectId | Returns a GraphQL execution error: You must specify a subjectId when filtering by shopId. |