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()—SelectedAccessPointModel | 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-selectSelectedAccessPointModel (see 7.8) - same type regardless of where the user selected the locationUser 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"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
    slSlovenian
    Insert into a website:
    <ppl-access-point-widget
     id="pplWidget"
     api-key="**************************"
     config='{"viewMode":"modal","defaultCountry":"cz","defaultLang":"de"}'
    ></ppl-access-point-widget>

    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 (SelectedAccessPointModel)#

    Object returned in e.detail of the ppl-accesspointwidget-select event and by the getSelectedAccessPoint() method:
    The object always has the same structure, regardless of where the user selected the location (list of nearby places, place details, saved places, or the most recently selected place). The widget constructs it using data common to all sources; no additional API call is made for this purpose.
    Note:
    • All fields are optional (nullable). Always check for the presence of values when processing.
    • typecontains the type name from the pickup point directory (ParcelShop, ParcelBox, AlzaBox), not the internal API code.
    • accessPointType is deprecated and always holds the same value as type. It is retained for backward compatibility and will be removed in version 2.0; use only type for new integrations.
    • The fields additionalNote (pickup point note) and urlPath (path to the location details on ppl.cz) are reserved; they are always present in the object but currently hold a null value. Only some of the data sources used to construct the object provide this information, meaning the object would otherwise differ depending on the selection method. Once this data is available across all sources, these fields will be populated without requiring further changes to the API contract. Account for them in your integration, but do not rely on their values for the time being.

    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 (packageWeight, codRequired, …), pre-selected access point (accessPointCode), map centering (centeredToAddress) 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-10-08 07:12:24
    Previous
    6. Integration: React
    Next
    8. Advanced Scenarios
    Built with