π³ Master Zoho Payments Testing with APIDog β A Complete OAuth + API Workflow Guide
Integrating a payment gateway like Zoho Payments can feel overwhelmingβespecially when OAuth authentication and webhook handling come into play.
In this guide, youβll learn how to:
β
Register your Zoho OAuth client properly
β
Generate access & refresh tokens step-by-step
β
Test Zoho Payments APIs smoothly using APIDog
β
Validate webhooks before touching production code
By the end, youβll have a fully tested payment flow with zero guesswork β perfect for building reliable fintech features.
π Why Use APIDog for Zoho Payments?
While tools like Postman can send requests, APIDog gives you a full API lifecycle workspace, which is ideal for sensitive payment integrations.
Key Benefits:
- π Design + Test + Document in one place
- π§ͺ Mock payment responses (success/failure flows)
- π€ Automated API testing
- π Auto-generated code snippets (Node.js, Python, Go, etc.)
This lets you focus on business logic instead of debugging chaos.
β Prerequisites
Before starting, make sure you have:
- A Zoho Payments sandbox or test organization
- APIDog installed
- Access to Zoho Developer Console
π OAuth Setup for Zoho Payments (Complete Flow)
This is a one-time setup that gives your app secure access to Zoho APIs.
β οΈ Only Account Owners or Admins in Zoho Payments can generate OAuth tokens.
π§Ύ Step 1: Register a New OAuth Client
- Go to Zoho Developer Console
- Ensure the client type in the URL is set to ORG
- Enter:
Parameter | Description |
Client Name | Name of your application |
Homepage URL | Your website or app homepage |
Authorized Redirect URI | Callback URL after authorization |
- Click CREATE
π Youβll now receive:
- Client ID
- Client Secret
π Keep these secure β never expose them publicly.
π Step 2: Generate Authorization Code
Create a GET request in your browser:
https://accounts.zoho.in/oauth/v2/org/auth?
Required Parameters:
Parameter | Description |
scope | Permissions like ZohoPay.payments.CREATE, READ, UPDATE |
client_id | From Developer Console |
soid | Format: zohopay.{account_id} |
response_type | code |
redirect_uri | Same as registered |
state | Random string |
access_type | online or offline |
Example:
https://accounts.zoho.in/oauth/v2/org/auth?scope=ZohoPay.payments.CREATE,ZohoPay.payments.READ&client_id=1005xxx&soid=zohopay.8xxxx&response_type=code&redirect_uri=https://www.premium.tempusmail.com/&access_type=offline
β Click ACCEPT to grant access.
Youβll be redirected with:
?code=AUTHORIZATION_CODE
Β
π Step 3: Generate Access & Refresh Tokens
Now make a POST request:
https://accounts.zoho.in/oauth/v2/token?
Parameters:
Parameter | Value |
code | Authorization code |
client_id | Your client ID |
client_secret | Your secret |
redirect_uri | Same callback URL |
grant_type | authorization_code |
Youβll receive:
- π
access_token(valid ~1 hour)
- β»οΈ
refresh_token(long-lived)
π Step 4: Refresh Expired Access Tokens
When access token expires:
https://accounts.zoho.in/oauth/v2/token?
Parameters:
Parameter | Value |
refresh_token | From previous step |
client_id | Your client ID |
client_secret | Your secret |
grant_type | refresh_token |
β
New access token generated instantly.
π« Revoke a Refresh Token (If Needed)
https://accounts.zoho.in/oauth/v2/token/revoke?
Parameter | Value |
token | refresh_token |
π§ͺ Testing Zoho Payments APIs in APIDog
Once authenticated, store your token as a global environment variable:
access_token = your_token_here
π Example: Create Payment Link
Method:
POST
URL:
{{base_url}}/hostedpages
Headers:
Authorization: Zoho-oauthtoken {{access_token}} X-com-zoho-subscriptions-organizationid: {{org_id}}
Body:
{ "customer_id":"9000000000000", "plan":{ "plan_code":"premium-monthly", "price":2900 } }
π― Response returns hosted payment page URL.
π Webhook Testing (Highly Recommended)
In APIDog you can:
β Define webhook schemas
β Simulate payment success/failure
β Validate real payload structure
This ensures your backend never breaks when real money flows in.
π Final Thoughts
By combining Zoho Payments OAuth with APIDogβs testing power, you get:
β
Secure authentication
β
Fully tested payment flows
β
Zero production surprises
β
Faster development
Once verified, export API-ready code and plug it directly into your application.
