offers
The coupons and campaigns a person holds, a ticket each, with a code to copy.
What the user can save, at a glance. offers draws each coupon or campaign as a ticket: what it is worth on the stub, what it is for, when it ends, and its code.
Drawn live in your browser with the SDK’s own sizes and colours, not a screenshot.
Rendered natively by the Flutter SDK since 0.101.0 and the web SDK since 0.76.0. A build that does not declare it is never offered it.
code must be a value one of your actions returned in this conversation, or a code written exactly so, case and all, in the knowledge the answer used or in your Persona instructions. A block carrying a code the app never gave is not drawn; its fallback text is shown instead, so nobody types a code that fails at the till.
When not to use it
One code to show at a counter or a gate, with its QR or barcode, is a pass. A discount already applied to an order belongs on the receipt.
Props
Every block also carries type and a required fallback_text of 1 to 300 characters.
| Prop | Type | Required | Constraints |
|---|---|---|---|
title | string | No | Up to 80 characters. |
items | array | Yes | 1 to 8 entries. |
items[].value | string | Yes | 1 to 12 characters. |
items[].unit | string | No | Up to 16 characters. |
items[].title | string | Yes | 1 to 60 characters. |
items[].terms | string | No | Up to 100 characters. |
items[].ends_label | string | No | Up to 30 characters. |
items[].ending_soon | boolean | No | None |
items[].code | string | No | 1 to 32 characters. |
items[].note | string | No | Up to 40 characters. |
items[].spent_label | string | No | Up to 30 characters. |
On the wire
{
"id": "blk_92",
"type": "offers",
"fallback_text": "Two offers: 15% off outerwear with RAIN15 until Sunday, and free express delivery over $80.",
"props": {
"items": [
{
"value": "15%",
"unit": "off",
"title": "Outerwear",
"terms": "Orders over $120",
"ends_label": "Ends Sunday",
"ending_soon": true,
"code": "RAIN15"
},
{
"value": "Free",
"unit": "delivery",
"title": "Express delivery",
"terms": "Orders over $80",
"ends_label": "Until 30 Nov",
"note": "Applied at checkout"
}
]
}
}Interaction
A tap on the code copies it and says Copied for a moment. An offer with a spent_label is struck through and shows that label where its code would be. ending_soon draws the end date as a warning; any other date is said plainly.