You can use the Purchase Orders resource to document the sale of products and services to be delivered at a late date.

Authenticated access scopes: com.read_inventories, com.write_inventories

Purchase Orders properties

id

"id": 1206854680

A unique identifier for the purchase order.

created_at

"created_at": "2021-05-13T07:29:20.1Z"

The date and time (ISO 8601 format) when the purchase order was created.

notes

"notes": "nhập hàng tháng 11"

An optional note that a shop owner can attach to the purchase order.

status

"status": "Chưa nhận hàng"

"Chưa nhận hàng": has not received the product.

"Hoàn thành": has received the product.

tran_date

"tran_date": "2021-07-27T03:29:32Z"

Expected date of delivery.The date and time (ISO 8601 format).

completed_at

"completed_at": "2021-07-27T03:29:32Z"

Received date of delivery.The date and time (ISO 8601 format).

closed_at

"closed_at ":"2014-12-18T00:00:00-05:00"

Purchase order closing date.The date and time (ISO 8601 format).

ref_number

"ref_number" : "IN_3007"

Reference number of the purchase order.

supplier

"supplier ": "Khác"

Supplier of the purchase order.

location

"location": {

   "id": 1007284

   "name": "Dottie Phan Đăng Lưu"

   "location_type": null

   "email": null

   "address1": "123 Phan Đăng Lưu"

   "address2": null

   "zip": "70000"

   "city": null

   "province": "Hồ Chí Minh"

   "country": "Vietnam"

   "country_code": null

   "country_name": "Vietnam"

   "province_code": "HC"

   "district": "Quận Phú Nhuận"

   "district_code": "HC481"

   "ward": null

   "ward_code": null

   "created_at": "2020-11-16T02:22:43.485Z"

   "updated_at": "2020-11-16T02:22:43.485Z"

   "is_primary": false

   "is_unavailable_quantity": false

   "type": null

}

id: A unique numeric identifier for the location.

name: The name of the location.

location_type: The location type.

address1: The first line of the address.

address2: The second line of the address.

zip: The zip or postal code.

city: The city the location is in.

province: The province the location is in.

country: The country the location is in.

phone: The phone number of the location.

created_at: The date and time when the location was created.

updated_at: The date and time when the location was last updated.

line_item

"line_item": {

   "received_items": null

   "not_received_items":  [

       {

           "id": 1002496132

           "product_id": 1028183686

           "product_variant_id": 1061514767

           "product_name": "Váy Quây dài"

           "variant_title": "Đen / S"

           "sku": "AO551"

           "barcode": "AO551"

           "quantity": 1

           "cost_amount": 100000.00

           "barcode": "Chưa nhận hàng"

           "receive_id": null

           "receive_date": null

      }

   ]

}

id: A unique numeric identifier for the line items.

product_id: The unique numeric identifier for the product.

product_variant_id: The unique numeric identifier for the product variant.

product_name: The name of the product.

variant_title: The name of the product variant.

sku: A unique identifier for the product in the shop.

barcode: The barcode, UPC, or ISBN number for the product.

quantity: The number of items in the line item for this product variant.

cost_amount: The cost for this product variant.

status: The delivery status for this product variant.

receive_id: A unique identifier for the receipt.

receive_date: The date and time when the item was received.

Endpoints

limit

Limit of the result.

page

Page to show the result.

Retrieves a list of purchase orders by page number. By default, the number of resources on the page is 50.

GET https://apis.haravan.com/com/inventories/purchase_orders?page=1

View response

				

HTTP/1.1 200 OK

{ "purchase_orders": [ { "id": 1000355305, "purchase_number": "PO100001", "notes": "", "status": "Chưa nhận hàng", "tran_date": "2021-07-30T06:04:34Z", "created_at": "2021-07-30T06:05:24.336Z", "updated_at": "2021-07-30T06:05:24.925Z", "completed_at": null, "closed_at": null, "ref_number": "iN_3007", "supplier": null, "location": { "id": 1007284, "name": "Dottie Phan Đăng Lưu", "location_type": null, "email": null, "address1": "123 Phan Đăng Lưu", "address2": null, "zip": "70000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0796060700", "country_code": null, "country_name": "Vietnam", "province_code": "HC", "district": "Quận Phú Nhuận", "district_code": "HC481", "ward": null, "ward_code": null, "created_at": "2020-11-16T02:22:43.485Z", "updated_at": "2020-11-16T02:22:43.485Z", "is_primary": false, "is_unavailable_quantity": false, "type": null }, "line_item": { "received_items": null, "not_received_items": [ { "id": 1002496132, "product_id": 1028183686, "product_variant_id": 1061514767, "product_name": "Váy Quây dài", "variant_title": "Đen / S", "sku": "AO551", "barcode": "AO551", "quantity": 1, "cost_amount": 0.00, "status": "Chưa nhận hàng", "receive_id": null, "receive_date": null } ] } }, { "id": 1000354988, "purchase_number": "PO100000", "notes": "", "status": "Hoàn thành", "tran_date": "2021-07-27T03:29:32Z", "created_at": "2021-07-27T03:33:38.404Z", "updated_at": "2021-07-30T05:58:31.483Z", "completed_at": "2021-07-30T05:58:31Z", "closed_at": null, "ref_number": "IN_2707", "supplier": null, "location": { "id": 1007284, "name": "Dottie Phan Đăng Lưu", "location_type": null, "email": null, "address1": "123 Phan Đăng Lưu", "address2": null, "zip": "70000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0796060700", "country_code": null, "country_name": "Vietnam", "province_code": "HC", "district": "Quận Phú Nhuận", "district_code": "HC481", "ward": null, "ward_code": null, "created_at": "2020-11-16T02:22:43.485Z", "updated_at": "2020-11-16T02:22:43.485Z", "is_primary": false, "is_unavailable_quantity": false, "type": null }, "line_item": { "received_items": [ { "id": 1002494198, "product_id": 1028183663, "product_variant_id": 1061514702, "product_name": "Đầm Bẹt Vai Thô Phối Bèo", "variant_title": "Default Title", "sku": "D-0003", "barcode": null, "quantity": 10, "cost_amount": 1000000.00, "status": "Hoàn thành", "receive_id": 1000345765, "receive_date": "2021-07-30T12:58:22Z" } ], "not_received_items": null } } ] }

Retrieves single the purchase order.

GET https://apis.haravan.com/com/inventories/purchase_orders/1000355305.json

View response

				

HTTP/1.1 200 OK

{ "purchase_order": { "id": 1000355305, "purchase_number": "PO100001", "notes": "", "status": "Chưa nhận hàng", "tran_date": "2021-07-30T06:04:34Z", "created_at": "2021-07-30T06:05:24.336Z", "updated_at": "2021-07-30T06:05:24.925Z", "completed_at": null, "closed_at": null, "ref_number": "iN_3007", "supplier": null, "location": { "id": 1007284, "name": "Dottie Phan Đăng Lưu", "location_type": null, "email": null, "address1": "123 Phan Đăng Lưu", "address2": null, "zip": "70000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0796060700", "country_code": null, "country_name": "Vietnam", "province_code": "HC", "district": "Quận Phú Nhuận", "district_code": "HC481", "ward": null, "ward_code": null, "created_at": "2020-11-16T02:22:43.485Z", "updated_at": "2020-11-16T02:22:43.485Z", "is_primary": false, "is_unavailable_quantity": false, "type": null }, "line_item": { "received_items": null, "not_received_items": [ { "id": 1002496132, "product_id": 1028183686, "product_variant_id": 1061514767, "product_name": "Váy Quây dài", "variant_title": "Đen / S", "sku": "AO551", "barcode": "AO551", "quantity": 1, "cost_amount": 0.00, "status": "Chưa nhận hàng", "receive_id": null, "receive_date": null } ] } } }