Skip to content

Instantly share code, notes, and snippets.

@JavascriptMick
Last active January 19, 2025 15:43
Show Gist options
  • Save JavascriptMick/233358b6a00d6d733ed9a630db587c2d to your computer and use it in GitHub Desktop.
Save JavascriptMick/233358b6a00d6d733ed9a630db587c2d to your computer and use it in GitHub Desktop.
RevenueCat Rest API V2 with Typescript
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/projects": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of projects
* @description This endpoint requires the following permission(s): <code>project_configuration:projects:read</code>.
*/
get: operations["list-projects"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/apps": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of apps
* @description This endpoint requires the following permission(s): <code>project_configuration:apps:read</code>.
*/
get: operations["list-apps"];
put?: never;
/**
* Create an App
* @description This endpoint requires the following permission(s): <code>project_configuration:apps:read_write</code>.
*/
post: operations["create-app"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/apps/{app_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get an app
* @description This endpoint requires the following permission(s): <code>project_configuration:apps:read</code>.
*/
get: operations["get-app"];
put?: never;
/**
* Update an app
* @description This endpoint requires the following permission(s): <code>project_configuration:apps:read_write</code>.
*/
post: operations["update-app"];
/**
* Delete an app
* @description This endpoint requires the following permission(s): <code>project_configuration:apps:read_write</code>.
*/
delete: operations["delete-app"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of customers
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read</code>.
*/
get: operations["list-customers"];
put?: never;
/**
* Create a customer
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read_write</code>.
*/
post: operations["create-customer"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a customer
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read</code>.
*/
get: operations["get-customer"];
put?: never;
post?: never;
/**
* Delete a customer
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read_write</code>.
*/
delete: operations["delete-customer"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/products/{product_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a product
* @description This endpoint requires the following permission(s): <code>project_configuration:products:read</code>.
*/
get: operations["get-product"];
put?: never;
post?: never;
/**
* Delete a product
* @description This endpoint requires the following permission(s): <code>project_configuration:products:read_write</code>.
*/
delete: operations["delete-product"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of products
* @description This endpoint requires the following permission(s): <code>project_configuration:products:read</code>.
*/
get: operations["list-products"];
put?: never;
/**
* Create a product
* @description <div class="theme-admonition theme-admonition-info alert alert--warning">
* <div class="heading">Warning</div>
* <div>This endpoint does not allow to create RevenueCat Billing products.</div>
* This endpoint requires the following permission(s): <code>project_configuration:products:read_write</code>.
*/
post: operations["create-product"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/entitlements/{entitlement_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read</code>.
*/
get: operations["get-entitlement"];
put?: never;
/**
* Update an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read_write</code>.
*/
post: operations["update-entitlement"];
/**
* Delete an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read_write</code>.
*/
delete: operations["delete-entitlement"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/entitlements": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of entitlements
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read</code>.
*/
get: operations["list-entitlements"];
put?: never;
/**
* Create an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read_write</code>.
*/
post: operations["create-entitlement"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/entitlements/{entitlement_id}/products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of products attached to a given entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read</code>.
*/
get: operations["get-products-from-entitlement"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/entitlements/{entitlement_id}/actions/attach_products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Attach a set of products to an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read_write</code>.
*/
post: operations["attach-products-to-entitlement"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/entitlements/{entitlement_id}/actions/detach_products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Detach a set of product from an entitlement
* @description This endpoint requires the following permission(s): <code>project_configuration:entitlements:read_write</code>.
*/
post: operations["detach-products-from-entitlement"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/offerings/{offering_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get an offering
* @description This endpoint requires the following permission(s): <code>project_configuration:offerings:read</code>.
*/
get: operations["get-offering"];
put?: never;
/**
* Update an offering
* @description This endpoint requires the following permission(s): <code>project_configuration:offerings:read_write</code>.
*/
post: operations["update-offering"];
/**
* Delete an offering and its attached packages
* @description This endpoint requires the following permission(s): <code>project_configuration:offerings:read_write</code>.
*/
delete: operations["delete-offering"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/offerings": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of offerings
* @description This endpoint requires the following permission(s): <code>project_configuration:offerings:read</code>.
*/
get: operations["list-offerings"];
put?: never;
/**
* Create an offering
* @description This endpoint requires the following permission(s): <code>project_configuration:offerings:read_write</code>.
*/
post: operations["create-offering"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/packages/{package_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read</code>.
*/
get: operations["get-package"];
put?: never;
/**
* Update a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read_write</code>.
*/
post: operations["update-package"];
/**
* Delete a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read_write</code>.
*/
delete: operations["delete-package-from-offering"];
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/offerings/{offering_id}/packages": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of packages in an offering
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read</code>.
*/
get: operations["list-packages"];
put?: never;
/**
* Create a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read_write</code>.
*/
post: operations["create-packages"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/packages/{package_id}/products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of products attached to a given package of an offering
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read</code>.
*/
get: operations["get-products-from-package"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/packages/{package_id}/actions/attach_products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Attach a set of products to a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read_write</code>.
*/
post: operations["attach-products-to-package"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/packages/{package_id}/actions/detach_products": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Detach a set of products from a package
* @description This endpoint requires the following permission(s): <code>project_configuration:packages:read_write</code>.
*/
post: operations["detach-products-from-package"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/subscriptions/{subscription_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a subscription
* @description This endpoint requires the following permission(s): <code>customer_information:subscriptions:read</code>.
*/
get: operations["get-subscription"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/subscriptions/{subscription_id}/entitlements": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of entitlements associated with a subscription
* @description Lists all Entitlements granted by a Subscription.
* This endpoint requires the following permission(s): <code>customer_information:subscriptions:read</code>.
*/
get: operations["list-subscription-entitlements"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/subscriptions/{subscription_id}/actions/cancel": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Cancel an active RevenueCat Billing subscription
* @description Cancel an active RevenueCat Billing subscription. The customer will lose access to the associated entitlements at the end of the current period.
* This endpoint requires the following permission(s): <code>customer_information:subscriptions:read_write</code>.
*/
post: operations["cancel-subscription"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/subscriptions/{subscription_id}/actions/refund": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Refund an active RevenueCat Billing subscription
* @description Cancel a RevenueCat Billing subscription by refunding the most recent payment. The customer will immediately lose access to the associated entitlements.
* This endpoint requires the following permission(s): <code>customer_information:subscriptions:read_write</code>.
*/
post: operations["refund-subscription"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/subscriptions": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of subscriptions associated with a customer
* @description This endpoint requires the following permission(s): <code>customer_information:subscriptions:read</code>.
*/
get: operations["list-subscriptions"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/purchases/{purchase_id}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a purchase
* @description This endpoint requires the following permission(s): <code>customer_information:purchases:read</code>.
*/
get: operations["get-purchase"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/purchases/{purchase_id}/entitlements": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of entitlements associated with a purchase
* @description Lists all Entitlements granted by a Purchase.
* This endpoint requires the following permission(s): <code>customer_information:purchases:read</code>.
*/
get: operations["list-purchase-entitlements"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/purchases/{purchase_id}/actions/refund": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Refund a RevenueCat Billing purchase
* @description Refund a RevenueCat Billing purchase and revoke access to associated granted entitlements.
* This endpoint requires the following permission(s): <code>customer_information:purchases:read_write</code>.
*/
post: operations["refund-purchase"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/purchases": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of purchases associated with a customer
* @description This endpoint requires the following permission(s): <code>customer_information:purchases:read</code>.
*/
get: operations["list-purchases"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/active_entitlements": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of customer's active entitlements
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read</code>.
*/
get: operations["list-customer-active-entitlements"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/aliases": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of the customer's aliases
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read</code>.
*/
get: operations["list-customer-aliases"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/attributes": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of the customer's attributes
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read</code>.
*/
get: operations["list-customer-attributes"];
put?: never;
/**
* Set a customer's attributes
* @description This endpoint requires the following permission(s): <code>customer_information:customers:read_write</code>.
*/
post: operations["set-customer-attributes"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/invoices": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get a list of the customer's invoices
* @description This endpoint requires the following permission(s): <code>customer_information:invoices:read</code>.
*/
get: operations["list-customer-invoices"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/customers/{customer_id}/invoices/{invoice_id}/file": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get an invoice
* @description This endpoint requires the following permission(s): <code>customer_information:invoices:read</code>.
*/
get: operations["get-invoice"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/projects/{project_id}/metrics/overview": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get overview metrics for a project
* @description This endpoint requires the following permission(s): <code>charts_metrics:overview:read</code>.
*/
get: operations["get-overview-metrics"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
}
export type webhooks = Record<string, never>;
export interface components {
schemas: {
AmazonApp: {
/** @description Amazon type details */
amazon?: {
/** @description The package name of the app */
package_name: string;
};
};
AmazonAppCreate: {
/** @description Amazon type details. Should only be used when type is amazon. */
amazon?: {
/** @description The package name of the app */
package_name: string;
/** @description Your Amazon Developer Identity Shared Key */
shared_secret?: string;
};
};
App: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "app";
/**
* @description The id of the app
* @example app1a2b3c4
*/
id: string;
/** @description The name of the app */
name: string;
/**
* @description The date when the app was created in ms since epoch
* @example 1658399423658
*/
created_at: number;
/**
* @description The platform of the app
* @example app_store
* @enum {string}
*/
type: "amazon" | "app_store" | "mac_app_store" | "play_store" | "stripe" | "rc_billing" | "roku";
/**
* @description The id of the project
* @example proj1a2b3c4
*/
project_id: string;
} & components["schemas"]["AmazonApp"] & components["schemas"]["AppStoreApp"] & components["schemas"]["MacAppStoreApp"] & components["schemas"]["PlayStoreApp"] & components["schemas"]["StripeApp"] & components["schemas"]["RCBillingApp"] & components["schemas"]["RokuApp"];
AppCreate: {
/** @description The name of the app */
name: string;
/**
* @description The platform of the app.
* Mac App Store is disabled by default. See [Legacy Mac Apps](https://www.revenuecat.com/docs/legacy-mac-apps) for more details.
*
* @enum {string}
*/
type: "amazon" | "app_store" | "mac_app_store" | "play_store" | "stripe" | "rc_billing" | "roku";
} & components["schemas"]["AmazonAppCreate"] & components["schemas"]["AppStoreAppCreate"] & components["schemas"]["MacAppStoreAppCreate"] & components["schemas"]["PlayStoreAppCreate"] & components["schemas"]["StripeAppCreate"] & components["schemas"]["RCBillingAppCreate"] & components["schemas"]["RokuAppCreate"];
AppStoreApp: {
/** @description App Store type details */
app_store?: {
/** @description The bundle ID of the app */
bundle_id: string;
};
};
AppStoreAppCreate: {
/** @description App Store type details. Should only be used when type is app_store. */
app_store?: {
/** @description The bundle ID of the app */
bundle_id: string;
/** @description The shared secret of the app */
shared_secret?: string;
/** @description PKCS /#8 In App Key downloaded from App Store Connect in PEM format. Copy the contents
* of the file in this field. See instructions on how to get it in:
* https://www.revenuecat.com/docs/in-app-purchase-key-configuration
* */
subscription_private_key: string;
/** @description In App Key id. The ID of the downloaded in app key. You can get it from App Store Connect */
subscription_key_id: string;
/** @description The key Issuer id. See instructions on how to obtain this in: https://www.revenuecat.com/docs/in-app-purchase-key-configuration#3-providing-the-issuer-id-to-revenuecat */
subscription_key_issuer: string;
};
};
/**
* @description The country that the object is associated with, in ISO alpha 2 code
* @example US
* @enum {string|null}
*/
Country: null | "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BV" | "BR" | "IO" | "BN" | "BG" | "BF" | "BI" | "CV" | "KH" | "CM" | "CA" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CD" | "CG" | "CK" | "CR" | "HR" | "CU" | "CW" | "CY" | "CZ" | "CI" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "SZ" | "ET" | "FK" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "HM" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KP" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "MK" | "RO" | "RU" | "RW" | "RE" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "UM" | "US" | "UY" | "UZ" | "VU" | "VE" | "VN" | "VG" | "VI" | "WF" | "EH" | "YE" | "ZM" | "ZW" | "AX";
/**
* @description ISO 4217 currency code
* @example USD
* @enum {string}
*/
Currency: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTC" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNH" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "SSP" | "STD" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VEF" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XAG" | "XAU" | "XCD" | "XDR" | "XOF" | "XPD" | "XPF" | "XPT" | "YER" | "ZAR" | "ZMW" | "ZWL";
Customer: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "customer";
/** @example 19b8de26-77c1-49f1-aa18-019a391603e2 */
id: string;
/**
* @description ID of the project to which the customer belongs
* @example proj1ab2c3d4
*/
project_id: string;
/**
* @description The first time the customer was seen
* @example 1658399423658
*/
first_seen_at: number;
/**
* @description The last time the customer was seen
* @example 1658399423658
*/
last_seen_at: number | null;
active_entitlements?: components["schemas"]["ListCustomerActiveEntitlements"];
/** @description The experiment enrollment object */
experiment?: components["schemas"]["ExperimentEnrollment"];
attributes?: components["schemas"]["ListCustomerAttributes"];
};
CustomerAlias: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "customer.alias";
/** @example 19b8de26-77c1-49f1-aa18-019a391603e2 */
id: string;
/**
* @description The time when the alias was created
* @example 1658399423658
*/
created_at: number;
};
CustomerAttribute: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "customer.attribute";
/**
* @description The name of the attribute. Reserved attributes are prefixed with a `$`.
* @example $email
*/
name: string;
/**
* @description The value of the attribute.
* @example [email protected]
*/
value: string | null;
/**
* @description The time when the attribute was last updated.
* @example 1658399423658
*/
updated_at: number;
};
/** @example opt_into_marketing */
CustomerAttributeCustomName: string;
/**
* @example $email
* @enum {string}
*/
CustomerAttributeReservedName: "$ad" | "$adGroup" | "$adjustId" | "$airshipChannelId" | "$amazonAdId" | "$amplitudeDeviceId" | "$amplitudeUserId" | "$appleRefundHandlingPreference" | "$apnsTokens" | "$appsflyerId" | "$appsflyerSharingFilter" | "$attConsentStatus" | "$branchId" | "$brazeAliasLabel" | "$brazeAliasName" | "$campaign" | "$clevertapId" | "$creative" | "$displayName" | "$email" | "$fbAnonId" | "$fcmTokens" | "$firebaseAppInstanceId" | "$gpsAdId" | "$idfa" | "$idfv" | "$ip" | "$iterableCampaignId" | "$iterableTemplateId" | "$iterableUserId" | "$keyword" | "$kochavaDeviceId" | "$mediaSource" | "$mixpanelDistinctId" | "$mparticleId" | "$onesignalId" | "$onesignalUserId" | "$phoneNumber" | "$posthogUserId" | "$telemetryDeckUserId" | "$telemetryDeckAppId" | "telemetry_deck_user_id" | "telemetry_deck_app_id" | "$segmentId" | "$tenjinId" | "$deviceVersion";
CustomerEntitlement: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "customer.active_entitlement";
/**
* @description ID of the entitlement granted to the customer
* @example entla1b2c3d4e5
*/
entitlement_id: string;
/**
* @description The date after which the access to the entitlement expires in ms since epoch
* @example 1658399423658
*/
expires_at: number | null;
};
DeletedObject: {
/**
* @description The type of the deleted object
* @enum {string}
*/
object: "app" | "customer" | "entitlement" | "offering" | "package" | "product";
/** @description The ID of the deleted object */
id: string;
/**
* @description The date when the object was deleted in ms since epoch
* @example 1658399423658
*/
deleted_at: number;
};
/** @enum {string} */
EligibilityCriteria: "all" | "google_sdk_lt_6" | "google_sdk_ge_6";
Entitlement: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "entitlement";
/**
* @description ID of the project to which the entitlement belongs
* @example proj1ab2c3d4
*/
project_id: string;
/**
* @description The id of the entitlement
* @example entla1b2c3d4e5
*/
id: string;
/**
* @description A custom identifier of the entitlement
* @example premium
*/
lookup_key: string;
/**
* @description The display name of the entitlement
* @example Premium
*/
display_name: string;
/**
* @description The date when the entitlement was created in ms since epoch
* @example 1658399423658
*/
created_at: number;
/**
* ProductsList
* @description List of products attached to the entitlement
*/
products?: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Product"][];
/**
* @description URL to access the next page of the Entitlement's products. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/entitlements/entle1a2b3c4d5/products?starting_after=prodeab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/entitlements/entle1a2b3c4d5/products
*/
url: string;
} | null;
};
/**
* @description The store environment
* @example production
* @enum {string}
*/
Environment: "production" | "sandbox";
Error: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @example error
* @enum {string}
*/
object: "error";
/**
* @description The error type
* @example parameter_error
* @enum {string}
*/
type: "parameter_error" | "resource_already_exists" | "resource_missing" | "idempotency_error" | "rate_limit_error" | "authentication_error" | "authorization_error" | "store_error" | "server_error" | "resource_locked_error" | "unprocessable_entity_error" | "invalid_request";
/**
* @description If the error is parameter-specific, the parameter related to the error
* @example customer_id
*/
param?: string | null;
/**
* @description A URL to more information about the error reported
* @example https://errors.rev.cat/parameter-error
*/
doc_url?: string;
/**
* @description A message describing the reason of the error
* @example id shouldn't be longer than 1,500 characters
*/
message: string;
/**
* @description Indicates if the error is retryable or not
* @example false
*/
retryable: boolean;
/**
* @description The ms the client should wait before retrying the request. Only present for retryable errors.
* @example null
*/
backoff_ms?: number | null;
};
ExperimentEnrollment: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "experiment_enrollment";
id: string;
name: string;
/**
* @description The variant of the Experiment that the Customer was or is assigned to, where 'a' represents the Control, and 'b' represents the Treatment.
* @example a
*/
variant: string;
} | null;
Invoice: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "invoice";
/**
* @description The id of the invoice
* @example rcbin1a2b3c4d5e
*/
id: string;
total_amount: components["schemas"]["MonetaryAmount"];
/**
* InvoiceLiteItemList
* @description List of line items that are part of the invoice. Each line item represents a product that was purchased.
*/
line_items: components["schemas"]["InvoiceLineItem"][];
/**
* @description The date when the invoiced was issued in ms since epoch
* @example 1658399423658
*/
issued_at: number;
/**
* @description The date when the invoiced was paid in ms since epoch
* @example 1658399423658
*/
paid_at: number | null;
/**
* @description URL to download the invoice pdf
* @example https://api.revenuecat.com/v2/projects/proj1ab2c3d4/customers/cust1ab2c3d4/invoices/inv1ab2c3d4/file
*/
invoice_url: string | null;
};
InvoiceLineItem: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "invoice.line_item";
/**
* @description The product identifier
* @example rc_1w_199
*/
product_identifier: string;
/**
* @description The display name of the product
* @example Premium Monthly 2023
*/
product_display_name: string | null;
/**
* @description The duration of the subscription in ISO-8601 standard
* @example P1M
*/
product_duration: string | null;
/**
* @description Total purchased items
* @example 1
*/
quantity: number;
unit_amount: components["schemas"]["MonetaryAmount"];
};
/** AppList */
ListApps: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["App"][];
/**
* @description URL to access the next page of the project's apps. If not present / null, there is no next page
* @example /v2/projects/projec1a2b3c4d/apps?starting_after=app1a2b3c4d
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/projec1a2b3c4d/apps
*/
url: string;
};
/** CustomerActiveEntitlementList */
ListCustomerActiveEntitlements: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["CustomerEntitlement"][];
/**
* @description URL to access the next page of the customer's active entitlements. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/active_entitlements?starting_after=entlab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/active_entitlements
*/
url: string;
};
/** CustomerAliasList */
ListCustomerAliases: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["CustomerAlias"][];
/**
* @description URL to access the next page of the customer's aliases. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/aliases?starting_after=9fjeja8fjed
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/aliases
*/
url: string;
};
/** CustomerAttributeList */
ListCustomerAttributes: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["CustomerAttribute"][];
/**
* @description URL to access the next page of the customer's aliases. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/attributes?starting_after=myCustomAttribute
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/attributes
*/
url: string;
};
/** CustomerInvoicesList */
ListCustomerInvoices: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Invoice"][];
/**
* @description URL to access the next page of the customer's invoice. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/invoices?starting_after=rcbin1a2b3c4d5e
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/invoices
*/
url: string;
};
/** CustomerList */
ListCustomers: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Customer"][];
/**
* @description URL to access the next page of the project's customers. If not present / null, there is no next page
* @example /v2/projects/projec1a2b3c4d/customers?starting_after=223xx1100
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/projec1a2b3c4d/customers
*/
url: string;
};
/** EntitlementList */
ListEntitlements: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Entitlement"][];
/**
* @description URL to access the next page of the project's entitlements. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/entitlements?starting_after=entlab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/entitlements
*/
url: string;
};
/** OfferingList */
ListOfferings: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Offering"][];
/**
* @description URL to access the next page of the project's offerings. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/offerings?starting_after=ofrngeab21da
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/offerings
*/
url: string;
};
/** PackageList */
ListPackages: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Package"][];
/**
* @description URL to access the next page of the project's packages. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages?starting_after=pkgeab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages
*/
url: string;
};
/** ProductList */
ListProducts: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Product"][];
/**
* @description URL to access the next page of the project's products. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/products?starting_after=prodab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/products
*/
url: string;
};
/** ProjectList */
ListProjects: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Project"][];
/**
* @description URL to access the next page of the projects. If not present / null, there is no next page
* @example /v2/projects?starting_after=projab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects
*/
url: string;
};
/** PurchaseList */
ListPurchases: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Purchase"][];
/**
* @description URL to access the next page of the customer's purchases. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/purchases?starting_after=purc1a2b3c4d5e
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/purchases
*/
url: string;
};
/** SubscriptionList */
ListSubscriptions: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Subscription"][];
/**
* @description URL to access the next page of the customer's subscriptions. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/subscriptions?starting_after=sub1a2b3c4d
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/customers/19b8de26-77c1-49f1-aa18-019a391603e2/subscriptions
*/
url: string;
};
MacAppStoreApp: {
/** @description Legacy Mac App Store type details */
mac_app_store?: {
/** @description The bundle ID of the app */
bundle_id: string;
};
};
MacAppStoreAppCreate: {
/** @description Mac App Store type details. Should only be used when type is mac_app_store. */
mac_app_store?: {
/** @description The bundle ID of the app */
bundle_id: string;
/** @description The shared secret of the app */
shared_secret?: string;
};
};
MonetaryAmount: {
currency: components["schemas"]["Currency"];
/**
* @description Total revenue generated (excluding taxes and commission)
* @example 9.99
*/
gross: number;
/**
* @description Store commission or payment processor fees deducted from gross revenue (if any)
* @example 2.99
*/
commission?: number;
/**
* @description Estimated taxes deducted from gross revenue
* @example 0.75
*/
tax: number;
/**
* @description Net revenue after store commission / fees and taxes
* @example 6.25
*/
proceeds: number;
};
Offering: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "offering";
/**
* @description The id of the offering
* @example ofrnge1a2b3c4d5
*/
id: string;
/**
* @description A custom identifier of the entitlement
* @example default
*/
lookup_key: string;
/**
* @description The display name of the offering
* @example The standard set of packages
*/
display_name: string;
/**
* @description Indicates if the offering is the current offering
* @example true
*/
is_current: boolean;
/**
* @description The date the offering was created at in ms since epoch
* @example 1658399423658
*/
created_at: number;
/**
* @description ID of the project to which the offering belongs
* @example proj1ab2c3d4
*/
project_id: string;
/** @description Custom metadata of the offering */
metadata?: components["schemas"]["OfferingMetadata"];
/** PackageList */
packages?: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Package"][];
/**
* @description URL to access the next page of the Offering's packages. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages?starting_after=pkgeab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages
*/
url: string;
} | null;
};
/**
* @description Custom metadata of the offering
* @example {
* "color": "blue",
* "call_to_action": "Subscribe Now!"
* }
*/
OfferingMetadata: {
[key: string]: unknown;
} | null;
OneTimeProduct: {
/**
* @description Indicates whether the product is consumable or not.
* @example true
*/
is_consumable: boolean | null;
} | null;
OverviewMetric: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "overview_metric";
/**
* @description Id of the overview metric
* @example active_trials
*/
id: string;
/**
* @description Display name of the overview metric
* @example Active Trials
*/
name: string;
/** @description Description of the overview metric */
description: string;
/**
* @description Unit of the overview metric
* @example $
*/
unit: string;
/**
* @description Length of time during which metric data is collected in ISO 8601 format. Zero period means metric data was collected now
* @example P0D
* @enum {string}
*/
period: "P0D" | "P28D";
/**
* @description Value of the overview metric
* @example 34765
*/
value: number;
/**
* @description Last time the overview metric was updated in ms since epoch
* @example 1658399423658
*/
last_updated_at: number | null;
/**
* Format: date-time
* @description Last time the overview metric was updated datetime in ISO 8601 format
* @example 2022-10-13 09:45:00.123000+00:00
*/
last_updated_at_iso8601: string | null;
};
OverviewMetrics: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "overview_metrics";
/** @description Details about each overview metric. */
metrics: components["schemas"]["OverviewMetric"][];
};
/**
* @example purchased
* @enum {string}
*/
Ownership: "purchased" | "family_shared";
Package: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "package";
/**
* @description The id of the package
* @example pkge1a2b3c4d5
*/
id: string;
/**
* @description The lookup_key of the package
* @example monthly
*/
lookup_key: string;
/**
* @description The display name of the package
* @example Monthly discounted with 3-day trial
*/
display_name: string;
/**
* @description The position of the package within the offering
* @example 1
*/
position: number | null;
/**
* @description The date the package was created at in ms since epoch
* @example 1658399423658
*/
created_at: number;
/** ProductList */
products?: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Product association */
items: components["schemas"]["PackageProductAssociation"][];
/**
* @description URL to access the next page of the project's products. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages/pkge1a2b3c4d5/products?starting_after=prodab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/offerings/ofrnge1a2b3c4d5/packages/pkge1a2b3c4d5/products
*/
url: string;
} | null;
};
PackageProductAssociation: {
product: components["schemas"]["Product"];
eligibility_criteria: components["schemas"]["EligibilityCriteria"];
};
PackageProductIDAssociation: {
product_id: string;
eligibility_criteria: components["schemas"]["EligibilityCriteria"];
};
PlayStoreApp: {
/** @description Play Store type details */
play_store?: {
/** @description The package name of the app */
package_name: string;
};
};
PlayStoreAppCreate: {
/** @description Play Store type details. Should only be used when type is play_store. */
play_store?: {
/** @description The package name of the app */
package_name: string;
};
};
Product: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "product";
/**
* @description The id of the product
* @example prod1a2b3c4d5e
*/
id: string;
/**
* @description The store product identifier
* @example rc_1w_199
*/
store_identifier: string;
/** @description The product type */
type: components["schemas"]["ProductType"];
/** @description The subscription product object */
subscription?: components["schemas"]["SubscriptionProduct"];
/** @description The one time product object */
one_time?: components["schemas"]["OneTimeProduct"];
/**
* @description The date when the product was created in ms since epoch
* @example 1658399423658
*/
created_at: number;
/**
* @description The id of the app
* @example app1a2b3c4
*/
app_id: string;
/** @description The app associated with the product */
app?: components["schemas"]["App"];
/**
* @description The display name of the product
* @example Premium Monthly 2023
*/
display_name: string | null;
};
/** @enum {string} */
ProductType: "subscription" | "one_time";
/** ProductsFromEntitlementList */
ProductsFromEntitlement: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Product"][];
/**
* @description URL to access the next page of the entitlement's products. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/entitlements/entla1b2c3d4e5/products?starting_after=prod1a2b3c4d5
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/entitlements/entla1b2c3d4e5/products
*/
url: string;
};
/** ProductsFromPackageList */
ProductsFromPackage: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["PackageProductAssociation"][];
/**
* @description URL to access the next page of the entitlement's products. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/packages/pkge1a2b3c4d5/products?starting_after=prod1a2b3c4d5
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/packages/pkge1a2b3c4d5/products
*/
url: string;
};
Project: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "project";
/**
* @description The id of the project
* @example proj1ab2c3d4
*/
id: string;
/**
* @description The name of the project
* @example MagicWeather
*/
name: string;
/**
* @description The date when the project was created in ms since epoch
* @example 1658399423658
*/
created_at: number;
};
Purchase: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "purchase";
/**
* @description The id of the purchase
* @example purch1a2b3c4d5e
*/
id: string;
/**
* @description The id of the customer
* @example 19b8de26-77c1-49f1-aa18-019a391603e2
*/
customer_id: string;
/**
* @description The ID of the original customer
* @example 19b8de26-77c1-49f1-aa18-019a391603e2
*/
original_customer_id: string;
/**
* @description The ID of the product that was purchased
* @example prod1a2b3c4d5e
*/
product_id: string;
/**
* @description The date when the purchase was made in ms since epoch
* @example 1658399423658
*/
purchased_at: number;
/** @description The revenue generated by the purchase in USD */
revenue_in_usd: components["schemas"]["MonetaryAmount"];
/**
* @description The quantity of the product purchased in one transaction
* @example 1
*/
quantity: number;
/**
* @description The status of a purchase
* @example owned
* @enum {string}
*/
status: "owned" | "refunded";
/**
* @description The ID of the offering the customer saw when they did the purchase
* @example ofrnge1a2b3c4d5
*/
presented_offering_id: string | null;
/** EntitlementList */
entitlements: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Entitlement"][];
/**
* @description URL to access the next page of the customer's entitlements. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/purchases/sub1a2b3c4d5e/entitlements?status=active&starting_after=entlab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/purchases/sub1a2b3c4d5e/entitlements
*/
url: string;
};
environment: components["schemas"]["Environment"];
/**
* @description Store the purchase belongs to
* @example amazon
* @enum {string}
*/
store: "amazon" | "app_store" | "mac_app_store" | "play_store" | "promotional" | "stripe" | "rc_billing";
/**
* @description The store purchase identifier
* @example 12345678
*/
store_purchase_identifier: string;
/** @description Ownership of the purchase */
ownership: components["schemas"]["Ownership"];
/** @description Billing country in ISO alpha 2 code */
country?: components["schemas"]["Country"];
};
RCBillingApp: {
/** @description Revenue Cat Billing Store type details */
rc_billing?: {
/** @description Stripe account connected to your RevenueCat account. */
stripe_account_id?: string | null;
/**
* @deprecated
* @description The company name. This field is deprecated. Please, use `app_name` instead.
*/
seller_company_name: string;
/** @description Shown in checkout, emails, and receipts sent to customers. */
app_name?: string;
/**
* @deprecated
* @description The company support email. This field is deprecated. Please, use `support_email` instead.
*/
seller_company_support_email?: string | null;
/** @description Used as the `reply to` address in all emails sent to customers, to allow them to receive support. */
support_email?: string | null;
/** @description The default currency to be used for the app. */
default_currency: components["schemas"]["RCBillingCurrency"];
};
};
RCBillingAppCreate: {
/** @description Revenue Cat Billing Store type details */
rc_billing?: {
/** @description It needs to be connected to your RevenueCat account. It can be omitted if you only have a single Stripe account connected to your RevenueCat account. */
stripe_account_id?: string | null;
/** @description Shown in checkout, emails, and receipts sent to customers. */
app_name: string;
/** @description Used as the `reply to` address in all emails sent to customers, to allow them to receive support. If you leave this field blank, your RevenueCat account email address will be used. */
support_email?: string | null;
default_currency?: components["schemas"]["RCBillingCurrency"];
} | null;
};
/**
* @description ISO 4217 currency code
* @example USD
* @enum {string}
*/
RCBillingCurrency: "AUD" | "CAD" | "EUR" | "GBP" | "JPY" | "USD";
RokuApp: {
/** @description Roku Channel Store type details */
roku?: {
/** @description Channel ID provided on the Roku Channel page. */
roku_channel_id?: string | null;
/** @description Channel name that is displayed on the Roku Channel page. */
roku_channel_name?: string | null;
};
};
RokuAppCreate: {
/** @description Roku Channel Store details. Should only be used when type is roku. */
roku?: {
/** @description Roku Pay API key provided on the Roku Pay Web Services page. */
roku_api_key?: string | null;
/** @description Channel ID provided on the Roku Channel page. */
roku_channel_id?: string | null;
/** @description Channel name that is displayed on the Roku Channel page. */
roku_channel_name?: string | null;
} | null;
};
StripeApp: {
/** @description Stripe type details */
stripe?: {
/** @description Stripe account connected to your RevenueCat account. */
stripe_account_id?: string | null;
};
};
StripeAppCreate: {
/** @description Stripe type details. Should only be used when type is stripe. */
stripe?: {
/** @description It needs to be connected to your RevenueCat account. It can be omitted if you only have a single Stripe account connected to your RevenueCat account. */
stripe_account_id?: string | null;
};
};
Subscription: {
/**
* @description String representing the object's type. Objects of the same type share the same value.
* @enum {string}
*/
object: "subscription";
/**
* @description The ID of the subscription (generated by RevenueCat)
* @example sub1ab2c3d4e5
*/
id: string;
/**
* @description The ID of the customer
* @example 19b8de26-77c1-49f1-aa18-019a391603e2
*/
customer_id: string;
/**
* @description The ID of the original customer. Relevant for subscriptions that were transferred from one customer to another
* @example 19b8de26-77c1-49f1-aa18-019a391603e2
*/
original_customer_id: string;
/**
* @description The RevenueCat ID of the product that the customer is subscribed to. Exists for all store types except for promotional.
* @example prod1a2b3c4d5e
*/
product_id: string | null;
/**
* @description The date when the subscription originally started in ms since epoch
* @example 1658399423658
*/
starts_at: number;
/**
* @description The date when the subscription billing period started in ms since epoch
* @example 1658399423658
*/
current_period_starts_at: number;
/**
* @description The date when the subscription billing period is expected to end in ms since epoch. Can be null if the subscription is paused until an indefinite date.
* @example 1658399423658
*/
current_period_ends_at: number | null;
/**
* @description Determines whether the customer should currently be provided access to the entitlements associated with the subscription
* @example true
*/
gives_access: boolean;
/**
* @description Determines whether there is a pending payment associated with the subscription
* @example true
*/
pending_payment: boolean;
/**
* @description The auto renewal status of a subscription.<br><br>Possible values:<br>• `will_renew`: the subscription is currently set to automatically renew<br>• `will_not_renew`: the subscription is currently set to expire at the end of the period<br>• `will_change_product`: the subscription is currently set to change product at the end of the period (which might start a new subscription)<br>• `will_pause`: the subscription is currently set to pause at the end of the current period<br>• `requires_price_increase_consent`: the subscription will expire at the end of the current period unless the customer consents to the price increase<br>• `has_already_renewed`: the customer has already been charged for the upcoming renewal (so the renewal will take place even if the customer opts out of auto-renewal before the end of the period)
*
* @example will_renew
* @enum {string}
*/
auto_renewal_status: "will_renew" | "will_not_renew" | "will_change_product" | "will_pause" | "requires_price_increase_consent" | "has_already_renewed";
/**
* @description The status of a subscription. Please note that additional states might be added in the future. To determine whether or not a subscription currently provides access to any associated entitlements, use the _gives_access_ field.<br><br>Possible values:<br>• `trialing`: the subscription is in a free trial period<br>• `active`: the subscription is active, in a paid period<br>• `expired`: the subscription is expired and no longer active<br>• `in_grace_period`: the subscription is past its regular expiry date and experienced a billing issue, but is currently still in an access-granting grace period<br>• `in_billing_retry`: the subscription has experienced a billing issue. Billing is being retried, access is suspended.-paused: the subscription is currently paused and should not provide access.<br>• `unknown`: the subscription is in an unknown state. Refer to the _gives_access_ field to determine whether or not to grant access.<br>• `incomplete`: the subscription is in an incomplete state, maybe due to incorrect billing details or because it's scheduled to start in the future.
*
* @example trialing
* @enum {string}
*/
status: "trialing" | "active" | "expired" | "in_grace_period" | "in_billing_retry" | "paused" | "unknown" | "incomplete";
/** @description Total revenue generated by a subscription in USD */
total_revenue_in_usd: components["schemas"]["MonetaryAmount"];
/**
* @description The ID of the offering the customer saw when purchasing the subscription
* @example ofrnge1a2b3c4d5
*/
presented_offering_id: string | null;
/** EntitlementList */
entitlements: {
/**
* @description String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
* @enum {string}
*/
object: "list";
/** @description Details about each object. */
items: components["schemas"]["Entitlement"][];
/**
* @description URL to access the next page of the customer's entitlements. If not present / null, there is no next page
* @example /v2/projects/proj1ab2c3d4/subscriptions/sub1a2b3c4d5e/entitlements?status=active&starting_after=entlab21dac
*/
next_page: string | null;
/**
* @description The URL where this list can be accessed.
* @example /v2/projects/proj1ab2c3d4/subscriptions/sub1a2b3c4d5e/entitlements
*/
url: string;
};
/** @description The store environment */
environment: components["schemas"]["Environment"];
/**
* @description Store the subscription belongs to
* @example amazon
* @enum {string}
*/
store: "amazon" | "app_store" | "mac_app_store" | "play_store" | "promotional" | "stripe" | "rc_billing";
/**
* @description The subscription identifier as per the store (e.g, for Apple App Store, the `transaction_id` of the latest transaction of the subscription, or for Google Play Store, the Order ID of the last renewal of the subscription)
* @example 12345678
*/
store_subscription_identifier: string;
/** @description Ownership of the subscription */
ownership: components["schemas"]["Ownership"];
/** @description Indicates pending product changes. Present if the `auto_renewal_status` is `will_change_product`. */
pending_changes?: {
/** @description The product that will be active as of the next renewal */
product?: components["schemas"]["Product"];
} | null;
/** @description Billing country in ISO alpha 2 code */
country?: components["schemas"]["Country"];
/**
* @description The URL to manage the subscription
* @example https://apps.apple.com/account/subscriptions
*/
management_url: string | null;
};
SubscriptionProduct: {
/**
* @description The duration of the subscription in ISO-8601 standard
* @example P1M
*/
duration: string | null;
/**
* @description The duration of the subscription's grace period in ISO-8601 standard
* @example P3D
*/
grace_period_duration: string | null;
/**
* @description The duration of the subcription's trial period in ISO-8601 standard
* @example P1W
*/
trial_duration: string | null;
} | null;
};
responses: {
/** @description Bad request */
BadRequest: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "parameter_error" | "invalid_request";
};
};
};
/** @description Conflict */
Conflict: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "resource_already_exists" | "idempotency_error";
};
};
};
/** @description Access denied */
Forbidden: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "authorization_error";
};
};
};
/** @description Internal server error */
InternalError: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "server_error";
};
};
};
/** @description Locked */
Locked: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "resource_locked_error";
};
};
};
/** @description Not found */
NotFound: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "resource_missing";
};
};
};
/** @description The request could not be completed because the rate limiting domain for this endpoint is currently at its limit for this project. */
RateLimited: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
"Retry-After": components["headers"]["RateLimitRetryAfter"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "rate_limit_error";
};
};
};
/** @description Unauthorized */
Unauthorized: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "authentication_error";
};
};
};
/** @description Unprocessable entity */
UnprocessableEntity: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"] & {
/** @enum {string} */
type?: "unprocessable_entity_error" | "parameter_error" | "store_error";
};
};
};
};
parameters: never;
requestBodies: never;
headers: {
/**
* @description The rate limit for this endpoint, expressed in requests per minute.
* @example 30
*/
RateLimitCurrentLimit: number;
/**
* @description The current number of requests used for the current limit (including the current request).
* @example 25
*/
RateLimitCurrentUsage: number;
/**
* @description The number of seconds to wait before retrying a rate limited request.Only present when a request is rate limited.
* @example 10
*/
RateLimitRetryAfter: number;
};
pathItems: never;
}
export type $defs = Record<string, never>;
export interface operations {
"list-projects": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListProjects"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-apps": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListApps"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-app": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": components["schemas"]["AppCreate"];
};
};
responses: {
/** @description Success. The app was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["App"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-app": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the app */
app_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["App"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"update-app": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the app */
app_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The name of the app
* @example My App
*/
name?: string;
/** @description Amazon type details. Should only be used when type is amazon. */
amazon?: {
/** @description The package name of the app */
package_name?: string;
/** @description Your Amazon Developer Identity Shared Key */
shared_secret?: string | null;
};
/** @description App Store type details. Should only be used when type is app_store. */
app_store?: {
/** @description The bundle ID of the app */
bundle_id?: string;
/** @description The shared secret of the app */
shared_secret?: string | null;
};
/** @description Legacy Mac App Store type details. Should only be used when type is mac_app_store. */
mac_app_store?: {
/** @description The bundle ID of the app */
bundle_id?: string;
/** @description The shared secret of the app */
shared_secret?: string | null;
};
/** @description Play Store type details. Should only be used when type is play_store. */
play_store?: {
/** @description The package name of the app */
package_name: string;
};
/** @description Stripe type details. Should only be used when type is stripe. */
stripe?: {
/** @description It needs to be connected to your RevenueCat account. It can be omitted if you only have a single Stripe account connected to your RevenueCat account. */
stripe_account_id?: string;
};
/** @description RevenueCat Billing type details. Should only be used when type is rc_billing. */
rc_billing?: {
/** @description It needs to be connected to your RevenueCat account. It can be omitted if you only have a single Stripe account connected to your RevenueCat account. */
stripe_account_id?: string | null;
/** @description Shown in checkout, emails, and receipts sent to customers. */
app_name?: string | null;
/** @description Used as the `reply to` address in all emails sent to customers, to allow them to receive support. If you leave this field blank, your RevenueCat account email address will be used. */
support_email?: string | null;
default_currency?: components["schemas"]["RCBillingCurrency"];
};
/** @description Roku Channel Store type details. Should only be used when type is roku. */
roku?: {
/** @description Roku Pay API key provided on the Roku Pay Web Services page. */
roku_api_key?: string | null;
/** @description Channel ID provided on the Roku Channel page. */
roku_channel_id?: string | null;
/** @description Channel name that is displayed on the Roku Channel page. */
roku_channel_name?: string | null;
};
};
};
};
responses: {
/** @description Success. The app was updated */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["App"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-app": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the app */
app_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-customers": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomers"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-customer": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The ID of the customer
* @example 19b8de26-77c1-49f1-aa18-019a391603e2
*/
id: string;
attributes?: {
/**
* @description The name of the attribute
* @example $email
*/
name: components["schemas"]["CustomerAttributeReservedName"] | components["schemas"]["CustomerAttributeCustomName"];
/**
* @description The value of the attribute
* @example [email protected]
*/
value: string;
}[];
};
};
};
responses: {
/** @description Success. The customer was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Customer"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-customer": {
parameters: {
query?: {
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `attributes` (requires `customer_information:customers:read` permission). */
expand?: "attributes"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Customer"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-customer": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-product": {
parameters: {
query?: {
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `app` (requires `project_configuration:apps:read` permission). */
expand?: "app"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the product */
product_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Product"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-product": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the product */
product_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-products": {
parameters: {
query?: {
/** @description This is an optional query parameter to get a list of products of a given entitlement associated with a particular app */
app_id?: string;
starting_after?: string;
limit?: number;
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `items.app` (requires `project_configuration:apps:read` permission). */
expand?: "items.app"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListProducts"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-product": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The store identifier of the product.
* - For Apple App Store products this is the product ID of the subscription or in-app product.
* - For Google's Play Store, it should follow the format 'productId:basePlanId' for subscription products and SKU for one-time purchase products.
* - For Stripe, the product identifier that always starts with "prod_"
* - For Amazon, if it's a subscription, the term SKU of the subscription. If it's a one-time purchase, the SKU of the product.
* - For Roku, this is the product identifier of the subscription or one-time purchase product.
*
* @example com.revenuecat.magicweather.monthly
*/
store_identifier: string;
/**
* @description The ID of the app
* @example app1a2b3c4
*/
app_id: string;
/** @description The product type */
type: components["schemas"]["ProductType"];
/**
* @description The display name of the product
* @example Premium Monthly 2023
*/
display_name?: string | null;
};
};
};
responses: {
/** @description Success. The product was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Product"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-entitlement": {
parameters: {
query?: {
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `product` (requires `project_configuration:products:read` permission). */
expand?: "product"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Entitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"update-entitlement": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The display name of the entitlement
* @example Premium
*/
display_name: string;
};
};
};
responses: {
/** @description Success. The entitlement was updated */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Entitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-entitlement": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-entitlements": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `items.product` (requires `project_configuration:products:read` permission). */
expand?: "items.product"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListEntitlements"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-entitlement": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The identifier of the entitlement
* @example premium
*/
lookup_key: string;
/**
* @description The display name of the entitlement
* @example Premium access to all features
*/
display_name: string;
};
};
};
responses: {
/** @description Success. The entitlement was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Entitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-products-from-entitlement": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ProductsFromEntitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"attach-products-to-entitlement": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description IDs of the products to be attached to the entitlement. */
product_ids: string[];
};
};
};
responses: {
/** @description Success. The products were attached to the entitlement */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Entitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"detach-products-from-entitlement": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the entitlement */
entitlement_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description IDs of the products to be detached from the entitlement. */
product_ids: string[];
};
};
};
responses: {
/** @description Success. The products were detached from the entitlement */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Entitlement"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-offering": {
parameters: {
query?: {
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `package` (requires `project_configuration:packages:read` permission), `package.product` (requires `project_configuration:products:read` permission). */
expand?: ("package" | "package.product")[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the offering */
offering_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Offering"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"update-offering": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the offering */
offering_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The display name of the offering
* @example premium access to features
*/
display_name?: string;
/**
* @description Indicates if the offering is the current offering
* @example true
*/
is_current?: boolean;
/** @description Custom metadata of the offering */
metadata?: components["schemas"]["OfferingMetadata"];
};
};
};
responses: {
/** @description Success. The offering was updated */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Offering"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-offering": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the offering */
offering_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-offerings": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `items.package` (requires `project_configuration:packages:read` permission), `items.package.product` (requires `project_configuration:products:read` permission). */
expand?: ("items.package" | "items.package.product")[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListOfferings"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-offering": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The custom identifier of the offering
* @example default
*/
lookup_key: string;
/**
* @description The display_name of the offering
* @example The standard set of packages
*/
display_name: string;
/** @description Custom metadata of the offering */
metadata?: components["schemas"]["OfferingMetadata"];
};
};
};
responses: {
/** @description Success. The offering was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Offering"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-package": {
parameters: {
query?: {
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `product` (requires `project_configuration:products:read` permission). */
expand?: "product"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Package"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"update-package": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The display name of the package
* @example monthly with one-week trial
*/
display_name?: string;
/**
* @description The position of the package within the offering
* @example 2
*/
position?: number;
};
};
};
responses: {
/** @description Success. The package was updated */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Package"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"delete-package-from-offering": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["DeletedObject"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-packages": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
/** @description Specifies which fields in the response should be expanded.
* Accepted values are: `items.product` (requires `project_configuration:products:read` permission). */
expand?: "items.product"[];
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the offering */
offering_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListPackages"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"create-packages": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the offering */
offering_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/**
* @description The lookup_key of the package
* @example monthly
*/
lookup_key: string;
/**
* @description The display name of the package
* @example monthly with one-week trial
*/
display_name: string;
/**
* @description The position of the package in the offering
* @example 1
*/
position?: number;
};
};
};
responses: {
/** @description Success. The package was created */
201: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Package"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-products-from-package": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ProductsFromPackage"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"attach-products-to-package": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description Product association list */
products: components["schemas"]["PackageProductIDAssociation"][];
};
};
};
responses: {
/** @description Success. The products were attached to the package. */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Package"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"detach-products-from-package": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the package */
package_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description IDs of the products to detach from the package */
product_ids: string[];
};
};
};
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Package"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-subscription": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the subscription */
subscription_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Subscription"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-subscription-entitlements": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the subscription */
subscription_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListEntitlements"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"cancel-subscription": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the subscription */
subscription_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success. The subscription has been successfully canceled. */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Subscription"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"refund-subscription": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the subscription */
subscription_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success. The subscription has been successfully refunded. */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Subscription"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-subscriptions": {
parameters: {
query?: {
/** @example production */
environment?: "sandbox" | "production";
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListSubscriptions"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-purchase": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the purchase */
purchase_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Purchase"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-purchase-entitlements": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the purchase */
purchase_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListEntitlements"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"refund-purchase": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the purchase */
purchase_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success. The purchase has been successfully refunded. */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Purchase"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-purchases": {
parameters: {
query?: {
/** @example production */
environment?: "sandbox" | "production";
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListPurchases"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-customer-active-entitlements": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomerActiveEntitlements"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-customer-aliases": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomerAliases"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-customer-attributes": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomerAttributes"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"set-customer-attributes": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody: {
content: {
"application/json": {
attributes: {
/**
* @description The name of the attribute
* @example $email
*/
name: components["schemas"]["CustomerAttributeReservedName"] | components["schemas"]["CustomerAttributeCustomName"];
/** @description The value of the attribute. Use null to delete the attribute. */
value: string | null;
}[];
};
};
};
responses: {
/** @description Success. The customer attributes were set */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomerAttributes"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
409: components["responses"]["Conflict"];
422: components["responses"]["UnprocessableEntity"];
423: components["responses"]["Locked"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"list-customer-invoices": {
parameters: {
query?: {
starting_after?: string;
limit?: number;
};
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ListCustomerInvoices"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-invoice": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
/** @description ID of the customer */
customer_id: string;
/** @description ID of the invoice */
invoice_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description File found. Needs to be downloaded from the location header */
302: {
headers: {
/** @description The URL to download the invoice pdf */
location?: string;
[name: string]: unknown;
};
content?: never;
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
"get-overview-metrics": {
parameters: {
query?: never;
header?: never;
path: {
/** @description ID of the project */
project_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Success */
200: {
headers: {
"RevenueCat-Rate-Limit-Current-Usage": components["headers"]["RateLimitCurrentUsage"];
"RevenueCat-Rate-Limit-Current-Limit": components["headers"]["RateLimitCurrentLimit"];
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["OverviewMetrics"];
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
404: components["responses"]["NotFound"];
429: components["responses"]["RateLimited"];
500: components["responses"]["InternalError"];
503: components["responses"]["InternalError"];
};
};
}
import createClient from 'openapi-fetch';
import type { paths, components } from '../api/revenuecat-api-v2';
// export nice explicit type definitions because components['schemas...etc is a bit of a mouthful
export type RCCustomer = components['schemas']['Customer'];
export type RCEntitlement = components['schemas']['Entitlement'];
export class RevenueCatService {
private client;
private rcSecretAPIKey: string;
private projectId: string;
constructor() {
this.client = createClient<paths>({
baseUrl: 'https://api.revenuecat.com/v2/'
});
this.rcSecretAPIKey = 'sk_XxXxXxXxXxXxXxXxXxXxX'; //you might wanna pull this from environment rather than hard code
this.projectId = 'a1a1a1a1a1a'; // same
}
async getCustomer(customerId: string): Promise<RCCustomer> {
const { data, error } = await this.client.GET(
'/projects/{project_id}/customers/{customer_id}',
{
params: {
path: { project_id: this.projectId, customer_id: customerId },
query: {} //add.... expand: ['attributes'] here if you need
},
headers: {
Authorization: `Bearer ${this.rcSecretAPIKey}` // Add the Bearer token to the headers
}
}
);
if (error != null) {
throw new Error('Failed to get customer information');
}
return data;
}
async getEntitlement(entitlement_id: string): Promise<RCEntitlement> {
const { data, error } = await this.client.GET(
'/projects/{project_id}/entitlements/{entitlement_id}',
{
params: {
path: { project_id: this.projectId, entitlement_id: entitlement_id },
query: {}
},
headers: {
Authorization: `Bearer ${this.rcSecretAPIKey}` // Add the Bearer token to the headers
}
}
);
if (error != null) {
throw new Error('Failed to get entitlement information');
}
return data;
}
}
import { describe, expect, it } from 'vitest';
import { RevenueCatService } from './revenuecat.service';
// Just a basic test to see if it works, not very repeatable
describe('RevenueCat', () => {
describe('get customer', () => {
it('should get a customer', async () => {
const rcService = new RevenueCatService();
const customer = await rcService.getCustomer('sometestid');
expect(customer.id).toEqual('sometestid');
const activeEntitlementId =
customer.active_entitlements?.items[0].entitlement_id;
if (activeEntitlementId != null) {
const entitlement = await rcService.getEntitlement(activeEntitlementId);
expect(entitlement.id).toEqual(activeEntitlementId);
expect(entitlement.lookup_key).toEqual('some lookup key'); // It would be much more useful if the lookup_key was on the original object... but whatever
}
});
}, 10000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment