Skip to content

Skroutz Marketplace Integration

Flow ID: IN-02 Module(s): eshop, webhooks, feeds, Transporters/Skroutz Complexity: High Last Updated: 2026-04-03

Business Context

Full Skroutz SmartCart integration covering: webhook-based order reception, admin accept/reject with stock validation, XML product feed generation, invoice upload, and Skroutz Last Mile courier integration.

Components

1. Order Reception (webhook): ecommercen/webhooks/AdvSmartCart.php receives new_order and order_updated events. New orders must have state='open'. Express orders auto-accept when state transitions to 'accepted'.

2. Order Management (admin): Adv_skroutz_orders_admin.php — listing with status filter, accept with stock validation + pickup window/location selection, reject with line-item reasons or order-level reason.

3. Product Feed: ecommercen/feeds/controllers/AdvSkroutzXml.php generates XML with: uid, name, image, category breadcrumb, VAT, manufacturer, EAN, stock, price, availability, weight, size, color. Supports color splitting (separate items per color variant).

4. Invoice Upload: SkroutzOrders::uploadInvoice() — POST multipart PDF to Skroutz API.

5. Skroutz Last Mile Courier: src/Transporters/Skroutz/Skroutz.php — createVoucher, cancelVoucher, trackAndTrace, getVoucherPdf, getPickingPoints. REST JSON with Bearer auth.

Order Acceptance Flow

  1. Admin reviews order in listing
  2. Stock validated: getLiveProductsParsed() checks per-SKU stock >= quantity (bypassable via DISABLE_PRODUCT_STOCK_CHECK)
  3. API call: SkroutzOrders::acceptOrder() with pickup params
  4. Create fake cart + guest customer → create_order_admin() with status=PAID, provider='skroutz_smart_cart'
  5. Fire afterOrderSuccessHooks() (ERP sync)

Product Matching

Line items matched via shop_product.skroutz_id (UID). Size/color resolved from registry-configured attribute/variation groups (AFFILIATION_ATTRS_GROUPS.GROUPS_FOR_SIZE/COLOR).

Key Tables

TablePurpose
skroutz_ordersOrder header (code, state, courier, expires_at, customer, address)
skroutz_line_itemsOrder items (shop_uid, product_name, quantity, price, size, color)
skroutz_invoice_detailsInvoice data (company, VAT, DOY) for B2B orders

Registry Configuration

KeyPurpose
SMARTCART.IS_ENABLEDMaster toggle
SMARTCART.API_URLSmartCart API base URL
SMARTCART.API_KEYAPI bearer token
SMARTCART.DISABLE_PRODUCT_STOCK_CHECKBypass stock validation
XML_FEEDS.IS_ENABLED_SKROUTZEnable XML feed
XML_FEEDS.SKROUTZ_TOKENFeed authentication

Live Testing Findings

Order Volume: Live database contains 46,246 Skroutz orders (2021-07 to 2022-12) with 102,463 line items, averaging ~2.2 items per order. This makes Skroutz the dominant marketplace channel by a wide margin.

Marketplace Comparison: Skroutz is the only active marketplace in this client's database. All other marketplace integrations show 0 rows:

MarketplaceOrders
Skroutz46,246
Shopflix0
Public0
IRIS0
JCC0

REST API: The endpoint rest/marketplace/skroutz/order returns HTTP 200 with proper JWT authentication, confirming the REST layer is operational.