Отправить order details (платежи Индия)
Отправка WhatsApp order details (оплата / инвойс) через одобренный Utility-шаблон с кнопкой ORDER_DETAILS.
Только Индия (WhatsApp Payments India). Нужно:
- India WhatsApp Business номер
- Включённый commerce на канале (
GET/POST /commerce) - Одобренный шаблон с кнопкой
ORDER_DETAILS
Используйте метод для структурированных полей (order, referenceId, currency, paymentSettings). API добавит кнопку шаблона sub_type: order_details и отправит тем же путём, что POST /sendTemplate.
Работает вне 24-часового окна (template).
Тот же payload можно отправить через POST /sendTemplate, добавив в params кнопку с sub_type: order_details.
JWT tokentoken<token>application/json- body
phone?integerRecipient phone (India E.164 digits, no +). Use phone or chatId.
chatId?stringRecipient chatId (e.g. [email protected]). Use phone or chatId.
template*stringApproved Utility template name that includes an ORDER_DETAILS button
namespace*stringTemplate namespace from the channel / template list
language*Template language
params?array<>Extra template components (HEADER / BODY / etc.). If an order_details button is missing, the API appends one from order / referenceId / currency / paymentSettings.
referenceId?stringUnique order / payment reference id (maps to reference_id)
currency?stringCurrency code for India payments
paymentSettings?Optional payment settings (UPI / payment gateway / payment link). Forwarded as payment_settings on the order_details action.
order*Order payload for the ORDER_DETAILS button. Typical fields: status, items[], subtotal, tax, shipping, discount. Amount objects use { "offset": 100, "value": <minor_units> } (e.g. value 50000 with offset 100 = ₹500.00).
[key: string]?anyServer response example
application/json- response
sent?booleanid?stringУникальный идентификатор сообщения
message?stringУведомление о статусе отправки сообщения
description?stringКомментарий к результату отправки
curl -X POST 'https://api.1msg.io/123/sendOrderDetails' \ -H 'Content-Type: application/json' \ -d '{ "phone": 919876543210, "template": "order_details_utility", "namespace": "your_namespace_uuid", "language": { "code": "en" }, "referenceId": "order-123", "currency": "INR", "order": { "status": "pending", "items": [ { "retailer_id": "SKU-1", "name": "Item", "amount": { "offset": 100, "value": 50000 }, "quantity": 1 } ], "subtotal": { "offset": 100, "value": 50000 } }}'{ "sent": true, "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8", "message": "Sent to [email protected]", "description": "Message has been sent to the provider"}