Chapter 1 · The scenario
Example: Table codes at a Mumbai café chain
A café chain with 14 outlets in Mumbai creates one QR code per outlet through the API, each pre-filled with text such as 'Hi! I'd like the menu [QR-BANDRA]', and prints them on table tents. When a guest scans and sends, the webhook handler reads the reference, tags the chat with the outlet, and a bot replies with that outlet's menu as a list message and a payment link. In the first month about 3,200 chats arrive from table codes, half of them from two outlets. For the monsoon menu, operations updates each code's pre-filled message to mention it while the printed tents stay the same. When one outlet closes, its codes are deleted, so stray scans show an expired-code notice instead of reaching a closed store.
Chapter 2 · What is a WhatsApp QR code?
A WhatsApp QR code is a scannable code that, when scanned with a phone camera or from inside WhatsApp, opens a chat with a business's WhatsApp number with a message already typed, such as 'Hi! I'd like the menu (table 12)'. The customer taps send and the conversation starts. Businesses print them on packaging, bills, standees, delivery bags, posters and outdoor or TV ads.
On the WhatsApp Business Platform, codes are managed through the message_qrdls edge of a phone number. POST /{PHONE_NUMBER_ID}/message_qrdls creates one from a prefilled_message and, with generate_qr_image set to SVG or PNG, returns a qr_image_url alongside a short link of the form https://wa.me/message/{code}. The same edge lists, updates and deletes codes, so a code printed on a thousand boxes can have its pre-filled message changed later without reprinting. Codes can also be managed in Meta's Business Manager interface.
A message QR code differs from a plain Click-to-Chat link (https://wa.me/<number>?text=...), which anyone can build for any number and which shows the phone number and text in the URL. The message QR code hides both behind a short code, is tied to your registered business number and can be edited or retired centrally. Either way, the customer's first message opens a 24-hour customer service window; a scan is not a marketing opt-in on its own.
Key takeaways
- A WhatsApp QR code opens a chat with your business number with a pre-filled message, ready for the customer to send.
- The Cloud API creates codes with POST /{PHONE_NUMBER_ID}/message_qrdls and returns a wa.me/message short link plus an SVG or PNG image.
- Pre-filled messages are capped at 140 characters, and one business number can have at most 2,000 QR codes and short links.
- Codes never expire on their own; once deleted, anyone who scans one sees a message that the code has expired.
- Meta provides no scan analytics, so put a unique reference in each code's pre-filled text and count the chats that arrive with it.
Chapter 3 · How it unfolds
How does a WhatsApp QR code work?
Decide the context for each code
Create one code per place, product or campaign (Andheri store, table 12, Diwali hamper box) and put a short reference such as
[QR-ANDH-01]in the pre-filled text so the chat can be attributed.Create it through the API
Call
POST /{PHONE_NUMBER_ID}/message_qrdlswith aprefilled_messageof up to 140 characters andgenerate_qr_imageset toSVGfor print orPNGfor screens. Store the returnedcode,deep_link_urland image.Print it so it scans
Use the SVG, keep the code dark on a light background with a clear margin, size it for the scanning distance (around 2 cm across is a practical minimum on packaging, far larger on posters) and print a line saying what happens: 'Scan to order on WhatsApp'.
Attribute and answer the chats
When the first message arrives by webhook, match the reference in the text to the code, tag the conversation, and reply with a bot or an agent inside the 24-hour window.
Edit or retire centrally
Send
POST /{PHONE_NUMBER_ID}/message_qrdlswith the samecodeand a newprefilled_messagewhen a campaign changes, andDELETE /{PHONE_NUMBER_ID}/message_qrdls/{code}when it ends.
Chapter 4 · In code
A WhatsApp QR code in code
# Create a code with a pre-filled message (max 140 characters) and an SVG imagecurl -X POST "https://graph.facebook.com/v26.0/{PHONE_NUMBER_ID}/message_qrdls" \-H "Authorization: Bearer {ACCESS_TOKEN}" \-H "Content-Type: application/json" \-d '{ "prefilled_message": "Hi! I want to order a Diwali hamper [QR-HAMPER-26]","generate_qr_image": "SVG" }'# List every code on the numbercurl "https://graph.facebook.com/v26.0/{PHONE_NUMBER_ID}/message_qrdls" \-H "Authorization: Bearer {ACCESS_TOKEN}"# Change the pre-filled text of an existing code: same image, no reprintcurl -X POST "https://graph.facebook.com/v26.0/{PHONE_NUMBER_ID}/message_qrdls" \-H "Authorization: Bearer {ACCESS_TOKEN}" \-H "Content-Type: application/json" \-d '{ "code": "4O4YGZEG3RIVE1","prefilled_message": "Hi! I want to order a New Year hamper [QR-HAMPER-26]" }'# Retire it: later scans show that the QR code has expiredcurl -X DELETE "https://graph.facebook.com/v26.0/{PHONE_NUMBER_ID}/message_qrdls/4O4YGZEG3RIVE1" \-H "Authorization: Bearer {ACCESS_TOKEN}"
Create returns code, prefilled_message, deep_link_url and qr_image_url; list and update return the first three; delete returns success: true.
Chapter 5 · The facts
A WhatsApp QR code: key facts and limits
| Create endpoint | POST /{PHONE_NUMBER_ID}/message_qrdls |
|---|---|
| Pre-filled message | Up to 140 characters |
| Image formats | SVG or PNG (generate_qr_image) |
| Short link format | https://wa.me/message/{code} |
| Codes per business number | Up to 2,000 QR codes and short links |
| Expiry | None automatic; delete a code to retire it |
| Scan analytics | Not provided by Meta |
Chapter 6 · Where it goes wrong
Common mistakes with a WhatsApp QR code
One code for everything
A single code on every poster, box and counter tells you nothing about which placement works. Create one code per placement or campaign; the 2,000-code ceiling leaves plenty of room.
Relying on the reference surviving
Customers can edit the pre-filled text before sending, and some delete the bracketed reference. Keep it short and at the end, and treat attribution from it as a minimum count.
Styling the code until it fails
Inverted colours, low contrast, logos over the modules and tiny print sizes cause failed scans. Meta advises against restyling the code; test every print proof with several phones.
Deleting a code that is still in print
A deleted code shows customers an expired message. If boxes or posters are still out there, update the pre-filled text instead and delete only when the print run is gone.
Treating a scan as opt-in
A scan starts a conversation, not a marketing subscription. Ask in the chat whether the customer wants offers, record the answer, and only then add them to marketing segments.
Chapter 7 · What good teams do
Best practices for a WhatsApp QR code
- Print the call to action next to the code; a bare code gets fewer scans than one that says what happens.
- Keep a register of code, location, print run and reference so everyone knows which code is where.
- Use SVG for print and test scanning in the real lighting: shop counters at night, delivery bags in sunlight.
- Write the pre-filled text the way a customer would speak, so most people send it unchanged.
Chapter 8 · Why it matters
Why does a WhatsApp QR code matter?
Offline is where many Indian customers first meet a business: a kirana counter, a restaurant table, a medicine strip, a property hoarding. A QR code turns that moment into a WhatsApp conversation in one scan, carrying context such as which store, table or product in the pre-filled text. Because codes are managed through the API, a marketing or operations team can create one per location or campaign, change the wording centrally and switch codes off when a promotion ends, and a developer can attribute every chat to the code that started it.
Chapter 9 · WhatsApp QR Code FAQs