---
title: "Miracle WhatsApp API and Web API Integration"
description: "Connect Miracle Accounting Software to WhatsApp Cloud API for invoice PDFs, GST bills, challans, builty documents, ledgers, and payment reminders."
url: https://whats91.com/solutions/miracle-whatsapp-api
lastModified: 2026-05-29T18:10:37.297Z
keywords: ["Miracle WhatsApp API", "Miracle Accounting Software WhatsApp Integration", "Miracle Web API", "Miracle API", "Miracle Accounting API", "Miracle ERP API", "Miracle Invoice WhatsApp", "Miracle PDF WhatsApp", "Miracle Payment Reminder Automation", "Miracle Accounting WhatsApp Cloud API"]

---

# Miracle WhatsApp API and Web API Integration

> Connect Miracle Accounting Software to WhatsApp Cloud API for invoice PDFs, GST bills, challans, builty documents, ledgers, and payment reminders.

**Source**: [https://whats91.com/solutions/miracle-whatsapp-api](https://whats91.com/solutions/miracle-whatsapp-api)

---


## Overview

Whats91 provides a custom Miracle WhatsApp API endpoint for businesses that use Miracle Accounting Software and need official WhatsApp Cloud API delivery. The integration sends approved WhatsApp templates with Miracle field placeholders and PDF attachments such as GST invoices, challans, builty documents, e-way bills, receipts, ledger statements, and payment reminders.

Miracle sends a JSON POST request to Whats91. Whats91 validates the token, template, recipient, variables, Base64 PDF attachment, and sender configuration. Whats91 then sends the message through WhatsApp Cloud API and records validation or delivery errors.

## Endpoint

```
POST https://graph.whats91.com/api/custom/miracle/send-template
```

This endpoint is designed for Miracle's WhatsApp Web API profile and accepts JSON fields, common aliases, template arguments, and Base64 PDF attachments.

## What is Miracle Web API?

Miracle Web API is the external integration configuration used by Miracle Accounting Software to send structured HTTP requests to another system. It is also described as Miracle API, Miracle Accounting API, Miracle ERP API, Miracle Integration API, or Miracle Accounting Software API depending on the business use case.

For WhatsApp delivery, Miracle Web API collects accounting fields such as party mobile number, bill number, bill date, amount, party name, attachment Base64, and file name. Miracle substitutes those fields into the configured JSON body and sends the request to Whats91. Whats91 acts as the messaging validation and Cloud API delivery layer.

The workflow is API-driven: Miracle generates or selects an accounting document, Miracle Web API sends the request, Whats91 validates the request, WhatsApp Cloud API delivers the approved template and document, and the customer receives the PDF on WhatsApp.

## How Miracle Accounting Software Connects to WhatsApp

The complete flow is:

1. Miracle generates an invoice, GST invoice, challan, builty, ledger statement, receipt, or payment reminder.
2. Miracle prepares an API request using the WhatsApp Web API profile.
3. Miracle sends the JSON request to Whats91.
4. Whats91 validates the template, token, recipient, variables, attachment, and sender.
5. Whats91 sends the approved template through WhatsApp Cloud API.
6. The customer receives the message and PDF attachment on WhatsApp.

This supports invoice delivery, GST invoice delivery, challan delivery, builty delivery, ledger statements, payment reminders, and routine customer communication.

## Miracle WhatsApp API vs WhatsApp Web Sending

| Feature | WhatsApp Web | Whats91 Cloud API |
|---|---|---|
| QR Login | Requires QR login and active session | No QR login required |
| Official API | Not an official API delivery path | Uses WhatsApp Cloud API |
| PDF Attachments | Depends on browser/session stability | Supports Base64 PDF attachments |
| Template Messaging | Does not use approved utility templates | Uses approved WhatsApp templates |
| Multi User Access | Limited by browser/device session | Team-managed sender and logs |
| Audit Logs | Limited | Request, template, attachment, and delivery logs |
| Delivery Tracking | Depends on visible chat status | Cloud API events and Whats91 logs |
| Automation | Fragile for recurring workflows | API-triggered accounting workflows |
| ERP Integration | Browser-style sending layer | Structured Miracle-to-Whats91 API flow |
| Scalability | Limited by session reliability | Better for high-volume document delivery |
| Business Verification | Not tied to API sender controls | Uses Meta Business Platform controls |
| Reliability | Can fail on logout or device change | Clearer API validation and error handling |

## Industries Using Miracle WhatsApp Automation

- Textile businesses: invoice PDFs, builty PDFs, challans, ledgers, and outstanding reminders.
- Ceramic industry: dispatch documents, tax invoices, dealer communication, and payment follow-up.
- FMCG distributors: retailer invoices, route-wise order updates, ledger sharing, and reminder templates.
- Manufacturers: finished goods invoices, challans, dispatch PDFs, account statements, and receipt confirmations.
- Wholesalers: daily invoice delivery, customer statements, payment receipts, and balance reminders.
- Commission agents: settlement documents, party statements, receipts, and account follow-up.
- Petrol pumps: monthly statements, credit bills, GST invoices, and fleet customer reminders.
- Pharmaceutical distributors: GST invoices, delivery challans, account reconciliation, and credit control communication.

## Miracle WhatsApp API Workflow

1. Miracle invoice generated.
2. Miracle Web API trigger.
3. Whats91 endpoint receives JSON.
4. Template validation.
5. Base64 PDF attachment check.
6. WhatsApp Cloud API delivery.
7. Customer receives PDF on WhatsApp.

Template delivery uses approved WhatsApp templates. PDF delivery uses `media_url_type=base64`, a Base64 document payload, and a file name. Logs and error handling cover missing tokens, invalid phones, missing templates, blank attachments, missing file names, sender health, and Cloud API delivery responses.

## Safe Sample Payload

```json
{
  "template_name": "builty",
  "country_code": "91",
  "send_to": "<<129:Party Mobile No.-1>>",
  "media_url_type": "base64",
  "base64": "<<288:Attachment Base64>>",
  "file_name": "<<287:Attachment File Name>>",
  "auth_token": "YOUR_WHATS91_API_TOKEN"
}
```

Never publish a live Whats91 token in screenshots, website content, or public documentation. Rotate any token that was exposed in setup material.

## How to Implement

1. Create and approve the WhatsApp utility template in Whats91 or Meta.
2. Generate a Whats91 API token for the Miracle integration.
3. In Miracle, create a WhatsApp Web API profile.
4. Set the POST URL to `https://graph.whats91.com/api/custom/miracle/send-template`.
5. Add `auth_token` with `YOUR_WHATS91_API_TOKEN` as the safe placeholder during documentation.
6. Create a WhatsApp format and paste the JSON message body.
7. Map `send_to` to the party mobile field.
8. For PDF attachments, use `media_url_type=base64`, Miracle's attachment Base64 field, and Miracle's attachment file-name field.
9. Select PDF file type and Log With Attachment in Miracle.
10. Send a test invoice or builty and review Whats91 logs.

## Supported Fields

| Field | Required | Aliases | Notes |
|---|---|---|---|
| auth_token | Required | authToken, token | Whats91 API token. Keep private. |
| template_id | Required | template_name, templateName | Approved template ID, Meta template ID, or template name. |
| country_code | Required | - | Use 91 for India. |
| send_to | Required | mobile, receiver, phone | Actual WhatsApp recipient field. |
| sender_id | Recommended | senderId, sender | Useful for accounts with multiple senders. |
| template_argument1... | As needed | - | One value per approved template variable. |
| media_url_type | For attachments | - | Use base64 or url. |
| base64 / file_name | For Base64 PDFs | fileName, filename | Miracle PDF attachment payload and file name. |

## Common Errors

- `MIRACLE_MISSING_AUTH_TOKEN`: Add `auth_token` or an accepted alias.
- `MIRACLE_MISSING_TEMPLATE_ID`: Add `template_id`, `template_name`, or `templateName`.
- `MIRACLE_TEMPLATE_NOT_FOUND`: Verify template spelling, language, account, and approval status.
- `MIRACLE_MISSING_SEND_TO`: Map `send_to` to a populated party mobile field.
- `MIRACLE_INVALID_PHONE`: Clean the mobile number and country code.
- `MIRACLE_INVALID_BASE64`: Confirm PDF and Log With Attachment settings in Miracle.
- `MIRACLE_MISSING_FILE_NAME`: Add `file_name` for Base64 attachments.
- `MIRACLE_SEND_FAILED`: Review Whats91 logs for sender health, template, or delivery status.

## Best Use Cases

- Sales invoices and GST documents
- Builty, challan, and transport PDFs
- Outstanding balance reminders
- Payment receipt confirmations
- Account statements and ledger follow-ups
- E-way bill and dispatch document sharing

## FAQ

### What is Miracle Web API?
Miracle Web API is Miracle's external API configuration for sending structured accounting data and document fields to systems such as Whats91.

### How does Miracle WhatsApp API integration work?
Miracle sends JSON to Whats91, Whats91 validates the request, and Whats91 sends the approved WhatsApp template and PDF through WhatsApp Cloud API.

### Can Miracle send PDF invoices to WhatsApp?
Yes. Use Base64 PDF attachment mapping with `media_url_type=base64`, `base64`, and `file_name`.

### Can Miracle send GST invoices through WhatsApp?
Yes. GST invoice PDFs can be sent through approved WhatsApp templates and Miracle attachment fields.

### Does Miracle support Base64 PDF attachments?
Yes. Enable PDF output and Log With Attachment in Miracle, then map the Base64 field into the Whats91 request.

### Can Miracle send payment reminders automatically?
Yes. Miracle can trigger approved reminder templates when the required party and amount fields are available.

### Can Miracle connect to WhatsApp Cloud API?
Yes. Miracle connects through Whats91, which handles WhatsApp Cloud API delivery.

### Can Miracle work with approved WhatsApp templates?
Yes. Send the template name or ID and the required variables to Whats91.
