Scripts

Partner apps can use scripts to run custom code on the end customer's subscription portal.

🔒 Requires read-script-tags or write-script-tags access scope.

What are scripts ?

Scripts allow you to extend or customize the entire experience on the subscription portal, by injecting JavaScript code.

This can be used to:

  • Display widgets or banners.
  • Track events and analytics.
  • Enhance UI with real-time Recurpay data.
  • Customize the cancellation flow or modify customer interactions.

How it works ?

Once the app is installed and script injection is configured, Recurpay automatically injects the script into the specified page(s) of the merchant's store. This ensures your script runs in the correct context without requiring manual setup by the merchant.


The script object

{
  "script": {
    "inline_src": "console.log('Hello from Recurpay Partner');",
    "display_scope": "customer_account",
    "cache": true
  }
}

The script resource

AttributeTypeDescription
inline_srcstringInline JavaScript code that will be injected and executed directly on the specified page of the merchant's store (e.g., console.log(...)).
display_scopeenumDefines where the script will be injected and executed. Supported values may include customer_account, storefront, etc.
cachebooleanDetermines whether the script should be cached by the storefront for better performance. Setting this to true enables caching.