Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding TRANSFER event #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type Webhook = {
| WebhookProductChange
| WebhookSubscriptionExtended
| WebhookTemporaryEntitlementGrant
| WebhookTransfer
}

// Initially based on the samples from https://www.revenuecat.com/docs/integrations/webhooks/sample-events
Expand Down Expand Up @@ -169,6 +170,22 @@ export interface WebhookTemporaryEntitlementGrant {
transaction_id: string
}

/**
* A transfer of transactions and entitlements was initiated between one App User ID(s) to another.
* Please note: The webhook will only be sent for the destination user despite us displaying this
* event in both customer histories because the event body is exactly the same for both users.
*/
export interface WebhookTransfer {
type: 'TRANSFER';
id: string;
app_id: string;
environment: Environment;
store: Store;
event_timestamp_ms: number;
transferred_from: string[],
transferred_to: string[],
}

// Helpers

type Attributes = Record<
Expand Down