search

Additional API

Paytm provides you additional JS APIs to "bridge" the gap between native and web app (e.g geolocation, contacts, gallery, camera, permission).

 

Note: This is an optional integration for your specific requirements. However, we recommend you to integrate these JS APIs to enhance user experience wherever required

 

The list of JS APIs currently supported are given below:

 

S.NO JS API FUNCTIONALITY
1. paytmPushWindow paytmPushWindow is used to push a new window to show new page. It adds a page to the stack and can be launched with custom startup params.
2. popWindow popWindow is used to close the current page. Can be called to exit the AppContainer.
3. openInBrowser openInBrowser is used to download any file in Mini Apps by passing the control to mobile browser eg. PDF.
4. paytmCheckPermission Checks if permissions are granted/denied.
5. paytmRequestPermission A bridge that requests permissions from users.
6. paytmOpenGallery Use the bridge below to open a custom image picker on iOS/Android, and get a callback once the user has picked an image or has cancelled
7. paytmCaptureImageFromCamera This bridge when invoked (assuming that camera permissions are already granted), opens the camera, and once the user clicks a picture, passes data to the web context.
8. paytmSelectUserAddress Improve the overall checkout experience by using the paytmSelectUserAddress API, and autofill the delivery /shipping address fields with user addresses that are saved with Paytm
9. createAppShortcut Allow a user to create the Mini App icon shortcut on their home screen.