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

Phương thức GET của Order phần 2

GET/admin/orders/450789469.json

Lấy một Order

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 một số thuộc tính xác định

GET /admin/orders/#{id}.json?fields=id,line_items,name,total_price
Xem kết quả
HTTP/1.1 200 OK
{
  "order": {
    "id": 450789469,
    "total_price": "409.94",
    "name": "#1001",
    "line_items": [
      {
        "id": 466157049,
        "variant_id": 39072856,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008GREEN",
        "variant_title": "green",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - green",
        "variant_inventory_management": "bizweb",
        "properties": [
          {
            "name": "Custom Engraving Front",
            "value": "Happy Birthday"
          },
          {
            "name": "Custom Engraving Back",
            "value": "Merry Christmas"
          }
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      },
      {
        "id": 518995019,
        "variant_id": 49148385,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008RED",
        "variant_title": "red",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - red",
        "variant_inventory_management": "bizweb",
        "properties": [
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      },
      {
        "id": 703073504,
        "variant_id": 457924702,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008BLACK",
        "variant_title": "black",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - black",
        "variant_inventory_management": "bizweb",
        "properties": [
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      }
    ]
  }
}

Lấy một Order

GET /admin/orders/#{id}.json
Xem kết quả
HTTP/1.1 200 OK
{
  "order": {
    "id": 450789469,
    "email": "[email protected]",
    "closed_on": null,
    "created_on": "2008-01-10T11:00:00Z",
    "modified_on": "2008-01-10T11:00:00Z",
    "number": 1,
    "note": null,
    "token": "b1946ac92492d2347c6235b4d2611184",
    "gateway": "authorize_net",
    "test": false,
    "total_price": "409.94",
    "subtotal_price": "398.00",
    "total_weight": 0,
    "total_tax": "11.94",
    "taxes_included": false,
    "currency": "USD",
    "financial_status": "authorized",
    "confirmed": false,
    "total_discounts": "0.00",
    "total_line_items_price": "398.00",
    "cart_token": "68778783ad298f1c80c3bafcddeea02f",
    "buyer_accepts_marketing": false,
    "name": "#1001",
    "referring_site": "http:\/\/www.otherexample.com",
    "landing_site": "http:\/\/www.example.com?source=abc",
    "cancelled_on": null,
    "cancel_reason": null,
    "total_price_usd": "409.94",
    "checkout_token": null,
    "reference": "fhwdgads",
    "user_id": null,
    "location_id": null,
    "source_identifier": "fhwdgads",
    "source_url": null,
    "processed_on": "2008-01-10T11:00:00Z",
    "device_id": null,
    "browser_ip": null,
    "landing_site_ref": "abc",
    "order_number": 1001,
    "discount_codes": [
      {
        "code": "TENOFF",
        "amount": "10.00",
        "type": "percentage"
      }
    ],
    "note_attributes": [
      {
        "name": "custom engraving",
        "value": "Happy Birthday"
      },
      {
        "name": "colour",
        "value": "green"
      }
    ],
    "payment_gateway_names": [
      "bogus"
    ],
    "processing_method": "direct",
    "checkout_id": 450789469,
    "source_name": "web",
    "fulfillment_status": null,
    "tax_lines": [
      {
        "title": "State Tax",
        "price": "11.94",
        "rate": 0.06
      }
    ],
    "tags": "",
    "contact_email": "[email protected]",
    "line_items": [
      {
        "id": 466157049,
        "variant_id": 39072856,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008GREEN",
        "variant_title": "green",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - green",
        "variant_inventory_management": "bizweb",
        "properties": [
          {
            "name": "Custom Engraving Front",
            "value": "Happy Birthday"
          },
          {
            "name": "Custom Engraving Back",
            "value": "Merry Christmas"
          }
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      },
      {
        "id": 518995019,
        "variant_id": 49148385,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008RED",
        "variant_title": "red",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - red",
        "variant_inventory_management": "bizweb",
        "properties": [
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      },
      {
        "id": 703073504,
        "variant_id": 457924702,
        "title": "IPod Nano - 8gb",
        "quantity": 1,
        "price": "199.00",
        "grams": 200,
        "sku": "IPOD2008BLACK",
        "variant_title": "black",
        "vendor": null,
        "fulfillment_service": "manual",
        "product_id": 632910392,
        "requires_shipping": true,
        "taxable": true,
        "gift_card": false,
        "name": "IPod Nano - 8gb - black",
        "variant_inventory_management": "bizweb",
        "properties": [
        ],
        "product_exists": true,
        "fulfillable_quantity": 1,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      }
    ],
    "shipping_lines": [
      {
        "title": "Free Shipping",
        "price": "0.00",
        "code": "Free Shipping",
        "source": "bizweb",
        "phone": null,
        "tax_lines": [
        ]
      }
    ],
    "billing_address": {
      "first_name": "Bob",
      "address1": "Chestnut Street 92",
      "phone": "555-625-1199",
      "city": "Louisville",
      "zip": "40202",
      "province": "Kentucky",
      "country": "United States",
      "last_name": "Norman",
      "address2": "",
      "company": null,
      "latitude": 45.41634,
      "longitude": -75.6868,
      "name": "Bob Norman",
      "country_code": "US",
      "province_code": "KY"
    },
    "shipping_address": {
      "first_name": "Bob",
      "address1": "Chestnut Street 92",
      "phone": "555-625-1199",
      "city": "Louisville",
      "zip": "40202",
      "province": "Kentucky",
      "country": "United States",
      "last_name": "Norman",
      "address2": "",
      "company": null,
      "latitude": 45.41634,
      "longitude": -75.6868,
      "name": "Bob Norman",
      "country_code": "US",
      "province_code": "KY"
    },
    "fulfillments": [
      {
        "id": 255858046,
        "order_id": 450789469,
        "status": "failure",
        "created_on": "2015-12-08T11:40:19Z",
        "service": "manual",
        "modified_on": "2015-12-08T11:40:19Z",
        "tracking_company": null,
        "tracking_number": "1Z2345",
        "tracking_numbers": [
          "1Z2345"
        ],
        "tracking_url": "http:\/\/wwwapps.ups.com\/etracking\/tracking.cgi?InquiryNumber1=1Z2345&TypeOfInquiryNumber=T&AcceptUPSLicenseAgreement=yes&submit=Track",
        "tracking_urls": [
          "http:\/\/wwwapps.ups.com\/etracking\/tracking.cgi?InquiryNumber1=1Z2345&TypeOfInquiryNumber=T&AcceptUPSLicenseAgreement=yes&submit=Track"
        ],
        "receipt": {
          "testcase": true,
          "authorization": "123456"
        },
        "line_items": [
          {
            "id": 466157049,
            "variant_id": 39072856,
            "title": "IPod Nano - 8gb",
            "quantity": 1,
            "price": "199.00",
            "grams": 200,
            "sku": "IPOD2008GREEN",
            "variant_title": "green",
            "vendor": null,
            "fulfillment_service": "manual",
            "product_id": 632910392,
            "requires_shipping": true,
            "taxable": true,
            "gift_card": false,
            "name": "IPod Nano - 8gb - green",
            "variant_inventory_management": "bizweb",
            "properties": [
              {
                "name": "Custom Engraving Front",
                "value": "Happy Birthday"
              },
              {
                "name": "Custom Engraving Back",
                "value": "Merry Christmas"
              }
            ],
            "product_exists": true,
            "fulfillable_quantity": 1,
            "total_discount": "0.00",
            "fulfillment_status": null,
            "tax_lines": [
            ]
          }
        ]
      }
    ],
    "client_details": {
      "browser_ip": "0.0.0.0",
      "accept_language": null,
      "user_agent": null,
      "session_hash": null,
      "browser_width": null,
      "browser_height": null
    },
    "refunds": [
      {
        "id": 509562969,
        "order_id": 450789469,
        "created_on": "2015-12-08T11:40:19Z",
        "note": "it broke during shipping",
        "restock": true,
        "user_id": 799407056,
        "refund_line_items": [
          {
            "id": 104689539,
            "quantity": 1,
            "line_item_id": 703073504,
            "line_item": {
              "id": 703073504,
              "variant_id": 457924702,
              "title": "IPod Nano - 8gb",
              "quantity": 1,
              "price": "199.00",
              "grams": 200,
              "sku": "IPOD2008BLACK",
              "variant_title": "black",
              "vendor": null,
              "fulfillment_service": "manual",
              "product_id": 632910392,
              "requires_shipping": true,
              "taxable": true,
              "gift_card": false,
              "name": "IPod Nano - 8gb - black",
              "variant_inventory_management": "bizweb",
              "properties": [
              ],
              "product_exists": true,
              "fulfillable_quantity": 1,
              "total_discount": "0.00",
              "fulfillment_status": null,
              "tax_lines": [
              ]
            }
          },
          {
            "id": 709875399,
            "quantity": 1,
            "line_item_id": 466157049,
            "line_item": {
              "id": 466157049,
              "variant_id": 39072856,
              "title": "IPod Nano - 8gb",
              "quantity": 1,
              "price": "199.00",
              "grams": 200,
              "sku": "IPOD2008GREEN",
              "variant_title": "green",
              "vendor": null,
              "fulfillment_service": "manual",
              "product_id": 632910392,
              "requires_shipping": true,
              "taxable": true,
              "gift_card": false,
              "name": "IPod Nano - 8gb - green",
              "variant_inventory_management": "bizweb",
              "properties": [
                {
                  "name": "Custom Engraving Front",
                  "value": "Happy Birthday"
                },
                {
                  "name": "Custom Engraving Back",
                  "value": "Merry Christmas"
                }
              ],
              "product_exists": true,
              "fulfillable_quantity": 1,
              "total_discount": "0.00",
              "fulfillment_status": null,
              "tax_lines": [
              ]
            }
          }
        ],
        "transactions": [
          {
            "id": 179259969,
            "order_id": 450789469,
            "amount": "209.00",
            "kind": "refund",
            "gateway": "bogus",
            "status": "success",
            "message": null,
            "created_on": "2005-08-05T12:59:12Z",
            "test": false,
            "authorization": "authorization-key",
            "currency": "USD",
            "location_id": null,
            "user_id": null,
            "parent_id": null,
            "device_id": null,
            "receipt": {},
            "error_code": null,
            "source_name": "web"
          }
        ],
        "order_adjustments": [
        ]
      }
    ],
    "payment_details": {
      "credit_card_bin": null,
      "avs_result_code": null,
      "cvv_result_code": null,
      "credit_card_number": "•••• •••• •••• 4242",
      "credit_card_company": "Visa"
    },
    "customer": {
      "id": 207119551,
      "email": "[email protected]",
      "accepts_marketing": false,
      "created_on": "2015-12-08T11:40:19Z",
      "modified_on": "2015-12-08T11:40:19Z",
      "first_name": "Bob",
      "last_name": "Norman",
      "orders_count": 1,
      "state": "disabled",
      "total_spent": "41.94",
      "last_order_id": 450789469,
      "note": null,
      "verified_email": true,
      "multipass_identifier": null,
      "tax_exempt": false,
      "tags": "",
      "last_order_name": "#1001",
      "default_address": {
        "id": 207119551,
        "first_name": null,
        "last_name": null,
        "company": null,
        "address1": "Chestnut Street 92",
        "address2": "",
        "city": "Louisville",
        "province": "Kentucky",
        "country": "United States",
        "zip": "40202",
        "phone": "555-625-1199",
        "name": "",
        "province_code": "KY",
        "country_code": "US",
        "country_name": "United States",
        "default": true
      }
    }
  }
}


GET/admin/orders/count.json

Lấy tổng số Order

created_on_min

Số Order được tạo sau ngày này (định dạng: 2008-12-31 03:00)

created_on_max

Số Order được tạo trước ngày này (định dạng: 2008-12-31 03:00)

modified_on_min

Số Order đượ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

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

status
  • open - Các Order đang hoạt động (mặc định)
  • closed - Các Order đã lưu trữ
  • any - Tất cả các Order
financial_status
  • authorized - Các Order có khoản tiền thanh toán đã được xác thực
  • pending - Các Order đang tạm dừng thanh toán
  • paid - Các Order đã được thanh toán
  • refunded - Các Order đã được hoàn trả
  • voided - Các Order đã vô hiệu việc thanh toán
  • any - Các Order có trạng thái thanh toán là authorized, pending, và paid (mặc định)
fulfillment_status
  • fulfilled - Các Order đã được giao hàng
  • partial - Các Order đã giao một phần
  • unfulfilled - Các Order chưa được giao hàng
  • any - Tất cả các Order (mặc định)

Tổng số các Order

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

Tổng số các Order có trạng thái thanh toán là authorized.

GET /admin/orders/count.json?financial_status=authorized
Xem kết quả
HTTP/1.1 200 OK
{
  "count": 1
}

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: