{
  "info": {
    "name": "TrustCold Partner API",
    "description": "Import this file. Set collection variable CLIENT_KEY. Pickup/drop-off: governorate, area, optional address or Google Maps URL in the same list.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base",
      "value": "https://trustcoldeg.com/api/v1/b2b"
    },
    {
      "key": "CLIENT_KEY",
      "value": ""
    },
    {
      "key": "trip_id",
      "value": "1"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{CLIENT_KEY}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Catalog",
      "item": [
        {
          "name": "Connection",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/connection"
          }
        },
        {
          "name": "Vehicle types",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Accept-Language",
                "value": "ar"
              }
            ],
            "url": "{{base}}/vehicle-types"
          }
        },
        {
          "name": "Locations catalog",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Accept-Language",
                "value": "ar"
              }
            ],
            "url": "{{base}}/locations",
            "description": "Returns data.modes, data.governorates[] (name, label, name_ar, name_en and regions[] objects of the same shape) and data.ui. Send governorate and region names, or a typed address / Google Maps URL, in from and to. Labels follow Accept-Language."
          }
        },
        {
          "name": "Search address",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/locations/search?q=مدينة نصر"
          }
        },
        {
          "name": "Quote",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"vehicle_type\": \"reefer_tank\",\n  \"from_governorate\": \"القاهرة\",\n  \"from_area\": \"مدينة نصر\",\n  \"to_governorate\": \"الإسكندرية\",\n  \"to_area\": \"سموحة\"\n}"
            },
            "url": "{{base}}/quote"
          }
        }
      ]
    },
    {
      "name": "Trips",
      "item": [
        {
          "name": "Create trip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "ORDER-10025"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"vehicle_type\": \"reefer_tank\",\n  \"trip_date\": \"2026-11-20\",\n  \"from_governorate\": \"القاهرة\",\n  \"from_area\": \"مدينة نصر\",\n  \"from_address\": \"https://maps.app.goo.gl/example\",\n  \"to_governorate\": \"الإسكندرية\",\n  \"to_area\": \"سموحة\"\n}"
            },
            "url": "{{base}}/trips"
          }
        },
        {
          "name": "List trips",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/trips?per_page=20"
          }
        },
        {
          "name": "Retrieve trip",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/trips/{{trip_id}}"
          }
        },
        {
          "name": "Live status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "If-None-Match",
                "value": "{{etag}}",
                "disabled": true
              }
            ],
            "url": "{{baseUrl}}/trips/{{tripId}}/status"
          }
        },
        {
          "name": "Trip updates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/trips/updates?since={{since}}"
          }
        },
        {
          "name": "Tracking",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/trips/{{trip_id}}/tracking",
            "description": "Returns data.trip (id, code, status, from, to, driver_name, vehicle_plate, client_name), data.latest, vehicle_status, eta, route[] and route_summary. Live trips may also include planned_route, stops, stop_points, waypoints, route_segments and route_gaps."
          }
        },
        {
          "name": "Cancel trip",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/trips/{{trip_id}}/cancel"
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Register webhook",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://partner.example/trustcold/hooks\"\n}"
            },
            "url": "{{base}}/webhook"
          }
        },
        {
          "name": "Show webhook",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/webhook"
          }
        },
        {
          "name": "Rotate webhook secret",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/webhook/rotate-secret"
          }
        },
        {
          "name": "Send test event",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base}}/webhook/test"
          }
        }
      ]
    }
  ]
}