# social.passports.travel.leg

> Published by [passports.social](https://lexicon.garden/identity/did:plc:ssdgllkzfwekkpmu7expw6cv)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:ssdgllkzfwekkpmu7expw6cv/social.passports.travel.leg)
- [Documentation](https://lexicon.garden/lexicon/did:plc:ssdgllkzfwekkpmu7expw6cv/social.passports.travel.leg/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:ssdgllkzfwekkpmu7expw6cv/social.passports.travel.leg/examples)

## Definitions

### `social.passports.travel.leg`

**Type**: `record`

One transport segment of a trip — a single origin-to-destination movement. Part of a social.passports.travel.trip.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `origin` | `ref` → `social.passports.place` | Yes | Inline origin place object. Self-contained — no external fetch required. |
| `carrier` | `string` | No | Carrier name, e.g. 'Japan Airlines' or 'Amtrak'. |
| `endDate` | `string` | No | Arrival date in YYYY-MM-DD format. |
| `createdAt` | `string` (datetime) | Yes |  |
| `startDate` | `string` | No | Departure date in YYYY-MM-DD format. Stored as a date string rather than datetime to avoid timezone ambiguity — travel dates are calendar-day concepts. |
| `carrierCode` | `string` | No | Transport-agnostic carrier code — IATA airline code for flights (e.g. 'JL'), route abbreviation for non-IATA carriers (e.g. 'ACE' for Acela). |
| `description` | `string` | No | Free-text notes about this leg. |
| `destination` | `ref` → `social.passports.place` | Yes | Inline destination place object. Self-contained — no external fetch required. |
| `serviceNumber` | `string` | No | Flight number, train number, or equivalent service identifier, e.g. 'JL006' or 'Acela 2151'. |
| `transportation` | `string` | Yes | Mode of transportation. |
| `originTransportCode` | `string` | No | Terminal code at origin — IATA airport code for flights (e.g. 'JFK'), station code for rail (e.g. 'NYP'), etc. Overrides the place record's transport_code for this specific leg. |
| `destinationTransportCode` | `string` | No | Terminal code at destination — IATA airport code for flights (e.g. 'CDG'), station code for rail, etc. Overrides the place record's transport_code for this specific leg. |

## Raw Schema

```json
{
  "id": "social.passports.travel.leg",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "origin",
          "destination",
          "transportation",
          "createdAt"
        ],
        "properties": {
          "origin": {
            "ref": "social.passports.place",
            "type": "ref",
            "description": "Inline origin place object. Self-contained — no external fetch required."
          },
          "carrier": {
            "type": "string",
            "maxLength": 100,
            "description": "Carrier name, e.g. 'Japan Airlines' or 'Amtrak'."
          },
          "endDate": {
            "type": "string",
            "maxLength": 10,
            "description": "Arrival date in YYYY-MM-DD format."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "startDate": {
            "type": "string",
            "maxLength": 10,
            "description": "Departure date in YYYY-MM-DD format. Stored as a date string rather than datetime to avoid timezone ambiguity — travel dates are calendar-day concepts."
          },
          "carrierCode": {
            "type": "string",
            "maxLength": 10,
            "description": "Transport-agnostic carrier code — IATA airline code for flights (e.g. 'JL'), route abbreviation for non-IATA carriers (e.g. 'ACE' for Acela)."
          },
          "description": {
            "type": "string",
            "maxLength": 3000,
            "description": "Free-text notes about this leg."
          },
          "destination": {
            "ref": "social.passports.place",
            "type": "ref",
            "description": "Inline destination place object. Self-contained — no external fetch required."
          },
          "serviceNumber": {
            "type": "string",
            "maxLength": 20,
            "description": "Flight number, train number, or equivalent service identifier, e.g. 'JL006' or 'Acela 2151'."
          },
          "transportation": {
            "type": "string",
            "description": "Mode of transportation.",
            "knownValues": [
              "flight",
              "train",
              "bus",
              "car",
              "ferry",
              "walking",
              "cycling",
              "other"
            ]
          },
          "originTransportCode": {
            "type": "string",
            "maxLength": 10,
            "description": "Terminal code at origin — IATA airport code for flights (e.g. 'JFK'), station code for rail (e.g. 'NYP'), etc. Overrides the place record's transport_code for this specific leg."
          },
          "destinationTransportCode": {
            "type": "string",
            "maxLength": 10,
            "description": "Terminal code at destination — IATA airport code for flights (e.g. 'CDG'), station code for rail, etc. Overrides the place record's transport_code for this specific leg."
          }
        }
      },
      "description": "One transport segment of a trip — a single origin-to-destination movement. Part of a social.passports.travel.trip."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
