# WhatsApp carousel ٹیمپلیٹس: media cards اور product cards

> WhatsApp کے media card اور product card carousel ٹیمپلیٹس بنائیں: cards کی حدیں، header اور بٹن کے اصول، creation اور send کا JSON، اور کون سا endpoint استعمال کریں۔

Published 2026-11-04. Z-API Omni team.

WhatsApp carousel ٹیمپلیٹ ایک مارکیٹنگ ٹیمپلیٹ ہے جس میں پیغام کا ایک body اور 2 سے 10 تک cards ہوتے ہیں جو دائیں بائیں scroll ہوتے ہیں۔ ہر media card میں image یا video کا header، ایک اختیاری body اور زیادہ سے زیادہ دو بٹن ہوتے ہیں۔ Meta کہتا ہے: «carousel cards صرف مارکیٹنگ ٹیمپلیٹ پیغامات کے لیے دستیاب ہیں» ([Meta media card carousel templates، رسائی 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/marketing-templates/media-card-carousel-templates))۔ جتنے cards آپ منظور کرواتے ہیں، اتنے ہی بھیجتے ہیں۔ Product card carousels ہر card کو آپ کے catalog سے لیتے ہیں، اور دو cards کے ساتھ منظور شدہ ٹیمپلیٹ 10 تک cards بھیج سکتا ہے۔ چونکہ دونوں مارکیٹنگ ٹیمپلیٹس ہیں، Cloud API پر مارکیٹنگ کی سپورٹ ختم کرنے کا Meta کا فیصلہ ان پر بھی لاگو ہوتا ہے، جس کی تفصیل [Marketing Messages API کی گائیڈ](/academy/ur/articles/whatsapp-marketing-messages-api/) میں ہے۔

## Media card کی حدیں

| عنصر | Meta کے صفحے کا اصول |
| --- | --- |
| Cards | کم از کم 2، زیادہ سے زیادہ 10، creation کے وقت مقرر |
| پیغام کا body | لازمی، variable values سمیت 1,024 حروف تک |
| Card header | `image` یا `video` |
| Card body | اختیاری، variable values سمیت 160 حروف تک |
| بٹن | ہر card پر دو تک: quick reply، phone number یا URL |
| بٹن کا label | 25 حروف |
| فون نمبر | 20 حروف |
| URL variable | ایک، جو URL کے آخر میں جوڑا جاتا ہے |

«کسی ٹیمپلیٹ پر متعین تمام cards کے components ایک جیسے ہونے چاہییں۔» اگر ایک card میں body text ہے تو ہر card میں ہونا چاہیے، «تاکہ cards کی اونچائی یکساں رہے۔» Meta کا صفحہ صاف الفاظ میں یہ نہیں کہتا کہ ہر header میں ایک ہی media type ہو۔ اس کی مثال ہر card پر images استعمال کرتی ہے، اور components والے اصول کی محفوظ تشریح یہی ہے کہ ایک ہی type رکھی جائے۔

WhatsApp، header media کو «WhatsApp صارف کے device کے مطابق ایک چوڑے تناسب میں» crop کرتا ہے۔ صفحہ کوئی file formats یا sizes نہیں بتاتا، اس لیے انہیں [WhatsApp media کی اقسام اور size کی حدیں](/academy/ur/articles/whatsapp-media-messages-supported-types-size-limits/) سے ملا کر چیک کریں۔

## Media card carousel ٹیمپلیٹ بنائیں

creation کے وقت ہر card header میں Resumable Upload API سے حاصل کردہ `header_handle` جاتا ہے، URL نہیں۔ یہ Meta کی مثال ہے، نئی formatting کے ساتھ، token اور WABA ID کے لیے shell variables کے ساتھ، اور مختصر کیے گئے handles کی جگہ `UPLOAD_HANDLE_1` سے `UPLOAD_HANDLE_3` کے ساتھ:

```bash
curl "https://graph.facebook.com/v26.0/$WABA_ID/message_templates" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "name": "carousel_template_media_cards_v1",
    "language": "en_US",
    "category": "marketing",
    "components": [
      {
        "type": "body",
        "text": "Rare succulents for sale! {{1}}, add these unique plants to your collection. Each of these rare succulents are {{2}} if you checkout using code {{3}}. Shop now and add some unique and beautiful plants to your collection!",
        "example": { "body_text": [["Pablo", "30%", "30OFF"]] }
      },
      {
        "type": "carousel",
        "cards": [
          {
            "components": [
              { "type": "header", "format": "image", "example": { "header_handle": ["UPLOAD_HANDLE_1"] } },
              {
                "type": "buttons",
                "buttons": [
                  { "type": "quick_reply", "text": "Send me more like this!" },
                  { "type": "url", "text": "Shop", "url": "https://www.luckyshrub.com/rare-succulents/{{1}}", "example": ["BLUE_ELF"] }
                ]
              }
            ]
          },
          {
            "components": [
              { "type": "header", "format": "image", "example": { "header_handle": ["UPLOAD_HANDLE_2"] } },
              {
                "type": "buttons",
                "buttons": [
                  { "type": "quick_reply", "text": "Send me more like this!" },
                  { "type": "url", "text": "Shop", "url": "https://www.luckyshrub.com/rare-succulents/{{1}}", "example": ["BUDDHA"] }
                ]
              }
            ]
          },
          {
            "components": [
              { "type": "header", "format": "image", "example": { "header_handle": ["UPLOAD_HANDLE_3"] } },
              {
                "type": "buttons",
                "buttons": [
                  { "type": "quick_reply", "text": "Send me more like this!" },
                  { "type": "url", "text": "Shop", "url": "https://www.luckyshrub.com/rare-succulents/{{1}}", "example": ["BLACK_PRINCE"] }
                ]
              }
            ]
          }
        ]
      }
    ]
  }'
```

body میں positional variables ہیں اور example، arrays کی array کی شکل میں ہے۔ یہ format [ٹیمپلیٹ variables: positional اور named parameters](/academy/ur/articles/whatsapp-template-variables-named-parameters/) میں سمجھایا گیا ہے۔ یہاں ہر card میں وہی دو components ہیں اور کسی card کا body نہیں۔ Meta کا صفحہ creation کا کوئی response نہیں دکھاتا۔

## ہر card کے parameters کے ساتھ carousel بھیجیں

send کے وقت ٹیمپلیٹ کے body کو اپنا `body` component ملتا ہے، اور carousel کو ایک `carousel` component ملتا ہے جس میں ہر card کی ایک entry ہوتی ہے۔ `card_index` صفر سے شروع ہوتا ہے اور card کی جگہ طے کرتا ہے۔ اب ہر header میں `/media` upload endpoint سے حاصل کردہ media `id` جاتا ہے۔ Meta، card headers کے لیے `link` کا کوئی option نہیں دکھاتا۔

یہ Meta کی send مثال ہے، shell variables کے ساتھ، اور اس کے asset IDs کی جگہ `MEDIA_ID_1` سے `MEDIA_ID_3` کے ساتھ:

```bash
curl "https://graph.facebook.com/v26.0/$PHONE_NUMBER_ID/messages" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+16505551234",
    "type": "template",
    "template": {
      "name": "carousel_template_media_cards_v1",
      "language": { "code": "en_US" },
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "Pablo" },
            { "type": "text", "text": "20%" },
            { "type": "text", "text": "20OFF" }
          ]
        },
        {
          "type": "carousel",
          "cards": [
            {
              "card_index": 0,
              "components": [
                { "type": "header", "parameters": [{ "type": "image", "image": { "id": "MEDIA_ID_1" } }] },
                { "type": "button", "sub_type": "quick_reply", "index": "0", "parameters": [{ "type": "payload", "payload": "more-aloes" }] },
                { "type": "button", "sub_type": "url", "index": "1", "parameters": [{ "type": "text", "text": "blue-elf" }] }
              ]
            },
            {
              "card_index": 1,
              "components": [
                { "type": "header", "parameters": [{ "type": "image", "image": { "id": "MEDIA_ID_2" } }] },
                { "type": "button", "sub_type": "quick_reply", "index": "0", "parameters": [{ "type": "payload", "payload": "more-crassulas" }] },
                { "type": "button", "sub_type": "url", "index": "1", "parameters": [{ "type": "text", "text": "buddhas-temple" }] }
              ]
            },
            {
              "card_index": 2,
              "components": [
                { "type": "header", "parameters": [{ "type": "image", "image": { "id": "MEDIA_ID_3" } }] },
                { "type": "button", "sub_type": "quick_reply", "index": "0", "parameters": [{ "type": "payload", "payload": "more-echeverias" }] },
                { "type": "button", "sub_type": "url", "index": "1", "parameters": [{ "type": "text", "text": "black-prince" }] }
              ]
            }
          ]
        }
      ]
    }
  }'
```

مثال `"index": "0"` کو string کے طور پر بھیجتی ہے، جبکہ اسی صفحے پر Meta کا syntax block، integer `0` استعمال کرتا ہے۔ اسی syntax block میں JSON کے اندر ایک `// Add additional cards here` comment بھی ہے، جسے چلانے سے پہلے آپ کو حذف کرنا ہو گا۔ اوپر والی مثال میں ایسا کوئی comment نہیں۔

بٹن کے parameters کو ٹیمپلیٹ کے مطابق ہونا چاہیے۔ «اگر کوئی بھی بٹن variables استعمال کرتا ہے تو بٹنوں کی type اور ترتیب، ٹیمپلیٹ پر متعین type اور ترتیب سے مطابقت رکھنی چاہیے۔» اتنے ہی cards بھیجیں جتنے cards کے ساتھ ٹیمپلیٹ منظور ہوا تھا۔

## کسی کے tap کرنے پر کیا واپس آتا ہے

quick reply اپنا payload، `messages` ویب ہُک میں `messages.button.payload` کے تحت لوٹاتا ہے۔ Meta کی مثال کی طرح ہر card کا الگ payload رکھیں، تاکہ آپ جان سکیں کہ اس شخص نے کس پروڈکٹ پر tap کیا۔ URL بٹن، device کا ڈیفالٹ browser کھولتا ہے، «اس لیے ان کے order کو بیان کرنے والا کوئی ویب ہُک trigger نہیں ہوتا۔» ایسی خریداری کے لیے جو WhatsApp کے اندر ہی رہے، Meta، product card carousels کی طرف اشارہ کرتا ہے۔ ٹیمپلیٹ کے باہر بٹنوں کے لیے [interactive بٹن اور list پیغامات](/academy/ur/articles/whatsapp-interactive-buttons-list-messages-limits/) دیکھیں۔

## catalog سے product card carousels

product card carousel کے لیے «آپ کے میسجنگ اکاؤنٹ سے منسلک، inventory والا ایک e-commerce product catalog» درکار ہے ([Meta product card carousel templates، رسائی 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/catalogs/product-card-carousel-template-messages))۔ creation کے وقت آپ ٹھیک دو cards متعین کرتے ہیں، اور منظور شدہ ٹیمپلیٹ 10 تک cards بھیج سکتا ہے۔ header کا format `product` ہے، اس لیے image، عنوان اور قیمت catalog سے آتے ہیں۔ cards میں body text نہیں ہوتا، اور ہر card میں «ایک واحد View بٹن یا URL بٹن» ہوتا ہے۔ View بٹن کی type `spm` ہے۔

یہ Meta کی creation مثال ہے، shell variables کے ساتھ۔ اس کے body میں single-quoted shell string کے اندر "you're" آتا ہے، جو string کو وقت سے پہلے ختم کر دیتا ہے، اس لیے apostrophe کو `'\''` کے طور پر escape کیا گیا ہے:

```bash
curl "https://graph.facebook.com/v26.0/$WABA_ID/message_templates" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "name": "carousel_template_product_cards_v1",
    "language": "en_US",
    "category": "marketing",
    "components": [
      {
        "type": "body",
        "text": "Rare succulents for sale! {{1}}, add these unique plants to your collection. All three of these rare succulents are available for purchase on our website, and they come with a 100% satisfaction guarantee. Whether you'\''re a seasoned succulent enthusiast or just starting your plant collection, these rare succulents are sure to impress. Shop now and add some unique and beautiful plants to your collection!",
        "example": { "body_text": "Pablo" }
      },
      {
        "type": "carousel",
        "cards": [
          {
            "components": [
              { "type": "header", "format": "product" },
              { "type": "buttons", "buttons": [{ "type": "spm", "text": "View" }] }
            ]
          },
          {
            "components": [
              { "type": "header", "format": "product" },
              { "type": "buttons", "buttons": [{ "type": "spm", "text": "View" }] }
            ]
          }
        ]
      }
    ]
  }'
```

یہاں `body_text` ایک سادہ string ہے، جس کی Meta اجازت دیتا ہے جب body میں صرف ایک variable ہو۔ send کے وقت ہر card صرف ایک header parameter بھیجتا ہے جس میں `product_retailer_id` اور `catalog_id` ہوتے ہیں، اور `spm` کے لیے کوئی بٹن parameters نہیں۔ Meta کی مثال دو cards والے ٹیمپلیٹ سے تین cards بھیجتی ہے:

```bash
curl "https://graph.facebook.com/v26.0/$PHONE_NUMBER_ID/messages" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+16505551234",
    "type": "template",
    "template": {
      "name": "carousel_template_product_cards_v1",
      "language": { "code": "en_US" },
      "components": [
        { "type": "body", "parameters": [{ "type": "text", "text": "Pablo" }] },
        {
          "type": "carousel",
          "cards": [
            { "card_index": 0, "components": [{ "type": "header", "parameters": [{ "type": "product", "product": { "product_retailer_id": "vrpj01fvwp", "catalog_id": "194836987003835" } }] }] },
            { "card_index": 1, "components": [{ "type": "header", "parameters": [{ "type": "product", "product": { "product_retailer_id": "va2l5ioeat", "catalog_id": "194836987003835" } }] }] },
            { "card_index": 2, "components": [{ "type": "header", "parameters": [{ "type": "product", "product": { "product_retailer_id": "sqpjv0mgde", "catalog_id": "194836987003835" } }] }] }
          ]
        }
      ]
    }
  }'
```

retailer IDs اور catalog ID کو اپنے IDs سے بدلیں۔ View پر tap کرنے سے آپ کے catalog سے پروڈکٹ کی تفصیلات کھلتی ہیں، اور وہاں دیا گیا order ایک order ویب ہُک trigger کرتا ہے۔ «WhatsApp، URL بٹن والے flows کے لیے order webhooks trigger نہیں کرتا۔»

## Carousel ٹیمپلیٹ یا interactive carousel

Meta ایک ایسا carousel بھی دستاویز کرتا ہے جو ٹیمپلیٹ نہیں، اور `type: "interactive"` کے ساتھ `interactive.type: "carousel"` کے طور پر بھیجا جاتا ہے ([Meta interactive media carousel messages، رسائی 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/interactive-media-carousel-messages))۔ اس میں 2 سے 10 cards اور 1,024 حروف تک کا لازمی body ہوتا ہے۔ card کا media، `link` سے دیا جا سکتا ہے۔ ہر card میں یا تو ایک `cta_url` بٹن ہوتا ہے یا quick-reply بٹن، جن کی type اور تعداد تمام cards میں یکساں ہو، اور labels کی حد 20 حروف ہے۔

وہ صفحہ کسٹمر سروس ونڈو کا ذکر نہیں کرتا۔ Meta کی send messages گائیڈ کہتی ہے کہ ونڈو بند ہونے کے بعد «آپ صرف پہلے سے منظور شدہ ٹیمپلیٹ پیغامات بھیج سکتے ہیں» ([Meta send messages، رسائی 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages))۔ ونڈو سے باہر کسی بھی شخص کے لیے ٹیمپلیٹ والے ورژن کی منصوبہ بندی کریں ([error 131047](/academy/ur/articles/whatsapp-error-131047-24-hour-window-templates/))۔

## کون سا endpoint carousel ٹیمپلیٹ بھیجتا ہے

Meta کے نمونے carousel ٹیمپلیٹس کو `/messages` پر بھیجتے ہیں۔ یہ تب تک درست ہے جب تک آپ کے WABA کے لیے Cloud API پر مارکیٹنگ فعال ہے۔ اگر آپ `disable_marketing_messages_on_cloud_api` کو `true` سیٹ کرتے ہیں تو وہی call، error 131063 لوٹاتی ہے۔ اس کے بجائے وہی payload، `/<PHONE_NUMBER_ID>/marketing_messages` پر بھیجیں ([Meta send marketing messages، رسائی 2026-11-04](https://developers.facebook.com/documentation/business-messaging/whatsapp/marketing-messages/send-marketing-messages))۔ 13 اکتوبر 2027 کے بعد Cloud API پر مارکیٹنگ sends ہر اکاؤنٹ کے لیے error لوٹائیں گے۔ اگر carousel اس کے بجائے review میں مسترد ہو جائے تو [ٹیمپلیٹ مسترد ہونے کی عام وجوہات](/academy/ur/articles/whatsapp-template-rejected-common-reasons/) بتاتا ہے کہ Meta کیا چیک کرتا ہے۔

*Z-API Omni ٹیم*
