Skip to content
New Webhooks added: Inventory and Order modifications. Check the changelog →
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.

GET /apps/api/me

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

# Response
# { "shop": { "id": "...", "name": "My Store" }, "app": { "name": "Zapier" } }

REST Hook Events (Triggers)

Subscribe a URL to receive push-based real-time events. Zapier and Make.com use this for instant triggers.

NameTypeRequiredDescription
order.createdeventNoFired when a new order is placed
order.updatedeventNoFired when order status changes
order.fulfilledeventNoFired when order is fulfilled
order.canceledeventNoFired when order is canceled
product.createdeventNoFired when a new product is added
product.updatedeventNoFired when product details change
customer.createdeventNoFired when a customer registers
cart.abandonedeventNoFired when cart is abandoned after configured delay

Register and unregister REST Hooks

bash
# Register a REST Hook
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"]}'

# Unregister
curl -X DELETE "https://cartly.pro/apps/api/webhooks/wh_01H8..." \
  -H "Authorization: Bearer ACCESS_TOKEN"

API Endpoints

Available REST endpoints for app integrations.

NameTypeRequiredDescription
GET /apps/api/meendpointNoReturns authenticated shop info and app details
GET /apps/api/customersendpointNoList customers with optional email filter
POST /apps/api/customersendpointNoCreate a new customer
PUT /apps/api/customers/:idendpointNoUpdate customer fields
PUT /apps/api/orders/:idendpointNoUpdate order status or add note
PUT /apps/api/inventory/:variant_idendpointNoAdjust inventory quantity for a variant
POST /apps/api/discountsendpointNoCreate a discount code
GET /apps/api/webhooksendpointNoList registered REST Hook subscriptions
POST /apps/api/webhooksendpointNoRegister a new REST Hook URL
DELETE /apps/api/webhooks/:idendpointNoUnregister a REST Hook

Action Examples

bash
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"}'

Webhook Headers

Every REST Hook delivery includes:

  • X-Cartly-Hmac-Sha256 — HMAC-SHA256 signature of the raw body, prefixed with sha256=
  • X-Cartly-Shop-Domain — the shop storefront domain (e.g. mystore.mycartly.pro)
  • X-Cartly-Webhook-Id — unique ID of the webhook subscription

Zapier Integration

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

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

Make.com Integration

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

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

OAuth Consent Page

For browser-redirect flows (required by Zapier and Make.com), redirect merchants to the Cartly OAuth consent page. See the Authentication guide for the full flow.

Signature verification (Node.js)

javascript
import crypto from "crypto";

function verifyCartlyWebhook(rawBody, signature, secret) {
  const hmac = crypto.createHmac("sha256", secret)
    .update(rawBody, "utf8").digest("hex");
  const expected = `sha256=${hmac}`;
  return crypto.timingSafeEqual(
    Buffer.from(signature), Buffer.from(expected)
  );
}

// Express handler
app.post("/cartly-hook",
  express.raw({ type: "application/json" }),
  (req, res) => {
    const sig = req.headers["x-cartly-hmac-sha256"];
    if (!verifyCartlyWebhook(req.body.toString(), sig, process.env.WEBHOOK_SECRET)) {
      return res.status(401).json({ error: "Invalid signature" });
    }
    res.status(200).json({ received: true });
  }
);