### Database setup commands
Source: https://github.com/open-ndc/ndc-sandbox/blob/master/README.md
Commands to initialize and migrate the database, and load initial fixtures.
```bash
rake db:create
```
```bash
rake db:migrate
```
```bash
rake db:fixtures:load[ID]
```
--------------------------------
### Start local server
Source: https://github.com/open-ndc/ndc-sandbox/blob/master/README.md
Launch the application server on port 9292.
```bash
rackup
```
--------------------------------
### Install dependencies
Source: https://github.com/open-ndc/ndc-sandbox/blob/master/README.md
Install the required Ruby gems for the project.
```bash
bundle install
```
--------------------------------
### Local Server Deployment
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Commands to clone the repository, configure the database, and start the development server.
```bash
# Clone and install dependencies
git clone https://github.com/open-ndc/ndc-sandbox.git
cd ndc-sandbox
bundle install
# Configure PostgreSQL database
# Edit config/database.yml with your credentials
# development:
# adapter: postgresql
# host: 127.0.0.1
# database: ndc_sandbox_dev
# username: your_username
# password: your_password
# Setup database with sample data
rake db:create
rake db:migrate
rake db:fixtures:load[FA] # Load Fantasy Airlines sample data
# Ensure Redis is running for shopping session storage
redis-server
# Start the server
rackup # Runs on http://localhost:9292
# Or use Foreman for process management
foreman start
```
--------------------------------
### GET /api/status
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Checks the connectivity status of the sandbox and retrieves information about the configured airline.
```APIDOC
## GET /api/status
### Description
Tests API connectivity and retrieves details about the sandbox owner and available airlines.
### Method
GET
### Endpoint
/api/status
### Response
#### Success Response (200)
- **status** (string) - The current status of the sandbox.
- **sandbox_owner_code** (string) - The airline code of the sandbox owner.
- **airlines** (array) - A list of available airlines with their codes and names.
#### Response Example
{
"status": "ok",
"sandbox_owner_code": "FA",
"airlines": [
{"code": "FA", "name": "Fantasy Airlines"}
]
}
```
--------------------------------
### Price Ancillary Services with ServicePriceRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Get pricing for specific ancillary services based on the shopping session and the number of travelers. Requires a valid ResponseID from a previous shopping session.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001a1b2c3d4e5f6...'
"http://localhost:9292/api/ndc"
# Response: ServicePriceRS with priced services for the number of travelers
```
--------------------------------
### Get Ancillary Services with ServiceListRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieve available ancillary services such as baggage, meals, and wifi for a shopping session using the ResponseID from AirShopping. Ensure the ResponseID is valid.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001a1b2c3d4e5f6...'
"http://localhost:9292/api/ndc"
# Response: ServiceListRS with available ancillary services and bundles
```
--------------------------------
### POST /api/ndc - ServicePriceRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Get pricing for specific ancillary services based on the shopping session and number of travelers.
```APIDOC
## POST /api/ndc - ServicePriceRQ
### Description
Get pricing for specific ancillary services based on the shopping session and number of travelers.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **Document** (object) - Required - Document details.
- **Name** (string) - Required - Name of the document.
- **ReferenceVersion** (string) - Required - Reference version of the document.
- **Party** (object) - Required - Party information.
- **Sender** (object) - Required - Sender details.
- **TravelAgencySender** (object) - Required - Travel agency sender details.
- **AgencyID** (string) - Required - Agency identifier.
- **ShoppingResponseIDs** (object) - Required - Shopping response identifiers.
- **ResponseID** (string) - Required - Identifier for the shopping response.
```
--------------------------------
### Create database manually
Source: https://github.com/open-ndc/ndc-sandbox/blob/master/README.md
Use this command if the automated database creation fails.
```bash
$ createdb db_name
```
--------------------------------
### Create Booking with OrderCreateRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Create an order or booking by selecting offers and providing passenger details. This request requires a valid ResponseID and OfferID from a previous shopping or offer discovery response.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001FAa1b2c3d4e5f6...OFFER-1'
"http://localhost:9292/api/ndc"
# Response: OrderViewRS with order confirmation and booking reference
```
--------------------------------
### Check API Status and Routes
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Verify connectivity to the sandbox and list available API endpoints.
```bash
# Test API connectivity and see available airlines
curl -X GET "http://localhost:9292/api/status"
# Response:
# {
# "status": "ok",
# "sandbox_owner_code": "FA",
# "airlines": [
# {"code": "FA", "name": "Fantasy Airlines"}
# ]
# }
# List all available API routes
curl -X GET "http://localhost:9292/api/"
```
--------------------------------
### Check Seat Maps with SeatAvailabilityRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Use this request to retrieve available seats for specific flight segments, including cabin layout, seat characteristics, and pricing for seat selection services.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001'
"http://localhost:9292/api/ndc"
# Response: SeatAvailabilityRS with cabin layouts, seat maps, and available services
```
--------------------------------
### Retrieve Order Details via OrderRetrieveRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Sends an XML request to the NDC endpoint to fetch full order details by reference.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001ORDER-12345' \
"http://localhost:9292/api/ndc"
# Response: OrderViewRS with complete order details
```
--------------------------------
### List Orders with OrderListRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieve a list of orders or bookings matching specified criteria. This request is useful for querying existing bookings made through the NDC system.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001TRAVEL-AGENCY-001'
"http://localhost:9292/api/ndc"
# Response: OrderListRS with matching orders
```
--------------------------------
### POST /api/ndc - OrderCreateRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Create an order/booking by selecting offers and providing passenger details.
```APIDOC
## POST /api/ndc - OrderCreateRQ
### Description
Create an order/booking by selecting offers and providing passenger details.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **Document** (object) - Required - Document details.
- **Name** (string) - Required - Name of the document.
- **ReferenceVersion** (string) - Required - Reference version of the document.
- **Party** (object) - Required - Party information.
- **Sender** (object) - Required - Sender details.
- **TravelAgencySender** (object) - Required - Travel agency sender details.
- **AgencyID** (string) - Required - Agency identifier.
- **Query** (object) - Required - Query details.
- **OrderItems** (object) - Required - List of order items.
- **ShoppingResponse** (object) - Required - Shopping response details.
- **Owner** (string) - Required - Owner of the shopping response.
- **ResponseID** (string) - Required - Identifier for the shopping response.
- **Offers** (object) - Required - List of offers.
- **Offer** (object) - Required - Offer details.
- **OfferID** (string) - Required - Identifier for the offer.
```
--------------------------------
### Perform FlightPriceRQ Price Confirmation
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Submit a FlightPriceRQ XML message to confirm pricing for specific flight segments selected from previous shopping results.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001SEG1JFK2024-06-15LAX2024-06-15FA101' \
"http://localhost:9292/api/ndc"
# Response: FlightPriceRS with detailed fare breakdown
```
--------------------------------
### Perform AirShoppingRQ Flight Search
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Submit an AirShoppingRQ XML message to search for flights and retrieve available offers.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0
agent@example.com
NYC12345678TRAVEL-AGENCY-001JFK2024-06-15LAXADT' \
"http://localhost:9292/api/ndc"
# Response: AirShoppingRS with offers, pricing, and ResponseID for subsequent requests
#
#
# OpenNDC Sandbox
# 15.2
#
#
#
# FA
# a1b2c3d4e5f6...
#
#
#
# 3
#
# OFFER-1
#
#
# 450.00
#
#
# ...
#
#
#
#
```
--------------------------------
### Test API with curl
Source: https://github.com/open-ndc/ndc-sandbox/blob/master/README.md
Send an XML payload to the NDC API endpoint for validation.
```bash
curl -X POST -H "Content-Type: application/xml" --data @AirShopping.xml "http://ndc-sandbox.dev/api/ndc/"
```
--------------------------------
### POST /api/ndc - OrderListRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieve a list of orders/bookings matching specified criteria.
```APIDOC
## POST /api/ndc - OrderListRQ
### Description
Retrieve a list of orders/bookings matching specified criteria.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **Document** (object) - Required - Document details.
- **Name** (string) - Required - Name of the document.
- **ReferenceVersion** (string) - Required - Reference version of the document.
- **Party** (object) - Required - Party information.
- **Sender** (object) - Required - Sender details.
- **TravelAgencySender** (object) - Required - Travel agency sender details.
- **AgencyID** (string) - Required - Agency identifier.
- **Query** (object) - Required - Query details.
- **Filters** (object) - Required - Filters for the query.
- **Agency** (object) - Required - Agency filter.
- **AgencyID** (string) - Required - Agency identifier.
```
--------------------------------
### POST /api/ndc - SeatAvailabilityRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieve available seats for specific flight segments including cabin layout, seat characteristics, and pricing for seat selection services.
```APIDOC
## POST /api/ndc - SeatAvailabilityRQ
### Description
Retrieve available seats for specific flight segments including cabin layout, seat characteristics, and pricing for seat selection services.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **Document** (object) - Required - Document details.
- **Name** (string) - Required - Name of the document.
- **ReferenceVersion** (string) - Required - Reference version of the document.
- **Party** (object) - Required - Party information.
- **Sender** (object) - Required - Sender details.
- **TravelAgencySender** (object) - Required - Travel agency sender details.
- **AgencyID** (string) - Required - Agency identifier.
- **DataList** (object) - Required - List of data.
- **FlightSegmentList** (object) - Required - List of flight segments.
- **FlightSegment** (object) - Required - Flight segment details.
- **SegmentKey** (string) - Required - Unique key for the segment.
- **Departure** (object) - Required - Departure details.
- **AirportCode** (string) - Required - Departure airport code.
- **Date** (string) - Required - Departure date (YYYY-MM-DD).
- **Time** (string) - Required - Departure time (HH:MM).
- **Arrival** (object) - Required - Arrival details.
- **AirportCode** (string) - Required - Arrival airport code.
- **Time** (string) - Required - Arrival time (HH:MM).
### Request Example
```xml
NDC Client1.0TRAVEL-AGENCY-001
```
### Response
#### Success Response (200)
- **SeatAvailabilityRS** (object) - Response containing cabin layouts, seat maps, and available services.
```
--------------------------------
### POST /api/ndc (FlightPriceRQ)
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieves detailed pricing for specific flight segments selected from an AirShopping response.
```APIDOC
## POST /api/ndc
### Description
Get detailed pricing for specific flight segments. Used after AirShopping to confirm prices for selected itineraries.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **FlightPriceRQ** (XML) - The IATA NDC compliant XML request containing flight segment details.
### Request Example
SEG1
### Response
#### Success Response (200)
- **FlightPriceRS** (XML) - Contains detailed fare breakdown for the requested segments.
```
--------------------------------
### POST /api/ndc (AirShoppingRQ)
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Performs a flight search based on origin, destination, and travel dates.
```APIDOC
## POST /api/ndc
### Description
Search for available flights between origin and destination airports on specified dates. Returns offers with pricing, flight segments, and traveler associations.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **AirShoppingRQ** (XML) - The IATA NDC compliant XML request containing search criteria.
### Request Example
JFK2024-06-15
### Response
#### Success Response (200)
- **AirShoppingRS** (XML) - Contains offers, pricing, and a ResponseID for subsequent requests.
#### Response Example
a1b2c3d4e5f6...
```
--------------------------------
### POST /api/ndc - ServiceListRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Retrieve available ancillary services (baggage, meals, wifi, etc.) for a shopping session using the ResponseID from AirShopping.
```APIDOC
## POST /api/ndc - ServiceListRQ
### Description
Retrieve available ancillary services (baggage, meals, wifi, etc.) for a shopping session using the ResponseID from AirShopping.
### Method
POST
### Endpoint
/api/ndc
### Request Body
- **Document** (object) - Required - Document details.
- **Name** (string) - Required - Name of the document.
- **ReferenceVersion** (string) - Required - Reference version of the document.
- **Party** (object) - Required - Party information.
- **Sender** (object) - Required - Sender details.
- **TravelAgencySender** (object) - Required - Travel agency sender details.
- **AgencyID** (string) - Required - Agency identifier.
- **ShoppingResponseIDs** (object) - Required - Shopping response identifiers.
- **ResponseID** (string) - Required - Identifier for the shopping response.
```
--------------------------------
### Cancel Order via OrderCancelRQ
Source: https://context7.com/open-ndc/ndc-sandbox/llms.txt
Sends an XML request to the NDC endpoint to cancel an existing booking.
```bash
curl -X POST \
-H "Content-Type: application/xml" \
-d '
NDC Client1.0TRAVEL-AGENCY-001ORDER-12345' \
"http://localhost:9292/api/ndc"
# Response: OrderCancelRS with cancellation confirmation
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.