# Plastic Tags ordering API for AI assistants Plastic Tags (https://plastictags.com.au) makes custom safety signs, labels, tags, engraved labels, cable labels and ferrules in Australia. This API lets an AI assistant (ChatGPT, Claude, Codex, Gemini or any agent that can make HTTP requests) build a cart for a person, then give that person a link to review everything on a cutsheet and a link to pay. There are three ways to add products: - **Ready-made sign and label designs** (safety signs, warning labels, tags): pick a design and change its wording. Section 4. - **Your own designs**, as engraved plastic labels or full-colour printed signs and stickers (equipment and switchboard labels, patch panel strips, name plates, valve tags, custom signs with symbols and logos): describe the layout in mm and the server draws it. No template needed. Section 5. - **Cable labels and ferrules**: one marking per cable or wire. Section 6. This page is everything you need. Read it all before you start. --- ## 1. Rules for the assistant 1. **You cannot place, pay for or confirm an order.** You build a cart. The person reviews it and pays on the website. Never tell them an order is placed. 2. **Always finish by giving the person `cutsheet_url` and `checkout_url`**, with the prices. The cutsheet shows every item exactly as it will be made, so the person can check it. The checkout link is where they add delivery details and pay. This API doesn't return preview images; the cutsheet is the place to check. 3. **Confirm the wording with the person before adding it.** Copy their text exactly, including spelling and capitals. Everything is made as written. 4. **Use only ids returned by this API.** Never guess a `product_id`, `material_id`, `icon_id`, `image_id` or option id. 5. **Read `warnings` after every add and check**, and tell the person about them. The usual ones are text too long to fit, text made smaller to fit, or a low-resolution logo. 6. **Prices are AUD and exclude GST** unless the field name ends in `_inc_gst`. Shipping and any order fees are added at checkout and are not in this API. 7. **Treat `cart_token` like a password for that cart.** Anyone with it can view and change the cart. Give the person `cutsheet_url` and `checkout_url`, which contain the token, and nobody else. 8. If something isn't possible here (see section 2), say so and point the person to the website: they can change any item from `edit_in_designer_url` or add more on the website before paying. 9. **If the person gives you a schedule, drawing, spreadsheet or photo**, make one label or sign for every item on it, using its wording exactly. Ask about anything the file doesn't make clear (size, colour, material, adhesive) before you build the cart, then tell them how many items you found so they can check none were missed. --- ## 2. What you can and can't do **You can:** - Search the catalogue of ready-made sign and label designs, see their materials, sizes, options and text fields, and change their wording. - Design your own engraved plastic labels: any size up to 1200 × 600mm, text in any layout, lines, borders, circles, ellipses, tables (grids), symbols and logos, in any engraved colour, with or without adhesive. - Design your own full-colour printed signs and stickers on any printed material (vinyl, laminated, reflective, polypropylene, aluminium, ACM, stainless steel, acrylic and more): any background colour, any text and shape colours, coloured panels, symbols and logos. - Search our library of symbols (safety pictograms, arrows, electrical and everyday icons) and put them on a design. - Upload the person's logo or artwork (SVG, PNG, JPEG or WebP) and put it on a design. - Order ferrules (wire markers), engraved plastic cable labels and stainless steel cable labels, with a different marking on each one. - Get prices, create a cart, view it, and remove items. - Give the person a cutsheet link to review everything, a checkout link, and a link to edit each design in the online designer. **You can't:** - Pay, place the order, apply discount codes, or quote shipping. - Change the layout, fonts or symbols of a ready-made design (section 4). Only the words in its text fields change. To change a layout, design your own instead (section 5). - Use curved, angled or rotated text and lines, gradients, photos with transparency effects, or fonts other than the ones listed. - Put two text colours on one engraved label. Engraved labels have one label colour and one text colour (section 5). - Order items that aren't covered here (cable ties on their own, tag holders, lockout gear and so on). Send the person to https://plastictags.com.au for those. - See or change an order after it has been paid, or track delivery. - Sign in to a customer account. Every cart is a guest cart until the person checks out. The person can change anything (layout, fonts, artwork) from `edit_in_designer_url` before paying. --- ## 3. Basics - **Base URL:** `https://plastictags.com.au/api/agent/` - Choose the action with `?action=...`. - `GET` actions take query parameters. `POST` actions take a JSON body (`Content-Type: application/json`). - Every response is JSON with `"ok": true` or `"ok": false` and an `"error"` message. - No API key or sign-in is needed. - CORS is open (`Access-Control-Allow-Origin: *`). ### Workflow 1. Work out what the person needs, and ask for any choices they haven't made (size, material or colour, adhesive, quantity, wording). 2. `create-cart` once, and keep the `cart_token`. 3. Add each thing: - a ready-made design: `search`, `product`, optionally `quote`, then `add-item` (section 4); - your own design: `design-options`, optionally `icons` and `upload-image`, `check-design`, then `add-design` (section 5); - cable labels or ferrules: `cable-options`, then `add-cable-labels` (section 6). 4. Tell the person about any `warnings`. 5. Give them the items and prices, `cutsheet_url` to review everything, and `checkout_url` to pay. --- ## 4. Ready-made designs {#templates} ### `GET ?action=help` A short summary of the actions. The actions in this section are for ready-made designs. Sections 5 and 6 cover your own designs and cable labels. ### `GET ?action=search&q={keyword}` Finds design products whose **name** contains the keyword. Use one or two plain words ("danger", "exit", "asbestos", "first aid"). Up to 25 results. ``` curl "https://plastictags.com.au/api/agent/?action=search&q=exit" ``` ```json { "ok": true, "results": [ { "product_id": 738, "name": "Fire Exit Do Not Obstruct Sign", "subtitle": "Green emergency information sign for fire exit doors ...", "from_unit_ex_gst": 16.19, "url": "https://plastictags.com.au/products/fire-exit-do-not-obstruct-sign" } ] } ``` `from_unit_ex_gst` is the lowest price per sign on the cheapest material and a bulk quantity. Use `quote` for real prices. Products whose name says "Custom" or "Your Text Here" are templates meant to be reworded. ### `GET ?action=product&id={product_id}` Everything needed to configure one product. ``` curl "https://plastictags.com.au/api/agent/?action=product&id=496" ``` ```json { "ok": true, "product": { "product_id": 496, "name": "Custom Danger Sign Your Text Here Printed", "url": "https://plastictags.com.au/products/custom-danger-sign-your-text-here-printed", "design_size_mm": { "width": 300, "height": 225 }, "text_fields": [ { "id": "text_1", "text": "DANGER", "multiline": false }, { "id": "text_2", "text": "YOUR TEXT\nHERE", "multiline": true } ], "materials": [ { "material_id": 603, "name": "Polypropylene", "best_for": "Indoor signs, temporary site notices; laminate option for outdoor", "indoor_life": "5-10 years", "outdoor_life": "1-3 years, up to 7 laminated", "from_unit_ex_gst": 19.75, "recommended": true, "size": { "mode": "custom", "options": [], "min_mm": 20, "max_width_mm": 600, "max_height_mm": 600 }, "mounting": { "label": "Adhesive Backing", "options": [ { "option_id": 38618, "label": "None" }, { "option_id": 38619, "label": "3M Adhesive" } ] }, "extras": [ { "label": "UV Protection", "options": [ { "option_id": 38615, "label": "None" }, { "option_id": 38616, "label": "Standard" } ] } ] }, { "material_id": 609, "name": "ACM", "size": { "mode": "fixed", "options": [ { "size_option_id": 43164, "label": "50x50", "width_mm": 50, "height_mm": 50 }, { "size_option_id": 43165, "label": "100x100", "width_mm": 100, "height_mm": 100 } ] }, "mounting": { "label": "Adhesive Backing", "options": [ ... ] }, "extras": [ ... ] } ] } } ``` **Fields:** - `text_fields`: the wording you can change. `text` is the template wording. `multiline: true` means the field is laid out over several lines. - `design_size_mm`: the size the template was designed at. - `materials[]`: what the sign can be made from. `recommended` marks good default choices. Use `best_for`, `indoor_life` and `outdoor_life` to help the person choose (e.g. outdoor signs need an outdoor-rated material or UV protection). - `size.mode`: - `"custom"`: any `width_mm` × `height_mm` between `min_mm` and `max_width_mm` × `max_height_mm`. If you leave the size out, `design_size_mm` is used. - `"fixed"`: choose one `size_option_id` from `size.options`. If you leave it out, the first option is used. - `"design_only"`: the size is set by the design; don't send a size. - Pick a size with similar proportions to `design_size_mm`, so the layout fits the sign. - `mounting.options`: send one as `mounting_option_id`. If you leave it out, the website's default option is used. - `extras[].options`: send the chosen ones in `option_ids` (one per extra at most). If you leave them out, the defaults are used. ### `POST ?action=quote` Prices a configuration. Takes the same options as `add-item`, plus `qty`. ``` curl -X POST "https://plastictags.com.au/api/agent/?action=quote" \ -H "Content-Type: application/json" \ -d '{"product_id":496,"material_id":603,"width_mm":300,"height_mm":225,"mounting_option_id":38619,"qty":3}' ``` ```json { "ok": true, "qty": 3, "size": "300 × 225 mm", "unit_ex_gst": 16.42, "line_ex_gst": 49.26, "line_inc_gst": 54.19, "currency": "AUD", "note": "Shipping and any order fees are shown at checkout." } ``` The price per sign drops at higher quantities. ### `POST ?action=create-cart` ``` curl -X POST "https://plastictags.com.au/api/agent/?action=create-cart" \ -H "Content-Type: application/json" -d '{"source":"chatgpt"}' ``` ```json { "ok": true, "cart_token": "5ef2db5e4fe703f23f20cf9c65a85cb9", "state": "init", "items": [], "items_subtotal_ex_gst": 0, "items_total_inc_gst": 0, "currency": "AUD", "cutsheet_url": "https://plastictags.com.au/cutsheet.php?id=42720655&cart=5ef2db5e4fe703f23f20cf9c65a85cb9", "checkout_url": "https://plastictags.com.au/checkout.php?cart=5ef2db5e4fe703f23f20cf9c65a85cb9", "note_for_customer": "Open cutsheet_url to review every item as it will be made, then checkout_url to add delivery details and pay. Shipping and any order fees are shown at checkout." } ``` `source` (optional) is your assistant's name. Create one cart per person and keep using its `cart_token`. ### `POST ?action=add-item` Adds one product design to the cart, with the wording for each label. | Field | Required | Meaning | |---|---|---| | `cart_token` | yes | From `create-cart`. | | `product_id` | yes | From `search`. | | `material_id` | yes | From `product` → `materials[]`. | | `size_option_id` | fixed sizes | From `size.options`. | | `width_mm`, `height_mm` | custom sizes | Within the material's limits. | | `mounting_option_id` | no | From `mounting.options`. | | `option_ids` | no | Array of ids from `extras[].options`. | | `labels` | yes | One row per different wording, see below. | | `notes` | no | A short note for the print team (200 characters). | **`labels`**: each row is `{"qty": n, "text": {"text_1": "...", "text_2": "..."}}`. - `qty` is how many signs get this wording. - Keys in `text` are `text_fields` ids. A field you leave out keeps the template wording. - Use `\n` for a new line in a multi-line field. - Up to 200 characters per field. Control characters are removed. - The item's quantity is the total of all row quantities, and the price uses that total. - All rows share one material, size and options. For a different material or size, add another item. Example: 2 signs reading "PUMP ROOM / AUTHORISED ONLY" and 1 reading "SWITCHBOARD": ``` curl -X POST "https://plastictags.com.au/api/agent/?action=add-item" \ -H "Content-Type: application/json" \ -d '{ "cart_token": "5ef2db5e4fe703f23f20cf9c65a85cb9", "product_id": 496, "material_id": 603, "width_mm": 300, "height_mm": 225, "mounting_option_id": 38619, "labels": [ {"qty": 2, "text": {"text_2": "PUMP ROOM\nAUTHORISED ONLY"}}, {"qty": 1, "text": {"text_2": "SWITCHBOARD"}} ] }' ``` The response is the whole cart, plus `item_id` and `warnings`: ```json { "ok": true, "item_id": 7146486, "warnings": [], "cart_token": "5ef2db5e4fe703f23f20cf9c65a85cb9", "state": "init", "items": [ { "kind": "template", "item_id": 7146486, "product_id": 496, "product": "Custom Danger Sign Your Text Here Printed", "material": "Polypropylene Signs & Labels", "size_mm": { "width": 300, "height": 225 }, "qty": 3, "subtotal_ex_gst": 49.26, "total_inc_gst": 54.19, "labels": [ { "qty": 2, "text": { "text_1": "DANGER", "text_2": "PUMP ROOM\nAUTHORISED ONLY" } }, { "qty": 1, "text": { "text_1": "DANGER", "text_2": "SWITCHBOARD" } } ], "edit_in_designer_url": "https://plastictags.com.au/design.php?ipid=7146486&cart=5ef2db5e4fe703f23f20cf9c65a85cb9" } ], "items_subtotal_ex_gst": 49.26, "items_total_inc_gst": 54.19, "currency": "AUD", "cutsheet_url": "https://plastictags.com.au/cutsheet.php?id=42720655&cart=5ef2db5e4fe703f23f20cf9c65a85cb9", "checkout_url": "https://plastictags.com.au/checkout.php?cart=5ef2db5e4fe703f23f20cf9c65a85cb9", "note_for_customer": "Open cutsheet_url to review every item as it will be made, then checkout_url to add delivery details and pay. Shipping and any order fees are shown at checkout." } ``` **About the text:** - Wording with more lines, or much longer lines, than the template is made smaller so it all fits in the template's text area. You'll get a warning saying by how much. Above about 50% smaller, shorten the wording or design your own sign (section 5) instead. - The artwork keeps its proportions. A size with different proportions from `design_size_mm` leaves a blank strip, and `quote` and `add-item` warn you with sizes that match. - Every row is printed with its own wording. The person can check each one on the cutsheet, and fix anything in `edit_in_designer_url`. ### `GET ?action=cart&cart_token={token}` Returns the cart in the same shape as above. Each item has a `kind`: `template` (section 4), `custom_design` (section 5) or `cable` (section 6; one entry per product and options, listing each marking). After the person has paid, `state` is no longer `"init"` and the cart can't be changed. ### `POST ?action=remove-item` ``` curl -X POST "https://plastictags.com.au/api/agent/?action=remove-item" \ -H "Content-Type: application/json" \ -d '{"cart_token":"5ef2db5e4fe703f23f20cf9c65a85cb9","item_id":7146486}' ``` Send `item_ids: [...]` to remove several at once (for example a few cable markings). Returns the updated cart. To change an item's wording, size or material, remove it and add it again. --- ## 5. Your own designs: engraved labels and printed signs {#custom-designs} Describe the layout in millimetres and the server draws it, sizes the text to fit, prices it and adds it to the cart. The same `design` object works for both kinds: - **`"kind": "engraved"`** (default): layered plastic, often called Traffolyte. A top colour over a core colour. Wherever you put text, lines, shapes or symbols, the top layer is engraved away and the core colour shows. So each label has one **label colour** and one **text colour**, chosen together as a `colour_option_id` (e.g. White/Black = white label, black text). {#engraved} - **`"kind": "printed"`**: full-colour UV printing on a material you choose with `material_id`. Set `background_colour` on the design, and `colour` on any element. Panels, symbols and logos print in colour. ### Workflow 1. `GET ?action=design-options`: engraved colours and adhesive, printed materials (with sizes, mounting and extras), fonts, element types and minimum text height. 2. Ask the person for the size, wording, colour or material, and adhesive if they haven't said. Typical engraved default: White/Black 1.6mm with adhesive. 3. For a symbol, `GET ?action=icons&q=...`. For the person's logo, `POST ?action=upload-image`. 4. `POST ?action=check-design` with your `design`. Read `warnings` and `price`, adjust and check again until there are no surprises. 5. `create-cart` (if you don't have one), then `POST ?action=add-design` with the same body plus `cart_token`, `qty` and a short `reference`. 6. When everything is added, give the person `cutsheet_url` and `checkout_url`. The old action names `engraved-options`, `preview-engraved` and `add-engraved` still work. ### `GET ?action=design-options` ``` { "ok": true, "engraved": { "size_mm": {"min": 10, "sheet": "1200 x 600", "rule": "The label must fit a 1200 x 600mm sheet either way round ..."}, "colours": [ {"colour_option_id": 57749, "name": "White/Black · 1.6mm", "colour": "White/Black", "thickness_mm": 1.6, "label_colour": "rgb(255,255,255)", "text_colour": "rgb(0,0,0)", "default": true}, ... ], "adhesive": {"options": [{"adhesive_option_id": 57737, "label": "Yes", "default": true}, {"adhesive_option_id": 57738, "label": "No", "default": false}]} }, "printed": { "how_it_works": "Full-colour UV printing. Set background_colour, and colour on each text/shape element. Choose a material_id below.", "materials": [ {"material_id": 604, "name": "Aluminium", "best_for": "Outdoor signs that need to last", "indoor_life": "10+ years", "outdoor_life": "Up to 7 years", "size": {"mode": "custom", "min_mm": 10, "max_width_mm": null, "max_height_mm": null}, "mounting": {"label": "Adhesive Backing", "options": [{"option_id": 38630, "label": "None"}, {"option_id": 38631, "label": "3M Adhesive"}]}, "extras": [{"label": "UV Protection", "options": [{"option_id": 38627, "label": "None"}, ...]}]}, ... ] }, "fonts": ["oswald (default, condensed)", "arial"], "element_types": ["text", "line", "rect", "circle", "ellipse", "grid", "icon (icon_id from icons)", "image (image_id from upload-image)"], "min_text_height_mm": 1.5 } ``` Always take the ids from this response; don't hard-code the examples. Printed materials work like section 4: `size.mode` `"custom"` takes any size within the limits; `"fixed"` means the design must be one of `size.options` (send `size_option_id`, or leave out `width_mm`/`height_mm` and they are taken from it). Send a `mounting_option_id` and `option_ids` (extras) from the material. ### `GET ?action=icons&q={words}` Searches the symbol library: safety pictograms (mandatory, prohibition, warning, emergency, fire), arrows, electrical and everyday icons. Up to 40 results, best first (`&limit=` up to 100). Search with plain words such as "warning", "mandatory", "fire", "arrow", "voltage"; if nothing comes back, try a broader word. ``` curl "https://plastictags.com.au/api/agent/?action=icons&q=earth" ``` ```json {"ok": true, "count": 1, "icons": [{"icon_id": 303, "name": "Earth Globe", "tags": "Earth Globe"}]} ``` Put one on a design as `{"type": "icon", "icon_id": 303, "x_mm": ..., "y_mm": ..., "width_mm": ..., "height_mm": ...}`. Use the `icon_id` from the response, not this example. ### `POST ?action=upload-image` Uploads the person's logo or artwork. Body: `{"filename": "logo.svg", "data_base64": "..."}`. SVG, PNG, JPEG or WebP, up to 8MB. ```json {"ok": true, "image_id": "3f9c...e1", "kind": "vector", "name": "logo.svg", "warnings": []} ``` - **SVG is best.** It is turned into sharp vector shapes. Text inside an SVG isn't supported: ask for the logo with text converted to outlines (you'll get a warning if text was skipped). - PNG, JPEG and WebP come back as `"kind": "raster"` with `width_px` and `height_px`. Under about 600px wide you'll get a warning that it may print blurry. - On engraved labels, a raster logo gets a warning: bitmaps can't be engraved cleanly, so the team will check it and may ask for a vector version. - Only send images the person gave you and has the right to use. Put it on a design as `{"type": "image", "image_id": "...", "x_mm": ..., "y_mm": ..., "width_mm": ..., "height_mm": ...}`. ### `POST ?action=check-design` Builds and prices a design without saving it. Use it to check sizes, warnings and price before adding. | Field | Engraved | Printed | |---|---|---| | `kind` | `"engraved"` (default) | `"printed"` | | `design` | required | required | | `colour_option_id` | from `engraved.colours` | — | | `adhesive_option_id` | optional | — | | `material_id` | — | required, from `printed.materials` | | `size_option_id` | — | fixed-size materials | | `mounting_option_id`, `option_ids` | — | optional | | `qty` | optional, for the price | optional, for the price | ``` curl -X POST "https://plastictags.com.au/api/agent/?action=check-design" \ -H "Content-Type: application/json" \ -d '{"colour_option_id":57749,"qty":2,"design":{"width_mm":80,"height_mm":25,"elements":[ {"type":"rect","x_mm":1.5,"y_mm":1.5,"width_mm":77,"height_mm":22,"thickness_mm":0.4,"corner_radius_mm":2}, {"type":"text","text":"MAIN SWITCHBOARD\nMSB-01","x_mm":3,"y_mm":3,"width_mm":74,"height_mm":19}]}}' ``` ``` { "ok": true, "kind": "engraved", "product": "Engraved White/Black · 1.6mm", "size_mm": {"width": 80, "height": 25}, "text_fields": [{"id": "text_1", "text": "MAIN SWITCHBOARD\nMSB-01", "multiline": true}], "warnings": [], "price": {"qty": 2, "unit_ex_gst": 2.74, "line_ex_gst": 5.48, "line_inc_gst": 6.03, "currency": "AUD"} } ``` ### `POST ?action=add-design` The same body as `check-design`, plus `cart_token` and `qty`, and optionally `reference` (a short name shown to the person and the production team, e.g. "Rack 3 patch panel 1") and `notes`. Returns `item_id`, `warnings` and the cart. For several different designs, call it once per design. For many labels with the same layout but different wording, you can send `labels: [{"qty": n, "text": {"text_1": "..."}}]` instead of `qty`, just like `add-item`. The `text_N` ids are the text elements in order, as listed in `text_fields`. ### The `design` object All positions and sizes are in mm, measured from the top-left corner. | Field | Meaning | |---|---| | `width_mm`, `height_mm` | Size. Can be left out if a grid sets the size (the design is then the size of the grid). Smallest side 10mm. Engraved labels are cut from 1200 × 600mm sheets, so the longest side can be up to 1200mm and the shortest up to 600mm (either way round). Printed materials have their own limits in `design-options`. Split anything bigger into several items. | | `corner_radius_mm` | Rounded corners. Optional, default 0. | | `font` | `"oswald"` (default, condensed, fits more text) or `"arial"`. | | `bold` | Default bold for all text. | | `background_colour` | Printed only. The background, e.g. `"#ffcc00"`. Default white. | | `colour` | Printed only. Default colour for text, lines and shapes. Default black. | | `elements` | List of elements, drawn in order (later ones on top). At most 1500 after grids are expanded. | Colours are `"#rrggbb"`, `"#rgb"` or `"rgb(r,g,b)"`. **Element types** | `type` | Fields | |---|---| | `text` | `text` (use `\n` for line breaks), `x_mm`, `y_mm`, and either a box (`width_mm`, `height_mm`) or `text_height_mm`. Optional `align` (`left`, `center`, `right`; default `center`), `valign` (`top`, `middle`, `bottom`; default `middle`), `font`, `bold`, `text_height_mm`, `colour` (printed). | | `line` | `x1_mm`, `y1_mm`, `x2_mm`, `y2_mm`, `thickness_mm` (default 0.3), `colour` (printed). Horizontal or vertical only. | | `rect` | `x_mm`, `y_mm`, `width_mm`, `height_mm`, `thickness_mm` (default 0.3), `filled` (default false), `corner_radius_mm`, `colour` (printed: the border or fill colour), `fill_colour` (printed: a coloured panel; with `thickness_mm` it also gets a border in `colour`). Use for borders and colour bands. | | `circle` | `cx_mm`, `cy_mm` (centre), `diameter_mm`, `thickness_mm`, `filled`, `colour`, `fill_colour` (printed). | | `ellipse` | `x_mm`, `y_mm`, `width_mm`, `height_mm` (its bounding box), `thickness_mm`, `filled`, `colour`, `fill_colour` (printed). | | `icon` | `icon_id` (from `icons`), `x_mm`, `y_mm`, `width_mm`, `height_mm`. Optional `align`, `valign`, `colour` (printed: recolours the whole symbol; leave it out to keep the symbol's own colours). | | `image` | `image_id` (from `upload-image`), `x_mm`, `y_mm`, `width_mm`, `height_mm`. Optional `align`, `valign`, `colour` (printed, vector logos only: one-colour version). | | `grid` | A table: see below. | **Icons and logos** are scaled to fit inside their box without stretching, then placed by `align` (`left`, `center`, `right`) and `valign` (`top`, `middle`, `bottom`). On an **engraved** label there are only two colours, so the dark parts of a symbol or logo are engraved in the text colour and the light parts stay the label colour. A logo on a dark background box will mostly disappear: use one with a light or transparent background, or a one-colour version. **Text sizing.** Text height means the height of a capital letter, in mm. - With a box, the text is made as large as fits inside the box (keeping a small margin), or `text_height_mm` if you give one and it fits. If it has to be made smaller, you get a warning saying so. - Without a box, `text_height_mm` is required. `x_mm` is the left edge, centre or right edge depending on `align`, and `y_mm` is the top of the capitals on the first line. - Text smaller than 1.5mm is refused. Under 2mm you get a warning that it may be hard to read. Use at least 3mm for labels read from a distance. - Keep text boxes inside any border you draw, or the text can touch the border. **Grids** are for tables and strips of labels in a row, such as patch panel labels. | Field | Meaning | |---|---| | `x_mm`, `y_mm` | Top-left of the grid. Default 0, 0. | | `column_width_mm` | Width of one column. Cells can also set their own `width_mm`, or `span` several columns. | | `rows` | List of rows. Each row: `height_mm` (required), `cells`, and optional `text_height_mm`, `bold`, `align`, `colour`. | | `cells` | Each cell is a string, or `{text, span, width_mm, align, bold, font, text_height_mm, colour}`. An empty string is an empty cell. | | `lines` | `"cells"` (box around every cell and the outside), `"rows"` (lines between rows only) or `"none"` (default). | | `line_thickness_mm` | Default 0.3. | | `line_colour` | Printed only. | | `text_size` | `"row"` (default): every cell in a row gets the same text height, the largest that fits all of them. `"cell"`: each cell's text fills its own cell. | Cells run left to right; a row can be shorter than the grid. Each cell's text is centred vertically in the cell. ### Example: patch panel strip (engraved) A 24-port strip, 444 × 11.2mm. Top row: one label per group of ports; bottom row: one label per port. ``` {"cart_token": "...", "colour_option_id": 57749, "adhesive_option_id": 57737, "qty": 1, "reference": "Rack 1 PP-01", "design": {"elements": [ {"type": "grid", "lines": "cells", "column_width_mm": 18.5, "rows": [ {"height_mm": 5.6, "cells": [{"text": "PP-01 PORTS 1-12", "span": 12}, {"text": "PP-01 PORTS 13-24", "span": 12}]}, {"height_mm": 5.6, "cells": ["1","2","3","4","5","6","7","8","9","10","11","12", "13","14","15","16","17","18","19","20","21","22","23","24"]} ]} ]}} ``` The label size comes from the grid (24 × 18.5 = 444mm wide, 11.2mm high). If the person sends a spreadsheet, map merged cells to `span` (or `width_mm`) so column widths match the panel. ### Example: equipment label with a border and a symbol (engraved) ``` {"width_mm": 80, "height_mm": 25, "corner_radius_mm": 2, "elements": [ {"type": "rect", "x_mm": 1, "y_mm": 1, "width_mm": 78, "height_mm": 23, "thickness_mm": 0.4, "corner_radius_mm": 1.5}, {"type": "icon", "icon_id": 253, "x_mm": 3, "y_mm": 3, "width_mm": 19, "height_mm": 19}, {"type": "text", "text": "PUMP 2", "x_mm": 24, "y_mm": 3, "width_mm": 53, "height_mm": 11, "bold": true}, {"type": "text", "text": "415V 3PH 7.5kW", "x_mm": 24, "y_mm": 14, "width_mm": 53, "height_mm": 8} ]} ``` ### Example: printed warning sign with a logo ``` {"cart_token": "...", "kind": "printed", "material_id": 604, "mounting_option_id": 38631, "qty": 2, "reference": "Plant room door", "design": {"width_mm": 300, "height_mm": 200, "background_colour": "#ffffff", "colour": "#000000", "elements": [ {"type": "rect", "x_mm": 0, "y_mm": 0, "width_mm": 300, "height_mm": 55, "fill_colour": "#ffcc00"}, {"type": "icon", "icon_id": 253, "x_mm": 10, "y_mm": 5, "width_mm": 45, "height_mm": 45}, {"type": "text", "text": "WARNING", "x_mm": 60, "y_mm": 5, "width_mm": 230, "height_mm": 45, "bold": true}, {"type": "text", "text": "HIGH VOLTAGE\nAUTHORISED PERSONS ONLY", "x_mm": 10, "y_mm": 65, "width_mm": 280, "height_mm": 85}, {"type": "image", "image_id": "3f9c...e1", "x_mm": 100, "y_mm": 160, "width_mm": 100, "height_mm": 32} ]}} ``` ### Tips - Check first and read the warnings before adding to the cart. - Use `"\n"` for two-line text in narrow cells rather than very small text. - For many labels with the same layout but different wording (e.g. 40 circuit labels), use `labels` in one `add-design`, or add one item per label with its own `reference`. - Engraved colours and adhesive apply to the whole label. One engraved label can't have two text colours; use a printed design for more colours. - For safety signs, follow the colours people expect (e.g. yellow for warning, red for danger and fire, blue for mandatory, green for safe condition). --- ## 6. Cable labels and ferrules {#cable} Three products, each with a different marking on every label: | `product` | What it is | |---|---| | `ferrules` | Printed sleeves that slide over a wire core. Usually one short marking: `L1`, `N`, `X1-3`. | | `plastic-cable-labels` | Engraved plastic tags with slots, fixed to a cable with cable ties. One or more lines. | | `stainless-cable-labels` | Stainless steel tags for harsh or outdoor places. One or more lines. | ### `GET ?action=cable-options` Lists each product's options. Choice options have `option_id`s; value options (like width in mm) take a number. One option in each list is the default. ``` { "ok": true, "limits": {"markings_per_call": 1000, "markings_per_cart": 3000, "lines_per_marking": 6, "characters_per_line": 60}, "products": [ {"product": "ferrules", "product_id": 2, "name": "Ferrules / wire markers", "marking_field": "Marker Text", "options": [ {"var_id": 2, "name": "Marker Width", "type": "choice", "options": [{"option_id": 1, "label": "15mm"}, {"option_id": 3, "label": "30mm", "default": true}]}, {"var_id": 3, "name": "Cable/Core Size", "type": "choice", "options": [{"option_id": 5, "label": "1.5-2.5mm Core"}, ...]}, {"var_id": 4, "name": "Colour", "type": "choice", "options": [{"option_id": 9, "label": "White w/ Black Text", "default": true}, ...]} ]}, {"product": "plastic-cable-labels", "product_id": 4, "options": [ {"var_id": 10, "name": "Width", "type": "value", "unit": "mm", "default": "100"}, {"var_id": 11, "name": "Height", "type": "value", "unit": "mm", "default": "20"}, {"var_id": 12, "name": "Text Height", "type": "value", "unit": "mm", "default": "5"}, ... ]}, ... ] } ``` Ask the person which options they need (for ferrules, the core size matters most). Anything left out uses the default. ### `POST ?action=add-cable-labels` | Field | Required | Meaning | |---|---|---| | `cart_token` | yes | From `create-cart`. | | `product` | yes | `ferrules`, `plastic-cable-labels` or `stainless-cable-labels`. | | `options` | no | `{"": option_id or label or value}`, e.g. `{"Marker Width": "15mm", "3": 5}` or `{"Width": 60, "Height": 15}`. | | `markings` | yes | One per label: `{"text": "...", "qty": 1, "group": "..."}`. | | `notes` | no | A short note for the production team. | - `text` is what's printed or engraved. Use `\n` between lines (up to 6 lines of 60 characters). - `qty` is how many copies of that marking (default 1). For a cable with a ferrule on each end, use `qty: 2`. - `group` (optional) groups markings on the cutsheet, e.g. `"DB-3"`. - Put every marking with the same options in one call (up to 1000). For different options (another colour or size), call again. - On stainless labels, the material is chosen to match the size. ``` curl -X POST "https://plastictags.com.au/api/agent/?action=add-cable-labels" \ -H "Content-Type: application/json" \ -d '{"cart_token":"...","product":"ferrules","options":{"Marker Width":"15mm","Cable/Core Size":"1.5-2.5mm Core","Colour":"Yellow w/ Black Text"}, "markings":[{"text":"L1","qty":2},{"text":"L2","qty":2},{"text":"L3","qty":2},{"text":"N","qty":2}]}' ``` Returns `added`, the `options` used, `warnings` and the cart. In the cart, the markings appear as one item with `"kind": "cable"`, `markings_count`, `qty` and each marking with its own `item_id`: ```json {"kind": "cable", "product": "ferrules", "name": "Ferrules / wire markers", "options": {"Cable/Core Size": "1.5-2.5mm Core", "Colour": "Yellow w/ Black Text", "Marker Width": "15mm"}, "markings_count": 4, "qty": 8, "subtotal_ex_gst": 7.84, "total_inc_gst": 8.64, "markings": [{"item_id": 7146560, "text": "L1", "qty": 2}, ...]} ``` To fix a marking, remove it with `remove-item` (`item_ids` for several) and add it again. --- ## 7. Limits | Limit | Value | |---|---| | Items per cart (not counting cable markings) | 30 | | Label rows per item | 500 | | Quantity per label row | 1000 | | Characters per text field | 200 | | Cable markings | 1000 per call, 3000 per cart | | New carts per IP address | 30 per hour | | `add-item`, `remove-item`, `add-design`, `add-cable-labels` per IP address | 300 per hour each | | `check-design` per IP address | 600 per hour | | `upload-image` per IP address | 60 per hour, 8MB each | | Design elements (after grids are expanded) | 1500 | | Smallest text height | 1.5mm | | Engraved label size | 10mm to 1200 × 600mm (either way round) | | Other requests per IP address | 1200 per hour | --- ## 8. Errors Errors return `"ok": false` and a message that says what to fix. | HTTP | When | What to do | |---|---|---| | 400 | Missing or invalid field, a product or option that isn't offered, a size outside the limits, an `item_id` not in the cart, an image that can't be read | Fix the request using ids from this API. | | 404 | Unknown product, cart not found, or the cart has already been ordered | Search again, or `create-cart` for a new cart. | | 405 | Wrong HTTP method | Every action that changes or checks something needs `POST` with JSON. | | 413 | Body too large (2MB, or 12MB for `upload-image`) | Split into smaller calls, or use a smaller image. | | 429 | Too many requests | Wait and try later. | | 500 | Server error | Try once more; if it keeps failing, send the person to the website. | --- ## 9. MCP The same tools are available as an MCP server (Streamable HTTP, no sign-in) at `https://plastictags.com.au/mcp`: - Ready-made designs: `search_products`, `get_product`, `get_quote`, `add_to_cart` - Your own designs: `get_design_options`, `search_icons`, `upload_image`, `check_design`, `add_design_to_cart` - Cable labels and ferrules: `get_cable_options`, `add_cable_labels_to_cart` - Cart: `create_cart`, `get_cart`, `remove_from_cart` Inputs are the same as the actions above. --- ## 10. Help for people A plain-English guide for customers: https://plastictags.com.au/resources/order-with-ai Website: https://plastictags.com.au · Contact: https://plastictags.com.au/contact.php · Shipping: https://plastictags.com.au/shipping-information.php