DocsBasic IntegrationCreate Smartlink

Create Smartlink

POST/api/smartlink

Description

The SmartLink endpoint sends users to FastEditor. There are three use cases depending on whether you are creating a new product or reopening an existing project. See the scenarios below to determine which parameters apply to your integration.

To limit the customer’s design size, use the optional maxDesignArea properties below. See the Product Management Design area limits guide for matching print areas, reopening projects, stored limits and validation rules.

Use Cases

  1. 1

    Create new product using product attributes Recommended

    Use supplier together with productAttributes to specify the product by its baseSku, printMethod, and optionally printColors and the supplier-specific print method/area properties.

    Example payload

    {
      "supplier": "PF Concept",
      "productAttributes": {
        "baseSku": "10029601",
        "printColors": 4,
        "supplierPrintMethodCode": "1",
        "supplierPrintAreaCodes": [
          "front"
        ]
      }
    }
  2. 2

    Create new product using virtual SKUs

    Some webshop platforms (e.g. WooCommerce) require a single distinct SKU value for each product variant. Use supplier together with virtualSku to encode the product configuration and print area / color constraints in one string. When virtualSku is provided, productAttributes will be ignored. See the SKU Concepts guide for the format.

    Example payload

    {
      "supplier": "PF Concept",
      "virtualSku": "10051500#1|$pp=front&$pc=4"
    }
  3. 3

    Open existing project

    When a customer has already personalised a product and wants to continue editing, use projectId to reopen the project. The supplier, virtualSku, and productAttributes parameters are irrelevant and will be ignored.

    Example payload

    {
      "projectId": 146
    }
The following parameters are optional and apply to all three scenarios: backUrl, cartUrl, country, currency, customAttributes, guestUser, language, maxDesignArea, productOptions, quantity, and userId.

Authentication

API Key Required

Pass your API key in the X-Api-Key header

Request Body

Smartlink creation parameters required

Sort fields:
FieldTypeRequiredDescription
backUrlstringNoThe URL where the customer should be sent if they abort project creation before reaching the shopping cart. This is separate from cartUrl, which is used after the customer completes the design. Example: https://my.shop/product
cartUrlstringNoThe shopping cart URL where the user should be sent after completing the design. This is only required if the cart URL is not set on a global level for this shop. Example: https://my.shopping.cart/url
countrystringNoThe country the user is shopping in. Example: US
currencystringNoThe currency in which to show pricing information in FastEditor. Example: USD
customAttributesobjectNoCustom attributes that you want to receive back in the Add to Cart callback.
guestUserbooleanNoOnly for white labels with the Auth Integration module implemented. When the provided userId parameter belongs to an anonymous or "guest" user, this should be set to true. It will enable the login dialog within FastEditor.
languagestringNoThe language in which to show the FastEditor UI. Example: en
maxDesignAreaobjectNoOptional maximum design surface area. For new projects, omit or send null for no limit. On reopen, omitted/null limits keep the saved values. Supply global and/or a non-empty printAreas list; a null field counts as omitted. See the Design area limits guide for matching, saved limits and validation.
productAttributesobjectNoAllows deeplinking to a product based on the "baseSku" (usually provided by the supplier) and a set of attributes. If a "sku" is provided in the same payload, this will be ignored.
productOptionsobjectNoDefines if the user can switch between different product options in the editor UI.
projectIdintegerNoProject unique identifier. Example: 146
quantityintegerNoWhen provided, after the user finishes creating the project, it will be added to the shopping cart in this quantity. Example: 50
skustringNoYour internal SKU of the product the user wants to create. Will be ignored in case projectId is set. Example: TSHIRT-100#DTG
supplierstringNoName of the supplier of the product deeplinking to. For a list of available suppliers, see the Connected Suppliers page. Example: PF Concept
userIdstringNoYour internal unique identifier for the user. If this is provided, we will create a user session linked to this user profile. Example: user_123
virtualSkustringNoA virtual SKU string that encodes both the product configuration and print area / color constraints. When provided, the editor will be pre-configured with the specified print positions and color count. See SKU Concepts for the format and how to discover available virtual SKUs. Will be ignored in case projectId is set. Example: TSHIRT-100#DTG|$pp=Front__Back&$pc=fc

maxDesignAreafields

FieldTypeRequiredDescription
metricUnitsstring enum NoSurface-area units: mm² for mm or in² for in. Defaults to mm when omitted or null. Changing units on reopen replaces the entire saved limit. Example: mm
mminnull
globalnumberNoPositive JSON number (decimals allowed), used for every print area without its own max. No default. Null counts as omitted. Numeric strings are rejected. Example: 40000
printAreasarrayNoPer-print-area limits. Empty or null counts as omitted; at least global or a non-empty list is required. Each entry needs a non-empty code or name and a positive numeric max (decimals allowed). Code takes precedence over name, with no fallback. A per-area max overrides global. For example: [{"code":"front","max":20000},{"name":"Back","max":15000}]. Not supported for legacy products or SmartLinks without a product.

productAttributesfields

Sort fields:
FieldTypeRequiredDescription
baseSkustringYesThe base product SKU from the supplier.
printMethodstringNoOne of the print methods available in FastEditor. For a list of available print methods, see the Print Methods guide.
printColorsinteger | string enum NoNumber of print colors available to the customer. Either an integer from 1 to 12, or the string "full-color".
123456789101112full-color
supplierPrintMethodNamestringNoPrint method name as defined in the original supplier data (non-normalized source data, only for suppliers that offer product feeds). Will be ignored in case supplierPrintMethodCode is sent in the same request.
supplierPrintMethodCodestringNoPrint method code as defined in the original supplier data (non-normalized source data, only for suppliers that offer product feeds).
supplierPrintAreaCodesarrayNoArray of print position codes as defined in the original supplier data. Array should hold values of the print positions that should be available for customization in the Editor.
supplierPrintAreaNamesarrayNoArray of print position names as defined by the supplier's provided data. Will be ignored in case supplierPrintAreaCodes is sent in the same request.

productOptionsfields

FieldTypeRequiredDescription
enabledbooleanNoEnable the UI in the editor for changing the product options.
openOnStartbooleanNoDo you want to open the UI for selecting the product options when the editor starts?

Example Request

curl -X POST "https://api.editor.staging.fasteditor.com/api/smartlink" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "backUrl": "https://my.shop/product",
  "cartUrl": "https://my.shopping.cart/url",
  "country": "US",
  "currency": "USD",
  "language": "en",
  "maxDesignArea": {
    "metricUnits": "mm",
    "global": 40000,
    "printAreas": [
      {
        "code": "front",
        "max": 20000
      }
    ]
  },
  "productAttributes": {
    "baseSku": "10029601",
    "printColors": 4,
    "supplierPrintMethodCode": "1",
    "supplierPrintAreaCodes": [
      "front"
    ]
  },
  "quantity": 50,
  "supplier": "PF Concept",
  "userId": "user_123"
}'

Example Response

200OK
Response Example
{
  "URL": "https://editor.staging.fasteditor.com/app/create/0/10110011?locale=en&countryid=1&currency=USD&user_token=abcdefghijklmnopqrstuvwxyz"
}
400Invalid maxDesignArea. The error message identifies the invalid field. The entire request fails without creating/updating a user or creating a token or SmartLink.
404When reopening a project with maxDesignArea.printAreas: projectId is unknown/deleted, or the project’s product no longer exists. A global-only limit does not trigger this lookup.