# Trainline Ticket Options API Documentation

<p><strong>Trainline Ticket Options API Documentation</strong> Read the ticket products for a journey, such as Advance Single, Off-Peak Single and Anytime Single. Each product has the price for all passengers, the refund, cancellation and exchange terms, the restrictions, the full condition texts and the offers it covers. The classes list the cheapest price per travel class and the services of the class, such as seat reservation, luggage, power socket and WiFi.</p>

- **Documentation:** [https://scrappa.co/docs/trainline-api/trainline_ticket_options](https://scrappa.co/docs/trainline-api/trainline_ticket_options)
- **API group:** Trainline API
- **Endpoint:** `GET https://scrappa.co/api/trainline/journeys/ticket-options`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `search_id` | string | Yes | search_id of a journey search answer. |
| `outward_journey_id` | string | Yes | id of the outward journey. |
| `inward_journey_id` | string | No | id of the return journey, for a return search. |
| `currency` | string | No | GBP or EUR. Use the same value as in the search. |

## Example response

```json
{
    "data": {
        "currency": "GBP",
        "search_id": "1ab6ab81-b316-4f2e-ba21-df3055a8e3cc",
        "ticket_classes": [
            {
                "code": "urn:trainline:atoc:class:Standard",
                "name": "Standard",
                "services": [
                    {
                        "name": "Allocated seating",
                        "group": "seatSelection"
                    },
                    {
                        "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                        "group": "luggage"
                    },
                    {
                        "name": "Power socket",
                        "group": "electricSocket"
                    },
                    {
                        "name": "WiFi",
                        "group": "wifi"
                    }
                ],
                "cheapest_price": {
                    "amount": 43.5,
                    "currency": "GBP"
                },
                "ticket_option_ids": [
                    "hxlMwq2mLks=",
                    "HygkdUTu6Xk="
                ]
            },
            {
                "code": "urn:trainline:atoc:class:premium",
                "name": "Premium",
                "services": [
                    {
                        "name": "Table seat",
                        "group": "firstClassComfort"
                    },
                    {
                        "name": "Comfier seats",
                        "group": "extraLegroom"
                    },
                    {
                        "name": "Allocated seating",
                        "group": "seatSelection"
                    },
                    {
                        "name": "1 suitcase (max 30x70x90cm), 1 small carry-on bag, 1 handbag",
                        "group": "luggage"
                    },
                    {
                        "name": "Power socket",
                        "group": "electricSocket"
                    },
                    {
                        "name": "WiFi",
                        "group": "wifi"
                    }
                ],
                "cheapest_price": {
                    "amount": 83,
                    "currency": "GBP"
                },
                "ticket_option_ids": [
                    "mOL87jh9kuw="
                ]
            }
        ],
        "ticket_options": [
            {
                "id": "hxlMwq2mLks=",
                "name": "Advance Single",
                "type": "NonFlexible",
                "refunds": "No refunds",
                "exchanges": null,
                "conditions": [
                    {
                        "text": "Non-refundable ticket, only valid for the date, time and trains specified.",
                        "title": "DESCRIPTION"
                    },
                    {
                        "text": "You must travel on the date, time and trains specified. You may not start, break and resume, or end your journey at any intermediate station except to change to/from connecting trains as shown on the ticket(s) or other valid travel itinerary.",
                        "title": "VALIDITY"
                    },
                    {
                        "text": "Tickets must be purchased in advance of travel, subject to availability.",
                        "title": "BOOKING"
                    },
                    {
                        "text": "No refunds available.",
                        "title": "REFUNDS"
                    },
                    {
                        "text": "Yes - date/time of tickets can be changed up until time of departure subject to the payment up to GBP 10.00 fee per ticket per person and any difference in fares. If you change to a train on which a cheaper fare is available, the difference will not be refunded. Not possible to change the origin or destination.",
                        "title": "AMENDING YOUR BOOKING"
                    },
                    {
                        "text": "Child discounts, 16-25 Railcard, Family and Friends Railcard (standard class only), Senior Railcard, Two Together Railcard, HM Forces and Disabled Persons Railcards discounts apply.",
                        "title": "DISCOUNTS"
                    },
                    {
                        "text": "V2R",
                        "title": "CODE"
                    },
                    {
                        "text": "View information about wheelchair spaces and accessibility on board your train here www.nationalrail.co.uk/on-the-train/accessible-train-travel-and-facilities. Find out how to book travel assistance here www.nationalrail.co.uk/help-and-assistance/passenger-assist.",
                        "title": "ACCESSIBILITY"
                    }
                ],
                "description": "Travel on specified train only",
                "full_amount": 43.5,
                "is_cheapest": true,
                "total_price": {
                    "amount": 43.5,
                    "currency": "GBP"
                },
                "alternatives": [
                    {
                        "journey_id": "785924f2-9819-4468-9ca7-eee4855546bd",
                        "total_price": {
                            "amount": 43.5,
                            "currency": "GBP"
                        },
                        "alternative_id": "6f3c35e3-7877-42a1-a1c9-72f338b722bc"
                    }
                ],
                "cancellation": null,
                "restrictions": [
                    "Avanti West Coast only"
                ],
                "difference_to_cheapest_in_class": {
                    "amount": 0,
                    "currency": "GBP"
                }
            },
            {
                "id": "mOL87jh9kuw=",
                "name": "Advance Single Standard Premium",
                "type": "NonFlexible",
                "refunds": "No refunds",
                "exchanges": null,
                "conditions": [
                    {
                        "text": "ADVANCE PREMIUM",
                        "title": "TICKET TYPE"
                    },
                    {
                        "text": "Non-refundable ticket, only valid for the date, time and trains specified. Gets standard premium seat.",
                        "title": "DESCRIPTION"
                    },
                    {
                        "text": "You must travel on the date, time and trains specified. You may not start, break and resume, or end your journey at any intermediate station except to change to/from connecting trains as shown on the ticket(s) or other valid travel itinerary.",
                        "title": "VALIDITY"
                    },
                    {
                        "text": "Can be booked up until the day before travel, subject to availability.",
                        "title": "BOOKING"
                    },
                    {
                        "text": "No refunds available.",
                        "title": "REFUNDS"
                    },
                    {
                        "text": "Yes - date/time of tickets can be changed up until time of departure (except if you have chosen to print your own tickets) subject to an administration fee of up to GBP 10.00 per ticket per person and any difference in fares. If you change to a train on which a cheaper fare is available, the difference will not be refunded. Not possible to change the origin or destination.",
                        "title": "AMENDING YOUR BOOKING"
                    },
                    {
                        "text": "Railcard discounts apply.",
                        "title": "DISCOUNTS"
                    },
                    {
                        "text": "5PR",
                        "title": "CODE"
                    },
                    {
                        "text": "View information about wheelchair spaces and accessibility on board your train here www.nationalrail.co.uk/on-the-train/accessible-train-travel-and-facilities. Find out how to book travel assistance here www.nationalrail.co.uk/help-and-assistance/passenger-assist.",
                        "title": "ACCESSIBILITY"
                    }
                ],
                "description": "Travel on specified train only",
                "full_amount": 83,
                "is_cheapest": false,
                "total_price": {
                    "amount": 83,
                    "currency": "GBP"
                },
                "alternatives": [
                    {
                        "journey_id": "785924f2-9819-4468-9ca7-eee4855546bd",
                        "total_price": {
                            "amount": 83,
                            "currency": "GBP"
                        },
                        "alternative_id": "bc52bee0-f922-4e7e-8a82-8c7ae70ee95d"
                    }
                ],
                "cancellation": null,
                "restrictions": [
                    "Avanti West Coast Only"
                ],
                "difference_to_cheapest_in_class": {
                    "amount": 0,
                    "currency": "GBP"
                }
            },
            {
                "id": "vizLMDbxtvM=",
                "name": "Advance Single (1st Class)",
                "type": "NonFlexible",
                "refunds": "No refunds",
                "exchanges": null,
                "conditions": [
                    {
                        "text": "Non-refundable ticket, only valid for the date, time and trains specified.",
                        "title": "DESCRIPTION"
                    },
                    {
                        "text": "You must travel on the date, time and trains specified. You may not start, break and resume, or end your journey at any intermediate station except to change to/from connecting trains as shown on the ticket(s) or other valid travel itinerary.",
                        "title": "VALIDITY"
                    },
                    {
                        "text": "Must be booked in advance of travel, subject to availability.",
                        "title": "BOOKING"
                    },
                    {
                        "text": "No refunds available.",
                        "title": "REFUNDS"
                    },
                    {
                        "text": "Yes - date/time of tickets can be changed up until time of departure subject to the payment up to GBP 10.00 fee per ticket per person and any difference in fares. If you change to a train on which a cheaper fare is available, the difference will not be refunded. Not possible to change the origin or destination.",
                        "title": "AMENDING YOUR BOOKING"
                    },
                    {
                        "text": "Child discounts, 16-25 Railcard, Family and Friends Railcard (standard class only), Senior Railcard, Two Together Railcard, HM Forces and Disabled Persons Railcards discounts apply.",
                        "title": "DISCOUNTS"
                    },
                    {
                        "text": "V1U",
                        "title": "CODE"
                    },
                    {
                        "text": "View information about wheelchair spaces and accessibility on board your train here www.nationalrail.co.uk/on-the-train/accessible-train-travel-and-facilities. Find out how to book travel assistance here www.nationalrail.co.uk/help-and-assistance/passenger-assist.",
                        "title": "ACCESSIBILITY"
                    }
                ],
                "description": "Travel on specified train only",
                "full_amount": 125,
                "is_cheapest": false,
                "total_price": {
                    "amount": 125,
                    "currency": "GBP"
                },
                "alternatives": [
                    {
                        "journey_id": "785924f2-9819-4468-9ca7-eee4855546bd",
                        "total_price": {
                            "amount": 125,
                            "currency": "GBP"
                        },
                        "alternative_id": "fc270a65-1f63-4bda-91dc-1d338c09751c"
                    }
                ],
                "cancellation": null,
                "restrictions": [
                    "Avanti West Coast Only"
                ],
                "difference_to_cheapest_in_class": {
                    "amount": 0,
                    "currency": "GBP"
                }
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "journeys_ticket_options"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | The search id or the journey id is unknown or has expired. This response is not billable. |
| 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. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
