Add

[POST] .../v1/sms/add

Creates a single SMS message. Use this method to create and immediately send one SMS message to a retail customer or partner through the default configured SMS gateway. The request body is required and must include entity_type, entity_id and message; the server resolves the recipient phone from the selected retail customer or partner record. On success the method inserts a new SMS record with status New, sends the message through the integration adapter, fires the SMSAdded webhook and returns new_id. The caller must have SMS send permission 586; missing body, missing message, invalid recipient type or id, missing default gateway, missing recipient or phone, gateway errors, denied permission and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
entity_id Int64 Required SMS recipient record ID. The server resolves the phone number from the selected recipient.
entity_type String Required SMS recipient type. Must be RetailCustomer or Partner. Allowed values: Default, RetailCustomer, Partner.
message String Required SMS message text. Required; the exact transport length limits depend on the configured SMS gateway.

Request Example

{
  "entity_type": "RetailCustomer",
  "entity_id": 25,
  "message": "Your order is ready"
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 1001
  }
}