{
  "info": {
    "_postman_id": "spotbay-wa-api-v1",
    "name": "SpotBay WhatsApp API",
    "description": "SpotBay WhatsApp API — transparent proxy over Meta Cloud API.\n\nSet `sb_token` and `phone_number_id` environment variables to get started.\n\nBase URL: https://api.spotbay.in/wa-api\n\nFull reference: https://www.spotbay.in/developers",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{sb_token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    { "key": "base_url", "value": "https://api.spotbay.in/wa-api", "type": "string" },
    { "key": "sb_token", "value": "sb_wa_your_token_here", "type": "string" },
    { "key": "phone_number_id", "value": "YOUR_PHONE_NUMBER_ID", "type": "string" },
    { "key": "waba_id", "value": "YOUR_WABA_ID", "type": "string" }
  ],
  "item": [
    {
      "name": "Messages",
      "item": [
        {
          "name": "Send Text Message",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/messages",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"919876543210\",\n  \"type\": \"text\",\n  \"text\": {\n    \"preview_url\": false,\n    \"body\": \"Hello from SpotBay! 👋\"\n  }\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        },
        {
          "name": "Send Template Message",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/messages",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"919876543210\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"hello_world\",\n    \"language\": { \"code\": \"en_US\" }\n  }\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        },
        {
          "name": "Send Image Message",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/messages",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"919876543210\",\n  \"type\": \"image\",\n  \"image\": {\n    \"link\": \"https://example.com/image.jpg\",\n    \"caption\": \"Check this out!\"\n  }\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        },
        {
          "name": "Send Interactive Buttons",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/messages",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"919876543210\",\n  \"type\": \"interactive\",\n  \"interactive\": {\n    \"type\": \"button\",\n    \"body\": { \"text\": \"Would you like to continue?\" },\n    \"action\": {\n      \"buttons\": [\n        { \"type\": \"reply\", \"reply\": { \"id\": \"yes_btn\", \"title\": \"Yes\" } },\n        { \"type\": \"reply\", \"reply\": { \"id\": \"no_btn\", \"title\": \"No\" } }\n      ]\n    }\n  }\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        },
        {
          "name": "Send Reaction",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/messages",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"recipient_type\": \"individual\",\n  \"to\": \"919876543210\",\n  \"type\": \"reaction\",\n  \"reaction\": {\n    \"message_id\": \"wamid.XXXXXX\",\n    \"emoji\": \"❤️\"\n  }\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        }
      ]
    },
    {
      "name": "Templates",
      "item": [
        {
          "name": "List Templates",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v21.0/{{waba_id}}/message_templates?limit=20",
              "host": ["{{base_url}}"],
              "path": ["v21.0", "{{waba_id}}", "message_templates"],
              "query": [{ "key": "limit", "value": "20" }]
            }
          }
        },
        {
          "name": "Create Template",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{waba_id}}/message_templates",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"order_confirmation\",\n  \"language\": \"en_US\",\n  \"category\": \"UTILITY\",\n  \"components\": [\n    {\n      \"type\": \"HEADER\",\n      \"format\": \"TEXT\",\n      \"text\": \"Order Confirmed\"\n    },\n    {\n      \"type\": \"BODY\",\n      \"text\": \"Hi {{1}}, your order #{{2}} has been confirmed!\",\n      \"example\": { \"body_text\": [[\"John\", \"ORD-12345\"]] }\n    },\n    {\n      \"type\": \"FOOTER\",\n      \"text\": \"Thank you for shopping with us.\"\n    }\n  ]\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        },
        {
          "name": "Delete Template",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{base_url}}/v21.0/{{waba_id}}?name=template_name",
              "host": ["{{base_url}}"],
              "path": ["v21.0", "{{waba_id}}"],
              "query": [{ "key": "name", "value": "template_name" }]
            }
          }
        }
      ]
    },
    {
      "name": "Media",
      "item": [
        {
          "name": "Upload Media",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/media",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "messaging_product", "value": "whatsapp", "type": "text" },
                { "key": "type", "value": "image/jpeg", "type": "text" },
                { "key": "file", "type": "file", "src": "" }
              ]
            }
          }
        },
        {
          "name": "Get Media URL",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/v21.0/{{media_id}}",
            "variable": [{ "key": "media_id", "value": "YOUR_MEDIA_ID" }]
          }
        },
        {
          "name": "Delete Media",
          "request": {
            "method": "DELETE",
            "url": "{{base_url}}/v21.0/{{media_id}}",
            "variable": [{ "key": "media_id", "value": "YOUR_MEDIA_ID" }]
          }
        }
      ]
    },
    {
      "name": "Phone Numbers",
      "item": [
        {
          "name": "List Phone Numbers",
          "request": {
            "method": "GET",
            "url": "{{base_url}}/v21.0/{{waba_id}}/phone_numbers"
          }
        },
        {
          "name": "Get Business Profile",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v21.0/{{phone_number_id}}/whatsapp_business_profile?fields=about,address,description,email,profile_picture_url,websites,vertical",
              "host": ["{{base_url}}"],
              "path": ["v21.0", "{{phone_number_id}}", "whatsapp_business_profile"],
              "query": [{ "key": "fields", "value": "about,address,description,email,profile_picture_url,websites,vertical" }]
            }
          }
        },
        {
          "name": "Update Business Profile",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": "{{base_url}}/v21.0/{{phone_number_id}}/whatsapp_business_profile",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messaging_product\": \"whatsapp\",\n  \"about\": \"We sell the best products!\",\n  \"address\": \"123 Main St, Mumbai\",\n  \"description\": \"Your trusted retail partner\",\n  \"email\": \"support@mybusiness.com\",\n  \"websites\": [\"https://mybusiness.com\"],\n  \"vertical\": \"RETAIL\"\n}",
              "options": { "raw": { "language": "json" } }
            }
          }
        }
      ]
    },
    {
      "name": "WABA",
      "item": [
        {
          "name": "Get WABA Details",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/v21.0/{{waba_id}}?fields=id,name,currency,timezone_id,message_template_namespace",
              "host": ["{{base_url}}"],
              "path": ["v21.0", "{{waba_id}}"],
              "query": [{ "key": "fields", "value": "id,name,currency,timezone_id,message_template_namespace" }]
            }
          }
        }
      ]
    }
  ]
}
