Skip to main content
Skip to navigation

Customers | REST API v1 Reference (1.0)

Download OpenAPI specification:Download

RevenueCat API v1 endpoint reference for Customers.

Customers

Part of the REST API v1 Reference.

Operations about customers.

Endpoints

Get or Create Customer

Gets the latest Customer Info for the customer with the given App User ID, or creates a new customer 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
Example: ios

Optionally set the X-Platform header to update the Customer'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 the customer's attributes.

Responses

Response samples

Content type
application/json
{
  • "request_date": "2019-07-26T17:40:10Z",
  • "request_date_ms": 1564162810884,
  • "subscriber": {
    }
}

Delete Customer

Permanently deletes a customer. Deletion is queued asynchronously.

For retry-safe flows, treat both 200 and 404 as successful "ensure deleted" completion.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The App User ID of the customer to be deleted (might be an aliased App User ID).

Responses

Response samples

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

Add Customer Attribution Data Deprecated

Attaches attribution data to a subscriber from specific supported networks.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The App User ID of the Customer.

Request Body schema: application/json
required
object

The data returned by the attribution network callbacks.

rc_idfa
string

The idfa from AdSupport on iOS. (iOS Only)

rc_gps_adid
string

The Google Play Services Advertising identifier. (Android Only)

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

The attribution network the data is coming from:

  • 0: Apple Search AdSupport
  • 1: Adjust
  • 2: AppsFlyer
  • 3: Branch
  • 4: Tenjin
  • 5: Facebook

Responses

Request samples

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

Response samples

Content type
application/json
"{}"

Update Customer Attributes

Updates attributes for a customer.

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 keys to attribute values.

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
integer <int64>

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
{
  • "value": {
    }
}

Get Authenticated Customer

Gets the latest Customer Info for the Customer identified by the access token. Use this endpoint from your backend to identify the Customer behind a request from your app. See Verify access tokens on your backend.

Requires an Authentication access token. The token is the only credential: don't send an API key. Authentication is in private beta.

Authorizations:
AccessToken

Responses

Response samples

Content type
application/json
{
  • "value": {
    },
  • "user": {
    }
}

Update Authenticated Customer Attributes

Updates attributes for the Customer identified by the access token. Accepts the same body as Update Customer Attributes.

Requires an Authentication access token. Authentication is in private beta.

Authorizations:
AccessToken
Request Body schema: application/json
object

Mapping of attribute keys to an object with a value and an optional updated_at_ms. If the value is null or an empty string, the attribute is deleted.

additional property
object
value
required
string
updated_at_ms
integer <int64>

Responses

Request samples

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

Response samples

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

Get Authenticated Customer In-App Currency Balances

Gets the in-app currency balances of the Customer identified by the access token, including currencies with a zero balance.

Requires an Authentication access token. Authentication is in private beta.

Authorizations:
AccessToken

Responses

Response samples

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

Spend Authenticated Customer In-App Currency

Spends in-app currency from the balance of the Customer identified by the access token. All amounts in one request are spent together, or none are.

Requires an Authentication access token. Authentication is in private beta. To spend currency with a secret API key from your server, use the API v2 transactions endpoint.

Authorizations:
AccessToken
header Parameters
Idempotency-Key
string <= 255 characters

An optional key that makes the request safe to retry. RevenueCat processes a transaction with the same key only once.

Request Body schema: application/json
required
required
object

Mapping of currency codes to the amount to spend. Each amount must be greater than 0.

property name*
additional property
integer >= 1
reference
string or null

An optional identifier of your own to attach to the transaction.

Responses

Request samples

Content type
application/json
{
  • "adjustments": {
    },
  • "reference": "my_custom_transaction_id"
}

Response samples

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

Get Project Public Keys (JWKS)

Gets the public keys that verify the signature of the access tokens of your project, as a JSON Web Key Set. Match the kid header of an access token to the kid of a key. See Verify access tokens on your backend.

This endpoint is public and needs no credentials. Cache the response. Authentication is in private beta.

path Parameters
project_id
required
string

The ID of your RevenueCat project, from Project Settings → General in the dashboard.

Responses

Response samples

Content type
application/json
{
  • "keys": [
    ]
}

Endpoint Reference

All API v1 resources, one page each. General concepts (authentication, request format, URL parameters) live on the API v1 overview.