Customers

The Customers API provides functionality for managing profiles, consents and benefits for your organisation's customers. The features include among others:

  • managing profiles
  • profile authentication (verify username and password)
  • managing temporary profiles used for anonymous sales
  • managing customer consents
  • fetching traveller info for a specific journey
  • managing loyalty programs
  • fetching customer entitlements used for sales discounts

Services

Profiles, Benefits and Consents are the services provided by the Customers API.

ServiceDescription
ProfilesManage customer profiles and authentication
BenefitsManage benefits for customers
ConsentsManage consents between your organisation and customers

Usage in sales

###Profiles Every purchase made by Entur APIs may specify customer profiles for contact info and as reference for travellers. This can be a persistent profile, or a temporary profile with optional information provided by the customer.

###Benefits Benefits can be used as a standalone API for your organisation to manage benefits for your customers, or coupled with an Entitlement Product to give discounts for sales for customers with benefits. This requires configuration of the Entitlement Product for the discount logic. An example of this is Personnel tickets.

Authentication

All endpoints in the Customers API requires an authentication header. The authentication header must be an Entur-issued OAuth2 bearer token (more details here). If you have access to a client Id and secret, you can use the curl example to retrieve a token:

curl --request POST \
  --url 'https://partner.entur.org/oauth/token' \
  --header 'content-type: application/json' \
  --data '{"grant_type":"client_credentials","client_id": "<clientid>","client_secret": "<clientsecret>","audience": "https://api.staging.entur.io"}'

Verify token

To verify the authentication token you can try to find a customer profile with email:

curl -X GET "https://api.entur.io/profiles?email=<email> -H "accept: application/json;charset=UTF-8" -H "Authorization: Bearer <token>"

If you are able to find the customer you are looking for, you are ready to go.