Skip to content
Scrappa Get API key
Trainline API 1 credit/request

Trainline Discount Cards API Documentation

GET https://scrappa.co/api/trainline/cards/discounts

Trainline Discount Cards API Documentation List the discount cards of UK and European carriers with the name, the operator, the language, the carriers that accept them and the number format.

Trainline Discount Cards API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/trainline/cards/discounts
Auth header
x-api-key
Cost
1 credit/request
Response preview
200 OK
{
    "data": {
        "cards": [
            {
                "code": "urn:trainline:sncf:card:GrandEstCartePrimo",
                "name": "Carte Grand-Est Primo",
                "group": "sncf_regional",
                "colour": "#6A7C00",
                "carriers": [
                    "pao_sncf"
                ],
                "language": "fr",
                "operator": "SNCF",
                "short_name": "Primo",
...

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "cards": [
            {
                "code": "urn:trainline:sncf:card:GrandEstCartePrimo",
                "name": "Carte Grand-Est Primo",
                "group": "sncf_regional",
                "colour": "#6A7C00",
                "carriers": [
                    "pao_sncf"
                ],
                "language": "fr",
                "operator": "SNCF",
                "short_name": "Primo",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:multivendors:card:SpainFamiliaNumerosaEspecialAsturias",
                "name": "Familia Numerosa Especial Asturias",
                "group": "large_family_discount",
                "colour": "#950A00",
                "carriers": [
                    "renfe",
                    "ilsa"
                ],
                "language": "es",
                "operator": "SpainRail",
                "short_name": "Familia numerosa",
                "description": null,
                "business_only": false,
                "number_pattern": "^[0-9]{2}[-/ ]?[0-9]{4}[-/ ]?[0-9]{4}$",
                "is_loyalty_card": false,
                "requires_number": true,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:sncf:card:NouvelleAquitaineCarteAvantagesPlus",
                "name": "Nouvelle-Aquitaine Carte\u00a0+",
                "group": "sncf_regional",
                "colour": "#9b1723",
                "carriers": [
                    "pao_sncf"
                ],
                "language": "fr",
                "operator": "SNCF",
                "short_name": "Carte\u00a0+",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            },
            {
                "code": "urn:trainline:obb:card:VORTEILScardComfort",
                "name": "VORTEILScard Comfort",
                "group": null,
                "colour": "#D53B4A",
                "carriers": [
                    "obb"
                ],
                "language": "de",
                "operator": "OBB",
                "short_name": "",
                "description": null,
                "business_only": false,
                "number_pattern": null,
                "is_loyalty_card": false,
                "requires_number": false,
                "has_expiration_date": true
            }
        ],
        "card_count": 4
    },
    "meta": {
        "billable": true,
        "endpoint_family": "cards_discounts"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

503

Upstream Unavailable

Trainline did not answer in time. Scrappa retries on other exits first. This response is not billable. Retry after a few seconds.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "cards_discounts"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Trainline service is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.