{
  "info": {
    "name": "Turan Shop API v1",
    "description": "راهنما در https://turancod.ir/solutions#api-guide است. توکن را به‌صورت محلی در turan_token وارد کنید. شناسه‌ها و اطلاعات گیرنده نمونه‌اند. درخواست‌های نوشتنی روی فروشگاه واقعی داده ثبت می‌کنند.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{turan_token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://turancod.ir/api/v1/integrations",
      "type": "string"
    },
    {
      "key": "turan_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "province_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "product_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "parcel_id",
      "value": "1",
      "type": "string"
    },
    {
      "key": "sku",
      "value": "MUG-001",
      "type": "string"
    },
    {
      "key": "order_id",
      "value": "ORDER-1001",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "اطلاعات پایه",
      "item": [
        {
          "name": "روش‌ها و شناسه‌های مجاز فروشگاه",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/options",
            "description": "مجوز: توکن معتبر."
          }
        },
        {
          "name": "شهرهای یک استان",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/cities?province_id={{province_id}}",
            "description": "مجوز: توکن معتبر."
          }
        }
      ]
    },
    {
      "name": "محصولات",
      "item": [
        {
          "name": "فهرست محصولات",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/products?page=1&per_page=20&client_product_id={{sku}}",
            "description": "مجوز: products:read."
          }
        },
        {
          "name": "ثبت محصول",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/products",
            "description": "مجوز: products:write. شناسه data.product.id را در product_id بگذارید.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"ماگ سرامیکی\",\n  \"client_product_id\": \"{{sku}}\",\n  \"price\": 250000,\n  \"weight\": 200,\n  \"status\": \"ENABLE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "ویرایش محصول",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/products/{{product_id}}",
            "description": "مجوز: products:write. برای غیرفعال کردن، status را DISABLE کنید.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"ماگ سرامیکی\",\n  \"client_product_id\": \"{{sku}}\",\n  \"price\": 275000,\n  \"weight\": 200,\n  \"status\": \"ENABLE\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "مرسوله‌ها",
      "item": [
        {
          "name": "محاسبه هزینه",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels/quote",
            "description": "مجوز: parcels:write. شناسه‌های عددی را با گزینه‌های فروشگاه جایگزین کنید.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"city_id\": 1,\n  \"service_type_id\": 1,\n  \"payment_type_id\": 1,\n  \"box_size_id\": 1,\n  \"items\": [\n    {\n      \"client_product_id\": \"{{sku}}\",\n      \"quantity\": 2\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "ثبت مرسوله پرداخت در محل",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels",
            "description": "مجوز: parcels:write. شناسه data.parcel.id را در parcel_id بگذارید.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"city_id\": 1,\n  \"service_type_id\": 1,\n  \"payment_type_id\": 1,\n  \"box_size_id\": 1,\n  \"items\": [\n    {\n      \"client_product_id\": \"{{sku}}\",\n      \"quantity\": 2\n    }\n  ],\n  \"client_order_id\": \"{{order_id}}\",\n  \"category_id\": 1,\n  \"customer_name\": \"علی\",\n  \"customer_family\": \"احمدی\",\n  \"customer_mobile\": \"09120000000\",\n  \"customer_postal_code\": \"1234567890\",\n  \"customer_address\": \"نشانی نمونه گیرنده\",\n  \"parcel_content\": \"دو ماگ سرامیکی\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "ثبت مرسوله با پرداخت کیف پول",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels",
            "description": "مجوز: parcels:write + wallet:charge. این درخواست در صورت موفقیت از کیف پول برداشت می‌کند.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"city_id\": 1,\n  \"service_type_id\": 1,\n  \"payment_type_id\": 2,\n  \"box_size_id\": 1,\n  \"items\": [\n    {\n      \"client_product_id\": \"{{sku}}\",\n      \"quantity\": 2\n    }\n  ],\n  \"client_order_id\": \"{{order_id}}-WALLET\",\n  \"category_id\": 1,\n  \"customer_name\": \"علی\",\n  \"customer_family\": \"احمدی\",\n  \"customer_mobile\": \"09120000000\",\n  \"customer_postal_code\": \"1234567890\",\n  \"customer_address\": \"نشانی نمونه گیرنده\",\n  \"parcel_content\": \"دو ماگ سرامیکی\",\n  \"payment_option\": \"wallet\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "فهرست مرسوله‌ها",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels?page=1&per_page=20",
            "description": "مجوز: parcels:read."
          }
        },
        {
          "name": "وضعیت مرسوله با شناسه",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels/{{parcel_id}}",
            "description": "مجوز: parcels:read."
          }
        },
        {
          "name": "استعلام با شماره سفارش فروشگاه",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels/by-order?client_order_id={{order_id}}",
            "description": "مجوز: parcels:read."
          }
        },
        {
          "name": "تاریخچه وضعیت مرسوله",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/parcels/{{parcel_id}}/history",
            "description": "مجوز: parcels:read.",
            "body": {
              "mode": "raw",
              "raw": "\"برای صفحه بعد از پارامتر cursor با مقدار next_cursor استفاده کنید.\"",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    }
  ]
}
