Skip to main content

RevenueCat API v1 (1.0)

Download OpenAPI specification:Download

transactions

Operations about transactions.

Create a Purchase

Records a purchase for a user from iOS, Android, or Stripe and will create a user if they don't already exist.

Authorizations:
BearerAuth
header Parameters
X-Platform
required
string
Default: ios

The platform this purchase is for. Either ios, android, amazon, macos, uikitformac, or stripe

Request Body schema: application/json
app_user_id
required
string

App User ID of the user the receipt is associated with.

fetch_token
required
string

For iOS, the base64 encoded receipt file, for Android the receipt token, for Amazon the receipt, and for Stripe the subscription ID or the Stripe Checkout Session ID.

product_id
string
Default: "com.my.product.iap"

The Apple, Google, or Amazon product identifier or SKU. Required for Google.

price
number <float>
Default: 1.99

The price of the product. Required if you provide a currency.

currency
string
Default: "USD"

The currency of the product. The currency must be in ISO 4217 format. Required if you provide a price.

payment_mode
string

Optionally used by the iOS SDK to communicate intro pricing periods. Either pay_as_you_go = 0, pay_up_front = 1, or free_trial = 2. Defaults to 2 (free trial) if an introductory period is detected in the receipt but this value is not provided.

introductory_price
number <float>

Introductory price paid

is_restore
string
Default: "false"

If true, the fetch token will trigger your configured restore behavior for any other users sharing the same fetch token.

presented_offering_identifier
string

Optional. The offering that was presented to the user at the time of purchase. This will be attached to any new transactions in this fetch token and will be available in ETL exports and webhooks. This is mostly useful if you're sending fetch tokens from your backend.

object

Responses

Request samples

Content type
application/json
{
  • "app_user_id": "string",
  • "fetch_token": "string",
  • "product_id": "com.my.product.iap",
  • "price": 1.99,
  • "currency": "USD",
  • "payment_mode": "string",
  • "introductory_price": 0.1,
  • "is_restore": "false",
  • "presented_offering_identifier": "string",
  • "attributes": {
    }
}

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Google Play: Refund and Revoke Subscription

Immediately revokes access to a Google Subscription and issues a refund for the last purchase. If you want to refund a one-time Google purchase, see refund a Google purchase.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

product_identifier
required
string

The identifier of the product belonging to the subscription that is being revoked.

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Google Play: Defer a Subscription

Defers the purchase of a Google Subscription to a later date.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

product_identifier
required
string

The identifier of the product belonging to the subscription that is being revoked.

Request Body schema: application/json
expiry_time_ms
required
integer <int32>

The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current expiry time for the subscription.

Responses

Request samples

Content type
application/json
{
  • "expiry_time_ms": 0
}

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Google Play: Refund and Revoke Purchase

Issues a refund for the most recent purchase of a Google product and revokes access. Works for subscription and non-subscription purchases that occurred in the last 365 days.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

store_transaction_identifier
required
string

The identifier of the transaction to refund. Example: GPA.3309-9122-6177-45730

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Google Play: Cancel a Subscription

Cancels a Google subscription.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

store_transaction_identifier
required
string

The identifier of the transaction to cancel. Example: GPA.3309-9122-6177-45730

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

customers

Operations about customers.

Get or Create Subscriber

Gets the latest subscriber info or creates one if it doesn't exist.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID used with the mobile SDK.

header Parameters
X-Platform
string
Default: ios

Optionally set the X-Platform header to update the subscriber record's last_seen field. Set to either ios, android, amazon, macos, uikitformac. Don't set this if you are calling the getter for informational purposes or using a secret API key to fetch subscriber attributes.

X-Is-Sandbox
string
Default: false

Optionally set the X-Platform header to get the sandbox transactions of this subscriber. Set to true to get sandbox purchases. Don't set this in production. The SDK will automatically set this for your based on the environment of the app.

Responses

Response samples

Content type
application/json
"{\n \"request_date\": \"2019-07-26T17:40:10Z\",\n \"request_date_ms\": 1564162810884,\n \"subscriber\": {\n \"entitlements\": {\n \"pro_cat\": {\n \"expires_date\": null,\n \"grace_period_expires_date\": null,\n \"product_identifier\": \"onetime\",\n \"purchase_date\": \"2019-04-05T21:52:45Z\"\n }\n },\n \"first_seen\": \"2019-02-21T00:08:41Z\",\n \"management_url\": \"https://apps.apple.com/account/subscriptions\",\n \"non_subscriptions\": {\n \"onetime\": [\n {\n \"id\": \"cadba0c81b\",\n \"is_sandbox\": true,\n \"purchase_date\": \"2019-04-05T21:52:45Z\",\n \"store\": \"app_store\"\n }\n ]\n },\n \"original_app_user_id\": \"XXX-XXXXX-XXXXX-XX\",\n \"original_application_version\": \"1.0\",\n \"original_purchase_date\": \"2019-01-30T23:54:10Z\",\n \"other_purchases\": {},\n \"subscriptions\": {\n \"annual\": {\n \"auto_resume_date\": null,\n \"billing_issues_detected_at\": null,\n \"expires_date\": \"2019-08-14T21:07:40Z\",\n \"grace_period_expires_date\": null,\n \"is_sandbox\": true,\n \"original_purchase_date\": \"2019-02-21T00:42:05Z\",\n \"ownership_type\": \"PURCHASED\",\n \"period_type\": \"normal\",\n \"purchase_date\": \"2019-07-14T20:07:40Z\",\n \"refunded_at\": null,\n \"store\": \"app_store\",\n \"unsubscribe_detected_at\": \"2019-07-17T22:48:38Z\"\n },\n \"onemonth\": {\n \"auto_resume_date\": null,\n \"billing_issues_detected_at\": null,\n \"expires_date\": \"2019-06-17T22:47:55Z\",\n \"grace_period_expires_date\": null,\n \"is_sandbox\": true,\n \"original_purchase_date\": \"2019-02-21T00:42:05Z\",\n \"ownership_type\": \"PURCHASED\",\n \"period_type\": \"normal\",\n \"purchase_date\": \"2019-06-17T22:42:55Z\",\n \"refunded_at\": null,\n \"store\": \"app_store\",\n \"unsubscribe_detected_at\": \"2019-06-17T22:48:38Z\"\n },\n \"rc_promo_pro_cat_monthly\": {\n \"auto_resume_date\": null,\n \"billing_issues_detected_at\": null,\n \"expires_date\": \"2019-08-26T01:02:16Z\",\n \"grace_period_expires_date\": null,\n \"is_sandbox\": false,\n \"original_purchase_date\": \"2019-07-26T01:02:16Z\",\n \"ownership_type\": \"FAMILY_SHARED\",\n \"period_type\": \"normal\",\n \"purchase_date\": \"2019-07-26T01:02:16Z\",\n \"refunded_at\": null,\n \"store\": \"promotional\",\n \"unsubscribe_detected_at\": null\n }\n }\n }\n}"

Delete Subscriber

Permanently deletes a subscriber.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user id, or alias, of the subscriber.

Responses

Response samples

Content type
application/json
"{\"app_user_id\": \"XXX-XXXXX-XXXXX-XX\", deleted: True}"

Add User Attribution Data

Attaches attribution data to a subscriber from specific supported networks.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string
Default: "your user id"

The app user ID, or alias, of the subscriber.

Request Body schema: application/json
required
object

The data returned by the attribution network callbacks.

network
required
string
Enum: "0" "1" "2" "3" "4" "5"

The attribution network the data is coming from. See below for possible values.

Responses

Request samples

Content type
application/json
{
  • "data": {
    },
  • "network": "0"
}

Response samples

Content type
application/json
"{}"

Update Subscriber Attributes

Updates subscriber attributes for a user.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user id used with the mobile SDK.

Request Body schema: application/json
object
required
object

Mapping of key names to subscriber attribute objects.

value
required
string

The value of the attribute. If the value is null or an empty string, the attribute will be deleted.

updated_at_ms
string <date-time>

UNIX epoch in milliseconds of when the attribute was updated. This value is used to resolve conflicts, an attribute will only be updated if the new updated_at_ms value is newer than the value for the stored attribute.

Responses

Request samples

Content type
application/json
{
  • "attributes": {
    }
}

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

offerings

Operations about offerings.

Override a Customer's Current Offering

Overrides the current Offering for a specific user

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

offering_uuid
required
string

The UUID for the offering you want to set as the override for the user. The UUID can be found in the URL of the offering. For example, the offering UUID in https://app.revenuecat.com/apps/abcd1234/offerings/ofrng1234567abc is ofrng1234567abc.

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Remove a Customer's Current Offering Override

Reset the offering overrides back to the current offering for a specific user

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Get Offerings

Gets the offerings for your app.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID used with the mobile SDK. The app user ID doesn't have to exist for the endpoint to work but it can affect the current offering depending on whether you have any Experiments running or have overridden the current offering for this specific app user ID.

header Parameters
X-Platform
required
string
Default: ios

Set the X-Platform header to fetch that platform's packages. Can be ios, android, amazon, or stripe.

Responses

Response samples

Content type
application/json
"{\n \"current_offering_id\": \"default\",\n \"offerings\": [\n {\n \"description\": \"The default offering\",\n \"identifier\": \"default\",\n \"packages\": [\n {\n \"identifier\": \"$rc_monthly\",\n \"platform_product_identifier\": \"monthly_free_trial\"\n },\n {\n \"identifier\": \"consumable\",\n \"platform_product_identifier\": \"consumable1\"\n },\n {\n \"identifier\": \"$rc_annual\",\n \"platform_product_identifier\": \"yearly_free_trial\"\n }\n ]\n },\n {\n \"description\": \"The sale offeringg\",\n \"identifier\": \"sale_offering\",\n \"packages\": [\n {\n \"identifier\": \"$rc_monthly\",\n \"platform_product_identifier\": \"monthly_free_trial_sale\"\n },\n {\n \"identifier\": \"consumable\",\n \"platform_product_identifier\": \"consumable1_sale\"\n },\n {\n \"identifier\": \"$rc_annual\",\n \"platform_product_identifier\": \"yearly_free_trial_sale\"\n }\n ]\n }\n ]\n}"

entitlements

Operations about entitlements.

Grant a Promotional Entitlement

Grants a user a promotional entitlement. Does not override or defer a store transaction, applied simultaneously.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user ID, or alias, of the subscriber.

entitlement_identifier
required
string

The identifier for the entitlement you want to grant to the user.

Request Body schema: application/json
duration
required
string

How long of a duration to grant the promotional entitlement for. See below for possible values.

start_time_ms
string <date-time>

A Unix epoch in milliseconds for when the promotional entitlement should have been considered as started. If not provided, the entitlement will be granted immediately. Future dates will also be granted immediately and will be active until the expiration date lapses.

Responses

Request samples

Content type
application/json
{
  • "duration": "string",
  • "start_time_ms": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
"// See the Subscriber object for response fields"

Revoke Promotional Entitlements

Revokes all promotional entitlements for a given entitlement identifier and app user ID.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The app user id, or alias, of the subscriber.

entitlement_identifier
required
string

The identifier for the entitlement you want to revoke from the user.

Responses

Response samples

Content type
application/json
"// See the Subscriber object for response fields"