Public API
How to get the API key
To start using Public API, you’ll first need to retrieve your unique API key. Follow these steps:
From the Navigation Tab, click on Settings.
Scroll down to the Public API section.
Locate your API key and click Copy to save it to your clipboard.
⚠️ Note: Keep your API key secure. Do not share it publicly or expose it in client-side code.
Rule endpoints
There are fields of rule, you need to understand:
Customers
id
Unique identifier for the customer in your system
birthday
Customer's date of birth
shopifyCustomerId
The corresponding customer ID from your Shopify store.
email
string
Customer's email address
points
Total loyalty points the customer has accumulated
status
boolean
Indicates the current status of the customer account
createdAt
Timestamp of when the customer record was created
updatedAt
Timestamp of the last update to the customer record
Rewards
id
Unique identifier for the reward record
type
The category of the reward event
settingType
description
oldPoints
newPoints
createdAt
updatedAt
Activities
id
shopifyDiscountId
discountCode
description
status
createdAt
updatedAt
List all customers
GET
/rest-api/v1/customers
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
// Some code
Return a single customer
GET
/rest-api/v1/customers/{id}
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
Update birthday
POST
/rest-api/v1/customers/updateBirthday
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
List all rewards
GET
/rest-api/v1/rewards
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
List all activities
GET
/rest-api/v1/activities
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
Update points
POST
/rest-api/v1/points/add
POST
/rest-api/v1/points/substract
POST
/rest-api/v1/points/update
<Description of the endpoint>
Headers
Content-Type
application/json
Authorization
Bearer <token>
Body
name
string
Name of the user
age
number
Age of the user
Response
{
"id": 1,
"name": "John",
"age": 30
}
Last updated