Contracts client
Contracts for customers
Return all contracts with possible filtering
Return all contracts with possible filtering
query Parameters
uuidGet the contract matching the uuid
customerNumberGet all contracts where a customer is a contractConsumer using Unique Entur id
customerRefGet all contracts where a customer is a contractConsumer using external customer id unique within an organisation
loyaltyProgramIdGet all contracts for a specific loyaltyProgram
contractHolderGet all contracts for a specific contract holder. Use customerNumber as value
consumableAfterGet all contracts which can be consumed after this date. Supports ISO 8601 date format
consumableBeforeGet all contracts which can be consumed before this date. Supports ISO 8601 date format
expirationDateAfterGet all contracts with expiration date after this date. Supports ISO 8601 date format
expirationDateBeforeGet all contracts with expiration date before this date. Supports ISO 8601 date format
externalRefGet all contracts by external reference. This is, for example, the personnel ticket code
organisationIdThe organisation the contracts belong to. You must have an Internal token to use this.
sortByProperties to sort the response by. Multiple values can be specified
sortDirectionThe sort direction if sortBy is specified
pageThe page to be retrieved. Starts at 1
perPageNumber of items per page
includeOrderLineEventsWhether to include order line events in the response. Note: setting this to true may impact performance. Default false.
includeConsumersall|none|contract-ho… · style: form · explode: trueWhether to include contract consumers in the response. Supported formats are 'all', 'none' and 'contract-holder'. Note: setting this to ALL may impact performance. Default is 'contract-holder'
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application> for companies, and <personal name>-<application> for individuals.
X-Correlation-IdCorrelation id
Return all contracts with possible filtering › Responses
OK
All items for this page
totalItemsTotal items which could be returned
totalPagesTotal number of pages
Validate contract consumption
Validate that the customer can consume given contracts
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application> for companies, and <personal name>-<application> for individuals.
X-Correlation-IdCorrelation id
Validate contract consumption › Request Body
A list of consumptions to verify
Validate contract consumption › Responses
OK
codeA code pertaining to the reason for rejection, if any. Code 3101 = OK.
reasonA short message detailing the reasoning behind the status.
isValidTrue if all consumptions were valid, otherwise false
Claims a personnel ticket directly.
Claim a personnel ticket for the given customer profile. A personnel ticket may correspond to more than one contract in benefits, and this method will attempt to claim them all.
Headers
AuthorizationET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application> for companies, and <personal name>-<application> for individuals.
X-Correlation-IdCorrelation id
Claims a personnel ticket directly. › Request Body
customerNumberThe customerNumber referring to the customer who claims the personnel ticket
externalReference\w+-(\w+)+-\w+ · requiredThe code of the personnel ticket to claim
Claims a personnel ticket directly. › Responses
OK
successWhether the claim was successful
customerNumberThe customerNumber for the customer now claiming the personnel ticket
Get contracts by external ref
Finds contracts by external reference.
path Parameters
externalRefquery Parameters
organisationIdThe organisation the contracts belong to, left empty will use orgID from token.
pageSelects a specific page in the collection
perPageSelects the number of elements per page
includeOrderLineEventsWhether to include order line events in the response. Note: setting this to true may impact performance. Default false.
includeConsumersall|none|contract-ho… · style: form · explode: trueWhether to include contract consumers in the response. Supported formats are 'all', 'none' and 'contract-holder'. Note: setting this to ALL may impact performance. Default is 'contract-holder'
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application> for companies, and <personal name>-<application> for individuals.
X-Correlation-IdCorrelation id
Entur-Customer-NumberTo identify logged in user and limit access per user
Get contracts by external ref › Responses
OK
All items for this page
totalItemsTotal items which could be returned
totalPagesTotal number of pages
Return all valid contracts by customer number. Returns only contracts with status VALID within timeframe.
path Parameters
customerNumberquery Parameters
travelDateorganisationIdincludeExpiredContractsincludeOrderLineEventsWhether to include order line events in the response. Note: setting this to true may impact performance. Default false.
includeConsumersall|none|contract-ho… · style: form · explode: trueWhether to include contract consumers in the response. Supported formats are 'all', 'none' and 'contract-holder'. Note: setting this to ALL may impact performance. Default is 'contract-holder'
Headers
ET-Client-NameEntur Client Header.
It is required that all consumers identify themselves by using this header.
Entur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.
The structure of ET-Client-Name should be: <company>-<application> for companies, and <personal name>-<application> for individuals.
X-Correlation-IdCorrelation id
Responses
OK
uuidUnique contract identifier
statusThe contract status. A normal contract has status valid. It can be expired, refunded, cancelled, misused and valid
createdAtWhen the contract was created
createdByWhich client created the contract
lastChangedAtWhen the contract was last changed
lastChangedByWhich client changed the contract last
consumableFromFrom when the contract can be consumed
The current values for a loyalty program
organisationIdWhich organisation the contract concerns
parentIf present, contract UUID of the parent contract. This field is usually set if the contract is created by a coupon usage, whereas this contract has a time constraint and the parent has a coupon constraint.
The list of keys validated against the customer claiming the contract
externalRefOptional external reference. Examples are membership number and employee number
couponsLimitHow many coupons the contract has. Default is cascaded from Loyalty Program Version. If set, the contract will be blocked for usage when all coupons are used. Coupons are registered via an OrderLineEvent.
The current total for this contract (earn/burn or giftcard)
If present, contains timed contracts that are dependent on this contract. See Contract response
The list of transactions for this contract (earn/burn or giftcard)
acceptanceDateWhen the contract was accepted by the customer
expirationDateWhen the contract expires
A list of order line events related to this contract
remainingCouponsThe remaining coupons for coupon based contracts. Derived from couponsLimit and orderLineEvents. The amount of remaining coupons are counted yearly and based of the earliest travel date.
The list of customers allowed to use the contract