Skip to content

E-Commerce API notes

There is one API for the whole platform. There is no separate E-Commerce API, no separate host for it, and no storefront-only key. For the path grammar, access endpoints, authentication, paging, response envelopes and error codes, read the developer integration path:

Integrate an external system →

Every mapping the backend has is under core2/, and the tenant-scoped ones this module uses are under core2/tnt/dm/… (Core2Config.TENANT_DOMAIN_URL_PREFIX). Nothing below is a substitute for that page; it is the e-commerce-specific part.

The document types this module produces

Server document typeProduced byQuantity · amount signumMeaning
INTERNAL_SHOPPING_CART (short code SHPCRT)storefront checkout, Customer Access, Shopping Cart (Internal)0 · 0A pre-order. No journal, no stock
INTERNAL_SALES_ORDERserver conversion of a paid cart, staff knock-off of a FINAL cart, marketplace order-ingestion jobs0 · 0The order. Counts against available stock; no journal, no stock
INTERNAL_RECEIPT_VOUCHERGEN_DOC_PGW_RECEIPT_VOUCHER_PROCESSOR after a gateway callback; the Shopee, TikTok Shop and Lazada payout jobs0 · −1The money. Posts to the cashbook and the debtor; belongs to Financial Accounting

A seller order (bl_mkp_seller_order_hdr) is not a server document type: it is a marketplace-table record with its own controller (mkp/seller-orders), no journal and no stock processor. A payment-gateway transaction (bl_fi_generic_doc_pgw_txn) is likewise a record attached to a document, not a document.

The sales invoice, delivery order and return that follow are Sales document types, and their signums are on that page.

Endpoint families an integration touches

FamilyPath (under core2/tnt/dm/)What it is
Back-office cartserp/gen-doc/internal-shopping-cartsThe generic-document controller the Shopping Cart (Internal) applet uses: create, save, update-posting-status (FINAL), delete
Customer-scoped cartsecom/internal-shopping-cartsThe controller the Customer Access applet uses: one cart per customer entity, the login must be linked to the entity (SHOPPING_CART_ALREADY_EXIST otherwise)
Storefront carts and checkoutcp-commerce/internal-shopping-cartsThe storefront’s own cart endpoint, whose service converts a paid cart to a sales order and handles point purchases
Gateway payments against any documenterp/gen-doc-pgw-paymentsReserve a payment reference for a document and get the signature the gateway expects; the gateway’s callback then queues the receipt-voucher processor
Payment channels and providerspgw/paymentchannels, pgw/payment-providers, pgw/contracts, pgw/contract-ratesThe master data the Payment Channel applet maintains and the storefront reads for its provider list; the provider endpoints have public/… variants the storefront calls anonymously
Mediafm/drives, fm/filesTenant drives and files behind the Media Library applet
Sales orderserp/gen-doc/internal-sales-ordersOrdinary sales orders; see Sales

Each family carries the platform’s permission model (owner / admin / member / read on the entity) and the login-entity-ep variants where a customer, seller or merchant login is scoped to its own entity.

The marketplaces and gateways that exist

These are the third-party platforms with code in the backend. Nothing else may be named as an integration on any page of this module.

KindPlatformsWhere the code is
MarketplacesLazada, Shopee, TikTok Shop, Shopify — full or partial sync cycles; Magento — product retrieval service onlyakaun-api … jobProcessor/custom/ecomSync, jobProcessor/ecomsync; see the EcomSync index for which step each has
Payment gatewaysiPay88, PayPal, FPXcontroller/tenant/dm/pgw/… and domain/paymentGateway/…

The marketplace connectors are jobs, not endpoints: an integration cannot call “sync to Shopee”; it can create the scheduler record that makes the job run, or write the listing and order records the job reads.

Two things an integration must respect

  1. Signum 0 means what it says. Writing an INTERNAL_SALES_ORDER through the API creates an order and nothing else. If your integration expects stock to move or revenue to post, it must create the sales invoice (Sales), or leave that to the warehouse.
  2. A cart’s line integrity is checked at checkout, and revisions are checked on save. The storefront’s conversion runs verifyCartLineIntegrityAtCheckout before it creates the order; a cart edited after the reference was generated fails. Read the revision back before you PUT, as every applet in the platform does.

What the API will not do for you

  • Post a gateway fee, or reconcile a payout against orders (§4 of Core Concepts).
  • Reserve stock on checkout.
  • Trigger a marketplace sync on demand.
  • Serve a storefront: the Customer Portal is a separate application configured per website in CP Commerce Admin, not an API product.
Last updated on