Sign inSign up

afindlator/profiles-api

By afindlator

Updated over 8 years ago

Fontana Customer profiles

Image
0

1.3K

afindlator/profiles-api repository overview

Profiles API

This API provides access to the data required by the Fontana Rewards front-end applications. These applications give customers the ability to review and effectively mange their rewards points. It also gives the marketing team the business intelligence require to drive sales.

End Points

GET /profiles/{id}

Returns customer profile associated with the specified card number. This profile will include the sales transaction associated with the customer's card number

On success: Returns status code 200 and JSON data.

On failure: Returns HTTP status Not Found (404) if the customer ID is invalid. Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.


GET /customers

Returns a list of customers that were born within a given time span.

On success:
Returns status code 200 and JSON data.

On failure:
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.

Parameters

from:
Period start date. Default: 0000-00-00

to:
Period end date Default: 2900-01-01

limit: Maximum number of records to return. Default: 100000

order by:
Record set sort order. Options:

  • currentpoints
  • liftimepoints
  • cardnumber

GET /customers/overview

Returns a summary of all customers on record. This data includes:

* Total number of Customers
* Total number of male customers
* Total number of female customers
* Total number of customers with unknown gender
* Total number of customers with email address
* Total number of Customers with phone numbers

On success:
Returns status code 200 and JSON data.

On failure:
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.


GET /customers/{customerid}/transactions

Returns a list of customer transactions within a given time span. The list is order by document date in descending order.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.

Parameters

** from: **
Period start date. Default: 0000-00-00

** to: **
Period end date.
Default: 2900-01-01


GET /customers/{customerid}/products

Returns a list of all products purchases associated with {customerid}. Products are ordered by frequency.

** On success: **
Returns status code 200 and JSON data.

** On failure: ** Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.


GET /stores/{storeid}/transactions

Returns a list of store specific transactions within a given time span.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.

Parameters

** from: **
Period start date. Default: 0000-00-00 ** to: **
Period end date
Default: 2900-01-01
** order_by ** Property by which dataset is sorted in descending order.
Options: totalspent, averagespent and transactions.
Default: cardnumber


GET /departments

Returns a list of all departments.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.


GET /departments/{deptid}/products

Returns a list of all products associated with department {deptid}.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.


GET /departments/{deptid}/transactions

Returns list of customers that have bought products from a specific departmant {deptid} within a give time frame.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.

Parameters

** from: **
Period start date. Default: 0000-00-00

** to: **
Period end date
Default: 2900-01-01

** order_by: **
Property by which dataset is sorted in descending order.
Options: totalspent, averagespent and transactions.
Default: cardnumber


GET /birthdays

Returns list of customers (sorted by birthday) with upcomming birthdays within the given period.

** On success: **
Returns status code 200 and JSON data.

** On failure: **
Returns HTTP status Internal Server Error (500) if there was a problem retrieving the data.

Parameters

** Start: **
Period start date.

** End: **
Period end date


How do I get set up?
  1. Ensure that a mysql database with Telus data is accessible
  2. Ensure the environment variable SALES_DB is set to the appropriate connection string in the form:
    <db_user>:<db_password>@tcp(<db_host>:<db_port>)/sales?charset=utf8
  3. Run the command:
    docker run -name <somename> -e SALES_DB afindlator/profiles-api:latest
Who do I talk to?

For support please contact Andrae Findlator:
Email: [email protected]
Mobile: (876) 361 - 2429

Tag summary

Content type

Image

Digest

Size

4 MB

Last updated

over 8 years ago

docker pull afindlator/profiles-api