Developer notes
Technical reference for developers who customize Hepsiburada Marketplace Connector.
Add-on identity
Section titled “Add-on identity”| Item | Value |
|---|---|
| Add-on id | kv_hepsiburada |
| Function prefix | fn_kv_hepsiburada_ |
| Language variables | kv_hepsiburada.* |
| CSS scope | .kv-hepsiburada |
| PHP namespace | Tygh\Addons\KvHepsiburada |
| Preset | marketplace (generated by kv new --kind integration), extended with the Marketplace Hub |
Structure
Section titled “Structure”The add-on has three layers. Only the last one knows Hepsiburada.
| Layer | Classes | Role |
|---|---|---|
| Base | Client\BaseClient, Accounts, Secret, Config, Access, Queue, Jobs, Log |
HTTP (cURL, TLS verification, timeouts), encrypted credentials per company, settings, job queue (back-off 5 min / 15 min / 1 h / 3 h / 12 h), log with masking and CSV |
Marketplace Hub (Hub\) |
DriverInterface, Hub, Options, Rules, StatusMap, Cache, Categories, Listings, ProductMap, ProductSync, Orders, Shipments, Returns |
Channel independent: category and attribute mapping, price rules and stock buffer, listing builder, product and batch sync, order import with buyer and address mapping, status mapping, shipment steps, returns, per item errors. It talks to the channel only through DriverInterface with normalized arrays (documented in the interface file) |
Driver (Drivers\Hepsiburada\, Client\Api) |
Driver, Mapper, Api |
Api = HTTP calls (Basic auth, User-Agent, endpoints), Mapper = pure translation (unit tested with samples), Driver = the DriverInterface implementation. Hub\Hub::DRIVER names it |
A second channel (N11, Allegro …) is a new add-on built from the same hub with its own Api, Mapper and Driver.
Hepsiburada API calls used
Section titled “Hepsiburada API calls used”Hosts per service (test = the same name with -sit): listing-external (listings), oms-external (orders, packages, claims), mpop (catalog), shipping-external (cargo companies). The mock server answers all of them on one port.
| Purpose | Call |
|---|---|
| Connection test | GET /listings/merchantid/{id}?offset=0&limit=1 (listing) |
| Categories, attributes, values | GET /product/api/categories/get-all-categories, …/categories/{id}/attributes, …/categories/{id}/attribute/{aid}/values (mpop) |
| Import products | POST /product/api/products/import (multipart JSON file, returns a tracking id) |
| Import status | GET /product/api/products/status/{trackingId} |
| Stock and price | POST /listings/merchantid/{id}/inventory-uploads (returns an upload id), GET …/inventory-uploads/id/{uploadId} |
| Orders | GET /orders/merchantid/{id} and …/cancelled (order lines, offset + limit, begindate / enddate) |
| Packages | GET /packages/merchantid/{id}/shipped, …/delivered, …/undelivered |
| Packing (“picking”) | POST /packages/merchantid/{id} (lineItemRequests) |
| Invoice link | PUT /packages/merchantid/{id}/packagenumber/{pn}/invoice |
| Own carrier tracking | POST /packages/merchantid/{id}/packagenumber/{pn}/intransit |
| Cancel lines | POST /lineitems/merchantid/{id}/id/{lineId}/cancelbymerchant |
| Claims | GET /claims/merchantId/{id}, POST /claims/number/{n}/accept |
| Cargo companies | GET /cargoFirms/{id} (shipping) |
Every request carries Authorization: Basic (API user and service key) and User-Agent: <developer user name>.
API conformance (official Hepsiburada documentation)
Section titled “API conformance (official Hepsiburada documentation)”Checked on 2026-11-06 in a real browser (the portal blocks plain HTTP clients) against https://developers.hepsiburada.com, through the portal’s own
public JSON endpoints: /api/v1/public/docs/hepsiburada/<product>/<version>/openapi (the OpenAPI files) and .../<product>/guides/<guide>.
The OpenAPI files are the reference for the paths; the mock server follows them.
| Purpose | What the add-on does | Official source | Verified |
|---|---|---|---|
| Authentication | HTTP Basic (user, password/service key) on every call; the OpenAPI security scheme of all four services is basic. Since the authentication change the integrator’s service key (Account > Information > Integration > Integrator information > Service key) is entered in the integrator’s screens; a renewed key must be entered again |
https://developers.hepsiburada.com/tr/companies/hepsiburada?category=baslangic&product=api-authentication&version=v1.0&guide=entegratore-servis-anahtari-eklemegoruntuleme&view=guide ; order/listing/catalog “Onemli Bilgiler” guides (“API, HTTP Basic Auth. ile korunmaktadir”) | yes |
| User-Agent | Header User-Agent is marked required on the listing operations and the guides tell to send it with the Basic credentials; it carries the developer user name of the integrator (the FAQ authorizes the integrator by its “developer user”) |
listing OpenAPI (getListings), https://developers.hepsiburada.com/api/v1/public/docs/hepsiburada/listeleme/guides/listeleme-entegrasyonu-test-sureci-adimlari ; FAQ entegrasyonda-sikca-sorulan-sorular |
yes. The public pages do not state which value the Basic user takes; the add-on sends the user you enter |
| Hosts | listing-external, oms-external, mpop, shipping-external (test: -sit, live: without -sit) |
OpenAPI servers / host of the four products |
yes |
| Listing | GET /listings/merchantid/{merchantId}, POST /listings/merchantid/{merchantId}/inventory-uploads, GET .../inventory-uploads/id/{id} |
listeleme/v1/openapi |
yes |
| Catalog | GET /product/api/categories/get-all-categories, .../categories/{categoryId}/attributes, .../attribute/{attributeId}/values, POST /product/api/products/import, GET /product/api/products/status/{trackingId} |
katalog-urun-entegrasyonu/v1.0/openapi (server https://mpop-sit.hepsiburada.com/product) |
yes |
| Orders and packages | GET /orders/merchantid/{id}, .../cancelled, `GET |
POST /packages/merchantid/{id}, …/packagenumber/{n}/invoice(PUT),…/intransit(POST),…/shipped |
delivered |
| Claims | GET /claims/merchantId/{id}, POST /claims/number/{claimNumber}/accept |
talep-listeleme/v1.0/openapi |
yes |
| Cargo companies | GET /cargoFirms/{merchantId} |
shipping-entegrasyonu/v1.0/openapi |
yes |
| Limits | order services 1,000 requests per second (429 with X-RateLimit-* headers); catalog 180 requests per minute per IP |
order and catalog “Onemli Bilgiler” guides | yes |
| Webhooks | Hepsiburada offers an order webhook model; the add-on polls instead and exposes no webhook address | guide siparis-webhook-modeli |
not used |
Database tables
Section titled “Database tables”| Table | Purpose |
|---|---|
?:kv_hepsiburada_accounts |
Credentials per company (secrets sealed), last connection check |
?:kv_hepsiburada_log, ?:kv_hepsiburada_jobs |
Log, queue |
?:kv_hepsiburada_product_map |
Product mapping: merchant SKU, listing state (N / P / Y), dirty flags, last pushed values, error |
?:kv_hepsiburada_order_map |
Imported orders, channel status, steps pushed, import error and retry time; the lines column keeps line id, SKU, quantity and the package number |
?:kv_hepsiburada_options |
Rules per account |
?:kv_hepsiburada_category_map, ?:kv_hepsiburada_attr_map |
Category mapping with price rule, attribute mapping |
?:kv_hepsiburada_cache |
Cached reference data (categories, attributes, values, brands) |
?:kv_hepsiburada_batches |
Import tracking ids (p: prefix) and inventory upload ids (i: prefix) waiting for their per item result |
?:kv_hepsiburada_returns |
Claims |
Hooks used
Section titled “Hooks used”PHP hooks: update_product_post (marks the mapped product for the next sync) and delete_product_post (removes its mapping). Template hooks: index:styles (admin styles). The pages come from the add-on’s own controller (kv_hepsiburada) and the menu schema. The storefront controller serves kv_hepsiburada.invoice, a page signed per order that prints the CS-Cart invoice as HTML for Hepsiburada to download.
Test the HTTP layer without Hepsiburada
Section titled “Test the HTTP layer without Hepsiburada”The base URL can be overridden for tests in config.local.php (development only):
$config['kv_hepsiburada_base_url'] = 'http://127.0.0.1:11841';tests/mock-server/server.js follows the documented API (Basic auth, User-Agent rule, batches, packages, claims); tests/unit.php covers the mapping with samples shaped like the documentation; tests/e2e/e2e.mjs drives a whole store against the mock.