{
  "info": {
    "_postman_id": "7d6b3f7f-1c9e-4e7a-93a1-0b3d3c8a7f10",
    "name": "KargoJet Partner API v1",
    "description": "KargoJet gönderi ve taşıyıcı API'si için başlangıç koleksiyonu. Önce apiToken ve warehouseId değişkenlerini doldurun.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.kargojet.com/partner-api/v1"
    },
    {
      "key": "apiToken",
      "value": ""
    },
    {
      "key": "warehouseId",
      "value": ""
    },
    {
      "key": "shipmentId",
      "value": ""
    },
    {
      "key": "packageId",
      "value": ""
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiToken}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Gönderi oluştur",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "ORD-10042"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"warehouse_id\": \"{{warehouseId}}\",\n  \"buyer_name\": \"Ayşe Yılmaz\",\n  \"buyer_phone\": \"5551112233\",\n  \"buyer_state\": \"İstanbul\",\n  \"buyer_city\": \"Kadıköy\",\n  \"buyer_address\": \"Caferağa Mah. Örnek Sok. No: 10\",\n  \"packages\": [{\n    \"width_cm\": 20,\n    \"height_cm\": 10,\n    \"length_cm\": 20,\n    \"weight_kg\": 1.2,\n    \"content_category\": \"other.personal_belongings\",\n    \"content_flags\": []\n  }]\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/shipments",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments"
          ]
        }
      }
    },
    {
      "name": "Gönderileri listele",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments?limit=10&offset=0",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments"
          ],
          "query": [
            {
              "key": "limit",
              "value": "10"
            },
            {
              "key": "offset",
              "value": "0"
            }
          ]
        }
      }
    },
    {
      "name": "Gönderi detayı",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}"
          ]
        }
      }
    },
    {
      "name": "Gönderi paketlerini listele",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/packages",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "packages"
          ]
        }
      }
    },
    {
      "name": "Paket durum geçmişi",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/packages/{{packageId}}/status-history",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "packages",
            "{{packageId}}",
            "status-history"
          ]
        }
      }
    },
    {
      "name": "Paket kimliğini koruyarak güncelle",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "PACKAGES-{{shipmentId}}"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"packages\": [{\n    \"id\": \"{{packageId}}\",\n    \"width_cm\": 20,\n    \"height_cm\": 10,\n    \"length_cm\": 20,\n    \"weight_kg\": 1.2,\n    \"content_category\": \"other.personal_belongings\",\n    \"content_flags\": []\n  }]\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/packages",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "packages"
          ]
        }
      }
    },
    {
      "name": "Gönderi ve paket takibi",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/tracking",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "tracking"
          ]
        }
      }
    },
    {
      "name": "Paket etiketlerini listele",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/labels?package_id={{packageId}}",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "labels"
          ],
          "query": [
            {
              "key": "package_id",
              "value": "{{packageId}}"
            }
          ]
        }
      }
    },
    {
      "name": "Taşıyıcı teklifleri",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"shipment_id\": \"{{shipmentId}}\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/shipments/quote",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "quote"
          ]
        }
      }
    },
    {
      "name": "Gönderiyi taşıyıcıya gönder",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Idempotency-Key",
            "value": "SUBMIT-{{shipmentId}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/submit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "submit"
          ]
        }
      }
    },
    {
      "name": "Etiket oluştur",
      "request": {
        "method": "POST",
        "url": {
          "raw": "{{baseUrl}}/shipments/{{shipmentId}}/labels",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "shipments",
            "{{shipmentId}}",
            "labels"
          ]
        }
      }
    }
  ]
}
