# RevenueCat

> Look up RevenueCat projects and customers, and check a customer's subscription status and the entitlements they currently have access to. Read-only access to the RevenueCat REST API v2.

App · Payments & Billing · 5 actions. Web page: https://docs.lodol.com/docs/integrations/revenuecat

## Actions

### Get customer

Look up a single customer by their App User ID, including the entitlements they currently have active. Optionally expand the customer's subscriber attributes (such as $email).

**Inputs**

- Project ID (`project_id`, text, required): The RevenueCat project ID, for example 'proj1ab2c3d4'. Use the 'List projects' action to find it.
- Customer ID (`customer_id`, text, required): The customer's App User ID in RevenueCat. Use the 'List customers' action (optionally searching by email) to find it.
- Include attributes (`expand_attributes`, true/false): Set to true to also return the customer's subscriber attributes (name, email, and any custom attributes). Default: `false`.

**Outputs**: The customer object. 'active_entitlements' lists the entitlements the customer currently has access to.

- `active_entitlements` (list): Entitlements currently active for the customer.
- `first_seen_at` (number): First seen (ms since epoch).
- `id` (text): The customer's App User ID.
- `last_seen_at` (number): Last seen (ms since epoch).
- `last_seen_country` (text): Last country (ISO code).
- `last_seen_platform` (text): Last platform (e.g. 'ios').
- `project_id` (text): ID of the owning project.

**Example output**

```json
{
  "active_entitlements": [
    {
      "entitlement_id": "entla1b2c3d4e5",
      "expires_at": 1721735423658
    }
  ],
  "first_seen_at": 1658399423658,
  "id": "app_user_0f8fad5b",
  "last_seen_app_version": "2.4.1",
  "last_seen_at": 1690199423658,
  "last_seen_country": "US",
  "last_seen_platform": "ios",
  "project_id": "proj1ab2c3d4"
}
```

### List customer active entitlements

List the entitlements a customer currently has access to: the quickest way to check whether a user should be granted premium features right now.

**Inputs**

- Project ID (`project_id`, text, required): The RevenueCat project ID, for example 'proj1ab2c3d4'. Use the 'List projects' action to find it.
- Customer ID (`customer_id`, text, required): The customer's App User ID in RevenueCat. Use the 'List customers' action (optionally searching by email) to find it.
- Limit (`limit`, number): Maximum number of results to return per page (default 20). At least 1.
- Continue after ID (`starting_after`, text): For pagination: the ID of the last item from the previous page. Leave blank for the first page.

**Outputs**

- `active_entitlements` (list): The entitlements currently active for the customer.
- `next_page` (text): URL of the next page, or null.

**Example output**

```json
{
  "active_entitlements": [
    {
      "entitlement_id": "entla1b2c3d4e5",
      "expires_at": 1721735423658
    },
    {
      "entitlement_id": "entlf6g7h8i9j0",
      "expires_at": null
    }
  ],
  "next_page": null
}
```

### List customer subscriptions

List a customer's subscriptions with their current status (active, trialing, expired, and so on), whether each one currently grants access, and its renewal state. Optionally filter to the sandbox or production environment.

**Inputs**

- Project ID (`project_id`, text, required): The RevenueCat project ID, for example 'proj1ab2c3d4'. Use the 'List projects' action to find it.
- Customer ID (`customer_id`, text, required): The customer's App User ID in RevenueCat. Use the 'List customers' action (optionally searching by email) to find it.
- Environment (`environment`, text): Optional. Only include subscriptions from this store environment: 'production' or 'sandbox'. Leave blank for both. One of: `production`, `sandbox`.
- Limit (`limit`, number): Maximum number of results to return per page (default 20). At least 1.
- Continue after ID (`starting_after`, text): For pagination: the ID of the last item from the previous page. Leave blank for the first page.

**Outputs**

- `next_page` (text): URL of the next page, or null.
- `subscriptions` (list): The customer's subscriptions.

**Example output**

```json
{
  "next_page": null,
  "subscriptions": [
    {
      "auto_renewal_status": "will_renew",
      "current_period_ends_at": 1690991423658,
      "current_period_starts_at": 1688399423658,
      "customer_id": "app_user_0f8fad5b",
      "ends_at": 1690991423658,
      "environment": "production",
      "gives_access": true,
      "id": "sub1ab2c3d4e5",
      "management_url": "https://apps.apple.com/account/subscriptions",
      "presented_offering_id": "ofrnge1a2b3c4d5",
      "product_id": "prod1a2b3c4d5e",
      "starts_at": 1658399423658,
      "status": "active",
      "store": "app_store",
      "total_revenue_in_usd": {
        "commission": 2.99,
        "currency": "USD",
        "gross": 9.99,
        "proceeds": 6.25,
        "tax": 0.75
      }
    }
  ]
}
```

### List customers

List customers in a RevenueCat project, or find a specific customer by their email address.

**Inputs**

- Project ID (`project_id`, text, required): The RevenueCat project ID, for example 'proj1ab2c3d4'. Use the 'List projects' action to find it.
- Email (`email`, text): Optional. Search for a customer by exact email address (matches the customer's $email attribute).
- Limit (`limit`, number): Maximum number of results to return per page (default 20). At least 1.
- Continue after ID (`starting_after`, text): For pagination: the ID of the last item from the previous page. Leave blank for the first page.

**Outputs**

- `customers` (list): The customers in the project.
- `next_page` (text): URL of the next page, or null.

**Example output**

```json
{
  "customers": [
    {
      "first_seen_at": 1658399423658,
      "id": "app_user_0f8fad5b",
      "last_seen_app_version": "2.4.1",
      "last_seen_at": 1690199423658,
      "last_seen_country": "US",
      "last_seen_platform": "ios",
      "project_id": "proj1ab2c3d4"
    }
  ],
  "next_page": null
}
```

### List projects

List the RevenueCat projects your API key can access. Every other action needs a project ID, so this is usually the first step.

**Inputs**

- Limit (`limit`, number): Maximum number of results to return per page (default 20). At least 1.
- Continue after ID (`starting_after`, text): For pagination: the ID of the last item from the previous page. Leave blank for the first page.

**Outputs**

- `next_page` (text): URL of the next page of results, or null when there are no more.
- `projects` (list): The projects the API key can access.

**Example output**

```json
{
  "next_page": null,
  "projects": [
    {
      "created_at": 1658399423658,
      "icon_url": null,
      "id": "proj1ab2c3d4",
      "name": "MagicWeather"
    }
  ]
}
```
