Limited Time Offer (LTO)

Request Parameters

KeyDescriptionValueData TypeRequired/Optional Constraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}StringRequiredShould be a valid Partner App Access Token
elementNameThe name of a template. The element name is unique for a WABAs namespace.{{ELEMENT_NAME}}StringRequiredelementName (not more than 180 char.) Mandatory fields
languageCodeLanguage code for the template. Refer to all the language codes here.{{LANGUAGE_CODE}}StringOptional languageCode default value : en_US
contentThe body of the template. {{CONTENT}}StringRequiredcontent (not more than 1024 char.)
categoryThe category of your template. {{CATEGORY}}StringRequiredCategory Type: MARKETING UTILITY
verticalTEXT {{VERTICAL}}StringRequiredvertical (not more than 180 char.)
templateTypeCAROUSEL{{TEMPLATE_TYPE}}StringRequiredThe type of template: CAROUSEL

Cards only to be passed if template type is CAROUSEL
exampleTemplate Example{{EXAMPLE}}StringRequired
enableSampleRequired for creating all types of templates{{ENABLE_SAMPLE}}true/falseOptionalif enableSample is true then exampleMedia
buttonsbuttons list[{"type":"COPY_CODE","example":"250FF"},{"type":"URL","text":"Shop Now","url":"<https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"URL","text":"Website","url":"https://www.luckyshrub.com/shop?promo={{1}}","example":["summer2023"]},{"type":"PHONE_NUMBER","text":"Call","phone_number":"918016337728"},{"type":"QUICK_REPLY","text":"Yes"},{"type":"QUICK_REPLY","text":"No"},{"type":"QUICK_REPLY","text":"Unsubscribe> from Promos"},{"type":"QUICK_REPLY","text":"Red"},{"type":"QUICK_REPLY","text":"Blue"},{"type":"QUICK_REPLY","text":"Green"}]StringRequired
hasExpirationSet true to add expiration to LTO templates{{HAS_EXPIRATION}}BooleanRequiredCopy code button component required if "has_expiration" is set to true.
isLTOLTO creation param{{ISLTO}}BooleanRequiredNeeds to be true to create LTO templates
limitedOfferTextLTO creation param{{LIMITED_OFFER_TEXT}}StringRequired
allowTemplateCategoryChangeBoolean value. If True, Meta will automatically update the template category as per the template content. The default value is False.{{ALLOW_TEMPLATE_CATEGORY_CHANGE}}true/falseOptional
APP IDApp ID to fetch the access token{{APP_ID}}StringRequiredThe Id should be a valid app Id of Gupshup

The App must be associated with the account that owns the PARTNER_APP_TOKEN being used

Sample Request

curl --location 'https://qa-partner-api.gupshup.io/partner/app/a41b30f4-d202-4fdb-911e-3a8fbfbfb797/template/msg' \
--header 'Connection: keep-alive' \
--header 'Authorization: sk_4087b15819a34606be15483456dcf636' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=918929874278' \
--data-urlencode 'sandbox=false' \
--data-urlencode 'destination=918888998545' \
--data-urlencode 'template={"id":"667237b0-0e4f-42f7-ae70-4603bae593ff","params":["250FF"],"expiration":1714694865000}' \
--data-urlencode 'src.name=august18'

Sample Response

{
    "status": "success",
    "template": {
        "appId": "a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
        "buttonSupported": "CC,PN,QR,URL",
        "category": "MARKETING",
        "containerMeta": "{\"appId\":\"a41b30f4-d202-4fdb-911e-3a8fbfbfb797\",\"data\":\"Hi All Dear SpiderMan, Here are our products.\",\"buttons\":[{\"type\":\"COPY_CODE\",\"example\":\"250FF\"},{\"type\":\"URL\",\"text\":\"Shop Now\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"URL\",\"text\":\"Website\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"PHONE_NUMBER\",\"text\":\"Call\",\"phone_number\":\"918016337728\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Yes\"},{\"type\":\"QUICK_REPLY\",\"text\":\"No\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Unsubscribe from Promos\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Red\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Blue\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Green\"}],\"sampleText\":\"Hi All Dear SpiderMan, Here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false,\"limitedTimeOffer\":{\"text\":\"offer limited\",\"has_expiration\":true}}",
        "createdOn": 1715610825823,
        "data": "Hi All Dear SpiderMan, Here are our products.\noffer limited | true | [Copy offer code,{{1}}] | [Shop Now,https://www.luckyshrub.com/shop?promo={{1}}] | [Website,https://www.luckyshrub.com/shop?promo={{1}}] | [Call,918016337728] | [Yes] | [No] | [Unsubscribe from Promos] | [Red] | [Blue] | [Green]",
        "elementName": "lto_newbv",
        "id": "b72c5f8d-5fdd-44a6-9207-56e0dbb34dda",
        "languageCode": "en",
        "languagePolicy": "deterministic",
        "meta": "{\"example\":\"Hi All Dear SpiderMan, Here are our products.\"}",
        "modifiedOn": 1715610825823,
        "namespace": "9c7fe92f_2a48_40ec_83d0_69c62a772433",
        "priority": 1,
        "quality": "UNKNOWN",
        "retry": 0,
        "stage": "NONE",
        "status": "PENDING",
        "templateType": "TEXT",
        "vertical": "aaa",
        "wabaId": "104505526065633"
    }
}

Status Codes

Status CodeResponseComment
Success
200{
"status":"success",
"template":{
"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797",
"buttonSupported":"CC,PN,QR,URL",
"category":"MARKETING",
"containerMeta":"{"appId":"a41b30f4-d202-4fdb-911e-3a8fbfbfb797","data":"Hi All Dear SpiderMan, Here are our products.","buttons":[{"type":"COPY_CODE","example":"250FF"},{"type":"URL","text":"Shop Now","url":"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"URL\",\"text\":\"Website\",\"url\":\"https://www.luckyshrub.com/shop?promo={{1}}\",\"example\":[\"summer2023\"]},{\"type\":\"PHONE_NUMBER\",\"text\":\"Call\",\"phone_number\":\"918016337728\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Yes\"},{\"type\":\"QUICK_REPLY\",\"text\":\"No\"},{\"type\":\"QUICK_REPLY\",\"text\":\"Unsubscribe from Promos"},{"type":"QUICK_REPLY","text":"Red"},{"type":"QUICK_REPLY","text":"Blue"},{"type":"QUICK_REPLY","text":"Green"}],"sampleText":"Hi All Dear SpiderMan, Here are our products.","enableSample":true,"editTemplate":false,"allowTemplateCategoryChange":false,"addSecurityRecommendation":false,"limitedTimeOffer":{"text":"offer limited","has_expiration":true}}",
"createdOn":1715610825823,
"data":"Hi All Dear SpiderMan, Here are our products.\noffer limited | true | [Copy offer code,{{1}}] | [Shop Now,https://www.luckyshrub.com/shop?promo={{1}}] | [Website,https://www.luckyshrub.com/shop?promo={{1}}] | [Call,918016337728] | [Yes] | [No] | [Unsubscribe from Promos] | [Red] | [Blue] | [Green]",
"elementName":"lto_newbv",
"id":"b72c5f8d-5fdd-44a6-9207-56e0dbb34dda",
"languageCode":"en",
"languagePolicy":"deterministic",
"meta":"{"example":"Hi All Dear SpiderMan, Here are our products."}",
"modifiedOn":1715610825823,
"namespace":"9c7fe92f_2a48_40ec_83d0_69c62a772433",
"priority":1,
"quality":"UNKNOWN",
"retry":0,
"stage":"NONE",
"status":"PENDING",
"templateType":"TEXT",
"vertical":"aaa",
"wabaId":"104505526065633"
}
}
Error
429{ "status": "error", "message": "Too Many Requests" }10 Requests per Minute
500{ "status": "error", "message": "Internal server error. Please try again later and If Issue still persist than contact Gupshup Dev Support" }For any Internal Error
Language
Click Try It! to start a request and see the response here!