💬 Shared WhatsApp Inbox on the new PlatformMore
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

Related

Lead Engagement & Conversion
Auto-reply to inbound leads via WhatsApp API
This scenario sends a free-text WhatsApp message with sendMessage inside the 24-hour customer service window after the client wrote first about a product or service.
Lead Engagement & Conversion
Reply to stock availability questions (WhatsApp API)
This scenario sends a free-text WhatsApp message with sendMessage inside the 24-hour customer service window after the client asks if an item is available.
Lead Engagement & Conversion
Purchase decision nudge with WhatsApp buttons
This scenario sends a prospective customer a personalised WhatsApp template while they are still deciding.
Lead Engagement & Conversion
Proposal follow-up reminder via WhatsApp API
The scenario sends the prospect a personalised WhatsApp template message reminding them to review the commercial proposal.
Lead Engagement & Conversion
WhatsApp API list message: product catalog picker
This scenario sends an interactive list with sendList during the 24-hour session window.
Lead Engagement & Conversion
Consultation invite via WhatsApp API template
The scenario sends the customer a personalized WhatsApp template message inviting them to a pre-purchase consultation.
Lead Engagement & Conversion
New lead alert to sales manager via WhatsApp API
The scenario sends the sales manager a personalised WhatsApp template when a new lead is captured.
Lead Engagement & Conversion
Start lead qualification via WhatsApp API
This use case sends a new lead an approved WhatsApp template with a personalized greeting: the message substitutes the lead's name and product or source context, and the «Начать» (Start) quick-reply b

Build for WhatsApp in hours
without infrastructure hassle