Tổng đài hỗ trợ - 
1900 6750
( 7:00 - 22:00 )

Phương thức GET của Product

GET/admin/products.json

Lấy ra danh sách Product

ids

Danh sách Id của Product, cách nhau bởi dấu phẩy

limit

Số lượng kết quả trả về

(mặc định: 50) (tối đa: 250)
page

Số trang

(mặc định: 1)
since_id

Giới hạn kết quả trả về sau một ID xác định

query

Lọc theo tên Product

vendor

Lọc theo nhà cung cấp

alias

Lọc theo alias

product_type

Lọc theo loại sản phẩm

collection_id

Lọc theo Id danh mục

created_on_min

Hiển thị các Product được tạo sau ngày này (định dạng: 2008-12-31 03:00)

created_on_max

Hiển thị các Product được tạo trước ngày này (định dạng: 2008-12-31 03:00)

modified_on_min

Hiển thị Product được cập nhật lần cuối sau ngày này (định dạng: 2008-12-31 03:00)

modified_on_max

Hiển thị Product được cập nhật lần cuối trước ngày này (định dạng: 2008-12-31 03:00)

published_on_min

Hiển thị Product được xuất bản sau ngày này (định dạng: 2008-12-31 03:00)

published_on_max

Hiển thị Product được xuất bản trước ngày này (định dạng: 2008-12-31 03:00)

published
  • true - Hiển thị các Product đã xuất bản
  • false - Hiển thị các Product chưa xuất bản
fields

Danh sách các trường trong kết quả trả về, cách nhau bởi dấu phẩy

Lấy tất cả Product

GET /admin/products.json
Ẩn kết quả

Lấy tất cả Product, chỉ hiển thị một vài thuộc tính

GET /admin/products.json?fields=id,images,name
Xem kết quả

Lấy danh sách các Product xác định

GET /admin/products.json?ids=632910392,921728736
Xem kết quả
HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 632910392,
      "name": "IPod Nano - 8GB",
      "content": "<p>It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.<\/p>",
      "summary": "It's the small iPod with one very big idea: Video.",
      "vendor": "Apple",
      "product_type": "Cult Products",
      "created_on": "2015-12-08T11:40:19Z",
      "alias": "ipod-nano",
      "modified_on": "2015-12-08T11:40:19Z",
      "published_on": "2007-12-31T19:00:00Z",
      "template_layout": null,
      
      "tags": "Emotive, Flash Memory, MP3, Music",
      "variants": [
        {
          "id": 808950810,
          "product_id": 632910392,
          "title": "Pink",
          "price": "199.00",
          "sku": "IPOD2008PINK",
          "position": 1,
          "grams": 200,
          "inventory_policy": "continue",
          "compare_at_price": null,
          
          "inventory_management": "bizweb",
          "option1": "Pink",
          "option2": null,
          "option3": null,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "requires_shipping": true,
          
          "barcode": "1234_pink",
          "inventory_quantity": 10,
          
          "image_id": 562641783,
          "weight": 0.2,
          "weight_unit": "kg"
        },
        {
          "id": 49148385,
          "product_id": 632910392,
          "title": "Red",
          "price": "199.00",
          "sku": "IPOD2008RED",
          "position": 2,
          "grams": 200,
          "inventory_policy": "continue",
          "compare_at_price": null,
          
          "inventory_management": "bizweb",
          "option1": "Red",
          "option2": null,
          "option3": null,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "requires_shipping": true,
          
          "barcode": "1234_red",
          "inventory_quantity": 20,
          
          "image_id": null,
          "weight": 0.2,
          "weight_unit": "kg"
        },
        {
          "id": 39072856,
          "product_id": 632910392,
          "title": "Green",
          "price": "199.00",
          "sku": "IPOD2008GREEN",
          "position": 3,
          "grams": 200,
          "inventory_policy": "continue",
          "compare_at_price": null,
          
          "inventory_management": "bizweb",
          "option1": "Green",
          "option2": null,
          "option3": null,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "requires_shipping": true,
          
          "barcode": "1234_green",
          "inventory_quantity": 30,
          
          "image_id": null,
          "weight": 0.2,
          "weight_unit": "kg"
        },
        {
          "id": 457924702,
          "product_id": 632910392,
          "title": "Black",
          "price": "199.00",
          "sku": "IPOD2008BLACK",
          "position": 4,
          "grams": 200,
          "inventory_policy": "continue",
          "compare_at_price": null,
          
          "inventory_management": "bizweb",
          "option1": "Black",
          "option2": null,
          "option3": null,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "requires_shipping": true,
          
          "barcode": "1234_black",
          "inventory_quantity": 40,
          
          "image_id": null,
          "weight": 0.2,
          "weight_unit": "kg"
        }
      ],
      "options": [
        {
          "id": 594680422,
          "product_id": 632910392,
          "name": "Color",
          "position": 1,
          "values": [
            "Pink",
            "Red",
            "Green",
            "Black"
          ]
        }
      ],
      "images": [
        {
          "id": 850703190,
          "product_id": 632910392,
          "position": 1,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "src": "https:\/\/bizweb.dktcdn.net\/s\/files\/1\/0006\/9093\/3842\/products\/ipod-nano.png?v=1449592819",
          "variant_ids": [
          ]
        },
        {
          "id": 562641783,
          "product_id": 632910392,
          "position": 2,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "src": "https:\/\/bizweb.dktcdn.net\/s\/files\/1\/0006\/9093\/3842\/products\/ipod-nano-2.png?v=1449592819",
          "variant_ids": [
            808950810
          ]
        }
      ],
      "image": {
        "id": 850703190,
        "product_id": 632910392,
        "position": 1,
        "created_on": "2015-12-08T11:40:19Z",
        "modified_on": "2015-12-08T11:40:19Z",
        "src": "https:\/\/bizweb.dktcdn.net\/s\/files\/1\/0006\/9093\/3842\/products\/ipod-nano.png?v=1449592819",
        "variant_ids": [
        ]
      }
    },
    {
      "id": 921728736,
      "name": "IPod Touch 8GB",
      "content": "<p>The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.<\/p>",
      "summary": "It's the small iPod with one very big idea: Video.",
      "vendor": "Apple",
      "product_type": "Cult Products",
      "created_on": "2015-12-08T11:40:19Z",
      "alias": "ipod-touch",
      "modified_on": "2015-12-08T11:40:19Z",
      "published_on": "2008-09-25T20:00:00Z",
      "template_layout": null,
      
      "tags": "",
      "variants": [
        {
          "id": 447654529,
          "product_id": 921728736,
          "title": "Black",
          "price": "199.00",
          "sku": "IPOD2009BLACK",
          "position": 1,
          "grams": 200,
          "inventory_policy": "continue",
          "compare_at_price": null,
          
          "inventory_management": "bizweb",
          "option1": "Black",
          "option2": null,
          "option3": null,
          "created_on": "2015-12-08T11:40:19Z",
          "modified_on": "2015-12-08T11:40:19Z",
          "requires_shipping": true,
          
          "barcode": "1234_black",
          "inventory_quantity": 13,
          
          "image_id": null,
          "weight": 0.2,
          "weight_unit": "kg"
        }
      ],
      "options": [
        {
          "id": 891236591,
          "product_id": 921728736,
          "name": "Title",
          "position": 1,
          "values": [
            "Black"
          ]
        }
      ],
      "images": [
      ],
      "image": null
    }
  ]
}

Lấy tất cả Product thuộc một danh mục

GET /admin/products.json?collection_id=841564295
Xem kết quả

Lấy các Product sau một ID xác định

GET /admin/products.json?since_id=632910392
Xem kết quả
HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 921728736,
      "name": "IPod Touch 8GB",
      "content": "

The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.<\/p>","summary": "It's the small iPod with one very big idea: Video.", "vendor": "Apple", "product_type": "Cult Products", "created_on": "2015-12-08T11:40:19Z", "alias": "ipod-touch", "modified_on": "2015-12-08T11:40:19Z", "published_on": "2008-09-25T20:00:00Z", "template_layout": null, "tags": "", "variants": [ { "id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "grams": 200, "inventory_policy": "continue", "compare_at_price": null, "inventory_management": "bizweb", "option1": "Black", "option2": null, "option3": null, "created_on": "2015-12-08T11:40:19Z", "modified_on": "2015-12-08T11:40:19Z", "requires_shipping": true, "barcode": "1234_black", "inventory_quantity": 13, "image_id": null, "weight": 0.2, "weight_unit": "kg" } ], "options": [ { "id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": [ "Black" ] } ], "images": [ ], "image": null } ] }

GET/admin/products/count.json

Lấy tổng số Product có trong danh mục

vendor

Lọc theo nhà cung cấp

product_type

Lọc theo loại

collection_id

Lọc theo Id danh mục

created_on_min

Hiển thị các Product được tạo sau ngày này (định dạng: 2008-12-31 03:00)

created_on_max

Hiển thị các Product được tạo trước ngày này (định dạng: 2008-12-31 03:00)

modified_on_min

Hiển thị các Product được cập nhật lần cuối sau ngày này (định dạng: 2008-12-31 03:00)

modified_on_max

Hiển thị các Product được cập nhật lần cuối trước ngày này (định dạng: 2008-12-31 03:00)

published_on_min

Hiển thị các Product được xuất bản sau ngày này (định dạng: 2008-12-31 03:00)

published_on_max

Hiển thị các Produc được xuất bản trước ngày này (định dạng: 2008-12-31 03:00)

published
  • true - chỉ hiển thị các Product đã xuất bản
  • false - chỉ hiển thị các Product chưa xuất bản

Tổng số các Product

GET /admin/products/count.json
Xem kết quả
HTTP/1.1 200 OK
{
  "count": 2
}

Đếm số Product thuộc một danh mục xác định

GET /admin/products/count.json?collection_id=841564295
Xem kết quả
HTTP/1.1 200 OK
{
  "count": 1
}
GET/admin/products/632910392.json

Lấy ra một Product

fields

danh sách các trường trong kết quả trả về, cách nhau bởi dấu phẩy

Chỉ lấy các trường xác định

GET /admin/products/#{id}.json?fields=id,images,name
Xem kết quả
HTTP/1.1 200 OK
{
  "product": {
    "id": 632910392,
    "name": "IPod Nano - 8GB",
    "images": [
      {
        "id": 850703190,
        "product_id": 632910392,
        "position": 1,
        "created_on": "2015-12-08T11:40:19Z",
        "modified_on": "2015-12-08T11:40:19Z",
        "src": "https:\/\/bizweb.dktcdn.net\/s\/files\/1\/0006\/9093\/3842\/products\/ipod-nano.png?v=1449592819",
        "variant_ids": [
        ]
      },
      {
        "id": 562641783,
        "product_id": 632910392,
        "position": 2,
        "created_on": "2015-12-08T11:40:19Z",
        "modified_on": "2015-12-08T11:40:19Z",
        "src": "https:\/\/bizweb.dktcdn.net\/s\/files\/1\/0006\/9093\/3842\/products\/ipod-nano-2.png?v=1449592819",
        "variant_ids": [
          808950810
        ]
      }
    ]
  }
}

Lấy một Product bằng ID

GET /admin/products/#{id}.json
Xem kết quả


Bài viết trên có hữu ích cho bạn không?

Hữu ích Không hữu ích
Số lượt đánh giá hữu ích: