Quick Start
Make your first authenticated calls to the Weave API — create a customer and read it back — in a few minutes.
Prerequisites
- An API key (
llk_<keyId>_<secret>). Create one in the dashboard under Developers → API Keys — see Authentication. - A way to make HTTP requests:
curl, orfetchfrom any language.
The API is served from https://api.loomloyalty.com. Every request carries your key as a bearer token, and every response is JSON.
1. Set your key
Keep the key out of source control — read it from an environment variable:
export LOOM_API_KEY="llk_<keyId>_<secret>"
2. Create a customer
An individual customer needs at minimum a first name. Send a POST to /customers:
curl -X POST https://api.loomloyalty.com/customers \
-H "Authorization: Bearer $LOOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identity": { "firstName": "Ada", "lastName": "Lovelace" },
"externalId": "user-1001"
}'
Responses are wrapped in a standard envelope; the created customer is under data:
{
"success": true,
"eventId": "…",
"eventDateTime": "…",
"data": {
"customerId": "…",
"externalId": "user-1001"
}
}
Save data.customerId — you'll use it to read the customer back.
3. Read the customer back
curl https://api.loomloyalty.com/customers/CUSTOMER_ID \
-H "Authorization: Bearer $LOOM_API_KEY"
The same envelope comes back with the customer under data.
The same flow with fetch
const BASE_URL = "https://api.loomloyalty.com";
const headers = {
Authorization: `Bearer ${process.env.LOOM_API_KEY}`,
"Content-Type": "application/json",
};
// Create
const created = await fetch(`${BASE_URL}/customers`, {
method: "POST",
headers,
body: JSON.stringify({ identity: { firstName: "Ada", lastName: "Lovelace" } }),
}).then((r) => r.json());
const customerId = created.data.customerId;
// Read back
const fetched = await fetch(`${BASE_URL}/customers/${customerId}`, { headers }).then((r) =>
r.json()
);
console.log(fetched.data);
Next Steps
- Learn the Core Concepts behind customers, programs, and points
- Handle errors and status codes and pagination
- Subscribe to webhooks for real-time events
- Browse the full API Reference