← Marketing API
LoyaltyPrograms
Singular: LoyaltyProgram — Base URL: https://marketing-api.ayoune.app — Access: CRUD — Machine-readable spec (JSON · YAML)
Try it now
beta
Response (live)
Requests are proxied through the consumer-app to *.ayoune.app. Tokens stay in your browser and are forwarded per call.
Example response (recorded) sample
A real, previously recorded GET /:id response of this endpoint — not the live call above. Sensitive fields are masked.
{
"payload": {
"_id": "65e0b12e121b7d48fe159196",
"type": "points",
"min_revenue": 0,
"percent": 0,
"points": 0,
"point_value": 0,
"invitations": 5,
"validDays": 30,
"sameLink": true,
"inUse": 0,
"customPrefix": "",
"isDraft": true,
"createdBy": "6045f4d25704710012485569",
"createdAt": "2024-02-29T16:30:38.377Z",
"updatedAt": "2024-02-29T16:30:38.377Z",
"shares": []
},
"meta": {
"links": [
{
"rel": "self",
"href": "https://marketing-api.ayoune.app/loyaltyprograms/65e0b12e121b7d48fe159196",
"method": "get",
"title": "GET",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
}
],
"relations": [],
"debugId": "6aa37dfce7af9185f0f6ecca",
"errors": [],
"actions": [
{
"rel": "self",
"action": "COPY",
"title": "MODEL_LOYALTYPROGRAM",
"href": "https://api.ayoune.app/marketing/loyaltyprograms/65e0b12e121b7d48fe159196/copy",
"method": "post",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
},
{
"rel": "self",
"action": "DELETE",
"title": "MODEL_LOYALTYPROGRAM",
"href": "https://api.ayoune.app/marketing/loyaltyprograms/65e0b12e121b7d48fe159196",
"method": "delete",
"types": [
"application/json",
"application/yaml",
"text/csv"
]
}
],
"version": {
"host": "2026.38.0",
"core": "2026.334.1"
},
"rateLimit": {
"limit": "2500",
"remaining": "1982",
"reset": "1789102955",
"resetDate": "Fri Sep 11 2026"
},
"responseTime": 23.06746,
"code": 200,
"status": "success",
"error": false
}
}
Endpoints
| Method | Path | Description | Right |
|---|---|---|---|
| GET | /loyaltyprograms |
List with filters/pagination | marketing.loyaltyprograms.view |
| GET | /loyaltyprograms/:id |
Single record | marketing.loyaltyprograms.view |
| POST | /loyaltyprograms |
Create new record | marketing.loyaltyprograms.new |
| PUT | /loyaltyprograms |
Update record | marketing.loyaltyprograms.edit |
| DELETE | /loyaltyprograms/:id |
Delete record | marketing.loyaltyprograms.delete |
SDK
import { aYOUne } from '@tolinax/ayoune';
const ay = new aYOUne('pat_your_token');
// List all
const list = await ay.marketing.loyaltyPrograms.find().limit(10).exec();
// Single record
const one = await ay.marketing.loyaltyPrograms.findById('OBJECT_ID').exec();
// Create
const created = await ay.marketing.loyaltyPrograms.create({ name: 'Foo' });