Skip to content

eCommerce

Protokol eCommerce is an integration for running your online store directly inside your Protokol project. It provides storefront configuration, custom domain management, and cart/product settings.

Warning

This integration is currently disabled and not available for installation. It will become available once the rollout criteria are met.


Overview

Key characteristics:

  • Storefront configuration — manage product display, cart settings, pricing, i18n, and homepage layout
  • Custom domains — add, validate, and remove custom domains for your storefront
  • Onboarding flow — guided setup is required before use
  • Environment-aware — separate dev and live environment settings

Getting Integration Settings

import { Ecommerce } from "@ptkl/sdk/beta"

const ecommerce = new Ecommerce()
const settings = await ecommerce.get()

console.log(settings) // current ecommerce settings
curl -X GET https://lemon.protokol.io/luma/integrations/v1/protokol-ecommerce \
  -H "Authorization: Bearer $TOKEN"

Updating Storefront Settings

import { Ecommerce } from "@ptkl/sdk/beta"

const ecommerce = new Ecommerce()
const updated = await ecommerce.update({
  company_name: "My Store",
  company_description: "Best products online",
  cart_settings: {
    enabled: true,
  },
})
curl -X PUT https://lemon.protokol.io/luma/integrations/v1/protokol-ecommerce \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "company_name": "My Store",
    "company_description": "Best products online",
    "cart_settings": { "enabled": true }
  }'

Custom Domain Management

Check Base Domain Availability

import { Ecommerce } from "@ptkl/sdk/beta"

const ecommerce = new Ecommerce()
const check = await ecommerce.checkBaseDomain("mystore.example.com")

console.log(check.available) // true or false
curl -X POST https://lemon.protokol.io/luma/integrations/v1/protokol-ecommerce/domains/check \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{ "domain": "mystore.example.com" }'

Add a Custom Domain

const result = await ecommerce.addCustomDomain("mystore.example.com")
console.log(result.token) // DNS verification token

Validate Domain

const validated = await ecommerce.validateCustomDomain(
  "mystore.example.com",
  "verification-token-from-add"
)

Remove Domain

await ecommerce.removeCustomDomain("mystore.example.com")

List Domains

const pending = await ecommerce.getPendingDomains()
const validated = await ecommerce.getValidatedDomains()

Permissions

Permission Description
settings Manage eCommerce storefront settings
manage_domains Add, validate, and remove custom domains

SDK Reference

The Ecommerce class is available via the SDK:

import { Ecommerce } from "@ptkl/sdk/beta"

// Or via the Integrations facade
import { Integrations } from "@ptkl/sdk/beta"
const integrations = new Integrations()
const ecommerce = integrations.getEcommerce()
Method Description
ecommerce.get() Get current ecommerce settings
ecommerce.update(settings) Update storefront settings
ecommerce.checkBaseDomain(domain) Check domain availability
ecommerce.addCustomDomain(domain) Add a custom domain
ecommerce.validateCustomDomain(domain, token) Validate domain ownership
ecommerce.removeCustomDomain(domain) Remove a custom domain
ecommerce.getPendingDomains() List pending domain verifications
ecommerce.getValidatedDomains() List validated custom domains