Add to Lotline button
Put a button on your product page that fills in the coffee for shoppers who use Lotline. For roasters and green sellers, no account needed.
An Add to Lotline button sits on your product page. A shopper who uses Lotline presses it after buying, and the coffee is waiting in their own inventory with everything you told Lotline already filled in: name, roaster, origin, process, roast, notes, sizes and prices.
It is for roasters and green sellers who sell online. You need no Lotline account, and neither does the page the button sits on: the builder is open to everyone, and the button is a plain link.
What a shopper gets
The shopper lands on a small page with your coffee's facts and one question: did they buy a bag, only want the coffee, or want to try it later? Either way the Add form opens filled in, and nothing is saved before they check it. Save to my wish list keeps the coffee and the link back to your page on a wish list, so they can buy it when they are ready (see Wish list). Add a bag describes their side. Lotline also recognises your roastery and your coffee when the shopper has bought from you before, so a second bag joins the first.
Make a button
- Open the builder. It is a normal page: no sign-in.
- Choose Roasted coffee or Green coffee, then type the coffee's Name. That is the only required field. Every other fact you add saves the shopper typing.
- Fill in the origin, the roast, the sizes with their prices and the address of the product page. For a blend, press Add another origin (see Blends).
- Choose how the button looks (see Looks) and press Make the button.
- The page shows the button as it will look. Press Copy HTML and paste the code where the button should go on your product page. Try it opens the link as a shopper would see it.
The builder is a form that sends its answers in the address of the page, so you can bookmark a filled-in builder or share it with the people in your roastery.
If a value can't be taken over, the builder says so before a shopper meets it: a country Lotline doesn't know, an altitude that isn't a number, an image address that doesn't start with https://. The button still works with the rest; fix the values and make it again.
From your inventory
If you roast or sell in Lotline, you don't have to type your own coffees again. With Roasting or Selling switched on, Settings › Integrations has an Add to Lotline button section. Open the builder goes to the page above. Make one for a coffee lists your own roasts: pick one and press Make the button, and the builder opens with the coffee's facts filled in (name, your roastery and its website, origin, process, roast, notes, the shop address, and the sizes and prices of its products when you sell). Check them, then copy the button. Nothing is saved in your inventory.
The fields
The link is the address https://<this Lotline>/add with the coffee's facts after a ?, one name=value pair for each, joined with &. The names are those of Lotline's API, so the link, the forms and the API speak one language. Only kind and name are required. Spaces are written + or %20, and a value that contains &, = or # must be escaped (%26, %3D, %23).
| Field | Kinds | Values |
|---|---|---|
v |
all | The format version, 1. Missing means 1. A newer number than the Lotline knows: it uses what it can read and says so |
kind |
all | roasted or green |
name |
all | The product's name, at most 200 characters |
roaster |
roasted | The roaster's name |
roaster_url |
roasted | The roaster's own website, https. Helps Lotline recognise your roastery |
vendor |
all | Who sells it, if not the roaster (a café, a green seller). For green coffee, the seller's name |
origin_country |
all | Country as two letters (ET) or in English (Ethiopia) |
origin_region |
all | Text, such as Guji |
producer |
all | Text, such as Hambela Estate |
varieties |
all | Text, such as 74110, 74112 |
process |
all | washed, natural, honey, wet_hulled or other |
fermentation |
all | anaerobic, carbonic_maceration, co_fermented, yeast_inoculated, thermal_shock or extended |
altitude_masl |
roasted | Metres above sea level, 0 to 9000 |
altitude_min_masl, altitude_max_masl |
green | Metres, 0 to 9000: the lowest and highest point |
crop_year |
all | A year from 1950 to 2100, such as 2025 |
share_pct |
all | A blend's share in percent: see Blends |
roast_level |
roasted | very_light, light, medium_light, medium, medium_dark, dark or very_dark |
roast_for |
roasted | espresso, filter or omni |
is_decaf |
roasted | true or false |
decaf_method |
roasted | The decaf method, such as swiss_water. See the API reference |
flavor_notes |
all | Comma-separated, at most 12 notes of 40 characters: peach,jasmine,black+tea |
cup_score |
all | A score, 0 to 100 |
grade |
green | The lot's grade, such as G1 |
moisture_pct |
green | Moisture in percent, 0 to 100 |
density_g_l |
green | Density in grams per litre, up to 2000 |
variant |
all | A size on sale: <grams>:<price>, such as 250:18.50. The price is optional (250). Repeat the field for each size, up to 10 |
currency |
all | The ISO 4217 code, such as CHF. Required when a size has a price |
url |
all | The product page, https only. Shoppers find your coffee again by it |
image |
all | A product image, https only. Lotline fetches it only if the shopper keeps it when saving |
roast_date |
roasted | The roast date as 2026-10-20, for links in a shipping email |
roaster_batch |
roasted | The batch or lot number, as printed on the bag |
Prices are written with a point (18.50) in the currency's main unit. A value that can't be read is left out, the shopper sees which, and the rest still works. Fields Lotline doesn't know are ignored, so you can add your own. The whole link may be up to 8 KB long.
Blends
The plain origin fields (origin_country, origin_region, producer, varieties, process, fermentation, altitude_min_masl, altitude_max_masl, crop_year, share_pct) describe the first origin. Add .2 to .10 to the same names for further origins:
origin_country=BR&process=natural&share_pct=60&origin_country.2=ET&process.2=washed&share_pct.2=40
Any origin beyond the first makes the coffee a blend. Give a share_pct to every origin or to none, and keep the total at 100 or less; otherwise the shares are left out. An origin with no valid value at all is dropped. Green coffee has one origin only. In the builder, press Add another origin for each coffee in the blend, up to 10.
Looks
The builder offers a Filled and an Outline button, each for a light or a dark page, with the label in English (Add to Lotline) or German (Zu Lotline hinzufügen). The label is yours to choose: it doesn't follow the language of the page you are reading. If your shop styles its own buttons, choose Text link and you get a plain <a> with the same label.
The button is one <a> with a small picture inside. It has no style sheet, no style attribute and no script, so shop themes and strict content security policies leave it alone. It is 36 pixels high, which is a comfortable target for a finger, and it has a text for screen readers. It opens in a new tab and keeps your shop page open.
Because the picture is part of a line of text, many themes leave a few pixels of space below it. If that bothers you, add this one line to your shop's CSS:
a[href*="/add?v=1"] { display: inline-block; line-height: 0; }
Privacy
The button loads nothing from Lotline. When your product page loads, the browser makes no request to Lotline for it: nothing to mention in your privacy policy, and it still works if Lotline is down. Lotline hears from a shopper only when they press it. Then it receives the link, and what any browser sends along when you follow a link, such as the address of your shop. It doesn't learn who the shopper is on your shop, and it doesn't send anything back to you.
In your shop
If you sell through WooCommerce, the plugin Lotline for WooCommerce puts the button on your product pages and in the customer's order email, and you don't paste anything. It works without connecting the shop to an inventory. Open WooCommerce › Lotline, and under Add to Lotline button:
- pick the weight attribute (or leave it to the product's weight) and map your product attributes to the link's fields once: origin country, region, producer, varieties, process, roast level, roast for and flavour notes. A mapped attribute's terms are taken as they are, ignoring case, with spaces and hyphens read as underscores (Wet hulled becomes
wet_hulled). A term the link can't read is dropped when Lotline opens the link, and the settings show which mapped values are not link values; - place the block Add to Lotline on the product template (block themes), or switch the button on for classic themes;
- switch on the link in the customer's order emails, if you like: it goes under each line of the processing and completed emails, for the size bought.
The plugin builds each product's link from its name, your shop's name and address, the product page and picture, the shop currency, and a size with its price for each variation. The link points to the Lotline address the plugin was connected with, or https://lotline.coffee.
Connected to Lotline, the link comes from Lotline and wins: it is built from the coffee you keep in Lotline, with the sizes and prices of its mapped listings. See Connect your WooCommerce shop. The switch is Add to Lotline button: from this coffee under Product pages in Inventory settings › Shops.
For Shopify, the app block Add to Lotline of Lotline's app shows the link Lotline writes into each variant: Connect your Shopify shop has the steps, and the Liquid line for your order emails.
Links in your shop template
If your shop has many products, build each link from the product's data instead of using the builder every time. These two examples are for orientation only: adapt the field names to your theme and test the result in the builder or by opening the link.
A WooCommerce theme (PHP, for example in single-product.php; Example Roasters is a made-up name):
<?php
$q = http_build_query( [
'v' => 1,
'kind' => 'roasted',
'roaster' => 'Example Roasters',
'name' => $product->get_name(),
'origin_country' => 'ET',
'process' => 'washed',
'url' => get_permalink( $product->get_id() ),
'currency' => get_woocommerce_currency(),
], '', '&', PHP_QUERY_RFC3986 );
// one variant field per size: <grams>:<price>
foreach ( $product->get_children() as $id ) {
$size = wc_get_product( $id );
$q .= '&variant=' . rawurlencode( (int) $size->get_weight() . ':' . $size->get_price() );
}
$link = 'https://lotline.coffee/add?' . $q;
?>
<a href="<?php echo esc_url( $link ); ?>" target="_blank" rel="noopener">…</a>
A Shopify theme (Liquid, in a product section; weights in grams and prices in the shop's currency):
{%- capture add_query -%}
v=1&kind=roasted&roaster=Example+Roasters
&name={{ product.title | url_encode }}
&url={{ shop.url | append: product.url | url_encode }}
¤cy={{ cart.currency.iso_code }}
{%- for variant in product.variants -%}
&variant={{ variant.weight }}:{{ variant.price | divided_by: 100.0 }}
{%- endfor -%}
{%- endcapture -%}
<a href="https://lotline.coffee/add?{{ add_query | strip_newlines | remove: ' ' }}" target="_blank" rel="noopener">…</a>
Replace lotline.coffee with the address of your own Lotline if you host one. Put the <svg> of a button from the builder inside the <a> instead of the dots. On WooCommerce you don't need this: the plugin does all of it (see above).
Links keep working
A link made today with v=1 keeps working. New fields and new kinds may be added later; they never change what a field you use already means, and a Lotline that doesn't know a new field ignores it. If you edit a product, the old button on a page you forgot about still opens the coffee as it was then.
Last changed 28.10.2026