Add Membership
Add a membership card to one or more passengers in a flight booking. This endpoint allows you to associate frequent flyer or loyalty program memberships with passengers.
Endpoint
- URL:
/api/v1/flight/addmembership - Method:
POST - Auth Required: Yes (Bearer Token/X-API-KEY)
- Content-Type:
application/json
Authentication
This endpoint requires a valid JWT Bearer token in the Authorization header:
Authorization: Bearer <access_token>
Request
Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
| system | string | No | Booking system code |
| bookingCode | string | No | Booking code |
| passengers | array | No | List of passengers (see PassengerInfo) |
PassengerInfo (PaxInfo)
| Field | Type | Description |
|---|---|---|
| index | integer | Sequence number, starting from 1 |
| passengerId | string | Passenger ID (from RetrievePNR) |
| parentId | string | Adult passenger ID (for INF) |
| passengerType | string | Passenger type: ADT, CHD, INF |
| title | string | Title |
| gender | boolean | Gender (true: male, false: female) |
| givenName | string | Given and middle name |
| surname | string | Surname |
| dateOfBirth | string | Date of birth (YYYY-MM-DD) |
| string | Contact email | |
| phone | string | Contact phone |
| membership | object | Membership info (see Membership) |
| document | object | Document info (see Passport) |
Membership
| Field | Type | Nullable | Description |
|---|---|---|---|
| airline | string | Yes | Airline code |
| membershipId | string | Yes | Membership ID |
| level | string | Yes | Membership level |
| skyTeamLevel | string | Yes | SkyTeam level |
Passport
| Field | Type | Description |
|---|---|---|
| surName | string | Surname |
| givenName | string | Given name |
| dateOfBirth | string | Date of birth (YYYY-MM-DD) |
| gender | boolean | Gender (true: male, false: female) |
| number | string | Document number (max 15 chars) |
| type | string | Document type: P (passport), I (ID card) |
| national | string | Nationality (3 chars) |
| expiryDate | string | Expiry date (YYYY-MM-DD) |
| issueCountry | string | Country of issue (3 chars) |
| issueDate | string | Issue date (YYYY-MM-DD) |
Response
200 OK
| Field | Type | Description |
|---|---|---|
| system | string | System name (e.g., VN, VJ, 1A) |
| status | boolean | Success status |
| error | object | Error code object (see ErrorCode) |
| description | string | Error description (if any) |
| trackingId | string | Tracking log ID |
| trackingTime | string | Tracking timestamp (ISO 8601) |
ErrorCode
| Field | Type | Description |
|---|---|---|
| id | integer | Error code ID |
| message | string | Error message |
Business Rules
- Each membership must be associated with a valid passenger.
- Duplicate or invalid membership IDs will result in an error.
- All required fields for each passenger and membership must be provided.
Example Request
{
"system": "VN",
"bookingCode": "ABC123",
"passengers": [
{
"index": 1,
"passengerId": "PAX001",
"membership": {
"airline": "VN",
"membershipId": "MEM123",
"level": "GOLD",
"skyTeamLevel": null
}
}
]
}
Example Response
{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "track-004",
"trackingTime": "2024-07-01T13:30:00Z"
}
Error Codes
See Error Codes for details.
Validation Questions
- What types of memberships are supported?
- Can a passenger have multiple memberships?
- What happens if a membership is already associated with another booking?
Compliance
- GDPR
- PCI-DSS
Traceability
- Requirement:
MEM-001,MEM-002