Skip to content

How to Use Booking API

How to Use Booking API

Prerequisites

Before you can use the Booking API, you need to complete the onboarding process to get your authentication credentials and tenant access.

Step 1: Onboarding Process

What is Onboarding?

Onboarding is the process of registering your organization as a tenant in the system. This process includes:

  • Organization verification
  • Account setup and configuration
  • Credential generation

How to Onboard?

  1. Provide Organization Details: Submit required business information and documentation
  2. Account Setup: Our team will configure your account based on your requirements

What You’ll Receive After Onboarding

  • API Key/Auth Token: Your unique authentication credential
  • Tenant ID: Your organization’s unique identifier in the system
  • User ID: Your individual user identifier
  • Service Configuration: Access to specific services based on your agreement

Step 2: Authentication Setup

Required Headers

All API requests must include these headers:

X-TENANT-ID: "your-tenant-id"
X-USER-ID: "your-user-id"
Authorization: "Bearer your-api-key"
Content-Type: application/json

Example Request

Terminal window
curl -X POST "https://sandbox-apis.prayog.io/gateway/booking-service/orders" \
-H "X-TENANT-ID: your-tenant-id" \
-H "X-USER-ID: your-user-id" \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"referenceId": "ORDER123",
"parcelCategory": "COURIER",
"orderType": "FORWARD"
}'

Step 3: Gateway Usage

Important: All Requests Must Go Through Gateway

All API requests must be routed through our API Gateway. This ensures:

  • Security validation

Gateway Endpoint

https://sandbox-apis.prayog.io/gateway/booking-service/orders

Note: Do not attempt to bypass the gateway or make direct connections to backend services.

Step 4: Making Your First API Call

1. Create a Booking

Terminal window
POST /orders

2. Get Booking Details

Terminal window
GET /orders/{orderId}

3. Update Booking

Terminal window
PATCH /orders/{orderId}

4. List Bookings

Terminal window
GET /orders

Step 5: Testing

Sandbox Environment

Use the sandbox environment for testing:

  • Base URL: https://sandbox-apis.prayog.io/booking-service
  • Purpose: Development and testing only
  • Data: Test data, not production

Production Environment

Common Issues & Solutions

Authentication Errors

  • 401 Unauthorized: Check your API key and ensure it’s valid
  • 403 Forbidden: Verify your tenant ID and user ID
  • Token Expired: Contact support to refresh your API key

Support & Resources

Onboarding Support

Visit: Onboarding Details

Next Steps

  1. Complete Onboarding
  2. Get Credentials: Receive your API key, tenant ID, and user ID
  3. Test Integration: Use sandbox environment for testing