Skip to main content
Use Your shop API when your store doesn’t run on Shopify or WooCommerce. You add a few read endpoints to your backend that answer in the JSON shape below, and Kai can then:
  • look up orders (“Where is my order?”),
  • recommend products from your live catalogue,
  • start returns, and
  • check and share discount codes.
Kai shows the results as cards in the chat, and your team sees the customer’s orders in the inbox. Connect it under Project settings → Integrations → Add integration → Your shop API. Enter the base URL and the headers Gleap should send (for example an API key), then click Test connection.

How Gleap calls your API

All paths below are relative to your base URL. With the base URL https://shop.example.com/api/gleap, products are read from https://shop.example.com/api/gleap/products.
Gleap validates every answer. An entry that doesn’t match the shape below is skipped, never half-used. Gleap also re-checks the results itself, so an order is only shown when its number and email really match.

Endpoints

Products

GET /products?q=hiking%20boots&max_price=120&in_stock=true&limit=6
GET /products/{id} returns { "product": { … } } in the same shape, or 404.

Orders

GET /orders/1042?email=sam%40example.com The number is URL-encoded, without a leading #. email is the address the customer gave in the chat; when Gleap knows the signed-in customer, it is their email from /customers. You may return 404 when the email doesn’t match. Gleap checks it again either way.
GET /orders?customer_id=cus_311&limit=5 and GET /orders?email=sam%40example.com&limit=5 return { "orders": [ … ] }, newest first. Gleap drops any order that doesn’t belong to that customer or email.

Customers

GET /customers?email=sam%40example.com and GET /customers?user_id=user_1842 return:
user_id is the user id your app passes to Gleap.identify with identity verification. Return only the customer with exactly that user id, and include it as userId. Gleap drops any customer whose userId (or, for email lookups, email) doesn’t match.

Discount codes (optional)

GET /discounts/SPRING10 returns 404 for an unknown code, or:
Return "valid": false for codes that are expired or used up. Kai only shares a code after this check says it is valid. applyUrl is optional: the Apply to bag button on the offer card opens it.

Returns (optional)

Kai never starts a return on its own. It shows the customer a confirm card, and Gleap calls this endpoint once, when the customer taps Start return (or when a teammate approves a return an AI agent asked for). POST /returns
With a labelUrl, the customer gets the label link in the chat. Without one, Kai tells them your team emails the label.

Money

amount is in major units (a number or a numeric string such as "89.90"). currency is the 3-letter ISO code. Gleap formats prices in the customer’s language.

Who sees order data

Products and discount codes are public. Orders are only shown to the order’s customer:
  • Signed-in customers (identity verification on): Gleap asks /customers?user_id= with the verified user id and shows that customer’s orders.
  • Everyone else has to give the order number and the email used for the order. Kai asks for both with a small form. A wrong email gets the same answer as an unknown number, and after 5 failed tries in one conversation Kai stops looking up orders.
Gleap never lists orders for an email alone, and never sends your headers or keys to the browser or into a chat card.

Kai’s switches

Each connection has four switches under Integrations → Your shop API:

Test connection

Test connection calls GET /products?q=test&limit=3 with your headers. It passes when your API answers 200 with { "products": [ … ] }; an empty list is fine.