RevenueCat API for in-app purchases. Use when user mentions "RevenueCat", "in-app purchase", "subscription", or mobile monetization.
If requests fail, run zero doctor check-connector --env-name REVENUECAT_TOKEN or zero doctor check-connector --url https://api.revenuecat.com/v1/subscribers/APP_USER_ID --method GET
All examples below assume you have REVENUECAT_TOKEN set.
RevenueCat has two API versions:
https://api.revenuecat.com/v1): Mature, recommended for subscriber lookupshttps://api.revenuecat.com/v2): Newer, project-scoped, for managing products/offerings/entitlementsBoth use Bearer token authentication.
Replace PROJECT_ID with your RevenueCat project ID and APP_USER_ID with the customer's app user ID.
Retrieve a customer's subscription status, entitlements, and purchase history. This is the most commonly used endpoint.
curl -s "https://api.revenuecat.com/v1/subscribers/APP_USER_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.subscriber | {entitlements, subscriptions, non_subscriptions}'
Extract only the active entitlements for a customer.
curl -s "https://api.revenuecat.com/v1/subscribers/APP_USER_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.subscriber.entitlements | to_entries[] | select(.value.expires_date == null or (.value.expires_date | fromdateiso8601 > now)) | {name: .key, product: .value.product_identifier, expires: .value.expires_date}'
Create a new customer or update attributes for an existing one.
curl -s -X POST "https://api.revenuecat.com/v1/subscribers/APP_USER_ID/attributes" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d '{"attributes": {"$email": {"value": "[email protected]"}, "$displayName": {"value": "John Doe"}}}' | jq .
Permanently delete a customer and their data (for GDPR compliance).
curl -s -X DELETE "https://api.revenuecat.com/v1/subscribers/APP_USER_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
Grant a customer access to an entitlement for a specific duration.
Write to /tmp/revenuecat_request.json:
{
"duration": "monthly",
"start_time_ms": 1672531200000
}
Duration values: daily, three_day, weekly, monthly, two_month, three_month, six_month, yearly, lifetime.
curl -s -X POST "https://api.revenuecat.com/v1/subscribers/APP_USER_ID/entitlements/ENTITLEMENT_ID/promotional" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
Revoke all promotional entitlements for a customer.
curl -s -X POST "https://api.revenuecat.com/v1/subscribers/APP_USER_ID/entitlements/ENTITLEMENT_ID/revoke_promotionals" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
Post a receipt from a store (Apple, Google, Stripe, etc.) to RevenueCat.
Write to /tmp/revenuecat_request.json:
{
"app_user_id": "APP_USER_ID",
"fetch_token": "RECEIPT_TOKEN",
"product_id": "com.example.premium_monthly"
}
curl -s -X POST "https://api.revenuecat.com/v1/receipts" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {id, lookup_key, display_name, is_current}'
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings/OFFERING_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
Write to /tmp/revenuecat_request.json:
{
"lookup_key": "premium",
"display_name": "Premium"
}
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
curl -s -X DELETE "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings/OFFERING_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/products" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {id, store_identifier, app_id, type}'
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/products/PRODUCT_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
Write to /tmp/revenuecat_request.json:
{
"store_identifier": "com.example.premium_monthly",
"app_id": "APP_ID",
"type": "subscription"
}
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/products" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
curl -s -X DELETE "https://api.revenuecat.com/v2/projects/PROJECT_ID/products/PRODUCT_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/entitlements" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {id, lookup_key, display_name}'
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/entitlements/ENTITLEMENT_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
Write to /tmp/revenuecat_request.json:
{
"lookup_key": "premium",
"display_name": "Premium Access"
}
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/entitlements" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/entitlements/ENTITLEMENT_ID/actions/attach_products" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d '{"product_ids": ["PRODUCT_ID_1", "PRODUCT_ID_2"]}' | jq .
curl -s -X DELETE "https://api.revenuecat.com/v2/projects/PROJECT_ID/entitlements/ENTITLEMENT_ID" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq .
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings/OFFERING_ID/packages" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {id, lookup_key, display_name}'
Write to /tmp/revenuecat_request.json:
{
"lookup_key": "monthly",
"display_name": "Monthly",
"position": 1
}
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings/OFFERING_ID/packages" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d @/tmp/revenuecat_request.json | jq .
curl -s -X POST "https://api.revenuecat.com/v2/projects/PROJECT_ID/offerings/OFFERING_ID/packages/PACKAGE_ID/actions/attach_products" --header "Content-Type: application/json" --header "Authorization: Bearer $REVENUECAT_TOKEN" -d '{"product_ids": ["PRODUCT_ID"]}' | jq .
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/customers/APP_USER_ID/subscriptions" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {id, product_identifier, store, status, expires_date}'
curl -s "https://api.revenuecat.com/v2/projects/PROJECT_ID/customers/APP_USER_ID/active_entitlements" --header "Authorization: Bearer $REVENUECAT_TOKEN" | jq '.items[] | {entitlement_identifier, expires_date}'
--header "Authorization: Bearer $REVENUECAT_TOKEN"sk_) for server-side calls. Never expose secret keys in client apps$ (e.g., $email, $displayName, $phoneNumber) for standard fieldslifetime for permanent access