Skip to main content
Skip to navigation

Transactions | REST API v1 Reference (1.0)

Download OpenAPI specification:Download

RevenueCat API v1 endpoint reference for Transactions.

Transactions

Part of the REST API v1 Reference.

Operations about transactions.

Endpoints

Create a Purchase

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

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

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

Request Body schema: application/json
app_user_id
required
string

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

fetch_token
required
string

For iOS, the base64 encoded receipt file (or JWSTransaction for StoreKit2), for Android the receipt token, for Amazon the receipt, for Stripe the subscription ID or the Stripe Checkout Session ID, for Roku the transaction ID, and for Paddle the subscription ID or transaction ID.

product_id
string

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

price
number <float>

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
boolean
Deprecated
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 Customer 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

Any Attributes to set on the Customer as a dictionary keyed by the Attribute name.

additional property
object

A single Attribute to be set.

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

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 of the Customer.

product_identifier
required
string

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

Responses

Response samples

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

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 of the Customer.

product_identifier
required
string

The identifier of the product belonging to the subscription that is being deferred. This can be found in RevenueCat's Product catalog -> {Product} -> Subscription Id.

Request Body schema: application/json
expiry_time_ms
integer <int64>

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. Either expiry_time_ms or extend_by_days must be provided.

extend_by_days
integer [ 1 .. 365 ]

The number of days to extend the subscription renewal date. Must be between 1 and 365. Either expiry_time_ms or extend_by_days must be provided.

Responses

Request samples

Content type
application/json
{
  • "expiry_time_ms": 1708417962662,
  • "extend_by_days": 30
}

Response samples

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

Google Play: Refund and Revoke Purchase

Issues a refund for the specified transaction 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 of the Customer.

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

Google Play: Cancel a Subscription

Cancels a Google subscription. The subscription remains valid until its expiration time, but it will not renew.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The App User ID of the Customer.

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

App Store: Extend a Subscription

Extends the renewal date of an auto-renewable subscription for up to 90 days for a specific customer.

This uses Apple's Extend a Subscription Renewal Date API.

Requires a v1 Secret API key.

Note: Apple limits subscription extensions to two per year per customer. Apple immediately sends the customer an email notification of the extension.

Authorizations:
BearerAuth
path Parameters
app_user_id
required
string

The App User ID of the Customer.

store_transaction_identifier
required
string

The store transaction identifier of the subscription to extend. Can be original transaction identifier or renewal transaction identifier. Example: 1000000819074923

Request Body schema: application/json
extend_by_days
required
integer [ 1 .. 90 ]

The number of days to extend the subscription renewal date. Must be between 1 and 90.

extend_reason_code
required
integer [ 0 .. 3 ]

The reason code for the subscription extension. See Apple's extendReasonCode documentation.

  • 0: Undeclared - The renewal-date extension reason is undeclared.
  • 1: Customer Satisfaction - The renewal-date extension is for customer satisfaction.
  • 2: Other - The renewal-date extension is for a reason other than the ones listed.
  • 3: Service Issue or Outage - The renewal-date extension is due to a service issue or outage.

Responses

Request samples

Content type
application/json
{
  • "extend_by_days": 30,
  • "extend_reason_code": 1
}

Response samples

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

Endpoint Reference

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