mirror of
https://github.com/simstudioai/sim.git
synced 2026-10-25 09:34:44 +08:00
fix(revenuecat): align tools and block with REST v1 API spec (#4488)
* fix(revenuecat): align tools and block with REST v1 API spec
- Validated all 10 tools and the block against context7 REST v1 docs
- Unwrap {value:{subscriber}} envelope across post-receipts, attributes,
entitlements, and Google subscription endpoints
- Trim entitlement output to documented fields (expires_date,
grace_period_expires_date, product_identifier, purchase_date)
- Add subscriber output fields: last_seen, original_application_version,
other_purchases, subscriber_attributes
- create_purchase: productId optional (Google-only required); add
introductoryPrice, attributes, updated_at_ms; surface customer + subscriber;
X-Platform required; presentedOfferingIdentifier and paymentMode
- update_subscriber_attributes: read response and surface subscriber;
note required updated_at_ms
- defer_google_subscription: enforce XOR(extendByDays, expiryTimeMs) and
1-365 range; expiryTimeMs as one-of alternative
- grant_entitlement: duration optional, added endTimeMs (one-of)
- refund_google_subscription: corrected endpoint to
/transactions/{storeTransactionId}/refund
- delete_customer: read 'deleted' field (was 'was_deleted')
- list_offerings: corrected X-Platform values
- get_customer: count active subscriptions by expiry/refund
- Added shared throwIfRevenueCatError helper for {code, message} envelope
- Moved type coercions from tools.config.tool to tools.config.params to
preserve dynamic refs
* docs
* fix(revenuecat): address PR review feedback
- create_purchase: wrap JSON.parse(attributes) with try/catch and clear error
- update_subscriber_attributes: drop subscriber output (endpoint returns
empty body) and guard JSON.parse on attributes
- grant_entitlement: throw when both duration and endTimeMs are provided,
matching defer_google_subscription behavior
* fix(revenuecat): tighten docs after sub-segment validation
- delete_customer: drop dead was_deleted fallback (docs specify 'deleted')
- grant_entitlement: mark duration + startTimeMs as deprecated, clarify
startTimeMs only affects expiration calc (not grant time)
- list_offerings: replace vague platform description with documented
X-Platform enum (ios, android, amazon, stripe, roku, paddle)
* docs
* fix(revenuecat): clear duration default when endTimeMs is provided
The duration dropdown defaults to 'monthly' so any user filling in the
advanced endTimeMs field would otherwise hit the XOR guard. Clear
duration in the params mapper so endTimeMs takes precedence.
* fix(revenuecat): clear extendByDays default when expiryTimeMs is provided
Mirror the duration/endTimeMs fix from 8204e89: when expiryTimeMs is
populated, clear extendByDays in the params mapper so the empty-string
form value does not trip the XOR guard. Also harden the tool-level XOR
checks in defer_google_subscription and grant_entitlement to treat empty
strings as undefined for direct (non-block) callers.
* fix(revenuecat): guard NaN in time-ms mappers and require integer days
- Block params mapper: only clear duration/extendByDays when the parsed
endTimeMs/expiryTimeMs is finite, so invalid input does not silently
discard the user's valid companion default
- defer_google_subscription: validate extendByDays as integer (was
Number.isFinite), matching the error message
* fix(revenuecat): fall back to Date.now() when request_date is malformed
A malformed request_date would parse to NaN, making every entitlement
and subscription compare false and silently zero active counts. Fall
back to Date.now() when the parsed value is not finite.
* fix(revenuecat): unwrap value envelope in list_offerings response
* improvement(revenuecat): include updated_at_ms in attributes placeholder and wand prompt
This commit is contained in:
@@ -51,8 +51,10 @@ Retrieve subscriber information by app user ID
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The subscriber object with subscriptions and entitlements |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -71,16 +73,13 @@ Retrieve subscriber information by app user ID
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
| `metadata` | object | Subscriber summary metadata |
|
||||
| ↳ `app_user_id` | string | The app user ID |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when the subscriber was first seen |
|
||||
@@ -115,21 +114,29 @@ Record a purchase (receipt) for a subscriber via the REST API
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `apiKey` | string | Yes | RevenueCat API key \(public or secret\) |
|
||||
| `appUserId` | string | Yes | The app user ID of the subscriber |
|
||||
| `fetchToken` | string | Yes | The receipt token or purchase token from the store \(App Store receipt, Google Play purchase token, or Stripe subscription ID\) |
|
||||
| `productId` | string | Yes | The product identifier for the purchase |
|
||||
| `price` | number | No | The price of the product in the currency specified |
|
||||
| `currency` | string | No | ISO 4217 currency code \(e.g., USD, EUR\) |
|
||||
| `isRestore` | boolean | No | Whether this is a restore of a previous purchase |
|
||||
| `platform` | string | No | Platform of the purchase \(ios, android, amazon, macos, stripe\). Required for Stripe and Paddle purchases. |
|
||||
| `fetchToken` | string | Yes | For iOS, the base64-encoded receipt \(or JWSTransaction for StoreKit2\); for Android the purchase token; for Amazon the receipt; for Stripe the subscription ID or Checkout Session ID; for Roku the transaction ID; for Paddle the subscription ID or transaction ID |
|
||||
| `productId` | string | No | Apple, Google, Amazon, Roku, or Paddle product identifier or SKU. Required for Google. |
|
||||
| `price` | number | No | Price of the product. Required if you provide a currency. |
|
||||
| `currency` | string | No | ISO 4217 currency code \(e.g., USD, EUR\). Required if you provide a price. |
|
||||
| `isRestore` | boolean | No | Deprecated. Triggers configured restore behavior for shared fetch tokens. |
|
||||
| `presentedOfferingIdentifier` | string | No | Identifier of the offering presented to the customer at the time of purchase. Attached to new transactions in this fetch token and exposed in ETL exports and webhooks. |
|
||||
| `paymentMode` | string | No | Payment mode for the introductory period. One of: pay_as_you_go, pay_up_front, free_trial. Defaults to free_trial when an introductory period is detected and no value is provided. |
|
||||
| `introductoryPrice` | number | No | Introductory price paid \(if any\). |
|
||||
| `attributes` | json | No | JSON object of subscriber attributes to set alongside the purchase. Each key maps to \{"value": string, "updated_at_ms": number\}. |
|
||||
| `updatedAtMs` | number | No | UNIX epoch in milliseconds used to resolve attribute conflicts at the request level. |
|
||||
| `platform` | string | Yes | Platform of the purchase. One of: ios, android, amazon, macos, uikitformac, stripe, roku, paddle. Sent as the X-Platform header \(required by RevenueCat\). |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `customer` | object | Customer object returned at the top level of POST /v1/receipts \(first_seen, last_seen, original_app_user_id, original_application_version, original_sdk_version, management_url, entitlements, original_purchase_date, request_date\). Null when the response uses the `value`-wrapped envelope. |
|
||||
| `subscriber` | object | The updated subscriber object after recording the purchase |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -148,16 +155,13 @@ Record a purchase (receipt) for a subscriber via the REST API
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
### `revenuecat_grant_entitlement`
|
||||
|
||||
@@ -170,8 +174,9 @@ Grant a promotional entitlement to a subscriber
|
||||
| `apiKey` | string | Yes | RevenueCat secret API key \(sk_...\) |
|
||||
| `appUserId` | string | Yes | The app user ID of the subscriber |
|
||||
| `entitlementIdentifier` | string | Yes | The entitlement identifier to grant |
|
||||
| `duration` | string | Yes | Duration of the entitlement \(daily, three_day, weekly, monthly, two_month, three_month, six_month, yearly, lifetime\) |
|
||||
| `startTimeMs` | number | No | Optional start time in milliseconds since Unix epoch. Set to a past time to achieve custom durations shorter than daily. |
|
||||
| `duration` | string | No | Deprecated. Duration of the entitlement. Provide either duration or endTimeMs \(endTimeMs preferred\). One of: daily, three_day, weekly, two_week, monthly, two_month, three_month, six_month, yearly, lifetime |
|
||||
| `endTimeMs` | number | No | Absolute end time in milliseconds since Unix epoch. Use instead of duration to grant the entitlement until a specific timestamp. |
|
||||
| `startTimeMs` | number | No | Deprecated. Optional start time in milliseconds since Unix epoch, used with duration to determine expiration. Regardless of value, the entitlement is always granted immediately. |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -179,8 +184,10 @@ Grant a promotional entitlement to a subscriber
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The updated subscriber object after granting the entitlement |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -199,16 +206,13 @@ Grant a promotional entitlement to a subscriber
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
### `revenuecat_revoke_entitlement`
|
||||
|
||||
@@ -228,8 +232,10 @@ Revoke all promotional entitlements for a specific entitlement identifier
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The updated subscriber object after revoking the entitlement |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -248,16 +254,13 @@ Revoke all promotional entitlements for a specific entitlement identifier
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
### `revenuecat_list_offerings`
|
||||
|
||||
@@ -269,7 +272,7 @@ List all offerings configured for the project
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `apiKey` | string | Yes | RevenueCat API key |
|
||||
| `appUserId` | string | Yes | An app user ID to retrieve offerings for |
|
||||
| `platform` | string | No | Platform to filter offerings \(ios, android, stripe, etc.\) |
|
||||
| `platform` | string | No | X-Platform header value. One of: ios, android, amazon, stripe, roku, paddle. Required when using a legacy public API key; ignored with app-specific API keys. |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -296,7 +299,7 @@ Update custom subscriber attributes (e.g., $email, $displayName, or custom key-v
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `apiKey` | string | Yes | RevenueCat secret API key \(sk_...\) |
|
||||
| `appUserId` | string | Yes | The app user ID of the subscriber |
|
||||
| `attributes` | json | Yes | JSON object of attributes to set. Each key maps to an object with a "value" field. Example: \{"$email": \{"value": "user@example.com"\}, "$displayName": \{"value": "John"\}\} |
|
||||
| `attributes` | json | Yes | JSON object of attributes to set. Each key maps to an object with "value" \(string; null or empty deletes the attribute\) and "updated_at_ms" \(Unix epoch ms used for conflict resolution — required\). Example: \{"$email": \{"value": "user@example.com", "updated_at_ms": 1709195668093\}\} |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -316,7 +319,8 @@ Defer a Google Play subscription by extending its billing date by a number of da
|
||||
| `apiKey` | string | Yes | RevenueCat secret API key \(sk_...\) |
|
||||
| `appUserId` | string | Yes | The app user ID of the subscriber |
|
||||
| `productId` | string | Yes | The Google Play product identifier of the subscription to defer \(use the part before the colon for products set up after Feb 2023\) |
|
||||
| `extendByDays` | number | Yes | Number of days to extend the subscription by \(1-365\) |
|
||||
| `extendByDays` | number | No | Number of days to extend the subscription by \(1-365\). Provide either extendByDays or expiryTimeMs. |
|
||||
| `expiryTimeMs` | number | No | Absolute new expiry time in milliseconds since Unix epoch. Use instead of extendByDays to set an exact expiry. |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -324,8 +328,10 @@ Defer a Google Play subscription by extending its billing date by a number of da
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The updated subscriber object after deferring the Google subscription |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -344,20 +350,17 @@ Defer a Google Play subscription by extending its billing date by a number of da
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
### `revenuecat_refund_google_subscription`
|
||||
|
||||
Refund and optionally revoke a Google Play subscription (Google Play only)
|
||||
Refund a specific store transaction by its store transaction identifier and revoke access (subscription or non-subscription, last 365 days)
|
||||
|
||||
#### Input
|
||||
|
||||
@@ -365,7 +368,7 @@ Refund and optionally revoke a Google Play subscription (Google Play only)
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `apiKey` | string | Yes | RevenueCat secret API key \(sk_...\) |
|
||||
| `appUserId` | string | Yes | The app user ID of the subscriber |
|
||||
| `productId` | string | Yes | The Google Play product identifier of the subscription to refund |
|
||||
| `storeTransactionId` | string | Yes | The store transaction identifier of the purchase to refund \(e.g., GPA.3309-9122-6177-45730 for Google Play\) |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -373,8 +376,10 @@ Refund and optionally revoke a Google Play subscription (Google Play only)
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The updated subscriber object after refunding the Google subscription |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -393,16 +398,13 @@ Refund and optionally revoke a Google Play subscription (Google Play only)
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
### `revenuecat_revoke_google_subscription`
|
||||
|
||||
@@ -422,8 +424,10 @@ Immediately revoke access to a Google Play subscription and issue a refund (Goog
|
||||
| --------- | ---- | ----------- |
|
||||
| `subscriber` | object | The updated subscriber object after revoking the Google subscription |
|
||||
| ↳ `first_seen` | string | ISO 8601 date when subscriber was first seen |
|
||||
| ↳ `last_seen` | string | ISO 8601 date when subscriber was last seen |
|
||||
| ↳ `original_app_user_id` | string | Original app user ID |
|
||||
| ↳ `original_purchase_date` | string | ISO 8601 date of original purchase |
|
||||
| ↳ `original_application_version` | string | iOS only. First App Store version of your app the customer installed |
|
||||
| ↳ `original_purchase_date` | string | iOS only. Date the app was first purchased/downloaded |
|
||||
| ↳ `management_url` | string | URL for managing the subscriber subscriptions |
|
||||
| ↳ `subscriptions` | object | Map of product identifiers to subscription objects |
|
||||
| ↳ `store_transaction_id` | string | Store transaction identifier |
|
||||
@@ -442,15 +446,12 @@ Immediately revoke access to a Google Play subscription and issue a refund (Goog
|
||||
| ↳ `auto_resume_date` | string | ISO 8601 date when a paused subscription will auto-resume |
|
||||
| ↳ `product_plan_identifier` | string | Google Play base plan identifier \(for products set up after Feb 2023\) |
|
||||
| ↳ `entitlements` | object | Map of entitlement identifiers to entitlement objects |
|
||||
| ↳ `grant_date` | string | ISO 8601 grant date |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `is_active` | boolean | Whether the entitlement is active |
|
||||
| ↳ `will_renew` | boolean | Whether the entitlement will renew |
|
||||
| ↳ `period_type` | string | Period type \(normal, trial, intro, promotional\) |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `store` | string | Store the entitlement was granted from |
|
||||
| ↳ `expires_date` | string | ISO 8601 expiration date \(null for non-expiring entitlements\) |
|
||||
| ↳ `grace_period_expires_date` | string | ISO 8601 grace period expiration date |
|
||||
| ↳ `product_identifier` | string | Product identifier |
|
||||
| ↳ `purchase_date` | string | ISO 8601 date of the latest purchase or renewal |
|
||||
| ↳ `non_subscriptions` | object | Map of non-subscription product identifiers to arrays of purchase objects |
|
||||
| ↳ `other_purchases` | object | Other purchases attached to the subscriber |
|
||||
| ↳ `subscriber_attributes` | object | Custom attributes set on the subscriber. Only returned when using a secret API key |
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user