DepartCart API Postman Collection

This Postman collection provides comprehensive testing capabilities for the DepartCart API.

Files Included

  1. DepartCart_API_Collection.postman_collection.json - Main collection with all API requests
  2. DepartCart_Environment.postman_environment.json - Environment variables for API credentials
  3. README_Postman_Collection.md - This documentation file

Setup Instructions

1. Import into Postman

  1. Open Postman
  2. Click "Import" button
  3. Import both files:
  4. DepartCart_API_Collection.postman_collection.json
  5. DepartCart_Environment.postman_environment.json

2. Configure Environment Variables

After importing, you need to update the environment variables with actual API credentials:

  1. In Postman, go to "Environments"
  2. Select "DepartCart Environment"
  3. Update the following variables with actual values from your .env file or environment variables:

api_key: Your API_KEY value

api_secret: Your API_SECRET value

  1. Make sure the environment is selected in Postman (top-right dropdown)

3. Update Base URL (if needed)

The collection is configured for https://departcart.com by default. If your server runs on a different URL:

  1. Update the base_url variable in the environment
  2. Or modify individual request URLs as needed

Collection Structure

📁 Authentication

Bearer token generation endpoints: - Generate Bearer Token

📁 URL Generation

Main API endpoints for generating encrypted URLs: - Generate Encrypted URL

📁 GTM Injectable API

Special endpoint for GTM scripts: - Generate Encrypted Seatmap URL

Usage Workflow

Step 1: Generate Bearer Token

  1. Select the appropriate "Generate Bearer Token" request for your brand
  2. Click "Send"
  3. The response will contain a bearer token
  4. The token is automatically saved to environment variables for use in subsequent requests

Example Response:

{
  "success": true,
  "bearer_token": "demo:1704312000:1704398400:abc123:signature",
  "token_type": "Bearer",
  "expires_in": 86400,
  "expires_at": 1704398400,
  "brand": "demo",
  "usage": "Authorization: Bearer demo:1704312000:1704398400:abc123:signature"
}

Step 2: Generate Encrypted URLs

  1. Modify the request body with your PNR and passenger details: json { "pnr": "YOUR_PNR", "last_name": "PASSENGER_LASTNAME", "source": "api", }
  2. Click "Send"
  3. The response will contain encrypted URLs for seatmap, cart, and checkout

Example Response:

{
  "success": true,
  "encrypted_id": "encrypted_booking_id_here",
  "seatmap_url": "https://departcart.com/seatmap?id=encrypted_id&source=api",
  "cart_url": "https://departcart.com/cart?id=encrypted_id",
  "checkout_url": "https://departcart.com/checkout?id=encrypted_id",
  "source": "api"
}

API Endpoints Reference

POST /generate-bearer-token

Generates a bearer token for API authentication.

Request Body:

{
  "api_key": "your_api_key",
  "api_secret": "your_api_secret",
  "duration_hours": 24
}

POST /generate-encrypted-url

Generates encrypted URLs for seatmap, cart, and checkout pages.

Headers:

Authorization: Bearer {your_bearer_token}
Content-Type: application/json

Request Body:

{
  "pnr": "BOOKING_REFERENCE",
  "last_name": "PASSENGER_LASTNAME",
  "source": "api",
}

Testing Features

Environment Variables Reference

Variable Description Auto-Set
base_url API base URL No
api_key API key No
api_secret API secret No
bearer_token Bearer token Yes

Troubleshooting

Authentication Errors

URL Generation Errors

Connection Errors

Security Notes

Support

For issues with the API endpoints or authentication, refer to the DepartCart documentation or contact the development team.