Manage QR Code Messages

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 wish to use the Business Manager to manage your QR codes, please see Manage your WhatsApp QR Codes.

Before You Start

Create New QR Code Message

Request

curl -X POST \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?prefilled_message=message-text&generate_qr_image=image-format&access_token=your-access-token'

The image format for the generate_qr_image field can be either svg or png. The svg format is the recommended format for print materials. The prefilled_message field has a character limit of 140 characters.

Response

{
    "code": "ANOVZ6RINRD7G1",
    "prefilled_message": "Tell me about your new sale!",
    "deep_link_url": "https://wa.me/message/ANOVZ6RINRD7G1",
    "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/An8Nfi7S69_twTspN_cD1gQNKeqM112SbCc8PIJm0MIH5K9gR2mBaErQsn_0-08fUc7_K3DsYNCHqlzaVLxyeoFNAOH43jRpelso3dkGqxAVcd-VKOMElO-LDwVaMA?efg=eyJ1cmxnZW4iOiJtYW5pZm9sZF9jcHBfdXJsZ2VuL21hbmlmb2xkX2Jsb2JzdG9yZV9zdmMifQ&hnt1=prn&oh=abf392689f0d87771ac6edb0a643684c&oe=5EEC69CF"
}

Retriev List of QR Code Messages

Request

curl -X GET \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?fields=code,prefilled_message,deep_link_url,qr_image_url.format(image-format)&access_token=your-access-token'

The image format for the qr_image_url.format(image-format) field can be either svg or png.

Response

{
    "data": [
        {
            "code": "ANOVZ6RINRD7G1",
            "prefilled_message": "I need help with my account.",
            "deep_link_url": "https://wa.me/message/ANOVZ6RINRD7G1",
            "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/An8Nfi7S69_twTspN_cD1gQNKeqM112SbCc8PIJm0MIH5K9gR2mBaErQsn_0-08fUc7_K3DsYNCHqlzaVLxyeoFNAOH43jRpelso3dkGqxAVcd-VKOMElO-LDwVaMA?efg=eyJ1cmxnZW4iOiJtYW5pZm9sZF9jcHBfdXJsZ2VuL21hbmlmb2xkX2Jsb2JzdG9yZV9zdmMifQ&hnt1=prn&oh=abf392689f0d87771ac6edb0a643684c&oe=5EEC69CG"
        },
        {
            "code": "TNGSHG326AIHH1",
            "prefilled_message": "What are your store hours?",
            "deep_link_url": "https://wa.me/message/TNGSHG326AIHH1",
            "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/An8FXjwdfiLGtluShN2E5Pk_lJdunhEQf6-FeWaJ3fjDWaGxQ5_F6VlJnXv0Sur_-9GZRpvMS_HuvTGhL0UqkXEhcRq-VB_mJFzM2HzkJM6BcoDQyZ2vXT4bIf76BA?efg=eyJ1cmxnZW4iOiJtYW5pZm9sZF9jcHBfdXJsZ2VuL21hbmlmb2xkX2Jsb2JzdG9yZV9zdmMifQ&hnt1=prn&oh=dada23db9bf3537d27daf67b3e16f3dc&oe=5EEC00A6"
        },
        {
            "code": "R3LUI5KILJUYA1",
            "prefilled_message": "When is the next sale?",
            "deep_link_url": "https://wa.me/message/R3LUI5KILJUYA1",
            "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/An8fjbSQzLpLNWoUzyUtAvKPyfzR3QTZEfLYW2DO6i6K1yQd2PDZYe23P3ZfJabhsz7yslM0qSLpIA_TA1ukRofhyNFghCcdDUVFj24SxOgJThE9vIWJ8k4icCWAfw?efg=eyJ1cmxnZW4iOiJtYW5pZm9sZF9jcHBfdXJsZ2VuL21hbmlmb2xkX2Jsb2JzdG9yZV9zdmMifQ&hnt1=prn&oh=4653fd0c09c1cbe3a3c68fdc86ef7a1c&oe=5EEC8240"
        },
  
    ]
}

Retrieve Single QR Code Message

Request

If you are using the message's code

You can either list the code field explicitly or include it as part of the URL of the API call:

curl -X GET \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?code=qr-code-id&access_token=your-access-token'
      
#OR
      
curl -X GET \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls/qr-code-id&access_token=your-access-token'    

Neither of the previous requests returns the qr_image_url parameter.

If you are using additional fields

You can request the specific fields you want returned. If you need to retrieve the qr_image_url field of a message, you must request it in the API call.

curl -X GET \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?fields=prefilled_message,deep_link_url,qr_image_url.format(image-format)&code=qr-code-id&access_token=your-access-token'

The image format for the qr_image_url.format(image-format) field can be either svg or png.

Response

{
    "data": [
        {
            "code": "ANOVZ6RINRD7G1",
            "prefilled_message": "What are your store hours?",
            "deep_link_url": "https://wa.me/message/ANOVZ6RINRD7G1",
            # The qr_image_url field is only returned if explicitly requested.
            "qr_image_url": "https://scontent.xx.fbcdn.net/m1/v/An8Nfi7S69_twTspN_cD1gQNKeqM112SbCc8PIJm0MIH5K9gR2mBaErQsn_0-08fUc7_K3DsYNCHqlzaVLxyeoFNAOH43jRpelso3dkGqxAVcd-VKOMElO-LDwVaMA?efg=eyJ1cmxnZW4iOiJtYW5pZm9sZF9jcHBfdXJsZ2VuL21hbmlmb2xkX2Jsb2JzdG9yZV9zdmMifQ&hnt1=prn&oh=abf392689f0d87771ac6edb0a643684c&oe=5EEC69CG"
        }
    ]
}

Update QR Code Message

Request

You can either list the code field explicitly or include it as part of the URL of the API call. If you need to generate a new QR code for your message, include the generate_qr_image field as well.

curl -X POST \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?code=qr-code-id&prefilled_message=new-message-text&generate_qr_image=image-format&access_token=your-access-token'
  
#OR
  
curl -X POST \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls/qr-code-id?prefilled_message=new-message-text&generate_qr_image=image-format&access_token=your-access-token'

The image format for the generate_qr_image field can be either svg or png. The svg format is the recommended format for print materials. The prefilled_message field has a character limit of 140 characters.

Response

{
    "code": "ANOVZ6RINRD7G1",
    "prefilled_message": "What are your store hours?",
    "deep_link_url": "https://wa.me/message/ANOVZ6RINRD7G1"
}

Delete QR Code Message

QR codes do not expire. You must delete a QR code in order to retire it.

Request

You can either list the code field explicitly or include it as part of the URL of the API call.

curl -X DELETE \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls?code=qr-code-id&access_token=your-access-token'
  
#OR
  
curl -X DELETE \
'https://graph.facebook.com/v10.0/phone-number-id/message_qrdls/qr-code-id&access_token=your-access-token' 

Response

{
    "success": true
}

FAQ

You can set up a QR code or short link in the Business Manager or by using the WhatsApp Business Management API. See the QR Code Messages documentation or the Help Center for more details.

To use the WhatsApp Business Management API to delete QR codes, see the Delete a QR Code Message documentation for more information.

To use the Business Manager to delete QR codes, see the Help Center for more information.

To use the WhatsApp Business Management API to get a list of existing QR codes, see the Retrieve a List of QR Code Messages documentation for more information.

To use the Business Manager to get a list of existing QR codes, see the Help Center for more information.

The total number of QR codes and short links associated with a single WhatsApp Business Account phone number cannot exceed 2000.

We recommend the .svg file format for the best quality in print materials.

Prefilled messages can contain up to 140 characters of text. This message is fully customizable and can be updated or deleted at any time.

Yes, the .svg file format is optimized for resizing.

If a user tries to access a QR code or short link that has been deleted, they will see an error message indicating the QR code/short link has expired.

While we do not offer the capability to natively customize QR codes, you can do so by downloading and editing QR codes with the software of your choice. We recommend you do not customize the color or look and feel of the code itself in order to preserve readability.

Please also refer to WhatsApp brand guidelines at https://whatsappbrand.com.

QR codes can now be generated and managed directly within the WhatsApp Business Management API and users can scan them with their WhatsApp, iOS, or Android camera.

In addition, with WhatsApp QR codes

  • Prefilled messages are fully customizable and can be changed or deleted at any time,
  • Users will always go directly to the app without any interstitial page, and
  • The in-app experience for an expired code sends the user a clear message.

You will be responsible for using the appropriate QR code based on expected location and language of users.

Analytics are not available as we limit the amount of data we log to protect user privacy.