Skip to main content

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

FieldTypeRequiredDescription
systemstringNoBooking system code
bookingCodestringNoBooking code
passengersarrayNoList of passengers (see PassengerInfo)

PassengerInfo (PaxInfo)

FieldTypeDescription
indexintegerSequence number, starting from 1
passengerIdstringPassenger ID (from RetrievePNR)
parentIdstringAdult passenger ID (for INF)
passengerTypestringPassenger type: ADT, CHD, INF
titlestringTitle
genderbooleanGender (true: male, false: female)
givenNamestringGiven and middle name
surnamestringSurname
dateOfBirthstringDate of birth (YYYY-MM-DD)
emailstringContact email
phonestringContact phone
membershipobjectMembership info (see Membership)
documentobjectDocument info (see Passport)
Membership
FieldTypeNullableDescription
airlinestringYesAirline code
membershipIdstringYesMembership ID
levelstringYesMembership level
skyTeamLevelstringYesSkyTeam level
Passport
FieldTypeDescription
surNamestringSurname
givenNamestringGiven name
dateOfBirthstringDate of birth (YYYY-MM-DD)
genderbooleanGender (true: male, false: female)
numberstringDocument number (max 15 chars)
typestringDocument type: P (passport), I (ID card)
nationalstringNationality (3 chars)
expiryDatestringExpiry date (YYYY-MM-DD)
issueCountrystringCountry of issue (3 chars)
issueDatestringIssue date (YYYY-MM-DD)

Response

200 OK

FieldTypeDescription
systemstringSystem name (e.g., VN, VJ, 1A)
statusbooleanSuccess status
errorobjectError code object (see ErrorCode)
descriptionstringError description (if any)
trackingIdstringTracking log ID
trackingTimestringTracking timestamp (ISO 8601)

ErrorCode

FieldTypeDescription
idintegerError code ID
messagestringError 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