razorpay / razorpay/razorpay-node

Best Practice for Updating Subscription Status in Mobile Apps (Webhook Delay Question)

Open
#461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
243
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Hi team ,

I'm implementing Razorpay Subscriptions in an Expo (React Native) mobile app.

Currently, subscription activation data arrives via webhook on my backend, which is the recommended source of truth. However, in a mobile app flow, after the user completes payment in Razorpay Checkout, I want to update the subscription status immediately on the frontend so users don’t see a delay.

My concern

Since the webhook can arrive a few seconds later, there is a potential delay before the backend marks the subscription active. During that time, the user has already completed payment but may not see the subscription activated in the app.

Question

  • What is the recommended approach for handling this scenario?

Specifically:

  1. After successful payment callback on mobile, should I optimistically mark the user as subscribed on the frontend and then call my backend to verify using Razorpay APIs (instead of waiting for webhook)?

  2. Is it considered best practice to verify subscription status immediately on backend via API after checkout success?

  3. Or do you suggest waiting for webhook only and using something like WebSocket to push status to the app?

I want to follow the best practice used by large-scale Razorpay subscription apps to ensure:

  • Instant UI feedback for the user ✅

  • Backend integrity using webhook ✅

  • Idempotent + secure verification ✅

Would appreciate your guidance on the ideal flow for subscription status sync in mobile apps using Razorpay.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions an Expo/React Native client, a backend, Razorpay Checkout, webhooks, and Razorpay APIs, but names no repository files or tests. Start by reviewing the existing subscription integration entry points; done would require a decided, documented status-synchronization flow with secure, idempotent backend verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react-native
Domain
api, mobile, payments
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.