Widget 2.0
    • PPL Access Point Widget — Implementation Guide for E-shops
    • 1. Quick Start — Integration in 5 Minutes
    • 2. Embedding the Widget into a Page
    • 3. Static HTML Integration
    • 4. Integration: Vanilla JavaScript
    • 5. Integration: PHP
    • 6. Integration: React
    • 7. Complete API Reference
    • 8. Advanced Scenarios
    • 9. Communication Channels Overview
    Switch to czech

    7. Complete API Reference

    7.1 HTML Attributes#

    Attributes are used for declarative configuration directly in HTML. Values are always strings.
    AttributeTypeRequiredDescription
    api-keystringYesAPI key assigned to the e-shop for authentication
    configJSON stringNoWidget configuration (see 7.5)

    7.2 JavaScript Properties#

    Properties allow passing JS objects directly without JSON serialization.
    PropertyTypeAccessDescription
    versionstringread-onlyWidget version
    widgetConfigWidgetConfig | undefinedread/writeWidget configuration

    7.3 JavaScript Methods#

    MethodParametersReturn TypeDescription
    configure(options)Partial<WidgetConfig>voidPartial merge configuration — changes only specified parameters, preserves the rest
    open()—voidOpens the widget (modal mode only)
    close()—voidCloses the widget (modal mode only)
    getSelectedAccessPoint()—DetailResponseModel | nullReturns the selected access point or null
    reset()—voidResets the widget to its default state

    7.4 Custom Events#

    All events have the prefix ppl-accesspointwidget-, are emitted with bubbles: true and composed: true (pass through Shadow DOM).
    EventPayload (e.detail)Description
    ppl-accesspointwidget-selectAccess point object (see 7.8)User selected an access point
    ppl-accesspointwidget-closenullWidget closed (without selection)
    ppl-accesspointwidget-error{ code: string, message: string }Error during initialization or API call
    ppl-accesspointwidget-readynullWidget successfully initialized

    7.5 Configuration Parameters (WidgetConfig)#

    Complete list of parameters passed via the config attribute or widgetConfig property. Parameters marked (admin) are typically configured in the widget admin by api-key — override them via config only when a specific page must differ from the global setting.

    General / UI#

    ParameterTypeDefaultDescription
    themestring"PPL_THEME"Widget theme
    viewMode"inline" | "modal""modal" / from admin(admin) Display mode — widget default is modal; admin can switch to inline. The config attribute on the element takes highest priority.
    closeButtonVisibleboolean—Show close button
    defaultLangstringfrom admin / "cs"(admin) Default language (see 7.6)
    langMenuboolean—Show language selection dropdown
    defaultCountrystringfrom admin / "CZ"(admin) Default country (ISO 3166-1 alpha-2)
    allowedCountriesstring[]from admin(admin) Allowed countries (intersection with server configuration)
    countriesMenuDisabledbooleanfalseDisable the country menu in the filter

    Map Position#

    ParameterTypeDescription
    centeredToAddressstringText address to center the map on
    centeredToLatnumberLatitude (WGS84)
    centeredToLonnumberLongitude (WGS84)

    Package Dimensions#

    ParameterTypeDescription
    packageWeightnumberWeight in kilograms
    packageWidthnumberWidth in centimetres
    packageHeightnumberHeight in centimetres
    packageLengthnumberLength in centimetres

    Services#

    ParameterTypeDescription
    ageCheckbooleanRequire age verification
    codRequiredbooleanCash on delivery required

    Access Points#

    ParameterTypeDescription
    accessPointCodestringKM code of the access point to pre-select (format KM + 7 digits, e.g. KM1234567)
    disabledAccessPointTypesstring[](admin) Disabled access point types — config is merged with the server list
    economyModeboolean(admin) Economy mode (Smart2Box) — server value cannot be overridden

    7.6 Supported Languages (defaultLang)#

    CodeLanguage
    bgBulgarian
    csCzech
    deGerman
    enEnglish
    esSpanish
    frFrench
    hrCroatian
    huHungarian
    itItalian
    nlDutch
    noNorwegian
    plPolish
    roRomanian
    skSlovak

    7.7 Access Point Types#

    TypeDescription
    ParcelShopStaffed pickup location (PPL Parcel Shop)
    ParcelBoxSelf-service parcel locker (PPL Parcel Box)
    AlzaBoxAlzaBox terminal (partner)

    7.8 Selected Access Point Structure (DetailResponseModel)#

    Object returned in e.detail of the ppl-accesspointwidget-select event and by the getSelectedAccessPoint() method:
    Note: All fields are optional (nullable). Always check for the presence of values when processing.

    7.9 Configuration Priority#

    Configuration is merged according to priority rules. The e-shop cannot extend server restrictions (set by the API key), only narrow them.
    1.
    Server configuration (API claims by api-key) → Default settings from widget admin
    2.
    Init parameters (config attribute / widgetConfig) → Overrides (or narrows) the default settings
    3.
    URL parameters → Highest priority
    Integration recommendations:
    If you specify no parameters in config, the widget uses exclusively the default configuration from the admin — this is sufficient in most cases.
    Use the config attribute only for parameters that differ from the default admin settings — typically dynamic cart data, pre-selected access point, map centering, or a page-level viewMode override.
    Global settings (default language, country, allowed AP types, viewMode, economyMode) are best managed in the widget admin, not in the integration source code — changes then do not require a deployment.
    Narrowing example: The server allows countries ["CZ", "SK", "HU"], the e-shop sets allowedCountries: ["CZ", "DE"] → the result is ["CZ"] (intersection). "DE" is not permitted by the server and will be ignored.
    Modified at 2026-04-22 12:04:29
    Previous
    6. Integration: React
    Next
    8. Advanced Scenarios
    Built with