Skip to content
Cartly Developers

Apps API

Build integrations with Zapier, Make.com, and custom apps using the Cartly REST Apps API and REST Hooks.

Overview

The Cartly Apps API powers official integrations like Zapier and Make.com and is available to any OAuth 2.0 authorized app. Two interaction patterns:

  • REST Hook triggers — subscribe a URL for push-based real-time events (used by Zapier and Make)
  • Action endpoints — create customers, update orders, adjust inventory, create discounts

Authentication

All Apps API requests require an OAuth 2.0 access token in the Authorization: Bearer header. Complete the OAuth 2.0 flow to obtain a token.

bashGET /apps/api/me
curl "https://cartly.pro/apps/api/me" \
  -H "Authorization: Bearer ACCESS_TOKEN"

# Response
# { "id": "...", "name": "My Store", "domain": "shop.example.com",
#   "shop_domain": "my-store.mycartly.pro",
#   "email": "owner@example.com", "currency": "USD", "plan": "growth" }
# shop_domain = the X-Cartly-Shop-Domain header of this shop's webhook deliveries:
# store it and join deliveries on it (domain is the custom domain when one is set).

REST Hooks (Triggers)

REST Hooks are push-based event delivery. Your app registers a URL; Cartly POSTs to it instantly when events occur. Zapier and Make.com use this for instant (non-polling) triggers. Pass your own secret when you register a hook: without it you cannot verify signatures. A topic Cartly does not emit is refused with a 400 (code webhook.unknown_topic) whose message lists the supported topics.

EventDescription
order.createdNew order placed in the store
order.fulfilledOrder marked as fulfilled
order.cancelledOrder cancelled
product.createdNew product added to catalog
product.updatedProduct details updated
customer.createdA customer account is created through the Headless Storefront API or the Apps API
cart.abandonedCart left without checkout for configured delay
bashRegister and unregister REST Hooks
# Register a REST Hook (pass your own secret: you need it to verify signatures)
curl -X POST "https://cartly.pro/apps/api/webhooks" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://hooks.zapier.com/...", "events": ["order.created"], "secret": "YOUR_SIGNING_SECRET"}'

# Unregister (WEBHOOK_ID = the id, a UUID, returned when you registered it)
curl -X DELETE "https://cartly.pro/apps/api/webhooks/WEBHOOK_ID" \
  -H "Authorization: Bearer ACCESS_TOKEN"

API Endpoints

MethodPathDescription
GET/apps/api/meReturns the authenticated shop: id, name, domain (the custom domain when set), shop_domain, email, currency, plan. shop_domain is the value webhook deliveries send in X-Cartly-Shop-Domain — the key to join deliveries to the shop
GET/apps/api/customersList customers with optional email filter
POST/apps/api/customersCreate a new customer
PUT/apps/api/customers/:idUpdate customer fields
PUT/apps/api/orders/:idUpdate an order's fulfillment: fulfillment_status = fulfilled | partial | unfulfilled (omit to leave it unchanged; any other value is a 400), tracking_number, tracking_company, tracking_url (stored only together with a tracking_number or tracking_company); a note field is accepted but not stored. Marking a Klarna order fulfilled captures its payment first — a failed capture is a 422 and the fulfillment status is unchanged (retry)
PUT/apps/api/inventory/:variant_idSet the available quantity of a variant at a location: available is required (missing → 400, never read as 0); default location unless location_id (a shop with no active location → 409); a location that doesn't stock the variant → 404
POST/apps/api/discountsCreate a discount code
GET/apps/api/webhooksList registered REST Hook subscriptions
POST/apps/api/webhooksRegister a new REST Hook URL
DELETE/apps/api/webhooks/:idUnregister a REST Hook
bashPOST /apps/api/customers
curl -X POST "https://cartly.pro/apps/api/customers" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"email": "jane@example.com", "first_name": "Jane"}'
bashPUT /apps/api/orders/:id
curl -X PUT "https://cartly.pro/apps/api/orders/ORDER_ID" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"fulfillment_status": "fulfilled", "tracking_company": "DHL", "tracking_number": "1Z999"}'
bashPUT /apps/api/inventory/:variant_id
curl -X PUT "https://cartly.pro/apps/api/inventory/VARIANT_ID" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"available": 12}'  # sets the available quantity (default location; add location_id for another)
bashPOST /apps/api/discounts
curl -X POST "https://cartly.pro/apps/api/discounts" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"code": "SUMMER20", "type": "percentage", "value": 20}'

Webhook Headers

Every REST Hook delivery includes:

  • X-Cartly-Hmac-Sha256 — HMAC-SHA256 signature of the raw body, prefixed with sha256= (deprecated: no replay protection)
  • X-Cartly-Signature-V2 — t=<unix seconds>,v1=<hex>, HMAC-SHA256 of t + "." + raw body — verify this one and reject stale timestamps
  • X-Cartly-Event-Id — the event's id, the same on every delivery of it: dedupe on it
  • X-Cartly-Shop-Domain — the shop's <slug>.mycartly.pro host, never its custom domain (e.g. mystore.mycartly.pro) — the same value as shop_domain from GET /apps/api/me: join deliveries to the shop on it
  • X-Cartly-Webhook-Id — unique ID of the webhook subscription
httpExample webhook delivery
POST https://your-endpoint.com/cartly-hook
Content-Type: application/json
X-Cartly-Signature-V2: t=1760000000,v1=<hex HMAC-SHA256 of "t.<raw body>">
X-Cartly-Timestamp: 1760000000
X-Cartly-Hmac-Sha256: sha256=<hex HMAC-SHA256 of the raw body>  (deprecated)
X-Cartly-Event-Id: 0b6f7f0e-6a39-4f0c-9d0a-2f6c1d1e9a11
X-Cartly-Webhook-Id: <subscription id>
X-Cartly-Shop-Domain: mystore.mycartly.pro

{"event": "order.created", "timestamp": "2026-10-07T12:00:00Z", "data": {...}}
javascriptSignature verification (Node.js)
import crypto from "crypto";

// X-Cartly-Signature-V2: "t=<unix seconds>,v1=<hex HMAC-SHA256(secret, t + "." + raw body)>"
function verifyCartlyWebhook(rawBody, header, secret, toleranceSeconds = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false; // stale / replayed
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const got = Buffer.from(parts.v1 ?? "", "hex");
  const want = Buffer.from(expected, "hex");
  return got.length === want.length && crypto.timingSafeEqual(got, want);
}

// Express handler — verify the RAW body
app.post("/cartly-hook", express.raw({ type: "application/json" }), (req, res) => {
  const header = req.headers["x-cartly-signature-v2"] ?? "";
  if (!verifyCartlyWebhook(req.body.toString("utf8"), header, process.env.WEBHOOK_SECRET)) {
    return res.status(401).json({ error: "Invalid signature" });
  }
  // dedupe on req.headers["x-cartly-event-id"]
  res.status(200).json({ received: true });
});

When a Store Uninstalls Your App

The app's access tokens are revoked and its REST hooks stop receiving events right away. A hook subscribed to app/uninstalled still receives that one event and is then removed. See the Webhooks guide.

Zapier Integration

Install from the Cartly App Store or directly on Zapier. Automate with 6,000+ apps — no code required.

  • Triggers (7): New Order, Order Paid, Order Fulfilled, New Product, New Customer, Inventory Updated, Abandoned Cart
  • Actions (4): Create Customer, Update Order, Adjust Inventory, Create Discount
  • Searches (2): Find Customer by email, Find Order by number

All triggers use REST Hooks for instant delivery. Zapier registers the webhook when a Zap is turned on and removes it when turned off.

Make.com Integration

Available on Make.com. Build multi-step scenarios with full data mapping.

  • Instant Triggers (5): New Orders, New Products, Product Updates, New Customers, Abandoned Carts
  • Actions (4): Create Customer, Update Order, Adjust Inventory, Create Discount
  • Searches (2): Search Customer, Search Order

For browser-redirect flows (required by Zapier and Make.com), redirect merchants to the Cartly OAuth consent page. After approval, Cartly redirects to your redirect_uri with a code parameter. Exchange it, with your PKCE code_verifier, for an access token at POST /oauth/token. See the Authentication guide for the full flow.

httpOAuth authorization URL
GET https://cartly.pro/oauth/authorize
  ?response_type=code
  &client_id=YOUR_CLIENT_ID
  &redirect_uri=https://your-app.com/callback
  &scope=shop:read%20orders:read%20customers:write%20webhooks:manage
  &state=random_csrf_token
  &code_challenge=BASE64URL_SHA256_OF_CODE_VERIFIER
  &code_challenge_method=S256

Marketplace Install

A merchant who installs your app from the Cartly marketplace is sent to your app's Install URL with shop, shop_id, install_id, timestamp and an hmac signed with your client_secret. Verify the hmac, then start the OAuth flow above with your own state and PKCE code_challenge. Forward install_id to /oauth/authorize to lock the consent page to that shop. Without an Install URL, the merchant connects the app from your site, as with Zapier and Make. See Marketplace Install for the parameters and how to verify them.