1MSG

Отправить order details (платежи Индия)

POST
/sendOrderDetails

Отправка 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.

Authorization

JWT token
querytoken<token>

Request Body

application/json
  1. body
phone?integer

Recipient phone (India E.164 digits, no +). Use phone or chatId.

chatId?string

Recipient chatId (e.g. [email protected]). Use phone or chatId.

template*string

Approved Utility template name that includes an ORDER_DETAILS button

namespace*string

Template 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?string

Unique order / payment reference id (maps to reference_id)

currency?string

Currency 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]?any

Response Body

Server response example

application/json
  1. response
sent?boolean
id?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"}