💬 Командный WhatsApp-Инбокс на новой ПлатформеЕщё
1msg official logo

Reply to price inquiries via WhatsApp API

This scenario sends a free-text WhatsApp message with sendMessage inside the 24-hour customer service window after the client asks how much a product or service costs.

Use case overview

This scenario sends a free-text WhatsApp message with sendMessage inside the 24-hour customer service window after the client asks how much a product or service costs.

Template example

Hello, {{1}}! The price for «{{2}}» is {{3}}. If you need a custom quote or volume discount, reply here and our manager will help.

  • {{1}}
    client name
  • {{2}}
    product or service name
  • {{3}}
    formatted price with currency
WhatsApp Business API for session reply — price inquiry

When to use it

Reach for this scenario when a prospect asks how much a product or service costs inside an open WhatsApp conversation and you need the quote back before they move on. It fits sales teams pulling live prices from CRM or a catalog API, small businesses handling quote requests in chat, and agencies wiring client storefronts to session replies instead of cold-start templates.

Current prices, not stale templates
Three body variables carry the client name, product name, and formatted price from your backend lookup, so the quote reflects the current list price instead of a fixed template value.
Faster answers than manual lookup
The inbound price question arrives via webhook, your backend resolves the SKU and list price, and sendMessage fires inside the open session — no rep copies numbers from a spreadsheet.
Dialog stays open for negotiation
The message invites the client to reply for custom quotes or volume discounts in the same thread, so follow-up questions do not require a new template cold start.
Fewer stalled price conversations
Product name and formatted amount land in the client's chat as soon as your pricing source returns a value, so the prospect can ask follow-up questions or proceed in the same session instead of waiting for a rep.

Workflow

  1. Status tracked

    An inbound client message with a price question arrives via webhook.

    status: "read"

  2. Capture event

    Your backend resolves the product SKU and current list price.

    phone: "+…"

  3. Build & send

    A session text message sends the quote with product name and formatted amount.

    POST /sendMessage

  4. Delivered

    The client continues the dialog for discounts or checkout in the same session.

    delivered

WhatsApp Business API for session reply — price inquiry

Technical implementation

Prerequisites

  1. 1MSG API Key · How to get API Key
  2. WhatsApp Business account · How to Connect WABA
  3. Open 24-hour session window · How the 24-hour window works
  4. Customer opt-in · How to Manage Customers Consent
  5. Webhook endpoint · How to Set Up Webhooks

Code examples

#!/usr/bin/env bash
set -euo pipefail

# === Configuration (replace "___" placeholders) ===
API_BASE_URL="https://api.1msg.io"        # production 1MSG API base URL
CHANNEL_ID="___"                           # channel ID from 1MSG dashboard
API_TOKEN="___"                            # channel JWT token (Bearer)



# === Test data ===
TEST_PHONE="___"                 # client phone in international format · requires open 24-hour session window
TEST_CUSTOMERNAME="___"         # {{1}} customer name
TEST_PRODUCTORSERVICENAME="___"         # {{2}} product or service name
TEST_PAYMENTAMOUNT="___"         # {{3}} payment amount

PHONE_NORM="$(printf '%s' "$TEST_PHONE" | tr -cd '0-9')"

for pair in "CHANNEL_ID=$CHANNEL_ID" "API_TOKEN=$API_TOKEN" "TEST_PHONE=$TEST_PHONE" \
            "TEST_CUSTOMERNAME=$TEST_CUSTOMERNAME" \
            "TEST_PRODUCTORSERVICENAME=$TEST_PRODUCTORSERVICENAME" \
            "TEST_PAYMENTAMOUNT=$TEST_PAYMENTAMOUNT"; do
  val="${pair#*=}"
  if [ -z "$val" ] || [ "$val" = "___" ]; then
    echo "Missing configuration value: ${pair%%=*}" >&2
    exit 1
  fi
done

if [ -z "$PHONE_NORM" ]; then
  echo "Error: phone number has no digits after normalization" >&2
  exit 1
fi

URL="${API_BASE_URL%/}/${CHANNEL_ID}/sendMessage"

read -r -d '' PAYLOAD <<JSON || true
{
  "phone": "${PHONE_NORM}",
  "body": "Hello, Alexey! The price for «Premium Plan (annual)» is 49 900 RUB. If you need a custom quote or volume discount, reply here and our manager will help."
}
JSON

RESPONSE="$(curl -s -w '\n%{http_code}' -X POST "$URL" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -d "$PAYLOAD")"

HTTP_CODE="$(printf '%s' "$RESPONSE" | tail -n1)"
BODY="$(printf '%s' "$RESPONSE" | sed '$d')"

case "$BODY" in
  *'"sent":true'*) ok=1 ;;
  *) ok=0 ;;
esac

if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ] && [ "$ok" -eq 1 ]; then
  echo "Message sent to client."
  echo "API response: $BODY"
else
  echo "Send failed. HTTP status: $HTTP_CODE" >&2
  echo "$BODY" >&2
  exit 1
fi

Response and delivery status

HTTP 2xx and JSON "sent": true mean 1MSG accepted the message for sending — not that it already reached the customer's phone. Save the id field (looks like wamid.…) to correlate delivery callbacks.

200 OKResponse
{
  "sent": true,
  "message": "Sent to [email protected]",
  "description": "Message has been sent to the provider",
  "id": "wamid.HBgLMzgwNjM5..."
}
  • sent

    Accepted for sending — not yet on the customer's phone

  • id

    Store it; delivery callbacks and hookInfo are keyed on this

Delivery statuses and webhooks →

Common errors

StatusAPI responseCauseFix
200Message was not sent: provide chatId, phone, bsuid, or usernameNo recipient the channel could resolve.Pass exactly one recipient: phone (country code plus number, digits only), chatId (for example [email protected]) or bsuid.
200Message was not sent: empty bodyThe body field is missing or empty.Send a non-empty body string. It is required for text, reply-button and list messages.
401token is requiredThe request has no token.Add your channel token as the token query parameter: https://api.1msg.io/{channelId}/{method}?token=…

All error codes →

Common questions

Связанные

Вовлечение и конверсия лидов
WhatsApp Business API для напоминания о сопровождении предложений
Сценарий отправляет потенциальному клиенту шаблонное персонализированное сообщение WhatsApp с напоминанием ознакомиться с коммерческим предложением.
Вовлечение и конверсия лидов
WhatsApp Business API для каталога товаров — интерактивный список
Этот сценарий отправляет интерактивный список с помощью sendList в течение 24-часового окна сеанса.
Вовлечение и конверсия лидов
WhatsApp Business API для консультаций перед покупкой
Сценарий отправляет клиенту персонализированный шаблон сообщения WhatsApp с приглашением на консультацию перед покупкой.
Вовлечение и конверсия лидов
WhatsApp Business API для уведомления нового менеджера по лидам
Сценарий отправляет менеджеру по продажам персонализированный шаблон WhatsApp, когда поступает новый лид.
Вовлечение и конверсия лидов
WhatsApp Business API для квалификации лидов с ключевыми вопросами
Этот кейс отправляет новому лиду одобренный шаблон WhatsApp с персонализированным приветствием: подставляются имя лида и продукт, а также быстрый ответ «Начать»
Вовлечение и конверсия лидов
WhatsApp Business API для повторного обращения к лиду без ответа
Сценарий отправляет лиду персонализированный шаблон WhatsApp, если он не ответил на предыдущее продажное сообщение в ожидаемое время.
Вовлечение и конверсия лидов
WhatsApp Business API для передачи лида в отдел продаж
Сценарий отправляет клиенту персонализированный шаблон WhatsApp, когда квалифицированный лид передаётся в отдел продаж.
Вовлечение и конверсия лидов
WhatsApp Business API для первого контакта с новым лидом
Сценарий отправляет лиду персонализированный шаблон WhatsApp как первое касание в продажах.

Интегрируйте WhatsApp за часы
без проблем с инфраструктурой