محصولات

سرویس جدید ایساج به طور کامل محصول محور می باشد و با توجه به اطلاعات دریافتی از این api می توانید بسته یا شارژ مورد نظر خود را خریداری نمایید

GET/api/clients/products

لیست محصولات

  • Name
    name
    Type
    string
    Description

    نام محصول

  • Name
    description
    Type
    string
    Description

    توضیحات

  • Name
    status
    Type
    boolean
    Description

    وضعیت

  • Name
    sim_card_type
    Type
    string
    Description

    credit: سیم کارت اعتباری
    permanent: سیم کارت دائمی

  • Name
    operator_id
    Type
    string
    Description

    1: همراه اول
    2: ایرانسل
    3: رایتل
    4: آپتل
    5: شاتل موبایل

  • Name
    second_price
    Type
    number
    Description

    مبلغ دوم - درصورتی که این فیلد پر باشد می توانید از بازه price تا second_price عدد ارسال کنید

  • Name
    categories
    Type
    object
    Description

    مشابه نمونه در این فیلد نام دسته بندی و زیر دسته بندی ها وجود دارند و می توانید دسته بندی مورد نظر را پیدا کنید.

با این api می توانید لیست محصولات را مشاهده و دیتای مورد نیاز خود را استخراج کنید

فیلد های اختیاری

فیلد های زیر را به صورت query params ارسال کنید

  • Name
    per_page
    Type
    string
    Description

    تعداد محصولات در هر صفحه را می توانید ارسال کنید

  • Name
    order
    Type
    string
    Description

    اگر در این فیلد id ارسال کنید می توانید بر اساس آن محصولات را مرتب کنید

  • Name
    type_order
    Type
    string
    Description

    یا به صورت asc یا به صورت desc

Request

GET
/api/clients/products
curl -G https://gateway.esaj.ir/api/clients/products?per_page=1000 \
  -H "Authorization: Bearer {token}" \

نمونه پاسخ

{
"data": [
{
  "id": 1,
  "name": "2 گیگابایت",
  "name_en": null,
  "description": "2 گیگابایت",
  "description_full": null,
  "sku": null,
  "price": 104500,
  "second_price": null,
  "showable_price": null,
  "type": "cell_internet",
  "minimum_sale": null,
  "dimension": null,
  "score": 0,
  "status": 1,
  "options": null,
  "deliverable": 0,
  "third_party_id": null,
  "capacity": null,
  "period": 3,
  "sim_card_type": "credit",
  "operator_id": 4,
  "profile_id": "20880",
  "order": 1,
  "created_at": null,
  "updated_at": null,
  "categories": [
    {
      "id": 1,
      "name": "اپتل",
      "data": "[\n      {\n        \"id\": 1,\n        \"text\": \"3 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 2,\n        \"text\": \"ماهانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 3,\n        \"text\": \"هفتگی\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 4,\n        \"text\": \"15 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 5,\n        \"text\": \"3 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 6,\n        \"text\": \"6 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 7,\n        \"text\": \"سالانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 8,\n        \"text\": \"رومینگ عراق 30 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 9,\n        \"text\": \"روزانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 10,\n        \"text\": \"رومینگ ترکیه 30 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 11,\n        \"text\": \"رومینگ امارات 30 روزه\",\n        \"parent\": 0\n      }\n    ]",
      "created_at": null,
      "updated_at": null,
      "pivot": {
        "categorizable_type": "App\\Models\\Product",
        "categorizable_id": 1,
        "category_id": 1,
        "address": "1"
      }
    }
  ]
},
{
  "id": 257,
  "name": "7 روزه 500 مگابایت",
  "name_en": null,
  "description": "7 روزه 500 مگابایت",
  "description_full": null,
  "sku": null,
  "price": 49500,
  "second_price": null,
  "showable_price": null,
  "type": "cell_internet",
  "minimum_sale": null,
  "dimension": null,
  "score": 0,
  "status": 1,
  "options": null,
  "deliverable": 0,
  "third_party_id": null,
  "capacity": null,
  "period": null,
  "sim_card_type": "credit",
  "operator_id": 1,
  "order": 257,
  "created_at": null,
  "updated_at": null,
  "categories": [
    {
      "id": 5,
      "name": "همراه اول",
      "data": "[\n      {\n        \"id\": 1,\n        \"text\": \"ماهانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 2,\n        \"text\": \"بسته های اینترنت انارستان مخصوص سیم کارتهای اعتباری\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 3,\n        \"text\": \"بسته های مکالمه انارستان مخصوص سیم کارتهای اعتباری\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 4,\n        \"text\": \"روزانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 5,\n        \"text\": \"هفتگی\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 6,\n        \"text\": \"2 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 7,\n        \"text\": \"4 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 8,\n        \"text\": \"بسته های پرفروش\",\n        \"parent\": 0\n      }\n    ]",
      "created_at": null,
      "updated_at": null,
      "pivot": {
        "categorizable_type": "App\\Models\\Product",
        "categorizable_id": 257,
        "category_id": 5,
        "address": "2"
      }
    }
  ]
},
],
"links": {
"first": "http://gateway.esaj.ir/api/clients/products?page=1",
"last": "http://gateway.esaj.ir/api/clients/products?page=5",
"prev": null,
"next": "http://gateway.esaj.ir/api/clients/products?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"links": [
  {
    "url": null,
    "label": "« Previous",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=1",
    "label": "1",
    "active": true
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=2",
    "label": "2",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=3",
    "label": "3",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=4",
    "label": "4",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=5",
    "label": "5",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=2",
    "label": "Next »",
    "active": false
  }
],
"path": "http://gateway.esaj.ir/api/clients/products",
"per_page": 100,
"to": 100,
"total": 439
},
"balance": 0
}
POST/api/filter

فیلتر محصولات

  • Name
    name
    Type
    string
    Description

    نام محصول

  • Name
    description
    Type
    string
    Description

    توضیحات

  • Name
    status
    Type
    boolean
    Description

    وضعیت

  • Name
    sim_card_type
    Type
    string
    Description

    credit: سیم کارت اعتباری
    permanent: سیم کارت دائمی

  • Name
    operator_id
    Type
    string
    Description

    1: همراه اول
    2: ایرانسل
    3: رایتل
    4: آپتل
    5: شاتل موبایل

  • Name
    second_price
    Type
    number
    Description

    مبلغ دوم - درصورتی که این فیلد پر باشد می توانید از بازه price تا second_price عدد ارسال کنید

  • Name
    categories
    Type
    object
    Description

    مشابه نمونه در این فیلد نام دسته بندی و زیر دسته بندی ها وجود دارند و می توانید دسته بندی مورد نظر را پیدا کنید.

در این قسمت با وارد کردن فیلتر مورد نظر خود می توانید محصولات را فیلتر نمایید

فیلد های قابل ارسال

  • Name
    table
    Type
    string
    Description

    در این قسمت فقط وارد کنید product

  • Name
    items
    Type
    object
    Description
  • Name
    name
    Type
    string
    Description

    بر اساس نام محصول

  • Name
    categories
    Type
    string
    Description

    در صورتی که نیاز به دریافت دسته بندی های محصولات دارید
    فیلد categories را برابر با categories قرار دهید

  • Name
    sim_card_type
    Type
    string
    Description

    برای دریافت محصولات اعتباری
    credit
    برای دریافت محصولات که مخصوص شماره های دائمی هستید
    permanent
    را ارسال فرمایید

  • Name
    type
    Type
    enum
    Description

    یکی از گزینه های زیر را می توانید وارد کنید
    cell_internet - محصولات بسته اینترنتی
    cell_direct_charge - محصولات شارژ
    td_lte_internet - محصولات TD-LTE (فقط ایرانسل)\

  • Name
    operator
    Type
    enum
    Description

    یکی از گزینه های زیر را می توانید وارد کنید
    irancell
    shatel
    aptel
    rightel
    mci

  • Name
    pagination
    Type
    string
    Description

    در صورتی که نیاز دارید محصولات را بدون pagination ببینید
    pagination را به صورت string "false" ارسال کنید

Request

POST
/api/filter
curl -X POST "https://gateway.esaj.ir/api/filter" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{"table": "product", "items": {"operator": "irancell"}}'

نمونه پاسخ

{
"data": [
{
  "id": 1,
  "name": "2 گیگابایت",
  "name_en": null,
  "description": "2 گیگابایت",
  "description_full": null,
  "sku": null,
  "price": 104500,
  "second_price": null,
  "showable_price": null,
  "type": "cell_internet",
  "minimum_sale": null,
  "dimension": null,
  "score": 0,
  "status": 1,
  "options": null,
  "deliverable": 0,
  "third_party_id": null,
  "capacity": null,
  "period": 3,
  "sim_card_type": "credit",
  "operator_id": 4,
  "profile_id": "20880",
  "order": 1,
  "created_at": null,
  "updated_at": null,
  "categories": [
    {
      "id": 1,
      "name": "اپتل",
      "data": "[\n      {\n        \"id\": 1,\n        \"text\": \"3 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 2,\n        \"text\": \"ماهانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 3,\n        \"text\": \"هفتگی\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 4,\n        \"text\": \"15 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 5,\n        \"text\": \"3 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 6,\n        \"text\": \"6 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 7,\n        \"text\": \"سالانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 8,\n        \"text\": \"رومینگ عراق 30 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 9,\n        \"text\": \"روزانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 10,\n        \"text\": \"رومینگ ترکیه 30 روزه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 11,\n        \"text\": \"رومینگ امارات 30 روزه\",\n        \"parent\": 0\n      }\n    ]",
      "created_at": null,
      "updated_at": null,
      "pivot": {
        "categorizable_type": "App\\Models\\Product",
        "categorizable_id": 1,
        "category_id": 1,
        "address": "1"
      }
    }
  ]
},
{
  "id": 257,
  "name": "7 روزه 500 مگابایت",
  "name_en": null,
  "description": "7 روزه 500 مگابایت",
  "description_full": null,
  "sku": null,
  "price": 49500,
  "second_price": null,
  "showable_price": null,
  "type": "cell_internet",
  "minimum_sale": null,
  "dimension": null,
  "score": 0,
  "status": 1,
  "options": null,
  "deliverable": 0,
  "third_party_id": null,
  "capacity": null,
  "period": null,
  "sim_card_type": "credit",
  "operator_id": 1,
  "order": 257,
  "created_at": null,
  "updated_at": null,
  "categories": [
    {
      "id": 5,
      "name": "همراه اول",
      "data": "[\n      {\n        \"id\": 1,\n        \"text\": \"ماهانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 2,\n        \"text\": \"بسته های اینترنت انارستان مخصوص سیم کارتهای اعتباری\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 3,\n        \"text\": \"بسته های مکالمه انارستان مخصوص سیم کارتهای اعتباری\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 4,\n        \"text\": \"روزانه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 5,\n        \"text\": \"هفتگی\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 6,\n        \"text\": \"2 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 7,\n        \"text\": \"4 ماهه\",\n        \"parent\": 0\n      },\n      {\n        \"id\": 8,\n        \"text\": \"بسته های پرفروش\",\n        \"parent\": 0\n      }\n    ]",
      "created_at": null,
      "updated_at": null,
      "pivot": {
        "categorizable_type": "App\\Models\\Product",
        "categorizable_id": 257,
        "category_id": 5,
        "address": "2"
      }
    }
  ]
},
],
"links": {
"first": "http://gateway.esaj.ir/api/clients/products?page=1",
"last": "http://gateway.esaj.ir/api/clients/products?page=5",
"prev": null,
"next": "http://gateway.esaj.ir/api/clients/products?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"links": [
  {
    "url": null,
    "label": "« Previous",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=1",
    "label": "1",
    "active": true
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=2",
    "label": "2",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=3",
    "label": "3",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=4",
    "label": "4",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=5",
    "label": "5",
    "active": false
  },
  {
    "url": "http://gateway.esaj.ir/api/clients/products?page=2",
    "label": "Next »",
    "active": false
  }
],
"path": "http://gateway.esaj.ir/api/clients/products",
"per_page": 100,
"to": 100,
"total": 439
},
"balance": 0
}

اطلاعات این صفحه مفید بود ؟