Editor Arguments

The JSON payload that configures the editor session

Introduction

The Editor Arguments JSON is the universal instruction set used to initialize a TronDesigner session. Whether you are using the Web Script or a URL-based integration, you are simply "packaging" this specific JSON structure.

Core Data Blocks

Block

Purpose

Required?

openMode

Determines if this is a new design or a saved session.

Yes

product

The "Canvas" (Supplier, Model, Variant).

Yes (if new)

printings

The "Rules" (Where and how the user can design).

Yes (if new)

customer

Your internal tracking IDs and metadata.

Recommended

editor

Controls UI behavior and result actions.

Yes

IMPORTANT: This is the foundational page of the documentation. Mastering this JSON structure allows you to integrate TronDesigner into any external system.

REFERENCE: For a list of available properties and definitions, see our TypeDoc Reference.

Below are blocks of JSON with examples and explanations.

1. Strategy: Operating Modes

Before defining products, you must tell the editor what the user is doing and how much data you are providing.

Opening Modes

Are we starting from scratch or opening a saved design? The printJobGuid is a unique identifier (string) generated by TronDesigner every time a user saves a design.

  • If you have a printJobGuid: You have to be in Edit or View mode. The Editor will ignore any product or print data you send and will instead load the design exactly as it was saved in our database.

  • If you DON'T have a printJobGuid: You have to be in Create mode.

"openMode": "CREATE|EDIT|VIEW"
  • Create → Starts a blank canvas. (New orders from a webshop.)

  • Edit → Loads an existing printJobGuid. (Customer changes their design in the cart.)

  • View → Read-only mode for an existing printJobGuid. (Internal staff checking a design.)

Calling Modes (Data Modes)

How much data you pass in your call? What is a required data minimum for each mode?

"dataMode": "EXACT|PARTIAL|OWN"

Content of Products and Printings blocks may differ, the rest stays the same for all modes. Partial can be referred as Free. Own can be referred as Custom.

See details, rules and logic for the Calling modes from the tech POV and business POV.

2. Product Definition

You need to tell the editor exactly which product to load using Suppliers and Models.
If you are starting a new design, the product block is your "Instruction Manual."

Product Identification:

  • Product: Product information, required when creating a new print job

  • supplierCode: The ID of the supplier. Find this in your Admin Portal under Suppliers.

    • You should manually set this code in the Admin Portal under Suppliers.

    • Example: If you are integrating products from supplier comany “PF Concept International Cooperatief U.A.”, your supplierCode needs to be PFC.

  • modelCode: The SKU/Model of the product. Product identification using model code instead of specific variants list. Only allowed in FREE (PARTIAL) data mode, user will be asked to select specific variants before opening the editor.

  • model object allows you to "rename" the product for the user.

    • title / description: These override the default values. Use this if your webshop uses different names than the supplier.

  • variants: List of product variants to be added to the print job (must be at least one).

    • dim1Title / dim1Colors: Explains the "Dimension" (Color).

    • productCode: The code of variant, should be available in your own system (TronCloud supplier’s product code).

  • overrides (optional): Overrides for setting own product name / code what will be displayed to user (without modifying the underlying supplier catalog).

    • productCode (optional): Overrides product code shown in editor / print output.

    • productName (optional, required for OWN data mode): Overrides product name shown in the Editor / Print output.

Example

"product": {
     "supplierCode": "PFC",  // From Admin Portal
     "modelCode": "100002",  
     "model": {       
       "title": "Nápojová láhev Oregon", 
       "description": "Custom description for your customers...",
       "dimCount": 1 
     },
     "variants": [
       {
         "productCode": "10000200", // The specific variant ID from your system
         "quantity": 10,
         "dim1Title": "Zelené jablko",
         "dim1Colors": ["00FF00"], // Hex code for the color picker
         "overrides": {
           /* USE THIS TO RENAME PRODUCTS IN THE EDITOR UI */
           "productCode": "PFC-10000200", // Your internal shop SKU
           "productName": "Green Bottle - Promo" // Your internal name
         }
       }
     ]
}

Overrides

{
   printJob: {
    addProducts: {
      variants: [
        {
          productCode: "AAP003-160",
          overrides: {
            productCode: "003-160",
            productName: "White",
          },
        },
        {
          productCode: "AAP003-103",
          overrides: {
            productCode: "003-103",
            productName: "Green",
          },
        },
      ],
      /* ...rest of print job arguments */
    },
  }
   /* ...rest of arguments */
}

3. Printing Definition

The printings array defines where and how the product can be decorated. This is a list of printings that should be added to the Print Job, required when creating a new Print Job. Each object in this array represents a Position (where) and a Technology (how).

Core Identification

  • printPositionCode: Print position identification code (TronCloud supplier’s print position code), e.g., FRONT.

  • printTechnologyCode: The identification code for the print technology (e.g., SCREEN_PRINTING, LASER_ENGRAVING).

    • Where to find these? These codes are visible in the Admin Portal under the specific Model's configuration.

  • Production Constraints:

    • maxColors: Limit the user to 4 colors even if the technology allows more.

    • maxWidth / maxHeight: Set hard limits for the design size in millimeters.

Overrides (optional)

Overrides for setting own print POSITION / TECHNOLOGY name / code what will be displayed to the user.

  • printPositionCode: Overrides print position code shown in the Editor / Print output

  • printPositionName (optional, but required for OWN data mode): Overrides print position name shown in the Editor / Print output.

  • printTechnologyCode: Overrides print technology code shown in the Editor / Print output.

  • printTechnologyName (optional, required for OWN data mode): Overrides print technology name shown in the Editor / Print output.

Mockups & Print Areas

This is the visual "engine" of the editor.

  • ownBackgroundUrls: These are the images of the product that appear behind the design.

Example

"printings": [
  {
    "printPositionCode": "FRONT",
    "printTechnologyCode": "PAD03",
    "overrides": {
      "printPositionName": "Přední strana", // Rename for UI
      "maxColors": 4, // Constraint for pricing
      "maxWidth": 40,
      "maxHeight": 50
    },
    "ownBackgroundUrls": [
        "https://troncloudprod.blob.core.windows.net/provider-images/cdf553d1-545e-4bd4-9a6c-006ab133102d?20251230T035622",
        "https://troncloudprod.blob.core.windows.net/provider-images/7ca81c8b-22ed-4ca6-9d41-60469b7c26bb?20251230T035616",
        "https://troncloudprod.blob.core.windows.net/provider-images/25934d27-8ee3-4e48-8519-8b2a56f261c0?20251230T035619"
     ],
  },
  {
    "printPositionCode": "BACK",
    "printTechnologyCode": "PAD03"
    /* No mockup provided? Editor uses default from TronCloud */
  }
]

Overrides

{
   printJob: {
    addPrintings: [
      {
        printPositionCode: "CUSTOM-FRONT",
        printPositionName: "Custom Front",
        printTechnologyCode: "CUSTOM-PAD03",
        printTechnologyName: "Custom PAD03",
      }
    ],
    /* ...rest of print job arguments */
  }
   /* ...rest of arguments */
}

4. Metadata & Tracking (Customer & Custom)

This block handles the "handshake" between TronDesigner and your database. This data is not displayed to the user; it is stored and returned to you to help you identify the order.

Customer & Order Identification

TronDesigner doesn't use this data to render anything; it simply stores it and returns it back to you in the result webhook or JS event.

  • orderCode / orderItemCode: Essential for matching the design to a specific line in your database.

  • customerEmail / customerIdentity: Useful for tracking which user created which design.

Example

"customer": {
  "customerCompany": "Abc Corp",
  "customerEmail": "JohnDoe@gmail.com",
  "customerIdentity": "USER-12345",
  "customerPerson": "John Doe",
  "orderCode": "ORDER-999",
  "orderItemCode": "ITEM-001",
  "orderTitle": "Summer Campaign T-Shirts"
}

Custom Properties

If the standard customer fields aren't enough, you can pass any key-value pairs here.

  • Example: "key1": "loyalty-member-gold".

  • Use Case: Pass internal flags that your system needs to see when the user returns to your cart.

Example

"customProperties": {
  "internal_erp_id": "88776655",
  "discount_applied": "true",
  "source_campaign": "winter_2026"
}

5. Editor Behavior & Results

This block controls the user’s "exit" experience and toggles specific UI features within the editor.

Editor Result Actions & Redirects

This defines the user's "exit" experience.

  • resultAction:

    • NONE: Does nothing (stays on the editor).

    • CLOSE: Closes the modal/window immediately.

    • DIALOG: Display a dialog with a button to close the Editor, optionally can display custom message. (Close Dialog)

  • redirectUrl: The URL the browser navigates to after the session ends.

Example: Default Behavior (No Redirect)

{
 "openMode": "CREATE",
 "dataMode": "EXACT",
 "printJob": {...},
 "editor": {
   "result": {
     "resultAction": "NONE"
   }
 }
}

Example: Custom Success Dialog & Redirect

{
 "openMode": "CREATE",
 "dataMode": "EXACT",
 "printJob": {...},
 "editor": {
   "result": {
     "resultAction": "dialog",
     "redirectUrl": "https://shop.example.com/cart",
     "closeDialog": [
       {
         "language": "en"
         "title": "Print Graphics ready",
         "message": "Print Graphics has been successfully created and saved.",
         "buttonText": "Continue to cart"
       },
       {
         "language": "cz"
         "title": "Tisková Grafika Připravena",
         "message": "Tisková Grafika byla úspěšně vytvořena a uložena.",
         "buttonText": "Pokračovat do košíku"
       }
     ]
   }
 }
}

Recommendation: Even when using redirectUrl, always listen for Webhooks or JS Events to ensure the printJobGuid is saved securely to your backend.

Data Selector Behavior Options (UI Toggles)

Controls behavior of data selector dialog at the start-up of the editor. This dialog is only available in Data Mode PARTIAL and allows user to make additional selection for product variants and print options. Also Data Selector is always shown to user when only model code is specified.

Option

Meaning

showSelectedVariants

Controls whether product variants selector is shown to user

Possible values are: None / Selected / Missing / All

None = Dialog is not shown when variants are specified

Selected= Only variants provided in arguments are shown, user can only remove them, but can’t add new ones

Missing (COMING) = Variant selector is only shown when one or more of provided variants are not found. User can remove or add any product variant.

All= Variant selector is always shown and shows all product variants and those provided in arguments are pre-selected. User can remove or add any product variant. This mode is also enforced when only model code is provided in arguments.

showSelectedPrintOptions

Controls whether print option selector is shown to user

Possible values are: None / Selected / Missing / All

None = Dialog is not shown when print options are specified.

Selected= Only print options provided in arguments are shown, user can only remove them, but can’t add new ones.

Missing (COMING) = Print option selector is only shown when one or more of provided print options are not found. User can remove or add any print option.

All= Print option selector is always shown and shows all print options and those provided in arguments are pre-selected. User can remove or add any print option. This mode is also enforced when no print options are provided in arguments.

showQuantityInputs

Controls whether user is asked to enter quantities when selecting product variants.

Possible values: true / false

Example

window.tronDesigner.openDesigner(
  { /* editor arguments */ },
  {
    editorOptions: {
      showSelectedPrintOptions: "All",
      showSelectedVariants: "All",
      showQuantityInputs: true
    }
  }
);

Missing Data Behavior: When product variant or print options specified in arguments isn’t found, behavior is determined by Data Mode and additional editor options.

Data Mode = Exact > Editor shows fatal error dialog and it’s not possible to continue.

Data Mode = Partial > If at least one product variant or model is found, it’s possible to continue and behavior is further defined by the editor options. (If not then Editor shows fatal error dialog and it’s not possible to continue).

Behavior is defined by showSelectedVariants / showSelectedPrintOptions

None > missing data are skipped and user goes directly to editor.

Missing > data selector is shown (but only when data are missing, otherwise user goes directly to editor). Error message with missing data is visible in the data selector.

Selected > data selector is shown and user sees what data are actually found and selected. Error message with missing data is visible in the data selector.


All > data selector is shown and user sees all available data with found data selected. Error message with missing data is visible in the data selector.

Data Mode = Own > host needs to provide all the data, no lookup and selection is available. If any part of data is missing editor shows fatal error dialog and it’s not possible to continue.

Integration Styles: UI Strategies. These styles represent how you combine Data Modes with UI Toggles to create a specific user experience.

  • Exact Mode (Fixed configuration): Use these flags to hide selection UIs (quantities, variants) if those details are already locked in your system.

  • Free (Partial) / Own (Custom) Modes (Flexible Configuration): Enable these flags to let the user choose their own product variants and quantities directly within the Editor.

6. Pricing & Calculations (Beta)

Calculation Mode (Beta): The calculation block is currently intended for integrations where price is calculated based on design complexity (number of colors, size).

  • NONE: No pricing shown in editor.

  • STATIC: Shows a fixed price passed from your shop.

  • DYNAMIC: (Consult with support before use) Communicates with an external calculator.

"calculation": {
  "mode": "NONE" // Options: NONE, STATIC, DYNAMIC
}

Code Examples in different data modes

Exact data mode

Example 1:

Creating a new Print Pob with 1x printing (no overrides - minimum valid example for EXACT mode).

Example 2:

Creating new print job with 2 printings (with all overrides)

Free (Partial) data mode

Example 1:

Creating a new Print Job (minimum valid example for PARTIAL mode)

Example 2:

Creating a new Print Job (just product data).

Own (Custom) data mode

Host provides all the necessary data, if needed the user will be asked to complete missing data (same as in Free/Partial mode). No PromoTron data is used.

See full example code here:

Github - Examples - Own Data

Example 1:

Creating a new Print Job (just product data).
*User will need to input print options including mockup.

Example 2:

Creating a new Print Job (product and print data without mockups).
*User will need to provide at least mockup background for every print option.

Example 3:

Creating a new Print Job (product and print data with mockups).
*Host provides complete data, the user goes directly to the editor without any inputs.

The Master JSON Example

Below is a complete payload featuring every available block. Check the TypeDoc Reference.

Summary & Validation

Before you move to implementation, keep these two rules in mind:

  • The "Key" Rule: If you have a printJobGuid, the editor loads a saved design. If not, it uses your product and printing blocks to build a new one.

  • The "Override" Rule: Use overrides to map TronDesigner’s technical data to your shop's internal SKUs and names.

Pro-Tip: Always validate your JSON structure before passing it to the Script or URL. A single missing comma or misspelled property (e.g., supplierID instead of supplierCode) will prevent the editor from opening.

Next Steps: