SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Implement Subscription Callbacks for a Multitenant Application

Implement the Subscribe/Unsubscribe callbacks of the SAP SaaS Provisioning Service (saas-registry) and use the information provided in the subscription/unsubscription event for your Multitenant Application in SAP BTP, Kyma runtime.

Overview

🎓 intermediate 25 min. SAP Btp, Kyma RuntimeIntermediateSAP Business Technology Platform

You will learn

  • How to implement the Subscribe/Unsubscribe callbacks for the SAP SaaS Provisioning Service
  • How to automatically create APIRule for tenant-specific URL in Kyma runtime
Unknown U Unknown June 17, 2025
Created by April 4, 2022
Contributors

Prerequisites

Steps

Step 1 Introduction to Subscription Callbacks

To perform internal tenant onboarding activities, you must implement the subscription and unsubscription callbacks of the SAP Software-as-a-Service Provisioning service (saas-registry) and use the information provided in the subscription event. You can also implement the getDependencies callback to obtain the dependencies of any SAP reuse services by your application. For more details, please read SAP Help Portal: Develop the Multitenant Application.

When a consumer tenant creates or revokes a subscription to your multitenant application via SAP BTP cockpit, the SAP SaaS Provisioning service calls the multitenant application with subscription callbacks:

PUTcallback/v1.0/tenants/*

To inform the application that a new consumer tenant wants to subscribe to the application, implement the callback service with the PUT method. The callback must return a 200 response code and a string in the body, which is the access URL of the tenant to the application subscription (the URL contains the subdomain). This URL is generated by the multitenant application based on the approuter configuration (see Configure the approuter Application)

For example: https://customer-cb741ym5-approuter.c-xxxxxxx.kyma.ondemand.com

The URL must be in the format: https://<subaccount-subdomain>-<approuter-application-host>.<domain>

DELETEcallback/v1.0/tenants/*

To inform the application that a tenant has revoked its subscription to the multitenant application and is no longer allowed to use it, implement the same callback with the DELETE method.

Payload of subscription PUT and DELETE methods:

JSON
{
    "subscriptionAppId": "<value>",                     
    # The application ID of the main subscribed application.
    # Generated by Authorization and Trust Management service(XSUAA)-based on the xsappname.
    "subscriptionAppName": "<value>"                    
    # The application name of the main subscribed application.
    "subscribedTenantId": "<value>"                     
    # ID of the subscription tenant
    "subscribedSubdomain": "<value>"                    
    # The subdomain of the subscription tenant (hostname for the identityzone).
    "globalAccountGUID": "<value>"                      
    # ID of the global account
    "subscribedLicenseType": "<value>"                  
    # The license type of the subscription tenant
}

GETcallback/v1.0/dependencies

JSON
[
   {
      "xsappname" : "<value>"   
      # The xsappname of the reuse service which the application consumes.
      # Can be found in the environment variables of the application:
      # VCAP_SERVICES.<service>.credentials.xsappname
   }
]

The callback must return a 200 response code and a JSON file with the dependent services appName and appId, or just the xsappname.

The JSON response of the callback must be encoded as either UTF8, UTF16, or UTF32, otherwise an error is returned.

Step 2 Implement Subscription Callbacks
+
Step 3 Define Logic for APIRule Creation
+
Step 4 Grant Role to Pod
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Introduction to Subscription Callbacks 2. Implement Subscription Callbacks 3. Define Logic for APIRule Creation 4. Grant Role to Pod

Learn more →