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 | Yes | Booking system code |
| bookingCode | string | Yes | Booking code |
| passengers | array | No | List of passengers (see PassengerInfo) |
PassengerInfo (PaxInfo)
See Passenger Info Object for the complete passenger schema, including membership, document, seatMaps, baggages, and ancillaries.
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.
Sample Request
{
"system": "VN",
"bookingCode": "ABC123",
"passengers": [
{
"index": 1,
"passengerId": "PAX001",
"membership": {
"airline": "VN",
"membershipId": "MEM123",
"level": "GOLD",
"skyTeamLevel": null
}
}
]
}
Sample Response
{
"system": "VN",
"status": true,
"error": null,
"description": null,
"trackingId": "track-004",
"trackingTime": "2024-07-01T13:30:00Z"
}
Error Codes
This endpoint may return the following error codes:
- 26000 - Membership: Errors specific to frequent flyer membership operations (26001-26005)
- 00000 - Flight Hub (General Errors): General system and authentication errors (00001-00056)
For a complete list of error codes, see Error Codes.
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