Loyalty
Introduction:
In this article we talk about API requests related to the Fideltour Loyalty module.
The sections of the Swagger which include this information are:
Use cases:
This part of the API is very useful in incorporating and managing contacts into the Fideltour loyalty programme from various data sources.
- Record a Fideltour contact in the customer loyalty program.
- Update contact details related to the loyalty programme:
- Update contact level
- Update contact points
- Update contact level points
- List and filter operations related to the loyalty programme
- Create an operation to grant loyalty points to a contact registered in the program.
- Create an operation to redeem loyalty points to a contact registered in the program.
- Log in to the loyalty programme
- Request a password change for the loyalty program account
Available methods:
All the methods and filters available for working with loyalty and can be found in the Swagger links mentioned above.
In this article we focus on the following:
Sign In
Record a contact in the loyalty program.
Parameter table:
| | | |
| | | Contact password for your Guest Portal |
| | | An activation email is sent to the contact |
| | | A welcome email sent to the contact |
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:
- { {
- "password":"UTendyE!?",
- "send_activation_email":false,
- "send_welcome_email":false,
- }
Answer:
In case of a 200 or 201 response, JSON received owns all the contact information
Update data
Update a contact's loyalty data
Parameter table:
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:
- { {
- "level":2673,
- "points":200 200 200
- "level_points":100 100 100
- }
Answer:
In case of a 200 or 201 response, JSON received owns all the contact information
Login
Log in to the loyalty program.
Parameter table:
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:
Answer:
In case of a 200 response, JSON received owns all the contact information
Reset password
Reset your password to access the loyalty program.
Parameter table:
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:
Answer:
In case of a 200 response, if there is a contact with the email entered, an email is sent with the new password set by Fideltour.
Get operations
List and filter customer loyalty programme operations
Parameter table:
No mandatory parameters, see all available filters in
Swagger
Request:
Method: get
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "count":5,
- "next":null,
- "previous":null,
- "results":[ [ [
- { {
- "id":405283,
- "contact_email":"pserra@customia.com",
- "book_room_number":null,
- "points":100 100 100,
- "expired_points":null,
- "consumed_points":- - -100 100 100,
- "remaining_points":0,
- "level_points":0,
- "bonus_points":"0.00",
- "timestamp":"2023-11-13T12:11:03.746192",
- "comments":null,
- "concept":"test",
- "code":"2991559E1a",
- "redeemed":0,
- "point_type":0,
- "expired_date":"2023-11-13T12:11:03.745212",
- "updated_at":"2023-11-13T12:11:03.784747",
- "contact":11656629,
- "product":null,
- "book":null,
- "manager":3738,
- "hotel":null
- },
- ]
- }
Get operation
Get an ID operation of the customer loyalty program
Parameter table:
| | | |
| | | Id of the operation sent in the URL |
Request:
Method: get
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "id":405278,
- "contact_email":"pserra@customia.com",
- "book_room_number":null,
- "points":100 100 100,
- "expired_points":null,
- "consumed_points":- - -100 100 100,
- "remaining_points":0,
- "level_points":0,
- "bonus_points":"0.00",
- "timestamp":"2023-11-13T12:05:43.309364",
- "comments":null,
- "concept":"test",
- "code":"B0937118e5",
- "redeemed":0,
- "point_type":0,
- "expired_date":"2023-11-13T12:05:43.308445",
- "updated_at":"2023-11-13T12:05:43.342388",
- "contact":11656629,
- "product":null,
- "book":null,
- "manager":3738,
- "hotel":null
- }
Add points
Create an operation to add points to a loyalty program contact.
Parameter table:
| | | |
| | | |
| | | |
| | | Points added to the contact |
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "contact":11656629,
- "concept":"reservations 2023",
- "points":500 500 500
- }
Redeem points
Create an operation to redeem points to a loyalty program contact.
Parameter table:
| | | |
| | | |
| | | |
| | | Points remaining from the contact |
Request:
Method: post
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "contact":11656629,
- "concept":"redeemed product",
- "points":100 100 100
- }
Get products
List and filter customer loyalty program products
Parameter table:
No mandatory parameters, see all available filters in Swagger
Request:
Method: get
Headers:
- Content-type: application/json
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "count":6,
- "next":null,
- "previous":null,
- "results":[ [ [
- { {
- "id":12345,
- "title":"We are looking forward to having you with us again.",
- "category":2,
- "image":"https://example/fideltour/media/product-image.jpg",
- "points":12345,
- "featured":false,
- "start_date":"2022-12-01",
- "end_date":"2024-12-31",
- "code":"Repeater1",
- "is_visible":true,
- "promocode":null,
- "notify_alert_emails":true,
- "hotels":[ [ [
- 12345,
- 12345,
- 12345,
- ],
- "levels":[ [ [
- 12345,
- 12345,
- 12345
- ]
- },
- ]
- }
Get product
Get a product by customer loyalty program ID
Parameter table:
| | | |
| | | Id of the product sent in the URL |
Request:
Method: get
Headers:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:
- { {
- "id":12345,
- "title":"We are looking forward to having you with us again.",
- "category":2,
- "image":"https://example/fideltour/media/product-image.jpg",
- "points":12345,
- "featured":false,
- "start_date":"2022-12-01",
- "end_date":"2024-12-31",
- "code":"Repeater1",
- "is_visible":true,
- "promocode":null,
- "notify_alert_emails":true,
- "hotels":[ [ [
- 12345,
- 12345,
- 12345,
- ],
- "levels":[ [ [
- 12345,
- 12345,
- 12345
- ]
- }