Skip to main content

Quickstart Guide

This guide will help you make your first API call to PriveTag B2A Platform.

Step 1: Get Your API Key

1

Create an Account

2

Generate API Key

Navigate to API Keys section and click “Create New Key”
3

Configure Permissions

Select the endpoints you need access to:
  • recommend - Activity recommendations
  • execute_booking - Booking execution
  • inventory - Availability check

Step 2: Make Your First Request

Get Recommendations

curl -X POST https://api.privetag.com/api/b2a/recommend \
  -H "x-api-key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "user_profile": {
      "travel_type": "couple",
      "interests": ["spa", "dinner"]
    },
    "location": {
      "city": "Phuket"
    },
    "limit": 5
  }'

Response

{
  "success": true,
  "data": {
    "recommendations": [
      {
        "id": "act_abc123",
        "title": "Sunset Spa Experience",
        "description": "Luxurious couples spa with ocean view",
        "category": "spa",
        "price": 3500,
        "currency": "THB",
        "relevance_score": 95,
        "recommendation_reason": "Perfect for couples - romantic spa experience"
      }
    ],
    "context": {
      "log_id": "ctx_xyz789",
      "user_profile_summary": "couple, spa & dinner interests",
      "environment_summary": "Phuket, sunny, 30°C"
    }
  }
}

Step 3: Execute a Booking

Once the user selects an activity, execute the booking:
curl -X POST https://api.privetag.com/api/b2a/execute_booking \
  -H "x-api-key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "activity_id": "act_abc123",
    "user_email": "guest@example.com",
    "user_name": "John Doe",
    "booking_date": "2025-12-15",
    "num_adults": 2,
    "context_log_id": "ctx_xyz789"
  }'
The user will receive a voucher email within 30 seconds!

Rate Limits

PlanRequests/MinuteDaily Quota
Free10100
Basic601,000
Premium30010,000
EnterpriseUnlimitedUnlimited

Common Use Cases

When it’s raining, recommend indoor activities:
{
  "location": { "lat": 13.7563, "lon": 100.5018 },
  "filters": { "is_indoor": true }
}
The API automatically fetches weather data when lat/lon is provided.
Family-friendly recommendations:
{
  "user_profile": {
    "travel_type": "family",
    "interests": ["theme-park", "zoo", "aquarium"]
  },
  "filters": { "difficulty": "easy" }
}
Find discounted activities:
GET /api/b2a/inventory?flash_deals_only=true&city=Bangkok

Next Steps