Send Message with Commerce Template
Commerce Template
This message format displays product information including the price. It may not support text as long as a feed template or include social information, but it can show users pricing details.
Use Case: Announce products sold in online stores or promotional items with price information (regular price, discount price, discount rate).

Template Type Definition
/**
* Commerce template class provided as a basic template
*
* @property content Content of the message including text, image, and link information
* @property commerce Price information for the content
* @property buttons Button list. Used when you want to change the button title and the link, or when you want to use two buttons. (Up to 2 buttons)
* @property buttonTitle Set to change the default button title "Learn more". If used, the link to move when the button is clicked will be the value entered in the content.
*/
export interface KakaoCommerceTemplate {
content: KakaoTemplateContent;
commerce: KakaoTemplateCommerce;
buttons?: KakaoTemplateButton[];
buttonTitle?: string;
}
Send Message to Myself
Use sendCommerceTemplateToMe to send a template message to yourself.
export function sendCommerceTemplateToMe(params: {
template: KakaoCommerceTemplate;
})
template: The template object.
Send Message to Friends
Use sendCommerceTemplateToFriends to send a template message to your friends.
export function sendCommerceTemplateToFriends(params: {
template: KakaoCommerceTemplate;
receiverUuids: string[];
includeFailureInfo?: boolean;
})
template: The template object.receiverUuids: List of friend uuids to send the message to. You can obtain these from the social package's Select KakaoTalk Friends or Get KakaoTalk Friends.
Pass includeFailureInfo: true to receive successful UUIDs and failures grouped by error. Omit it to receive the successful UUID array. See message results.
info
Refer to Component Types for detailed component types.
If you encounter any issues, refer to Troubleshooting.