Page Content
- Terminology
- Railcard Validation
- Simplified Railcard Validation
- Validity Changes
- Valid Railcard Types
Terminology
The following are key terms used throughout this documentation:
| Term |
Description |
| Station Issued Railcards |
These Railcards have been issued at a Station these have a short character Railcard Number (~5 characters) |
| Retailer Issued Railcards |
These Railcards have been issued via a Retailer and have a longer Railcard Number (~15-16 characters) |
Railcard Validation
Resource: /railcards/{railcardNumber}/expiry
This resource will allow the consumers to check whether the Railcard is known to the Railcard Validation Service by matching the requested details. If the Railcard search conditions are met, the system will return the confirmed expiry date of the Railcard. It is the responsibility of the consumers to check whether that Railcard can be used for the selected journey based on relevant business rules.
Both Station Issued and Retailer Issued Railcards can be validated.
In order to check a Railcards validity the system will check:
- Railcard Type is supported
- Railcard details match those stored
- Status of the stored Railcard is classed as "valid"
If the received Railcards details meet the above criteria the system will return the Railcard expiry date, otherwise an error will be returned.
Notes
- Not all Railcards can be validated by the system, for example, Regional Railcards are not stored within the system and therefore can’t be validated. The system will check whether the Railcard Type can be processed and return an error if the Railcard is not supported. For a list of valid Railcard Types see "Reference Data" below
- Railcard holders last name must be present in the request. this is to help identify station sold railcards which do not have unique railcard numbers
Simplified Railcard validation
Resource: /railcards/tbc
This resource is a simplified version of the above endpoint, allowing consumers to check for the existence and validity of a railcard by matching on just the railcard number and type. If a matching railcard is found the expiry date of the card will be returned. If a matching railcard isn't found an appropriate error will be returned.
Because station sold railcards can not be uniquely identified by just railcard number and type, using this endpoint may result in 'duplicate railcard' errors, which the consumer may then need to check using the above endpoint, with more details to find a unique match, or implement another strategy to validate the railcard (e.g. ask the customer to use an attended TIS to purchase their ticket where their railcard can be visually checked by staff)
Validity Changes
Resource: /railcards/validityChanges
This resource allows consumers to check whether railcards have changed their validity status. Under normal circumstances a railcard will be valid from its time of issue until it expires. However, there are times when a railcard may become invalid for other reasons, such as it being hotlisted. For those consumers who provide account based services, where they may use RVS to validate a railcard and then store that railcard against the user's account, this endpoint allows them to check whether any previously validated railcards have subsequently become invalid, and if so to remove or disable them from the account.
This endpoint works by allowing the users to specify a time window, for example the past 24 hours, and it will return any cards whose validity have changed within that time window. A typical use case would be executing this query once per day for the previous 24 hours, and updating customer account records to reflect any railcards which have become invalid within the last day.
Optional filters can be specified in the request to limit the response by railcard types (see below) or by validity transistions (valid to invalid, invalid to valid)
All supported railcard types are in scope of the Validity Change endpoint, However, initially station sold railcards will not show any validity changes as this data isn't currently captured. When this data does start to be captured it will be added to the validity change endpoint results with no changes needed to the API.
Valid Railcard Types
Resource: /railcards/tbc
This resource allows consumers to obtain a list of railcard types in scope of RVS, and can be used to determine whether to make an RVS check or not based on the railcard type.
As reference data which changes very infrequently this should only need to be accessed once every 24 hours and cached locally.