Send Message
Send a message (notification or OTP delivery) to a bound customer.
POST /api/v1/merchant/message/send
Headers
Include X-Api-Key, X-Api-Secret, Idempotency-Key (see Authentication).
Body
| Field | Type | Required | Description |
|---|---|---|---|
customerExternalId | string | ✅ | Customer ID in your system |
category | string | ❌ | NOTIFICATION (default) or OTP, for classification only |
text | string | ✅* | Raw text; one of text / templateCode |
templateCode | string | ✅* | Approved template code; one of text / templateCode |
variables | object | ❌ | Template variables, e.g. {"otp":"395217"} |
Provide at least one of
text/templateCode. With a template, LOMA renders{placeholders}usingvariables.
Example (raw text)
{
"customerExternalId": "C10086",
"category": "OTP",
"text": "Your OTP is 395217, valid for 5 minutes."
}
Example (template)
{
"customerExternalId": "C10086",
"category": "OTP",
"templateCode": "otp_msg",
"variables": { "otp": "395217", "minutes": 5 }
}
Success 200
{
"code": "OK",
"message": "Success",
"requestId": "req_...",
"data": {
"messageRequestId": "2072...014",
"status": "SENT"
}
}
messageRequestId: message request id, use it to check status.status:QUEUED/SENT/FAILED.
Common errors
| code | HTTP | Description |
|---|---|---|
CUSTOMER_NOT_BOUND | 409 | Customer not bound to LINE |
CUSTOMER_UNFOLLOWED | 409 | Customer hasn't added the OA as a friend; cannot push |
TEMPLATE_NOT_FOUND | 404 | Template missing or not approved |
TEMPLATE_VAR_MISSING | 400 | Missing template variable |
QUOTA_EXCEEDED | 429 | Monthly message quota used up |
VALIDATION_ERROR | 400 | Validation failed |
See Errors for the full list.