QR Codes and Short Links

This guide explains how to create and manage QR codes using the WhatsApp Business Management API.

Customers can scan a QR code from their phone to quickly begin a conversation with your business. The WhatsApp Business Management API allows you to create and access these QR codes and associated short links.

If you can use the Business Manager to manage your QR codes instead of the API, see Manage your WhatsApp QR Codes.

Before You Start

You will need:

Create QR Code

To create a QR code, send a POST request to the WhatsApp Business Phone Number > Message Qrdls endpoint.

In your post body, include an object with a prefilled_message property set to your message text and a generate_qr_image property set to your preferred image format, either SVG or PNG.

Example Request

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "prefilled_message": "Cyber Monday",
  "generate_qr_image": "SVG"
}'

Example Response

{
  "code": "4O4YGZEG3RIVE1",
  "prefilled_message": "Cyber Monday 1",
  "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1",
  "qr_image_url": "https://scontent-iad3-2.xx.fbcdn.net/..."
}

Get a List of QR Codes

To get a list of all QR codes on a business phone number, send a GET request to the WhatsApp Business Phone Number > Message Qrdls endpoint.

Example Request

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Authorization: Bearer EAAJB...'

Example Response

{
  "data": [
    {
      "code": "4O4YGZEG3RIVE1",
      "prefilled_message": "Cyber Monday",
      "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
    },
    {
      "code": "WOMVT6TJ2BP7A1",
      "prefilled_message": "Tell me more about your production workshop",
      "deep_link_url": "https://wa.me/message/WOMVT6TJ2BP7A1"
    }
  ]
}

Get a QR Code

To get information about a specific QR code, send a GET request to the WhatsApp Business Phone Number > Message Qrdls endpoint and append the QR code ID as a path parameter.

Example Request

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls/4O4YGZEG3RIVE1' \
-H 'Authorization: Bearer EAAJB...'

Example Response

{
  "data": [
    {
      "code": "4O4YGZEG3RIVE1",
      "prefilled_message": "Cyber Monday",
      "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
    }
  ]
}

Update a QR Code

To update a QR code, send a POST request to the WhatsApp Business Phone Number > Message Qrdls endpoint.

In the post body, include a code property set to the ID of the QR code you wish to update, and a prefilled_message property set to the new QR code text.

Example Request

curl 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
    "code": "4O4YGZEG3RIVE1",
    "prefilled_message": "Cyber Tuesday"
}'

Example Response

{
  "code": "4O4YGZEG3RIVE1",
  "prefilled_message": "Cyber Tuesday",
  "deep_link_url": "https://wa.me/message/4O4YGZEG3RIVE1"
}

Delete QR Code

QR codes do not expire automatically. To delete a QR code, send a DELETE request to the WhatsApp Business Phone Number > Message Qrdls endpoint and append the ID of the QR code you wish to retire as a path parameter.

Example Request

curl -X DELETE 'https://graph.facebook.com/v19.0/106540352242922/message_qrdls/4O4YGZEG3RIVE1' \
-H 'Authorization: Bearer EAAJB...'

Example Response

{
  "success": true
}

Reference

Learn More