REST API for merchants to access products, orders, customers, events and analytics.
Base URL: https://cart.melyx.id/api/v1.php
All API requests require a Bearer token. Generate one in your merchant dashboard → API Keys.
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://cart.melyx.id/api/v1.php?action=products
?action=productsList all your products with prices.
| Param | Type | Default |
|---|---|---|
| page | int | 1 |
| limit | int | 20 (max 100) |
{"data":[{"id":1,"name":"TrustedWeb","type":"digital","prices":[{"id":1,"name":"Tier 1","amount":"59.00","billing_type":"one_time"}]}]}
?action=ordersList orders with customer info. Filter by status.
| Param | Type | Default |
|---|---|---|
| status | string | all (paid/refunded/pending/failed) |
| page, limit | int | 1, 20 |
?action=customersList customers with LTV and order count.
?action=eventsList behavior tracking events. Filter by type.
| Param | Type | Values |
|---|---|---|
| type | string | page_view, product_view, add_to_cart, checkout_start, checkout_complete, abandon, upsell_accept, bump_check, coupon_apply |
?action=statsDaily revenue stats (gross, net, orders, conversion, abandon rate).
| Param | Type | Default |
|---|---|---|
| days | int | 30 (max 90) |
?action=tax&country=IEGet tax rate for a country. No auth required.
Embed on checkout pages to track visitor behavior:
<script src="https://cart.melyx.id/assets/tracker.js" data-merchant="YOUR_MERCHANT_ID" data-product="PRODUCT_ID" data-page="PAGE_ID"></script>
JavaScript API:
SmartCart.checkoutStart(priceId) SmartCart.checkoutComplete(orderId) SmartCart.checkoutFail(reason) SmartCart.addToCart(priceId) SmartCart.bumpCheck(bumpId) SmartCart.upsellAccept(step, priceId) SmartCart.couponApply(code)
Embed a buy button on any website:
<div data-smartcart-buy="BUTTON_CODE"
data-smartcart-label="Buy Now"
data-smartcart-color="#8b5cf6"
data-smartcart-style="popup"></div>
<script src="https://cart.melyx.id/assets/buy-button.js"></script>
Options: data-smartcart-size (small/medium/large), data-smartcart-style (popup/redirect), data-smartcart-dark (true/false)
Configure in dashboard → Notifications. Events:
| Event | When |
|---|---|
order.paid | Payment captured successfully |
order.refunded | Refund processed |
subscription.new | New subscription created |
subscription.cancelled | Subscription cancelled |
customer.new | New customer registered |
Signature header: X-SmartCart-Signature: t=timestamp,v1=hmac
60 requests/minute per API key. 429 returned when exceeded.