Skip to content

Partner Setup Guide

This guide covers the complete process of setting up and managing logistics partners in the system.

Partner Setup Flow

mermaid
graph TD
    A[Partner Panel] --> B[Select Partner]
    B --> C[Configure Basic Info]
    C --> D[Configure Zones]
    D --> E[Configure Services]
    E --> F[Configure Charges]
    F --> G[Configure Discounts]
    G --> H[Activate Partner]

Step 1: Basic Partner Configuration

javascript
const partnerConfig = {
  partnerId: "partner_123",
  name: "Express Logistics",
  type: "B2B_AND_B2C",
  operationalHours: {
    weekdays: "09:00-18:00",
    weekends: "10:00-16:00",
  },
  serviceableRegions: ["NORTH", "SOUTH", "EAST"],
  contactInfo: {
    email: "operations@expresslogistics.com",
    phone: "+1-555-0123",
    address: "123 Logistics Ave",
  },
};

// Create partner configuration
const response = await client.partners.create(partnerConfig);

Step 2: Zone Configuration

Define geographical areas where the partner operates:

javascript
const zoneConfig = {
  name: "North Zone",
  description: "Northern operational region",
  states: ["Delhi", "Punjab", "Haryana"],
  cities: ["New Delhi", "Chandigarh", "Gurugram"],
  serviceTypes: ["EXPRESS", "STANDARD"],
  operationalStatus: "ACTIVE",
};

// Create zone
const zone = await client.zones.create(zoneConfig);

Step 3: Service Configuration

Configure available delivery services:

javascript
const serviceConfig = {
  serviceType: "EXPRESS",
  description: "Same day delivery",
  sla: {
    deliveryTime: "24h",
    pickupTime: "2h",
  },
  constraints: {
    maxWeight: 20,
    maxDimensions: {
      length: 100,
      width: 50,
      height: 50,
    },
  },
  availability: {
    weekdays: true,
    weekends: true,
    holidays: false,
  },
};

// Configure service
const service = await client.services.configure(serviceConfig);

Step 4: Charge Configuration

Set up delivery charges and pricing:

javascript
const chargeConfig = {
  baseCharge: 100,
  weightSlabs: [
    { upTo: 5, charge: 50 },
    { upTo: 10, charge: 100 },
    { upTo: 20, charge: 200 },
  ],
  additionalCharges: {
    cod: 50,
    insurance: "1%",
    fuelSurcharge: "5%",
  },
  specialZoneCharges: {
    NORTH: 1.0,
    SOUTH: 1.2,
    REMOTE: 1.5,
  },
};

// Configure charges
const charges = await client.charges.configure(chargeConfig);

Step 5: Discount Configuration

Configure partner-specific discounts:

javascript
const discountConfig = {
  name: "Bulk Shipment Discount",
  type: "VOLUME_BASED",
  criteria: {
    minShipments: 100,
    timeframe: "30d",
  },
  discounts: [
    { threshold: 100, discount: "5%" },
    { threshold: 500, discount: "10%" },
    { threshold: 1000, discount: "15%" },
  ],
  validity: {
    start: "2024-01-01",
    end: "2024-12-31",
  },
};

// Configure discount
const discount = await client.discounts.configure(discountConfig);

Partner Activation

After completing all configurations:

javascript
const activationResult = await client.partners.activate(partnerId, {
  verificationChecks: {
    zonesConfigured: true,
    servicesConfigured: true,
    chargesConfigured: true,
    discountsConfigured: true,
  },
  activationNote: "All configurations complete and verified",
});

Configuration Validation

Use the validation endpoint to check configuration completeness:

javascript
const validationResult = await client.partners.validate(partnerId);

if (validationResult.success) {
  console.log("Partner configuration complete");
} else {
  console.log("Missing configurations:", validationResult.missingItems);
}

Best Practices

  1. Zone Configuration

    • Start with broader regions
    • Define clear boundaries
    • Consider operational capacity
  2. Service Configuration

    • Define realistic SLAs
    • Account for peak periods
    • Include all constraints
  3. Charge Configuration

    • Use market-competitive rates
    • Account for operational costs
    • Include seasonal variations
  4. Discount Configuration

    • Set achievable thresholds
    • Define clear terms
    • Monitor impact

Error Handling

javascript
try {
  await client.partners.configure(config);
} catch (error) {
  if (error.code === "INVALID_ZONE") {
    console.error("Invalid zone configuration:", error.details);
  } else if (error.code === "INVALID_CHARGE") {
    console.error("Invalid charge configuration:", error.details);
  } else {
    console.error("Configuration error:", error);
  }
}

Next Steps

  1. Configure Zones
  2. Set up Shipment Assignment
  3. View API Reference

Released under the MIT License.