v1.0 API Reference

Getting Started with ShubhCloud API

The ShubhCloud REST API allows developers to dispatch WhatsApp marketing broadcasts, transactional alerts (OTPs, order tracking), and interactive conversational workflows directly through Meta's WhatsApp Cloud infrastructure.

Base URL: https://api.shubhmart.co.in/v1

Authentication

All HTTP requests must include your secret API key in the Authorization header using the standard HTTP Bearer scheme.

Authorization: Bearer shubh_live_94a7f28bc91e77d013a

Never expose your live API keys in client-side applications (such as React SPA or vanilla browser scripts). Always route through a backend server.

Send Template Message

Use this endpoint to initiate a business-initiated conversation using pre-approved Meta WhatsApp templates (e.g., Marketing, Utility notifications, Authentication OTPs).

POST /v1/messages

Request Body Parameters

Field Type Description
to *required string Recipient phone number in E.164 format with country code (e.g. +919876543210).
type *required string Must be template for notifications outside 24h customer window.
template.name *required string The approved template slug registered in your Meta WhatsApp Manager.
template.language *required string Template language code, e.g. en_US, hi_IN.
template.components array Array of components (header, body, buttons) containing dynamic parameters.

Example Request Payload (JSON)

{ "to": "+919876543210", "type": "template", "template": { "name": "festive_sale_alert", "language": "en_US", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Roshan" }, { "type": "text", "text": "30% OFF" } ] } ] } }

Example Response (200 OK)

{ "success": true, "message_id": "wamid.HBgLOTE5ODc2NTQzMjEwFQIAERgSRjQ3OUExQTM1QzJERTZFRDkA", "status": "accepted", "category": "MARKETING", "wallet": { "deducted": 0.9646, "wholesale_meta_cost": 0.7846, "reseller_margin": 0.1800, "balance_remaining": 4999.0354 }, "created_at": "2026-09-16T11:25:00Z" }

Send Authentication OTP (1-Tap Copy)

Dispatches a high-priority 2FA / login verification code via Meta's dedicated Authentication category with 1-tap copy button support.

POST /v1/messages/otp

Request Payload (JSON)

{ "to": "+919876543210", "type": "template", "template": { "name": "login_otp_code", "language": "en_US", "components": [ { "type": "body", "parameters": [{ "type": "text", "text": "849204" }] }, { "type": "button", "sub_type": "url", "index": "0", "parameters": [{ "type": "text", "text": "849204" }] } ] } }

Send WhatsApp Native Flow (In-Chat Form)

Launches an interactive native form inside WhatsApp without opening external browser windows.

POST /v1/messages/flow

Request Payload (JSON)

{ "to": "+919876543210", "type": "interactive", "interactive": { "type": "flow", "header": { "type": "text", "text": "Consultation Booking" }, "body": { "text": "Please select your appointment slot below." }, "action": { "name": "flow", "parameters": { "flow_message_version": "3", "flow_token": "flow_booking_9841", "flow_id": "7849102481029", "flow_cta": "Book Appointment Now" } } } }

Webhooks & Event Callbacks

Configure your HTTP POST webhook endpoint to receive real-time notifications when a message is dispatched, delivered, read by the customer, or when a customer sends a reply.

Delivery Receipt Payload Event

{ "event": "message_status_update", "message_id": "wamid.HBgLOTE5ODc2NTQzMjEw...", "status": "delivered", "recipient_id": "+919876543210", "timestamp": 1789547100 }

Pre-Built Libraries & Integrations

Easily integrate using your preferred programming language or framework:

Node.js / NPM
npm i shubhcloud-sdk
Python / PyPI
pip install shubhcloud
PHP / Composer
composer require shubhcloud