Profiles

Use case examples

Note, all endpoints in the Customers API require access tokens.

Look up a profile

curl --request GET \
  --url 'https://api.entur.io/customers/v2/profiles/<customerIdentifier>' \
  --header 'Authorization: Bearer <token>'

Create a new profile

curl --request POST \
  --url 'https://api.entur.io/customers/v2/profiles/' \
  --header 'Authorization: Bearer <token>' \
  --data '{"firstName": "Ola", "surname": "Nordmann", "email": "ola@nordmann.org", "languagePreference": "NO", "createdBy": "test", "createdByChannel": "test", "organisationId": 1, "password":"abcD123"}'

Search for profiles

Search will return the profiles that match all search parameters. To see all available search parameters, see the api documentation.

curl --request GET \
  -- url = 'https://api.entur.io/customers/v2/profiles-search?email=<EMAIL>&surname=<NAME>' \
  -- header 'Authorization: Bearer <token>'

Concepts within profiles

This guide describes basic concepts within the customers/vX/profiles api.

Customers

A customer is a person or legal entity who has created a profile within the Customers API to gain benefits and track journeys within the Entur sales system. Each profile is connected to a specific organisation, and no organisation can gain profile data connected to a different organisation (i.e. Vy cannot view information about Entur profiles).

A profile is uniquely identified by its customerNumber. This references is used throughout the Entur sales system to connect a profile to its purchases, consents, loyalty programs, contact with customer support, etc. A profile can also be uniquely identified with the combination of customerRef and organisationId. CustomerRef can be set when creating the profile, and can be used to hold an external reference originating in the partner systems.

Temporary profiles

Temporary profiles are used to contain customer information that is necessary for a specific journey and/or ticket, when the customer does not wish to register a permanent profile. A temporary profile must have an expiration date; typically the deadline for applying for a refund or replacement tickets. All provided parameters, including expiration date, are updatable. After the profile is expired, all customer information is deleted and is not recoverable.

Temporary profiles are used with a subsection of the Customers API.

In addition, temporary profiles can be included in profile search, using the includeTemporary query parameter, for example in

Temporary profiles have restricted usage within the Customers API. A temporary profile can have consents, postal addresses and preferences, but not ecards or loyalty programs. A temporary profile can be converted to a permanent profile if done before the profile expires, using:

Access restrictions

We expect communication via a service, not directly from a front-end application. To this end, we've set the CORS restrictions so you can't connect directly to the API from a browser (except from these pages).

The Customers APIs all check that the current client has the necessary rights before allowing access to customer data. In practice, this means that a client with a Partner-JWT-token for an organisation will only ever have access to customers in that organisation. If you try to access a customer you're not entitled to see, you will get a 404 response, as if the customer didn't exist.

API Versioning

Deprecation

The current version of the Customers API (at time of writing, v2) supports the features of the previous version (with a caveat, see below).

Methods and endpoints marked as deprecated in this version will be removed in the next version and should not be used in new code.