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

Fulfillment

Một Fulfillment đại diện cho việc vận chuyển một hay nhiều item của một đơn hàng. Khi một đơn hàng đã được chuyển về trạng thái fulfilled tức là tất cả item trong đơn hàng đã được chuyển đến cho khách hàng.

Rõ ràng, một người chủ Shop muốn chỉ thực hiện một lần giao hàng đối với đơn hàng nhưng đôi khi kích cỡ item hay item có còn trong kho hay không sẽ khiến cho việc giao hàng phải thực hiện nhiều lần. Đó là lí do một đơn hàng có thể có nhiều Fulfillment

Bạn có thể làm gì với Fulfillment?

Sapo API cho phép bạn thực hiện các thao tác sau với tài nguyên Fulfillment. Các phiên bản chi tiết hơn của những thao tác này có thể có:

Các thuộc tính của Fulfillment

created_on
{ "created_on" : "2012-03-13T16:09:54Z" }

Thời gian Fulfillment được tạo. API trả về kết quả theo định dạng chuẩn ISO 8601.

id
{ "id" : 255858046 }

Số duy nhất định danh Fulfillment.

line_items
{ "fulfillable_quantity" : 1 }
{ "fulfillment_service" : "manual" }
{ "fulfillment_status" : "null" }
{ "grams" : 200 }
{ "id" : 466157049 }
{ "price" : "199.00" }
{ "product_id" : 632910392 }
{ "quantity" : 1 }
{ "requires_shipping" : true }
{ "sku" : "IPOD2008GREEN" }
{ "title" : "IPod Nano - 8gb" }
{ "variant_id" : "39072856" }
{ "variant_title" : "green" }
{ "vendor" : "null" }
{ "name" : "IPod Nano - 8gb - green" }
{ "variant_inventory_management" : "bizweb" }
{ "properties" : "[ ]" }
{ "product_exists" : true }

Một bản ghi lịch sử của mỗi item trong fulfillment:

  • fulfillable_quantity: Số lượng còn phải giao.
  • fulfillment_service: Nhà cung cấp dịch vụ, đơn vị thực hiện Fulfillment.
  • fulfillment_status: Trạng thái giao hàng của Order. Các giá trị hợp lệ là: fulfilled, null or partial.
  • grams: Khối lượng của item, được tính theo đơn vị grams.
  • id: Id của line_item trong Fulfillment.
  • price: Giá của item.
  • product_id: Số duy nhất định danh Product trong Fulfillment.
  • quantity: Số lượng của item trong Fulfillment.
  • requires_shipping: Xác định khách hàng có cần cung cấp địa chỉ giao hàng khi đặt hàng hay không. Các giá trị hợp lệ: "true" hoặc "false."
  • sku: Định danh duy nhất của item trong Fulfillment.
  • title: Tiêu đề của Product.
  • variant_id: Id của ProductVariant được giao.
  • variant_title: Tiêu đề của ProductVariant được giao.
  • vendor: Tên nhà phân phối item.
  • name: Tên của ProductVariant.
  • variant inventory management: Tên hệ thống quản lý kho.
  • properties: Các thuộc tính thêm ứng với từng line item.
  • product_exists: Xác định Product có còn tồn tại hay không. Các giá trị hợp lệ là: "true" hoặc "false".
order_id
{ "order_id" : 450789469 }

Số duy nhất định danh Order.

receipt
{ "testcase" : true }
{ "authorization" : "123456" }

Thông tin về hóa đơn:

  • testcase: Xác định Fulfillment có phải là trường hợp test hay không. Các giá trị hợp lệ là "true" hoặc "false".
  • authorization: Mã xác thực.
status
{ "status" : "failure" }

Trạng thái của Fulfillment. Các giá trị hợp lệ:

  • pending: Fulfillment đang tạm hoãn.
  • success: Fulfillment hoàn thành.
  • cancelled: Fulfillment bị hủy.
  • error: Có lỗi xảy ra với lời gọi Fulfillment.
  • failure: Fulfillment thất bại.
tracking_company
{ "tracking_company" : "null" }

Tên công ty giao vận.

tracking_numbers
{ "tracking_numbers" : ["1Z2345"] }

Danh sách các mã giao vận, được cung cấp bởi công ty giao vận.

tracking_urls
{ "tracking_urls" : ["http://www.google.com/search?q=1Z2345"] }

Các đường dẫn URL để kiểm soát Fulfillment.

modified_on
{ "modified_on" : "2012-05-01T14:22:25Z" }

Thời gian Fulfillment được cập nhật lần cuối. API trả về kết quả theo định dạng chuẩn ISO 8601.

variant_inventory_management
{ "variant_inventory_management" : "bizweb" }

Tên của dịch vụ quản lý kho.

Endpoints

GET/admin/orders/450789469/fulfillments.json
limit

Số lượng kết quả

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

Trang

(mặc định: 1)
since_id

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

created_on_min

Lấy các Fulfillment được tạo sau ngày này (định dạng: 2008-12-31 03:00)

created_on_max

Lấy các Fulfillment được tạo trước ngày này (định dạng: 2008-12-31 03:00)

modified_on_min

Lấy các Fulfillment đượ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

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

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 danh sách các Fulfillment của một Order.

GET /admin/orders/#{id}/fulfillments.json
Xem kết quả
HTTP/1.1 200 OK
{
  "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": [
          ]
        }
      ]
    }
  ]
}

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

GET /admin/orders/#{id}/fulfillments.json?since_id=255858046
Xem kết quả
HTTP/1.1 200 OK
{
  "fulfillments": [
    {
      "id": 1022782890,
      "order_id": 450789469,
      "status": "success",
      "created_on": "2015-12-08T11:40:33Z",
      "service": "manual",
      "modified_on": "2015-12-08T11:40:33Z",
      "tracking_company": null,
      "tracking_number": "123456789",
      "tracking_numbers": [
        "123456789"
      ],
      "tracking_url": "http:\/\/www.google.com\/search?q=123456789",
      "tracking_urls": [
        "http:\/\/www.google.com\/search?q=123456789"
      ],
      "receipt": {},
      "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": 0,
          "total_discount": "0.00",
          "fulfillment_status": "fulfilled",
          "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": 0,
          "total_discount": "0.00",
          "fulfillment_status": "fulfilled",
          "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": 0,
          "total_discount": "0.00",
          "fulfillment_status": "fulfilled",
          "tax_lines": [
          ]
        }
      ]
    }
  ]
}
GET/admin/orders/450789469/fulfillments/count.json
created_on_min

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

created_on_max

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

modified_on_min

Tổng số Fulfillment đượ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

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

Tổng số tất cả Fulfillment của một Order.

GET /admin/orders/#{id}/fulfillments/count.json
Xem kết quả
HTTP/1.1 200 OK
{
  "count": 1
}
GET/admin/orders/450789469/fulfillments/255858046.json
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 một Fulfillment.

GET /admin/orders/#{id}/fulfillments/#{id}.json
Xem kết quả
HTTP/1.1 200 OK
{
  "fulfillment": {
    "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": [
        ]
      }
    ]
  }
}
POST/admin/orders/450789469/fulfillments.json

Tạo một Fulfillment cho Order với các line item xác định.

Thực hiện giao vận tất cả các line item của một Order và gửi email xác minh giao vận tới khách hàng.

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_number": "123456789",
    "send_notification_email": true
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782885,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:29Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:29Z",
    "tracking_company": null,
    "tracking_number": "123456789",
    "tracking_numbers": [
      "123456789"
    ],
    "tracking_url": "http:\/\/www.google.com\/search?q=123456789",
    "tracking_urls": [
      "http:\/\/www.google.com\/search?q=123456789"
    ],
    "receipt": {},
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}

Giao hàng một phần đối với một line item.

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049,
        "quantity": 1
      }
    ]
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782886,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:29Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:29Z",
    "tracking_company": null,
    "tracking_number": null,
    "tracking_numbers": [
    ],
    "tracking_url": null,
    "tracking_urls": [
    ],
    "receipt": {},
    "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": "partial",
        "tax_lines": [
        ]
      }
    ]
  }
}

Giao hàng toàn bộ đối với một line item.

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049
      }
    ]
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782888,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:32Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:32Z",
    "tracking_company": null,
    "tracking_number": null,
    "tracking_numbers": [
    ],
    "tracking_url": null,
    "tracking_urls": [
    ],
    "receipt": {},
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}

Giao hàng mà không sử dụng mã giao vận

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782889,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:32Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:32Z",
    "tracking_company": null,
    "tracking_number": null,
    "tracking_numbers": [
    ],
    "tracking_url": null,
    "tracking_urls": [
    ],
    "receipt": {},
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}

Giao hàng với nhiều mã giao vận

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_numbers": [
      "da10038ee679f9afc93a785cafdd8d52",
      "6349a40313ae3c7544331ff9fb44f28c",
      "ca0b2d7bcccec4b58a94a24fa04101d3"
    ],
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782891,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:34Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:34Z",
    "tracking_company": null,
    "tracking_number": "da10038ee679f9afc93a785cafdd8d52",
    "tracking_numbers": [
      "da10038ee679f9afc93a785cafdd8d52",
      "6349a40313ae3c7544331ff9fb44f28c",
      "ca0b2d7bcccec4b58a94a24fa04101d3"
    ],
    "tracking_url": "http:\/\/www.google.com\/search?q=da10038ee679f9afc93a785cafdd8d52",
    "tracking_urls": [
      "http:\/\/www.google.com\/search?q=da10038ee679f9afc93a785cafdd8d52",
      "http:\/\/www.google.com\/search?q=6349a40313ae3c7544331ff9fb44f28c",
      "http:\/\/www.google.com\/search?q=ca0b2d7bcccec4b58a94a24fa04101d3"
    ],
    "receipt": {},
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}

Giao hàng với các thông tin Tracking Url và công ty giao vận

POST /admin/orders/#{id}/fulfillments.json
{
  "fulfillment": {
    "tracking_url": "http:\/\/www.packagetrackr.com\/track\/somecarrier\/1234567",
    "tracking_company": "Jack Black's Pack, Stack and Track",
    "line_items": [
      {
        "id": 466157049
      },
      {
        "id": 518995019
      },
      {
        "id": 703073504
      }
    ]
  }
}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 1022782892,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:35Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:35Z",
    "tracking_company": "Jack Black's Pack, Stack and Track",
    "tracking_number": null,
    "tracking_numbers": [
    ],
    "tracking_url": "http:\/\/www.packagetrackr.com\/track\/somecarrier\/1234567",
    "tracking_urls": [
      "http:\/\/www.packagetrackr.com\/track\/somecarrier\/1234567"
    ],
    "receipt": {},
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}
PUT/admin/orders/450789469/fulfillments/255858046.json

Cập nhật mã giao vận của một Fulfillment.

PUT /admin/orders/#{id}/fulfillments/#{id}.json
{
  "fulfillment": {
    "tracking_number": "987654321",
    "id": 255858046
  }
}
Xem kết quả
HTTP/1.1 200 OK
{
  "fulfillment": {
    "id": 255858046,
    "order_id": 450789469,
    "status": "failure",
    "created_on": "2015-12-08T11:40:19Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:30Z",
    "tracking_company": null,
    "tracking_number": "987654321",
    "tracking_numbers": [
      "987654321"
    ],
    "tracking_url": "http:\/\/www.google.com\/search?q=987654321",
    "tracking_urls": [
      "http:\/\/www.google.com\/search?q=987654321"
    ],
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      }
    ]
  }
}
POST/admin/orders/450789469/fulfillments/255858046/complete.json

Hoàn thành một Fulfillment.

POST /admin/orders/#{id}/fulfillments/#{id}/complete.json
{}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 255858046,
    "order_id": 450789469,
    "status": "success",
    "created_on": "2015-12-08T11:40:19Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:30Z",
    "tracking_company": "UPS",
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": "fulfilled",
        "tax_lines": [
        ]
      }
    ]
  }
}
POST/admin/orders/450789469/fulfillments/255858046/cancel.json

Hủy một fulfillment.

POST /admin/orders/#{id}/fulfillments/#{id}/cancel.json
{}
Xem kết quả
HTTP/1.1 201 Created
{
  "fulfillment": {
    "id": 255858046,
    "order_id": 450789469,
    "status": "cancelled",
    "created_on": "2015-12-08T11:40:19Z",
    "service": "manual",
    "modified_on": "2015-12-08T11:40:34Z",
    "tracking_company": "UPS",
    "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": 0,
        "total_discount": "0.00",
        "fulfillment_status": null,
        "tax_lines": [
        ]
      }
    ]
  }
}

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: