Entur Developer
Personalisation Client Integration

CurrentReward

The current rewards the member has achieved in the program
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

LevelStatusReward

Rewards for this level
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

MemberPoints

id
​string · required
sourceId
​string · required
programId
​integer · int64 · required
memberId
​integer · int64 · required
amount
​number · required
pointDefinitionReference
​string · required
createdAt
​string · date-time · required
​object
updatedAt
​string · date-time

MemberReward

Rewards when the level is reached
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

SuspensionPeriod

A SuspensionPeriod is a mechanism for temporarily blocking/pausing various features in personalisation for a member. A SuspensionPeriod has several subtypes that determines which feature is being suspended.
id
​integer · int64 · required

Generated identifier

endAt
​string · date-time · required

When the suspension period ends

startAt
​string · date-time · required

When the suspension period starts

createdAt
​string · date-time · required

The date and time when the period was created

referenceId
​string · required
Code
Id to match multiple suspension periods. Can for example be the id of the ticket, so that all periods for that ticket gets the same suspensionId. Used for cancelling suspensions. See the CancelSuspensions effect.
@type
​string · required
​object

Metadata for the suspension period

cancelledAt
​string · date-time

When the suspension period was cancelled from.

updatedAt
​string · date-time

The date and time when the period was last updated

CappingStatus

The capping status for this point definition, if capping is enabled
cappingAmount
​number · required

The amount that this point definition is capped at

Example: 100
isReached
​boolean · required

Whether the capping amount has been reached by the member

Example: true

CurrentFeatureReward

The current rewards the member has achieved in the program
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

CurrentLevelSummary

Summary of the current level of a member
programId
​integer · int64 · required

Id of the program. WARNING: Don't use this for matching with a specific program, since it may vary across environments. Use "programReference" instead.

Example: 1
memberId
​integer · int64 · required

Id of the member within the program. Can be used to look up more information about the member.

Example: 1
​CurrentReward[] · required

The current rewards the member has achieved in the program

​SuspensionStatus[] · required
​PointDefinitionStatus[] · required

The current status of each point definition in the program

programReference
​string | null

Reference to the program. This is a unique reference that is the same in all environments, and can be used to identify the program. Nullable for backwards compatibility reasons. Should be filled out in most cases.

Example: flexiticket
​

CurrentLevelSummaryQuery

Status query for a member
customerId
​string · required

Customer id of the member

Example: 29582738
programId
​integer | null · int64

Id of the program to query. If null, will return summary of all programs the customer is enrolled in.

Example: 1
programReference
​string | null

Reference to the program to query. Better to use than programId, since programId might vary in different environments.

Example: flexiticket
programReferences
​array | null

List of reference to the programs to query. If given then it overrides the programReference parameter.

Example: ["flexiticket","reis"]
statusAt
​string | null · date-time

Get current level summary at a given date and time. Defaults to now if not set.

Example: 2023-10-01T12:00:00.567Z

CurrentPercentDiscountedProductReward

The current rewards the member has achieved in the program
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required
percentDiscount
​number · required

The percentage discount this reward gives

Example: 5

CurrentPointsPeriod

The period for which the current points are valid. Only filled out if the point definition is periodic. Can return the first active period after the queried time if there is no period active at that point.
startOfPeriod
​string · date-time · required

The start of the period for which the current points are valid

endOfPeriod
​string | null · date-time

The end of the period for which the current points are valid

CustomerMembership

Information about a customers membership in a program
programId
​integer · int64 · required
memberId
​integer · int64 · required

The ID for the customer's membership in the program

programReference
​string | null

Unique reference for the program.

Example: reis
​object | null

Metadata about the member

CustomerMembershipsQuery

Program memberships for a customer
customerId
​string · required

Customer id of the member

Example: 29582738
programReferences
​array | null

List of reference to the programs to query.

Example: ["flexiticket","reis"]

DeferredRegistration

Request deferred registration for a customer ID and order ID
customerId
​string · required

The customer ID for which to register the order

orderId
​string · required

The order ID for which to register

orderLineId
​string · required

The order line ID for which to register

EffectSuspensionPeriod

A type of suspension period that prevents any effects to be executed on the member within the period. For example, this can prevent the member for receiving any points, by blocking the GivePoint effect.
id
​integer · int64 · required

Generated identifier

endAt
​string · date-time · required

When the suspension period ends

startAt
​string · date-time · required

When the suspension period starts

createdAt
​string · date-time · required

The date and time when the period was created

referenceId
​string · required
Code
Id to match multiple suspension periods. Can for example be the id of the ticket, so that all periods for that ticket gets the same suspensionId. Used for cancelling suspensions. See the CancelSuspensions effect.
@type
​string · required
effectType
​string · enum · required

The type of effect that this period suspends

Enum values:
AddMember
UpdateMemberMetadata
GivePoint
RefundPoints
ConsumePoints
SuspendRewards
SuspendEffect
CancelSuspensions
metadata
​object | null

Metadata for the suspension period

cancelledAt
​string | null · date-time

When the suspension period was cancelled from.

updatedAt
​string | null · date-time

The date and time when the period was last updated

Error

status
​integer · int32 · required

The http status code.

Example: 400
title
​string · required
message
​string · required

The main error message.

Example: An error occurred
correlationId
​string · required

The unique correlation id for the request.

Example: b5d4960d-7ab2-43d6-a8f3-113da042a288
detail
​string | null

The main error message.

Example: An error occurred
​array | null

Validation error on a specific field.

FieldError

Validation error on a specific field.
field
​string · required
message
​string · required

LevelStatus

The current level in the reward ladder the member has achieved
levelId
​integer · int64 · required

Id of the level in the reward ladder

Example: 1
​LevelStatusReward[] · required

Rewards for this level

LevelStatusFeatureReward

Rewards for this level
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

LevelStatusPercentDiscountedProductReward

Rewards for this level
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required
percentDiscount
​number · required

The percentage discount this reward gives

Example: 5

Member

A member
id
​integer · int64 · required
customerId
​string · required

Customer id

organisationId
​integer · int64 · required

The organisation this member belongs to

createdAt
​string · date-time · required
​object | null

Metadata needed for the processing of events

updatedAt
​string | null · date-time

MemberFeatureReward

Rewards when the level is reached
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required

MemberLevelSummary

Requirements and rewards for each membership level of a specific program
name
​string · required

Level name

​RewardRequirement[] · required

Requirements for reaching the level

requirementsNeeded
​string · enum · required

Whether any or all requirements need to be fulfilled

Enum values:
ALL
ANY
Example: ALL
​MemberReward[] · required

Rewards when the level is reached

MemberPercentDiscountedProductReward

Rewards when the level is reached
description
​string · required
rewardId
​integer · int64 · required
@type
​string · required
percentDiscount
​number · required

The percentage discount this reward gives

Example: 5

MemberPointsConsumedResponse

id
​string · required
sourceId
​string · required
programId
​integer · int64 · required
memberId
​integer · int64 · required
amount
​number · required
pointDefinitionReference
​string · required
createdAt
​string · date-time · required
consumedAt
​string · date-time · required
​object | null
updatedAt
​string | null · date-time
refundedAt
​string | null · date-time

MemberPointsEarnedResponse

id
​string · required
sourceId
​string · required
programId
​integer · int64 · required
memberId
​integer · int64 · required
amount
​number · required
pointDefinitionReference
​string · required
createdAt
​string · date-time · required
validFrom
​string · date-time · required
​object | null
updatedAt
​string | null · date-time
expireAt
​string | null · date-time
cancelledAt
​string | null · date-time

MemberRewardLadder

Information about the current reward ladder for a program member
​MemberLevelSummary[] · required

Program level details, including the specific requirements and rewards for each level in the program

NoPointsGivenResult

Result of deferred registration where no points were given
reason
​string · enum · required

Reason why no points were given

Enum values:
ORDER_DOES_NOT_BELONG_TO_CUSTOMER
CONDITIONS_NOT_SATISFIED
CUSTOMER_NOT_MEMBER
CUSTOMER_ID_NOT_FOUND_IN_EVENT
MEMBER_SUSPENDED
TICKET_CANCELLED
AMOUNT_EVALUATED_TO_ZERO
ORDER_ALREADY_REGISTERED
Example: ORDER_DOES_NOT_BELONG_TO_CUSTOMER
status
​integer · int32 · required

The http status code.

Example: 400
title
​string · required

PageMember

Paged content
​Member[] · readOnly · required

All items for this page

totalItems
​integer · int32 · readOnly · required

Total items which could be returned

Example: 1
totalPages
​integer · int32 · readOnly · required

Total number of pages

Example: 1

PageMemberPoints

Paged content
​MemberPoints[] · readOnly · required

All items for this page

totalItems
​integer · int32 · readOnly · required

Total items which could be returned

Example: 1
totalPages
​integer · int32 · readOnly · required

Total number of pages

Example: 1

PagePointPeriod

Paged content
​PointPeriod[] · readOnly · required

All items for this page

totalItems
​integer · int32 · readOnly · required

Total items which could be returned

Example: 1
totalPages
​integer · int32 · readOnly · required

Total number of pages

Example: 1

PageSuspensionPeriod

Paged content
​SuspensionPeriod[] · readOnly · required

All items for this page

totalItems
​integer · int32 · readOnly · required

Total items which could be returned

Example: 1
totalPages
​integer · int32 · readOnly · required

Total number of pages

Example: 1

PageTransaction

Paged content
​Transaction[] · readOnly · required

All items for this page

totalItems
​integer · int32 · readOnly · required

Total items which could be returned

Example: 1
totalPages
​integer · int32 · readOnly · required

Total number of pages

Example: 1

PointDefinitionStatus

The current status of a point definition in a program for a member
pointDefinitionId
​integer · int64 · required

Id of the point definition

pointDefinitionReference
​string · required

Unique reference for the point. Meant to be used to identify what kind of point this is, across different environments where the id might be different. This enables clients of the api to enrich the presentation of the point definition, beyond what this api delivers (for example giving the point definition an icon, or more descriptive text).

Example: trips_done
pointDefinitionSingularName
​string · required

Singular name of the point definition

Example: reise
pointDefinitionPluralName
​string · required

Plural name of the point definition

Example: reiser
currentPoints
​number · required

The amount of points the member currently has of this point definition

Example: 15
pendingPoints
​number · required

The amount of points the member has received, but are not valid yet. If the point definition is periodic, this field will only contain the pending points in the current point period.

Example: 15
​
​

PointPeriod

The core information about a point period
id
​integer · int64 · required

The ID of the point period

startAt
​string · date-time · required

The start time of the point period

endAt
​string · date-time · required

The end time of the point period

​object | null

Metadata for a point period. Example:

Code
{"userType": "ADULT", "stationPair": { "to": "NSR:StopPlace:337", "from": "NSR:StopPlace:11" } }

PointsGiven

List of points given per point definition
amount
​number · required

The amount of points given

pointDefinitionReference
​string · required

Reference to the point definition given point for

transactionId
​integer | null · int64

The ID of the transaction for the given points. Null if the points given amount is 0.

pointPeriodId
​integer | null · int64

The ID of the point period the points were given in, if applicable

PointsGivenResult

Points given to a customer as a result of deferred registration
​PointsGiven[] · required

List of points given per point definition

Program

Information about a program
id
​integer · int64 · required
organisationId
​integer · int64 · required

Id of organisation owning the program

Example: 1
preset
​string · enum · required
Enum values:
CAMPAIGN_CODE_PROGRAM
CUSTOM
name
​string · required

The name of the program

Example: Entur+
organisationsWithAccess
​integer[] · required

A list of organisations that can consume the program

Example: [1,2]
administratorOrganisations
​integer[] · required

A list of organisations that can administrate the program

Example: [1,2,3]
active
​boolean · required

If program is active. Inactive programs are excluded from triggering effects.

Example: true
createdAt
​string · date-time · required
programVersionId
​integer · int64 · required
reference
​string | null

Unique reference for the program. Meant to be used to identify which program this is, across different environments where the id might be different. This enables clients of the api to more easily identify the program, for example to enrich the presentation, beyond what this api delivers (for example with an icon, or more descriptive text).

Example: reis
infoLink
​string | null

A link to information about the program

Example: https://selskap.test/theprogram/
updatedAt
​string | null · date-time

RewardRequirement

Requirements for reaching the level
requiredAmount
​number · required

Required amount to reach a program level

pointDefinitionId
​integer · int64 · required

Id of the point definition

pointDefinitionReference
​string | null

Point definition reference

RewardsSuspensionPeriod

A type of suspension period used to prevent the member from receiving any rewards in the period.
id
​integer · int64 · required

Generated identifier

endAt
​string · date-time · required

When the suspension period ends

startAt
​string · date-time · required

When the suspension period starts

createdAt
​string · date-time · required

The date and time when the period was created

referenceId
​string · required
Code
Id to match multiple suspension periods. Can for example be the id of the ticket, so that all periods for that ticket gets the same suspensionId. Used for cancelling suspensions. See the CancelSuspensions effect.
@type
​string · required
metadata
​object | null

Metadata for the suspension period

cancelledAt
​string | null · date-time

When the suspension period was cancelled from.

updatedAt
​string | null · date-time

The date and time when the period was last updated

SuspensionStatus

Status of a suspension
referenceId
​string · required

The reference id of the suspension

suspensionType
​SuspensionStatusType · enum · required
Code
The type of suspension: - Rewards: Member is suspended from receiving rewards - GivePointsEffect: Member is suspended from being given points - ConsumePointsEffect: Member is suspended from using points - UpdateMemberMetadata: Member is suspended from updating their metadata. - SuspendRewardsEffect: Member is suspended from being put into reward suspension - SuspendEffectEffect: Member is suspended from being put into effect suspension
Enum values:
Rewards
GivePointsEffect
SuspendRewardsEffect
SuspendEffectEffect
ConsumePointsEffect
startAt
​string · date-time · required

When the suspension started

endAt
​string · date-time · required

When the suspension will end

SuspensionStatusType

string · enum
Enum values:
Rewards
GivePointsEffect
SuspendRewardsEffect
SuspendEffectEffect
ConsumePointsEffect
Code
The type of suspension: - Rewards: Member is suspended from receiving rewards - GivePointsEffect: Member is suspended from being given points - ConsumePointsEffect: Member is suspended from using points - UpdateMemberMetadata: Member is suspended from updating their metadata. - SuspendRewardsEffect: Member is suspended from being put into reward suspension - SuspendEffectEffect: Member is suspended from being put into effect suspension

Transaction

A transaction
id
​integer · int64 · required

Generated identifier

Example: 1
programId
​integer · int64 · required

The id of the program this transaction belongs to

amount
​number · required

The number of points of the definition this transaction gives

pointDefinitionId
​integer · int64 · required

The id of the point definition this transaction gives points of

createdAt
​string · date-time · required

The date and time when the transaction was created

validFrom
​string · date-time · required

The date and time the transaction is valid from.

pointDefinitionReference
​string | null

The reference of the point definition this transaction gives points of

referenceId
​string | null

Unique reference for this transaction. Populated from the event that created the transaction, based on the effect configuration.

updatedAt
​string | null · date-time

The date and time when the transaction was last updated

expireAt
​string | null · date-time

The date and time when the transaction expires. If null, the transaction never expires.

cancelledAt
​string | null · date-time

The date and time when the transaction was cancelled. If not null, the transaction is valid until this time.

​object | null

Metadata for the transaction

TransactionByOrder

A transaction
id
​integer · int64 · required

Generated identifier

Example: 1
programId
​integer · int64 · required

The id of the program this transaction belongs to

memberId
​integer · int64 · required

The ID of the member in the program this transaction belongs to

amount
​number · required

The number of points of the definition this transaction gives

pointDefinitionId
​integer · int64 · required

The id of the point definition this transaction gives points of

createdAt
​string · date-time · required

The date and time when the transaction was created

validFrom
​string · date-time · required

The date and time the transaction is valid from.

pointDefinitionReference
​string | null

The reference of the point definition this transaction gives points of

pointPeriodId
​integer | null · int64

The id of the point period this transaction belongs to, if applicable

updatedAt
​string | null · date-time

The date and time when the transaction was last updated

expireAt
​string | null · date-time

The date and time when the transaction expires. If null, the transaction never expires.

cancelledAt
​string | null · date-time

The date and time when the transaction was cancelled. If not null, the transaction is valid until this time.

​object | null

Metadata for the transaction

Did you find what you were looking for?