### setup Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Sets up Purchases with your API key and an app user ID. ```APIDOC ## setup ### Description Sets up Purchases with your API key and an app user ID. ### Method static Future setup(String apiKey, {String? appUserId, PurchasesAreCompletedBy? purchasesAreCompletedBy, String? userDefaultsSuiteName, StoreKitVersion? storeKitVersion, bool useAmazon = false, bool usesStoreKit2IfAvailable = false}) ### Parameters #### Path Parameters - **apiKey** (String) - Required - Your RevenueCat API key. - **appUserId** (String?) - Optional - The unique identifier for the app user. - **purchasesAreCompletedBy** (PurchasesAreCompletedBy?) - Optional - Specifies who completes purchases. - **userDefaultsSuiteName** (String?) - Optional - The suite name for user defaults. - **storeKitVersion** (StoreKitVersion?) - Optional - The StoreKit version to use. - **useAmazon** (bool) - Optional - Whether to use Amazon. - **usesStoreKit2IfAvailable** (bool) - Optional - Whether to use StoreKit 2 if available. ``` -------------------------------- ### setup static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setup.html Sets up the Purchases SDK with your RevenueCat API key and an optional app user ID. This method configures the SDK for use in your application. ```APIDOC ## setup static method ### Description Initializes the Purchases SDK. This is the first method you should call. ### Method Signature ```dart static Future setup( String apiKey, { String? appUserId, PurchasesAreCompletedBy? purchasesAreCompletedBy, String? userDefaultsSuiteName, StoreKitVersion? storeKitVersion, bool useAmazon = false, bool usesStoreKit2IfAvailable = false, } ) ``` ### Parameters * **apiKey** (string) - Required - Your RevenueCat API Key. * **appUserId** (string?) - Optional - A unique identifier for the user. If not provided, RevenueCat will generate one. * **purchasesAreCompletedBy** (PurchasesAreCompletedBy?) - Optional - Use `PurchasesAreCompletedByMyApp` if you have your own IAP implementation and want to use RevenueCat's backend. Defaults to `PurchasesAreCompletedByRevenueCat`. * **userDefaultsSuiteName** (string?) - Optional (iOS-only) - Specifies a custom `NSUserDefaults` suite for storing SDK preferences. If null, standard `NSUserDefaults` are used. * **storeKitVersion** (StoreKitVersion?) - Optional - Specifies the StoreKit version to use. Defaults to `StoreKitVersion.defaultVersion`. * **useAmazon** (bool) - Optional (Android-only) - Set to `true` if distributing on the Amazon Appstore. Defaults to `false`. * **usesStoreKit2IfAvailable** (bool) - Optional (iOS-only) - Set to `true` to enable StoreKit 2. Defaults to `false`. RevenueCat recommends leaving this as default to let the SDK decide the best StoreKit implementation. ``` -------------------------------- ### Setup Purchases SDK Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setup.html Initializes the Purchases SDK with your RevenueCat API key and optional user ID. This method is deprecated and `PurchasesConfiguration` should be used instead. ```dart /// [usesStoreKit2IfAvailable] iOS-only, will be ignored for Android. /// RevenueCat currently uses StoreKit 1 for purchases, as its stability in production scenarios has /// proven to be more performant than StoreKit 2. /// /// We're collecting more data on the best approach, but StoreKit 1 vs StoreKit 2 is an implementation detail /// that you shouldn't need to care about. /// /// Simply leave this parameter as default to let RevenueCat decide for you which StoreKit implementation to use. /// Set this to FALSE to disable StoreKit2. @Deprecated('Use PurchasesConfiguration') static Future setup( String apiKey, { String? appUserId, PurchasesAreCompletedBy? purchasesAreCompletedBy, String? userDefaultsSuiteName, StoreKitVersion? storeKitVersion, bool useAmazon = false, bool usesStoreKit2IfAvailable = false, } ) { final configuration = PurchasesConfiguration(apiKey) ..appUserID = appUserId ..purchasesAreCompletedBy = purchasesAreCompletedBy ?? const PurchasesAreCompletedByRevenueCat() ..userDefaultsSuiteName = userDefaultsSuiteName ..storeKitVersion = storeKitVersion ?? StoreKitVersion.defaultVersion ..store = useAmazon ? Store.amazon : null; _lastReceivedCustomerInfo = null; return configure(configuration); } ``` -------------------------------- ### setKeyword Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Associates a subscriber attribute with the install keyword for the user. ```APIDOC ## setKeyword ### Description Associates a subscriber attribute with the install keyword for the user. ### Method static Future setKeyword(String keyword) ### Parameters #### Path Parameters - **keyword** (String) - Required - The install keyword. ``` -------------------------------- ### setMediaSource Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Associates a subscriber attribute with the install media source for the user. ```APIDOC ## setMediaSource ### Description Associates a subscriber attribute with the install media source for the user. ### Method static Future setMediaSource(String mediaSource) ### Parameters #### Path Parameters - **mediaSource** (String) - Required - The media source identifier. ``` -------------------------------- ### setMediaSource static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setMediaSource.html Associates a subscriber attribute with the install media source for the user. An empty string or null value for `mediaSource` will delete the subscriber attribute. ```APIDOC ## setMediaSource ### Description Associates a subscriber attribute with the install media source for the user. An empty string or null value for `mediaSource` will delete the subscriber attribute. ### Method Signature `Future setMediaSource(String mediaSource)` ### Parameters #### Path Parameters - **mediaSource** (String) - Required - The media source to associate with the user's install. An empty string or null will remove the attribute. ### Implementation ```dart static Future setMediaSource(String mediaSource) => _channel.invokeMethod('setMediaSource', {'mediaSource': mediaSource}); ``` ``` -------------------------------- ### getCustomerInfo static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getCustomerInfo.html Gets current customer info, which will normally be cached. ```APIDOC ## getCustomerInfo static method ### Description Gets current customer info, which will normally be cached. ### Method Signature `Future getCustomerInfo()` ### Implementation Example ```dart static Future getCustomerInfo() async { final result = await _channel.invokeMethod('getCustomerInfo'); return CustomerInfo.fromJson(Map.from(result)); } ``` ``` -------------------------------- ### setAd static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setAd.html Associates a subscriber attribute with the install ad for the user. An empty string or null will delete the subscriber attribute. ```APIDOC ## setAd static method ### Description Associates a subscriber attribute with the install ad for the user. An empty string or null value will remove the attribute. ### Method Signature `Future setAd(String ad)` ### Parameters #### Path Parameters - **ad** (String) - Required - Subscriber attribute associated with the install ad for the user. An empty String or null will delete the subscriber attribute. ### Implementation ```dart static Future setAd(String ad) => _channel.invokeMethod('setAd', {'ad': ad}); ``` ``` -------------------------------- ### ReadyForPromotedProductPurchaseListener Typedef Definition Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/ReadyForPromotedProductPurchaseListener.html Defines the signature for the listener callback. This function is called when a promoted purchase is initiated, providing the product identifier and a future that starts the purchase process. It's crucial to either execute the startPurchase future or cache it if the app is not ready to handle the purchase. ```dart typedef ReadyForPromotedProductPurchaseListener = void Function( String productIdentifier, Future Function() startPurchase, ); ``` -------------------------------- ### getCustomerInfo Static Method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getCustomerInfo.html Use this method to get the current customer info, which is normally cached. It invokes a platform channel method and parses the result into a CustomerInfo object. ```dart static Future getCustomerInfo() async { final result = await _channel.invokeMethod('getCustomerInfo'); return CustomerInfo.fromJson(Map.from(result)); } ``` -------------------------------- ### Set Tenjin Analytics Installation ID Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setTenjinAnalyticsInstallationID.html Use this static method to set the Tenjin Installation ID for the current user. An empty string or null will remove the attribute. ```dart static Future setTenjinAnalyticsInstallationID(String tenjinAnalyticsInstallationID) => _channel.invokeMethod( 'setTenjinAnalyticsInstallationID', {'tenjinAnalyticsInstallationID': tenjinAnalyticsInstallationID}, ); ``` -------------------------------- ### Set Install Campaign Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setCampaign.html Associates a subscriber with an install campaign. An empty string or null value for `campaign` will remove the attribute. This method is part of the Purchases Flutter SDK. ```dart static Future setCampaign(String campaign) => _channel.invokeMethod('setCampaign', {'campaign': campaign}); ``` -------------------------------- ### Get Current Storefront Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/storefront.html Retrieves the current storefront for the store account. This method invokes a platform channel to get the storefront details and parses the JSON response into a `Storefront` object. Returns null if no storefront information is available. ```dart static Future get storefront async { final storefrontJson = await _channel.invokeMethod('getStorefront'); if (storefrontJson == null) { return null; } return Storefront.fromJson(Map.from(storefrontJson)); } ``` -------------------------------- ### configure Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/configure.html Sets up the Purchases SDK with your API key and an app user ID. This is the primary method for initializing the SDK. ```APIDOC ## configure ### Description Sets up Purchases with your API key and an app user ID. This method initializes the SDK and applies various configuration settings. ### Method Signature `static Future configure(PurchasesConfiguration purchasesConfiguration)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body `purchasesConfiguration` (PurchasesConfiguration) - Object containing configuration parameters: - `apiKey` (string) - Your RevenueCat API key. - `appUserID` (string) - The unique identifier for the current app user. - `userDefaultsSuiteName` (string, optional) - The suite name for UserDefaults. - `storeKitVersion` (StoreKitVersion, optional) - The StoreKit version to use. - `purchasesAreCompletedBy` (PurchasesAreCompletedBy, optional) - Specifies how purchases are completed. - `store` (Store, optional) - The store to use (e.g., `Store.amazon`). - `shouldShowInAppMessagesAutomatically` (bool, optional) - Whether to automatically show in-app messages. - `entitlementVerificationMode` (EntitlementVerificationMode, optional) - The mode for entitlement verification. - `pendingTransactionsForPrepaidPlansEnabled` (bool, optional) - Enables handling of pending transactions for prepaid plans. - `automaticDeviceIdentifierCollectionEnabled` (bool, optional) - Enables automatic collection of device identifiers. - `diagnosticsEnabled` (bool, optional) - Enables diagnostic logging. - `preferredUILocaleOverride` (String?, optional) - Overrides the preferred UI locale. ### Request Example ```dart await Purchases.configure( PurchasesConfiguration( "YOUR_API_KEY", appUserID: "a_user_id", store: Store.amazon, shouldShowInAppMessagesAutomatically: true, ) ); ``` ### Response #### Success Response This method returns a `Future` and does not return a value upon successful completion. #### Response Example None (void return type) ``` -------------------------------- ### Storefront Class Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_storefront/Storefront-class.html Information about how to instantiate the Storefront class. ```APIDOC ## Constructors ### `Storefront({required String countryCode})` Creates a new Storefront instance with the specified country code. ### `Storefront.fromJson(Map json)` Creates a Storefront instance from a JSON map. ``` -------------------------------- ### setCreative Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Associates a subscriber attribute with the install ad creative for the user. ```APIDOC ## setCreative ### Description Associates a subscriber attribute with the install ad creative for the user. ### Method static Future setCreative(String creative) ### Parameters #### Path Parameters - **creative** (String) - Required - The creative identifier. ``` -------------------------------- ### IntroductoryPrice Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_introductory_price/IntroductoryPrice-class.html Provides documentation for the two constructors of the IntroductoryPrice class: the default constructor and the factory constructor for JSON parsing. ```APIDOC ## Constructors ### IntroductoryPrice ```dart IntroductoryPrice(double price, String priceString, String period, int cycles, PeriodUnit periodUnit, int periodNumberOfUnits) ``` **Description**: Creates an instance of IntroductoryPrice. ### IntroductoryPrice.fromJson ```dart const IntroductoryPrice.fromJson(Map json) ``` **Description**: Creates an IntroductoryPrice instance from a JSON map. ``` -------------------------------- ### PresentedOfferingContext Constructor Source: https://pub.dev/documentation/purchases_flutter/latest/models_presented_offering_context_wrapper/PresentedOfferingContext/PresentedOfferingContext.html Initializes a new instance of the PresentedOfferingContext class. ```APIDOC ## PresentedOfferingContext Constructor ### Description Initializes a new instance of the PresentedOfferingContext class. ### Parameters #### Path Parameters - **offeringIdentifier** (String) - Required - The identifier of the offering. - **placementIdentifier** (String?) - Optional - The identifier of the placement. - **targetingContext** (PresentedOfferingTargetingContext?) - Optional - The targeting context for the offering. ``` -------------------------------- ### IntroductoryPrice Methods and Operators Source: https://pub.dev/documentation/purchases_flutter/latest/models_introductory_price/IntroductoryPrice-class.html Documents the available methods and operators for the IntroductoryPrice class, including equality comparison and string representation. ```APIDOC ## Methods ### noSuchMethod ```dart noSuchMethod(Invocation invocation) → dynamic ``` **Description**: Invoked when a nonexistent method or property is accessed. (inherited) ### toString ```dart tosString() → String ``` **Description**: A string representation of this object. (inherited) ## Operators ### operator == ```dart operator ==(Object other) → bool ``` **Description**: The equality operator. (inherited) ``` -------------------------------- ### setCampaign Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Sets the subscriber attribute for the install campaign. This is used for tracking campaign attribution. ```APIDOC ## setCampaign ### Description Sets the subscriber attribute associated with the install campaign for the user. ### Method Static method ### Parameters #### Request Body - **campaign** (String) - The campaign identifier. ``` -------------------------------- ### PromotionalOffer Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_promotional_offer/PromotionalOffer/PromotionalOffer.html Provides the implementation for the PromotionalOffer constructor, assigning parameters to instance variables. ```dart const PromotionalOffer( this.identifier, this.keyIdentifier, this.nonce, this.signature, this.timestamp, ); ``` -------------------------------- ### IntroductoryPrice Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_introductory_price/IntroductoryPrice/IntroductoryPrice.html The actual implementation of the IntroductoryPrice constructor, assigning values to instance variables. ```dart const IntroductoryPrice( this.price, this.priceString, this.period, this.cycles, this.periodUnit, this.periodNumberOfUnits, ); ``` -------------------------------- ### setAd Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Sets the subscriber attribute for the install ad. This is used for tracking ad attribution. ```APIDOC ## setAd ### Description Sets the subscriber attribute associated with the install ad for the user. ### Method Static method ### Parameters #### Request Body - **ad** (String) - The ad identifier. ``` -------------------------------- ### PurchasesConfiguration Constructor Source: https://pub.dev/documentation/purchases_flutter/latest/models_purchases_configuration/PurchasesConfiguration-class.html Initializes a new instance of the PurchasesConfiguration class with the provided API key. ```APIDOC ## PurchasesConfiguration(String apiKey) ### Description Initializes a new instance of the PurchasesConfiguration class. ### Parameters * **apiKey** (String) - Required - RevenueCat API Key. ``` -------------------------------- ### setAdGroup Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Sets the subscriber attribute for the install ad group. This is used for tracking ad attribution. ```APIDOC ## setAdGroup ### Description Sets the subscriber attribute associated with the install ad group for the user. ### Method Static method ### Parameters #### Request Body - **adGroup** (String) - The ad group identifier. ``` -------------------------------- ### setTenjinAnalyticsInstallationID Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases-class.html Associates a subscriber attribute with the Tenjin Installation ID for the user. Required for the RevenueCat Tenjin integration. ```APIDOC ## setTenjinAnalyticsInstallationID ### Description Associates a subscriber attribute with the Tenjin Installation ID for the user. Required for the RevenueCat Tenjin integration. ### Method static Future setTenjinAnalyticsInstallationID(String tenjinAnalyticsInstallationID) ### Parameters #### Path Parameters - **tenjinAnalyticsInstallationID** (String) - Required - The Tenjin Analytics Installation ID. ``` -------------------------------- ### getOfferings static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getOfferings.html Fetches the configured offerings for the current user. Offerings are cached on instantiation for quick access during the purchase flow. ```APIDOC ## getOfferings ### Description Fetches the configured offerings for the current user. Offerings allows you to configure your in-app products via RevenueCat and greatly simplifies management. Offerings will be fetched and cached on instantiation so that, by the time they are needed, your prices are loaded for your purchase flow. ### Method Signature `Future getOfferings()` ### Returns - `Future`: A future that resolves to an `Offerings` object containing the available offerings. ``` -------------------------------- ### setAdGroup static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setAdGroup.html Sets or deletes the subscriber attribute associated with the install ad group for the user. ```APIDOC ## setAdGroup static method ### Description Associates a subscriber attribute with the install ad group for the user. Passing an empty string or null will delete the subscriber attribute. ### Method Signature `Future setAdGroup(String adGroup)` ### Parameters #### Path Parameters - **adGroup** (String) - Required - The ad group to associate with the user. An empty string or null will delete the attribute. ``` -------------------------------- ### PricingPhase Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_pricing_phase_wrapper/PricingPhase/PricingPhase.html Provides the actual implementation of the PricingPhase constructor, showing how the parameters are assigned to the class instance variables. ```dart const PricingPhase( this.billingPeriod, this.recurrenceMode, this.billingCycleCount, this.price, this.offerPaymentMode, ); ``` -------------------------------- ### purchase static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/purchase.html Initiates a purchase with the provided purchase parameters. This method handles different purchase types including packages, products, and subscription options across various platforms. ```APIDOC ## purchase static method ### Description Initiates a purchase with the provided purchase parameters. This method handles different purchase types including packages, products, and subscription options across various platforms. ### Method Signature `Future purchase(PurchaseParams purchaseParams)` ### Parameters #### purchaseParams (PurchaseParams) - Required An object containing all necessary information for the purchase, such as package, product, subscription option, and any relevant platform-specific details. ### Returns `Future` - A future that resolves to a `PurchaseResult` object indicating the outcome of the purchase. ### Throws - `UnsupportedPlatformException`: If the purchase is attempted on an unsupported platform (e.g., web for product purchases, or non-Android for subscription option purchases). - `ArgumentError`: If none of `package`, `product`, or `subscriptionOption` are set in `PurchaseParams`. ``` -------------------------------- ### Get appUserID in Purchases Flutter Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/appUserID.html Retrieves the current appUserID. This method is part of the Purchases SDK implementation. ```dart static Future get appUserID async => await _channel.invokeMethod('getAppUserID') as String; ``` -------------------------------- ### Purchase Static Method Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/purchase.html This method is used to initiate a purchase. It takes `PurchaseParams` as input and handles logic for different platforms and purchase types, including packages, products, and subscription options. It also supports win-back offers and product change information. ```dart static Future purchase( PurchaseParams purchaseParams, ) async { final package = purchaseParams.package; final storeProduct = purchaseParams.product; final subscriptionOption = purchaseParams.subscriptionOption; final productChangeInfo = purchaseParams.productChangeInfo; final googleProductChangeInfo = purchaseParams.googleProductChangeInfo; final googleIsPersonalizedPrice = purchaseParams.googleIsPersonalizedPrice; final oldProductIdentifier = productChangeInfo?.oldProductIdentifier ?? googleProductChangeInfo?.oldProductIdentifier; final storeReplacementMode = productChangeInfo != null ? productChangeInfo.replacementMode?.value : _storeReplacementModeFromGoogleProrationMode( googleProductChangeInfo?.prorationMode, )?.value; final signedDiscountTimestamp = purchaseParams.promotionalOffer?.timestamp.toString(); final winBackOffer = purchaseParams.winBackOffer; final customerEmail = purchaseParams.customerEmail; final presentedOfferingContext = purchaseParams.package?.presentedOfferingContext ?? purchaseParams.product?.presentedOfferingContext ?? purchaseParams.subscriptionOption?.presentedOfferingContext; final presentedOfferingContextJson = presentedOfferingContext?.toJson(); final purchaseArgs = { 'googleOldProductIdentifier': oldProductIdentifier, 'storeReplacementMode': storeReplacementMode, 'googleIsPersonalizedPrice': googleIsPersonalizedPrice, 'signedDiscountTimestamp': signedDiscountTimestamp, 'presentedOfferingContext': presentedOfferingContextJson, 'customerEmail': customerEmail, 'winBackOfferIdentifier': winBackOffer?.identifier, }; final isWinBackOfferPurchase = (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.macOS) && winBackOffer != null; if (package != null) { final methodName = isWinBackOfferPurchase ? 'purchasePackageWithWinBackOffer' : 'purchasePackage'; return await _invokeReturningPurchaseResult(methodName, { ...purchaseArgs, 'packageIdentifier': package.identifier, }); } else if (storeProduct != null) { if (kIsWeb) { throw UnsupportedPlatformException(); } final methodName = isWinBackOfferPurchase ? 'purchaseProductWithWinBackOffer' : 'purchaseProduct'; return await _invokeReturningPurchaseResult(methodName, { ...purchaseArgs, 'productIdentifier': storeProduct.identifier, 'type': storeProduct.productCategory?.name, }); } else if (subscriptionOption != null) { if (defaultTargetPlatform != TargetPlatform.android) { throw UnsupportedPlatformException(); } return await _invokeReturningPurchaseResult('purchaseSubscriptionOption', { ...purchaseArgs, 'productIdentifier': subscriptionOption.productId, 'optionIdentifier': subscriptionOption.id, }); } else { throw ArgumentError('One of package, product or subscriptionOption must be set in PurchaseParams.'); } } ``` -------------------------------- ### PromotedPurchaseResult Constructor Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/PromotedPurchaseResult-class.html Constructs a PromotedPurchaseResult with its properties. This is used internally to hold the result of starting a promoted purchase. ```APIDOC ## Constructors ### PromotedPurchaseResult ```dart PromotedPurchaseResult({required String productIdentifier, required CustomerInfo customerInfo}) ``` #### Description Constructs a PromotedPurchaseResult with its properties. #### Parameters * **productIdentifier** (String) - Required - The product identifier associated with the promoted purchase. * **customerInfo** (CustomerInfo) - Required - The customerInfo associated with the promoted purchase. ``` -------------------------------- ### WinBackOffer Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_win_back_offer/WinBackOffer-class.html Provides information on how to instantiate the WinBackOffer class. ```APIDOC ## Constructors WinBackOffer(String identifier, double price, String priceString, int cycles, String period, String periodUnit, int periodNumberOfUnits) const WinBackOffer.fromJson(Map json) factory ``` -------------------------------- ### Get Virtual Currencies Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getVirtualCurrencies.html Fetches the virtual currencies for the current subscriber. Returns a VirtualCurrencies object or throws a PlatformException. ```dart /// Fetches the virtual currencies for the current subscriber. /// /// Returns a [VirtualCurrencies] object, or throws a [PlatformException] if there /// was a problem fetching the virtual currencies. static Future getVirtualCurrencies() async { final result = await _channel.invokeMethod('getVirtualCurrencies'); return VirtualCurrencies.fromJson(Map.from(result)); } ``` -------------------------------- ### setSimulatesAskToBuyInSandbox Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setSimulatesAskToBuyInSandbox.html Simulates the ask-to-buy flow for iOS purchases in sandbox environments. This should only be used for testing purposes. ```APIDOC ## setSimulatesAskToBuyInSandbox ### Description This method is used to simulate the ask-to-buy flow for iOS purchases when in a sandbox environment. It is intended solely for testing purposes. ### Method Signature `Future setSimulatesAskToBuyInSandbox(bool enabled)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **enabled** (bool) - Required - Set to `true` to simulate the ask-to-buy flow. Set to `false` to disable simulation. ### Platform iOS only. ### Notes Refer to http://errors.rev.cat/ask-to-buy for more information on the ask-to-buy flow. ``` -------------------------------- ### appUserID Property Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/appUserID.html Gets the current appUserID. This is a property that returns a Future representing the unique identifier for the current user. ```APIDOC ## appUserID Property ### Description Gets the current appUserID. ### Method Getter ### Endpoint N/A (SDK method) ### Parameters None ### Response #### Success Response - **appUserID** (Future) - The current app user ID. ### Request Example ```dart String userId = await Purchases.appUserID; ``` ### Response Example ```json "example_user_id" ``` ``` -------------------------------- ### IntroductoryPrice Constructor Signature Source: https://pub.dev/documentation/purchases_flutter/latest/models_introductory_price/IntroductoryPrice/IntroductoryPrice.html Defines the parameters for creating an IntroductoryPrice object. ```dart const IntroductoryPrice( 1. double price, 2. String priceString, 3. String period, 4. int cycles, 5. PeriodUnit periodUnit, 6. int periodNumberOfUnits, ) ``` -------------------------------- ### ProrationModeExtension value getter Source: https://pub.dev/documentation/purchases_flutter/latest/models_upgrade_info/ProrationModeExtension/value.html Returns an integer corresponding to the `ProrationMode` enum. Use this getter to get a numerical representation for proration modes. ```dart int? get value { switch (this) { case ProrationMode.immediateWithTimeProration: return 1; case ProrationMode.immediateWithoutProration: return 3; case ProrationMode.immediateAndChargeFullPrice: return 5; case ProrationMode.immediateAndChargeProratedPrice: return 2; default: return null; } } ``` -------------------------------- ### PromotionalOffer Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_promotional_offer/PromotionalOffer-class.html Provides documentation for the constructors of the PromotionalOffer class. ```APIDOC ## Constructors ### PromotionalOffer ```dart PromotionalOffer(String identifier, String keyIdentifier, String nonce, String signature, int timestamp) ``` **Description**: Creates a new PromotionalOffer instance. **Parameters**: - **identifier** (String) - Required - Identifier agreed upon with the App Store for a discount of your choosing. - **keyIdentifier** (String) - Required - The identifier of the public/private key pair agreed upon with the App Store when the keys were generated. - **nonce** (String) - Required - One-time use random entropy-adding value for security. - **signature** (String) - Required - The cryptographic signature generated by your private key. - **timestamp** (int) - Required - Timestamp of when the signature is created. ### PromotionalOffer.fromJson ```dart factory PromotionalOffer.fromJson(Map json) ``` **Description**: Creates a PromotionalOffer instance from a JSON map. **Parameters**: - **json** (Map) - Required - The JSON map to parse. ``` -------------------------------- ### Implementing props for Equality Source: https://pub.dev/documentation/purchases_flutter/latest/models_storefront/Storefront/props.html The `props` getter should return a list of properties that determine equality between two instances. This example includes `countryCode`. ```dart @override List get props => [ countryCode, ]; ``` -------------------------------- ### Offering Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_offering_wrapper/Offering/Offering.html Shows the implementation of the Offering constructor, assigning the provided parameters to the corresponding instance variables. ```dart const Offering( this.identifier, this.serverDescription, this.metadata, this.availablePackages, { this.lifetime, this.annual, this.sixMonth, this.threeMonth, this.twoMonth, this.monthly, this.weekly, this.webCheckoutUrl, }); ``` -------------------------------- ### PresentedOfferingContext Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_presented_offering_context_wrapper/PresentedOfferingContext-class.html This section details the constructors available for the PresentedOfferingContext class. ```APIDOC ## Constructors PresentedOfferingContext(String offeringIdentifier, String? placementIdentifier, PresentedOfferingTargetingContext? targetingContext) const PresentedOfferingContext.fromJson(Map json) ``` -------------------------------- ### get storefront Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/storefront.html Retrieves the current storefront for the store account. This method returns a Future that resolves to a Storefront object or null if no storefront is available. ```APIDOC ## get storefront ### Description Gets the current storefront for the store account. ### Method `get` ### Endpoint `purchases.storefront` ### Returns - **Future** - A Future that resolves to the current Storefront object, or null if none is set. ``` -------------------------------- ### PromotionalOffer.fromJson Factory Constructor Source: https://pub.dev/documentation/purchases_flutter/latest/models_promotional_offer/PromotionalOffer/PromotionalOffer.fromJson.html Creates a PromotionalOffer instance from a JSON map. Ensure the map contains all required keys: 'identifier', 'keyIdentifier', 'nonce', 'signature', and 'timestamp'. ```dart factory PromotionalOffer.fromJson(Map json) => PromotionalOffer( json['identifier'] as String, json['keyIdentifier'] as String, json['nonce'] as String, json['signature'] as String, json['timestamp'] as int, ); ``` -------------------------------- ### String get name Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_purchases_completed_by/PurchasesAreCompletedByTypeExtension/name.html This getter returns a string representation for each enum value in PurchasesAreCompletedByType. It is used to identify the type of purchase completion. ```dart String get name { switch (this) { case PurchasesAreCompletedByType.myApp: return 'MY_APP'; case PurchasesAreCompletedByType.revenueCat: return 'REVENUECAT'; } } ``` -------------------------------- ### beginRefundRequestForProduct Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/beginRefundRequestForProduct.html Initiates a refund request for a given product. This method is only available on iOS 15+ and presents a refund request sheet. It returns the status of the refund request or throws an exception if unsuccessful or on an unsupported platform. ```APIDOC ## beginRefundRequestForProduct ### Description Initiates a refund request for a product. This method is only available on iOS 15+ and presents a refund request sheet for the latest transaction associated with the product. ### Method Signature `static Future beginRefundRequestForProduct(StoreProduct product)` ### Parameters #### Path Parameters - **product** (StoreProduct) - Required - The StoreProduct to begin a refund request for. ### Returns - **RefundRequestStatus** - The status of the refund request. This could be `RefundRequestStatus.userCancelled`. ### Exceptions - **PlatformException** - Thrown if the request was unsuccessful. - **UnsupportedPlatformException** - Thrown if called on an unsupported platform (Android or iOS < 15). ### Implementation Example ```dart static Future beginRefundRequestForProduct( StoreProduct product, ) async { final statusCode = await _channel.invokeMethod( 'beginRefundRequestForProduct', {'productIdentifier': product.identifier}, ); if (statusCode == null) throw UnsupportedPlatformException(); return RefundRequestStatusExtension.from(statusCode); } ``` ``` -------------------------------- ### setCreative static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setCreative.html Associates a subscriber attribute with the install ad creative for the user. Passing an empty string or null will delete the subscriber attribute. ```APIDOC ## setCreative ### Description Associates a subscriber attribute with the install ad creative for the user. An empty string or null value will delete the subscriber attribute. ### Method Signature `Future setCreative(String creative)` ### Parameters #### Path Parameters - **creative** (String) - Required - Subscriber attribute associated with the install ad creative for the user. Empty String or null will delete the subscriber attribute. ### Implementation ```dart static Future setCreative(String creative) => _channel.invokeMethod('setCreative', {'creative': creative}); ``` ``` -------------------------------- ### StoreProductDiscount Props Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_store_product_discount/StoreProductDiscount/props.html This snippet shows the implementation of the get props method for the StoreProductDiscount class. It returns a list of properties used for equality checks. ```dart @override List get props => [ identifier, price, priceString, cycles, period, periodUnit, periodNumberOfUnits, ]; ``` -------------------------------- ### PresentedOfferingTargetingContext Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_presented_offering_targeting_context_wrapper/PresentedOfferingTargetingContext-class.html Constructors for creating instances of PresentedOfferingTargetingContext. ```APIDOC ## Constructors PresentedOfferingTargetingContext(int revision, String ruleId) const PresentedOfferingTargetingContext.fromJson(Map json) ``` -------------------------------- ### Get String Name for EntitlementVerificationMode Source: https://pub.dev/documentation/purchases_flutter/latest/models_entitlement_verification_mode/EntitlementVerificationModeExtension/name.html Use this getter to retrieve the string representation of an EntitlementVerificationMode enum value. It handles cases for 'disabled' and 'informational' modes. ```dart String get name { switch (this) { case EntitlementVerificationMode.disabled: return 'DISABLED'; case EntitlementVerificationMode.informational: return 'INFORMATIONAL'; } } ``` -------------------------------- ### PurchaseParams.storeProduct Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_purchase_params/PurchaseParams/PurchaseParams.storeProduct.html Provides the implementation for the PurchaseParams.storeProduct constructor. This code initializes the purchase parameters with the provided store product and its associated optional configuration details. ```dart const PurchaseParams.storeProduct( StoreProduct storeProduct, { StoreProductChangeInfo? productChangeInfo, @Deprecated('Use productChangeInfo') GoogleProductChangeInfo? googleProductChangeInfo, bool? googleIsPersonalizedPrice, PromotionalOffer? promotionalOffer, WinBackOffer? winBackOffer, String? customerEmail, }) : this._( null, storeProduct, null, productChangeInfo, googleProductChangeInfo, googleIsPersonalizedPrice, promotionalOffer, winBackOffer, customerEmail, ); ``` -------------------------------- ### StoreProductChangeInfo Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_store_product_change/StoreProductChangeInfo/StoreProductChangeInfo.html This is the implementation of the StoreProductChangeInfo constructor. It initializes the product identifier and optional replacement mode. ```dart const StoreProductChangeInfo( this.oldProductIdentifier, { this.replacementMode, }); ``` -------------------------------- ### setTenjinAnalyticsInstallationID Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setTenjinAnalyticsInstallationID.html Associates a Tenjin Installation ID with the current user. This is necessary for the RevenueCat Tenjin integration. Passing an empty string or null will remove the subscriber attribute. ```APIDOC ## setTenjinAnalyticsInstallationID ### Description Associates a Tenjin Installation ID with the current user. This is necessary for the RevenueCat Tenjin integration. Passing an empty string or null will remove the subscriber attribute. ### Method Signature `Future setTenjinAnalyticsInstallationID(String tenjinAnalyticsInstallationID)` ### Parameters #### Path Parameters - **tenjinAnalyticsInstallationID** (String) - Required - The Tenjin Installation ID to set. An empty string or null will delete the attribute. ``` -------------------------------- ### AmazonConfiguration Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_purchases_configuration/AmazonConfiguration/AmazonConfiguration.html Initializes the AmazonConfiguration with an API key and sets the store to Amazon. ```dart AmazonConfiguration(String apiKey) : super(apiKey) { store = Store.amazon; } ``` -------------------------------- ### UpgradeInfo Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_upgrade_info/UpgradeInfo/UpgradeInfo.html The actual implementation of the UpgradeInfo constructor, initializing the oldSKU and prorationMode properties. Marked as deprecated. ```dart @Deprecated('Use GoogleProductChangeInfo') UpgradeInfo(this.oldSKU, {this.prorationMode}); ``` -------------------------------- ### getProducts static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getProducts.html Fetches product information. Returns a list of products or throws an error if the products are not properly configured in RevenueCat or if there is another error while retrieving them. ```APIDOC ## getProducts static method ### Description Fetches the product info for a list of product identifiers. This method can return a list of `StoreProduct` objects or throw an error if product configuration is incorrect or retrieval fails. ### Method Signature `Future> getProducts(List productIdentifiers, {ProductCategory productCategory = ProductCategory.subscription, @Deprecated('Use ProductType') PurchaseType type = PurchaseType.subs})` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Method Parameters - **productIdentifiers** (List) - Required - Array of product identifiers to fetch information for. - **productCategory** (ProductCategory) - Optional - Defaults to `ProductCategory.subscription`. If the products are Android INAPPs, this needs to be `ProductCategory.nonSubscription` otherwise the products won't be found. This parameter only has effect in Android. - **type** (PurchaseType) - Optional - Defaults to `PurchaseType.subs`. If the products are Android INAPPs, this needs to be `PurchaseType.inapp` otherwise the products won't be found. This parameter only has effect in Android. Deprecated: Use `ProductType` instead. ``` -------------------------------- ### Set or Remove Subscriber Keyword Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setKeyword.html Use this static method to associate a keyword with the user's install. Passing an empty string or null will remove the attribute. ```dart static Future setKeyword(String keyword) => _channel.invokeMethod('setKeyword', {'keyword': keyword}); ``` -------------------------------- ### setCampaign static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setCampaign.html Sets the campaign for the current user. This is useful for tracking install campaigns. Passing an empty string or null will remove the campaign attribute. ```APIDOC ## setCampaign ### Description Associates a subscriber attribute with the install campaign for the user. An empty string or null value will delete the subscriber attribute. ### Method Signature `Future setCampaign(String campaign)` ### Parameters #### Path Parameters - **campaign** (String) - Required - The campaign identifier. An empty string or null will delete the attribute. ### Implementation ```dart static Future setCampaign(String campaign) => _channel.invokeMethod('setCampaign', {'campaign': campaign}); ``` ``` -------------------------------- ### Check Trial or Introductory Price Eligibility Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/checkTrialOrIntroductoryPriceEligibility.html Use this method to determine if a user is eligible for introductory pricing or trials for a given product. This is crucial for deciding whether to display the normal product price or the introductory price. Note that this method is iOS-only; Android always returns unknown eligibility. ```dart static Future> checkTrialOrIntroductoryPriceEligibility( List productIdentifiers, ) async { final eligibilityMap = await _channel .invokeMethod('checkTrialOrIntroductoryPriceEligibility', { 'productIdentifiers': productIdentifiers, }); return Map.from( eligibilityMap.map( (key, value) => MapEntry( key, IntroEligibility.fromJson(Map.from(value)), ), ), ); } ``` -------------------------------- ### Retrieve a Package by Identifier Source: https://pub.dev/documentation/purchases_flutter/latest/models_offering_wrapper/Offering/getPackage.html Use this method to get a specific package from the list of available packages using its identifier. It returns the package if found, otherwise null. ```dart Package? getPackage(String identifier) => availablePackages .firstWhereOrNull((package) => package.identifier == identifier); ``` -------------------------------- ### Offering Class Constructors Source: https://pub.dev/documentation/purchases_flutter/latest/models_offering_wrapper/Offering-class.html Constructors for the Offering class. Use `fromJson` to create an Offering instance from JSON data. ```APIDOC ## Constructors ### Offering ```dart Offering( String identifier, String serverDescription, Map metadata, List availablePackages, {Package? lifetime, Package? annual, Package? sixMonth, Package? threeMonth, Package? twoMonth, Package? monthly, Package? weekly, String? webCheckoutUrl} ) ``` ### Offering.fromJson ```dart factory Offering.fromJson(Map json) ``` ``` -------------------------------- ### PurchaseParams.package Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_purchase_params/PurchaseParams/PurchaseParams.package.html This snippet shows the implementation of the PurchaseParams.package constructor. It initializes purchase parameters for a package, including optional product change information, personalized pricing flags, promotional offers, win-back offers, and customer email. ```dart const PurchaseParams.package( Package package, { StoreProductChangeInfo? productChangeInfo, @Deprecated('Use productChangeInfo') GoogleProductChangeInfo? googleProductChangeInfo, bool? googleIsPersonalizedPrice, PromotionalOffer? promotionalOffer, WinBackOffer? winBackOffer, String? customerEmail, }) : this._( package, null, null, productChangeInfo, googleProductChangeInfo, googleIsPersonalizedPrice, promotionalOffer, winBackOffer, customerEmail, ); ``` -------------------------------- ### setKeyword static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setKeyword.html Sets or removes a subscriber attribute associated with the install keyword for the user. An empty string or null value for the keyword will delete the subscriber attribute. ```APIDOC ## setKeyword static method ### Description Associates a subscriber attribute with the install keyword for the user. If an empty string or null is provided for the keyword, the subscriber attribute will be deleted. ### Method Signature `Future setKeyword(String keyword)` ### Parameters #### Path Parameters - **keyword** (String) - Required - The keyword to associate with the subscriber attribute. An empty string or null will remove the attribute. ### Implementation ```dart static Future setKeyword(String keyword) => _channel.invokeMethod('setKeyword', {'keyword': keyword}); ``` ``` -------------------------------- ### purchasePackageWithWinBackOffer Method Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/purchasePackageWithWinBackOffer.html This is the implementation of the `purchasePackageWithWinBackOffer` method. It invokes the underlying platform method to perform the purchase with a win-back offer. Note that this method is deprecated and `purchase(PurchaseParams)` should be used instead. ```dart @Deprecated('Use purchase(PurchaseParams)') static Future purchasePackageWithWinBackOffer( Package package, WinBackOffer winBackOffer, ) async { final purchaseResult = await _invokeReturningPurchaseResult('purchasePackageWithWinBackOffer', { 'packageIdentifier': package.identifier, 'presentedOfferingContext': package.presentedOfferingContext.toJson(), 'winBackOfferIdentifier': winBackOffer.identifier, }); return purchaseResult; } ``` -------------------------------- ### Get Cached Virtual Currencies Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getCachedVirtualCurrencies.html Retrieves the currently cached VirtualCurrencies. Returns null if virtual currencies have not been fetched yet. This method is part of the Purchases Flutter SDK. ```dart static Future getCachedVirtualCurrencies() async { final result = await _channel.invokeMethod('getCachedVirtualCurrencies'); if (result == null) { return null; } return VirtualCurrencies.fromJson(Map.from(result)); } ``` -------------------------------- ### PresentedOfferingContext Methods Source: https://pub.dev/documentation/purchases_flutter/latest/models_presented_offering_context_wrapper/PresentedOfferingContext-class.html This section lists the methods available for the PresentedOfferingContext class. ```APIDOC ## Methods noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. inherited ttoJson() → dynamic toString() → String A string representation of this object. inherited ``` -------------------------------- ### Implementation of purchasePackage Static Method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/purchasePackage.html This code snippet shows the internal implementation of the `purchasePackage` static method. It handles the conversion of upgrade and proration modes before invoking the underlying purchase logic. ```dart @Deprecated('Use purchase(PurchaseParams)') static Future purchasePackage( Package packageToPurchase, { @Deprecated('Use GoogleProductChangeInfo') UpgradeInfo? upgradeInfo, GoogleProductChangeInfo? googleProductChangeInfo, bool? googleIsPersonalizedPrice, }) async { final storeReplacementMode = _storeReplacementModeFromGoogleProrationMode( googleProductChangeInfo?.prorationMode, )?.value ?? _storeReplacementModeFromGoogleReplacementModeInt( upgradeInfo?.prorationMode?.value, )?.value; final purchaseResult = await _invokeReturningPurchaseResult('purchasePackage', { 'packageIdentifier': packageToPurchase.identifier, 'presentedOfferingContext': packageToPurchase.presentedOfferingContext.toJson(), 'googleOldProductIdentifier': googleProductChangeInfo?.oldProductIdentifier ?? upgradeInfo?.oldSKU, 'googleProrationMode': null, 'storeReplacementMode': storeReplacementMode, 'googleIsPersonalizedPrice': googleIsPersonalizedPrice, }); return purchaseResult; } ``` -------------------------------- ### Retrieve Offering by Identifier Source: https://pub.dev/documentation/purchases_flutter/latest/models_offerings_wrapper/Offerings/getOffering.html Use this method to get a specific offering from the available offerings using its unique identifier. Ensure the identifier exists, otherwise, it may return null. ```dart Offering? getOffering(String identifier) => all[identifier]; ``` -------------------------------- ### Get Eligible Win Back Offers for Product Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/getEligibleWinBackOffersForProduct.html Use this method to retrieve eligible WinBackOffers for a given StoreProduct. This is an iOS-only feature and requires iOS 18.0 or greater with StoreKit 2. ```dart static Future> getEligibleWinBackOffersForProduct( StoreProduct product, ) async { final result = await _channel.invokeMethod('eligibleWinBackOffersForProduct', { 'productIdentifier': product.identifier, }); return (result as List) .map((e) => WinBackOffer.fromJson(Map.from(e))) .toList(); } ``` -------------------------------- ### PresentedOfferingContext Constructor Implementation Source: https://pub.dev/documentation/purchases_flutter/latest/models_presented_offering_context_wrapper/PresentedOfferingContext/PresentedOfferingContext.html The implementation of the PresentedOfferingContext constructor, used for initializing the object with offering and placement identifiers, and targeting context. ```dart const PresentedOfferingContext( this.offeringIdentifier, this.placementIdentifier, this.targetingContext, ); ``` -------------------------------- ### setAttributes static method Source: https://pub.dev/documentation/purchases_flutter/latest/purchases_flutter/Purchases/setAttributes.html Stores additional, structured information on a user. Key names starting with "$" are reserved by RevenueCat. Set the value as an empty string to delete an attribute. ```APIDOC ## setAttributes ### Description Stores additional, structured information on a user. Key names starting with "$" are reserved by RevenueCat. Set the value as an empty string to delete an attribute. ### Method static Future ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **attributes** (Map) - Required - A map of attributes by key. Set the value as an empty string to delete an attribute. ### Request Example ```dart await Purchases.setAttributes({ 'email': 'test@example.com', 'phone': '+15555555555', }); ``` ### Response #### Success Response This method returns a `Future` and does not return a value upon success. #### Response Example N/A ```