Loyalty

Loyalty

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.
  1. Record a Fideltour contact in the customer loyalty program.
  2. Update contact details related to the loyalty programme:
  3. Update contact level
  4. Update contact points
  5. Update contact level points
  6. List and filter operations related to the loyalty programme
  7. Create an operation to grant loyalty points to a contact registered in the program.
  8. Create an operation to redeem loyalty points to a contact registered in the program.
  9. Log in to the loyalty programme
  10. 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:

Field

Type

Obl.

Description

password

String

Yes

Contact password for your Guest Portal

send_activation_email

Boolean

Yes

An activation email is sent to the contact

send_welcome_email

Boolean

Yes

A welcome email sent to the contact


Request:

Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

BODY: Example below:

  1. { {
  2. "password":"UTendyE!?",
  3. "send_activation_email":false,
  4. "send_welcome_email":false,
  5. }

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:

Field

Type

Obl.

Description

level level

Int

No No

Level ID in Fideltour

points points points

Int

No No

Contact points

level_points

Int

No No

Contact level points


Request:
Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

BODY: Example below:

  1. { {
  2. "level":2673,
  3. "points":200 200 200
  4. "level_points":100 100 100
  5. }
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:

Field

Type

Obl.

Description

email

String

Yes

Contact email

password

String

Yes

Contact password


Request:
Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:

  1. { {
  2. "email":"test@test.com",
  3. "password":"UTendyE!?"
  4. }
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:

Field

Type

Obl.

Description

email

String

Yes

Contact email


Request:
Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Example below:

  1. { {
  2. "email":"test@test.com",
  3. }

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:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Answer:
In case of a 200 or 201 response, the following JSON is received:

  1. { {
  2. "count":5,
  3. "next":null,
  4. "previous":null,
  5. "results":[ [ [
  6. { {
  7. "id":405283,
  8. "contact_email":"pserra@customia.com",
  9. "book_room_number":null,
  10. "points":100 100 100,
  11. "expired_points":null,
  12. "consumed_points":- - -100 100 100,
  13. "remaining_points":0,
  14. "level_points":0,
  15. "bonus_points":"0.00",
  16. "timestamp":"2023-11-13T12:11:03.746192",
  17. "comments":null,
  18. "concept":"test",
  19. "code":"2991559E1a",
  20. "redeemed":0,
  21. "point_type":0,
  22. "expired_date":"2023-11-13T12:11:03.745212",
  23. "updated_at":"2023-11-13T12:11:03.784747",
  24. "contact":11656629,
  25. "product":null,
  26. "book":null,
  27. "manager":3738,
  28. "hotel":null
  29. },
  30. ]
  31. }

Get operation

Get an ID operation of the customer loyalty program

Parameter table:

Field

Type

Obl.

Description

id

Int

No No

Id of the operation sent in the URL


Request:
Method: get
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Answer:
In case of a 200 or 201 response, the following JSON is received:

  1. { {
  2. "id":405278,
  3. "contact_email":"pserra@customia.com",
  4. "book_room_number":null,
  5. "points":100 100 100,
  6. "expired_points":null,
  7. "consumed_points":- - -100 100 100,
  8. "remaining_points":0,
  9. "level_points":0,
  10. "bonus_points":"0.00",
  11. "timestamp":"2023-11-13T12:05:43.309364",
  12. "comments":null,
  13. "concept":"test",
  14. "code":"B0937118e5",
  15. "redeemed":0,
  16. "point_type":0,
  17. "expired_date":"2023-11-13T12:05:43.308445",
  18. "updated_at":"2023-11-13T12:05:43.342388",
  19. "contact":11656629,
  20. "product":null,
  21. "book":null,
  22. "manager":3738,
  23. "hotel":null
  24. }

Add points
Create an operation to add points to a loyalty program contact.

Parameter table:


Field

Type

Obl.

Description

contact contact contact

Int

Yes

Contact ID

concept concept concept

String

Yes

Concept of operation

points points points

Int

Yes

Points added to the contact


Request:
Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Answer:
In case of a 200 or 201 response, the following JSON is received:

  1. { {
  2. "contact":11656629,
  3. "concept":"reservations 2023",
  4. "points":500 500 500
  5. }

Redeem points
Create an operation to redeem points to a loyalty program contact.

Parameter table:

Field

Type

Obl.

Description

contact contact contact

Int

Yes

Contact ID

concept concept concept

String

Yes

Concept of operation

points points points

Int

Yes

Points remaining from the contact


Request:
Method: post
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Answer:
In case of a 200 or 201 response, the following JSON is received:

  1. { {
  2. "contact":11656629,
  3. "concept":"redeemed product",
  4. "points":100 100 100
  5. }

Get products

List and filter customer loyalty program products

Parameter table:
No mandatory parameters, see all available filters in Swagger

Request:
Method: get
Headers:
  1. Content-type: application/json
  2. Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Answer:
In case of a 200 or 201 response, the following JSON is received:

  1. { {
  2. "count":6,
  3. "next":null,
  4. "previous":null,
  5. "results":[ [ [
  6. { {
  7. "id":12345,
  8. "title":"We are looking forward to having you with us again.",
  9. "category":2,
  10. "image":"https://example/fideltour/media/product-image.jpg",
  11. "points":12345,
  12. "featured":false,
  13. "start_date":"2022-12-01",
  14. "end_date":"2024-12-31",
  15. "code":"Repeater1",
  16. "is_visible":true,
  17. "promocode":null,
  18. "notify_alert_emails":true,
  19. "hotels":[ [ [
  20. 12345,
  21. 12345,
  22. 12345,
  23. ],
  24. "levels":[ [ [
  25. 12345,
  26. 12345,
  27. 12345
  28. ]
  29. },
  30. ]
  31. }

Get product

Get a product by customer loyalty program ID

Parameter table:

Field

Type

Obl.

Description

id

Int

No No

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:

  1. { {
  2. "id":12345,
  3. "title":"We are looking forward to having you with us again.",
  4. "category":2,
  5. "image":"https://example/fideltour/media/product-image.jpg",
  6. "points":12345,
  7. "featured":false,
  8. "start_date":"2022-12-01",
  9. "end_date":"2024-12-31",
  10. "code":"Repeater1",
  11. "is_visible":true,
  12. "promocode":null,
  13. "notify_alert_emails":true,
  14. "hotels":[ [ [
  15. 12345,
  16. 12345,
  17. 12345,
  18. ],
  19. "levels":[ [ [
  20. 12345,
  21. 12345,
  22. 12345
  23. ]
  24. }
    • Related Articles

    • Other connections

      Other Introduction In the Hotel Data Hub API, several numeric values are required, which serve to identify an item or element in Fideltour's database. We can deduce that if an item does not exist in the database, it must first be created in order to ...
    • GDPR Consent

      GDPR Consent Introduction: In this article, we talk about API requests related to the mandatory consents of the General Data Protection Regulation (GDPR in English), and how to manage it in our contacts. - Create consents for a contact - List and ...
    • Motion management

      Movements Table of Contents Introduction Use cases Available methods Table of parameters Examples Petition (POST) Answer (POST) Petition (GET) Answer (GET) Petition (PATCH) Answer (PATCH) Introduction: In this article we talk about API requests ...
    • Introduction

      Getting started Introduction: In this article, we show how to consult and use the HotelDataHub/Fideltour API through the Swagger platform. There, we find the different endpoints (URLs) and the information that must be provided for each one to use the ...
    • Contact management

      Contacts Introduction: In this article we talk about API requests related to Contacts. Create contact Update contact List and filter contacts The endpoint we use is:https://app.hoteldatahub.io/api/v1/contacts/and the Swagger section ...