Inventory Purchase Receive
You can use the Purchase Receives 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
What you can do with Purchase Receives
The Haravan API lets you do the following with the Purchase Receives resource.
- GET
https://apis.haravan.com/com/v2/inventories/purchase_receives.json
- GET
https://apis.haravan.com/com/v2/inventories/purchase_receives/{purchase_receive_id}.json
Purchase Receives properties
id
: number
"id": 1001004628
A unique identifier for the purchase receive.
receive_number
: string
"receive_number": "IR1000000007"
The number of the purchase receive.
ref_number
: string
"ref_number": "#732000"
Reference number of the purchase receive.
ref_purchase_order_id
: number
"ref_purchase_order_id": null
Reference purchase order number of the purchase receive.
tags
: string
"tags": "tagsational, tag1, tag2, tag3"
Tags are additional short descriptors formatted as a string of comma-separated values. For example, if an article has three tags: tag1, tag2, tag3.
created_at
: string
"created_at": "2022-08-25T05:15:12.917Z"
The date and time (ISO 8601 format) when the purchase receive was created.
updated_at
: string
"updated_at": "2022-09-05T02:27:46.779Z"
The date and time (ISO 8601 format) when the purchase receive was updated.
received_at
: string
"received_at": "2022-08-25T05:15:12.917Z"
The date and time (ISO 8601 format) when the purchase receive was received.
notes
: string
"notes": "Notes"
An optional note that a shop owner can attach to the purchase receive.
status
: string
"status": "Đã nhập hàng"
Nháp: draft.
Đã nhập hàng: has received the product.
Đã xuất trả: has returned the product.
Đã hủy: has canceled the product.
total
: number
"total": 1100
Total quantity of purchase receive.
total_cost
: number
"total_cost": 1080100
Total cost of purchase receive.
supplier
: json
Details
- id: A unique numeric identifier for the supplier.
- name: The name owner of the supplier.
- supplier_name: The name of the supplier.
- phone: The phone number of the supplier.
- email: The email of the supplier.
- address: The address of the supplier.
- zip: The zip or postal code.
- city: The city the supplier is in.
- created_at: The date and time when the supplier was created.
- updated_at: The date and time when the supplier was last updated.
- country: The country name the supplier is in.
- country_code: The country code the supplier is in.
- province: The province name the supplier is in.
- province_code: The province code the supplier is in.
- district: The district name the supplier is in.
- district_code: The district code the supplier is in.
- ward: The ward name the supplier is in.
- ward_code: The ward code the supplier is in.
location
: json
Details
- id: A unique numeric identifier for the location.
- name: The name of the location.
- location_type: The location type. There are ontheroad and default type.
- email: The email of the location.
- 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.
- phone: The phone number of the location.
- country: The country name the location is in.
- country_code: The country code the location is in.
- country_name: The country name the location is in.
- province: The province name the location is in.
- province_code: The province code the location is in.
- district: The district name the location is in.
- district_code: The district code the location is in.
- ward: The ward name the location is in.
- ward_code: The ward code the location is in.
- created_at: The date and time when the location was created.
- updated_at: The date and time when the location was last updated.
- is_primary: The primary location if true. Vice versa, the normal location.
- is_unavailable_quantity: Allowable use decimal number if true. Vice versa, just long number.
- type: The location type. There are ontheroad and default type.
line_items
: json
Details
- id: A unique numeric identifier for the line item.
- product_name: The name of the product.
- product_id: The unique numeric identifier for the product.
- product_variant_id: The unique numeric identifier for the product variant.
- 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.
- original_cost: The price for this product variant.
- discount_amount: Discount for this product variant.
- cost: The cost for this product variant after discount.
- quantity: The number of items in the line item for this product variant.
- total_cost: The total cost for this product variant after discount..
- variant_unit: The unit of the product variant.
{
"id": 1000002202,
"unit": "unit",
"base": true,
"sellable": true,
"ratio": 1,
"barcode": null,
"sku": null,
"price": 0
}
- lots: List lot of the product variant.
[
{
"lot_no": "Lot 1",
"expire_date": "2022-09-10T17:00:00Z",
"quantity": 100
},
{
"lot_no": "Lot 2",
"expire_date": "2022-09-10T17:00:00Z",
"quantity": 100
},
]
Retrieves a list of purchase receives.
Retrieves a list of purchase receives. You can filter resources by params.
Parameters
limit
Limit of the result.
page
Page to show the result.
Retrieve all of the resources of the purchase receives by page number. By default, the number of resources on the page is 50.
- GET
https://apis.haravan.com/com/v2/inventories/purchase_receives.json?page=1
Details
HTTP/1.1 200 OK
{
"purchase_receives": [
{
"id": 1001004580,
"receive_number": "IR1000000001",
"supplier": {
"id": 1040044131,
"name": "",
"supplier_name": "Supplier Name",
"phone": "",
"email": "",
"address": "102/18 tô hiến thành",
"zip": null,
"city": null,
"created_at": "2022-08-22T08:15:33.044Z",
"updated_at": "2022-08-22T08:15:33.044Z",
"country": "Vietnam",
"country_code": "VN",
"province": "Hồ Chí Minh",
"province_code": "HC",
"district": "Quận 10",
"district_code": "HC475",
"ward": "Phường 15",
"ward_code": "27163"
},
"location": {
"id": 497789,
"name": "Địa điểm mặc định",
"location_type": "default",
"email": null,
"address1": "số 14 đường Phan Tôn",
"address2": null,
"zip": "700000",
"city": null,
"province": "Hồ Chí Minh",
"country": "Vietnam",
"phone": "0784665872",
"country_code": "VN",
"country_name": "Vietnam",
"province_code": "HC",
"district": "Quận 1",
"district_code": "HC466",
"ward": "Phường Đa Kao",
"ward_code": "26737",
"created_at": "2022-06-13T07:43:47.654Z",
"updated_at": "2022-10-14T04:12:16.992Z",
"is_primary": true,
"is_unavailable_quantity": false,
"type": "default"
},
"created_at": "2022-08-23T08:22:39.71Z",
"updated_at": "2022-09-06T07:27:39.106Z",
"received_at": "2022-08-23T08:22:39.71Z",
"notes": null,
"status": "Đã nhập hàng",
"total": 100,
"total_cost": 10000000,
"tags": "IR1000000001,IR1000000002",
"ref_purchase_order_id": 1040148821,
"ref_number": "THAMCHIEUIR1000000001",
"line_items": null
},
{
"id": 1001004562,
"receive_number": "IR1000000000",
"supplier": {
"id": 1040044131,
"name": "",
"supplier_name": "Nhà làm",
"phone": "",
"email": "",
"address": "102/18 tô hiến thành",
"zip": null,
"city": null,
"created_at": "2022-08-22T08:15:33.044Z",
"updated_at": "2022-08-22T08:15:33.044Z",
"country": "Vietnam",
"country_code": "VN",
"province": "Hồ Chí Minh",
"province_code": "HC",
"district": "Quận 10",
"district_code": "HC475",
"ward": "Phường 15",
"ward_code": "27163"
},
"location": {
"id": 497980,
"name": "Kho Hồ Chí Minh",
"location_type": "default",
"email": "[email protected]",
"address1": "102/18 Tô hiến thành",
"address2": null,
"zip": null,
"city": null,
"province": "Hồ Chí Minh",
"country": "Vietnam",
"phone": "0784665872",
"country_code": "VN",
"country_name": "Vietnam",
"province_code": "HC",
"district": "Quận 10",
"district_code": "HC475",
"ward": "Phường 15",
"ward_code": "27163",
"created_at": "2022-07-07T02:21:22.595Z",
"updated_at": "2022-10-14T04:12:17.037Z",
"is_primary": false,
"is_unavailable_quantity": false,
"type": "default"
},
"created_at": "2022-08-22T08:16:19.926Z",
"updated_at": "2022-08-22T08:16:20.032Z",
"received_at": "2022-08-22T08:16:19.926Z",
"notes": null,
"status": "Đã nhập hàng",
"total": 100,
"total_cost": 50000000,
"tags": null,
"ref_purchase_order_id": null,
"ref_number": null,
"line_items": null
}
]
}
Retrieves single the purchase receive.
Retrieves single the purchase receive.
- GET
https://apis.haravan.com/com/v2/inventories/purchase_receives/1001004628.json
Details
HTTP/1.1 200 OK
{
"purchase_receive": {
"id": 1001004628,
"receive_number": "IR1000000007",
"supplier": {
"id": 1040044132,
"name": "Nguyễn Ngọc Sáng",
"supplier_name": "NGỌC SÁNG FnD",
"phone": "09876542321",
"email": "[email protected]",
"address": "Ấp Cẩm An",
"zip": null,
"city": null,
"created_at": "2022-08-25T03:18:07.743Z",
"updated_at": "2022-08-25T03:18:07.744Z",
"country": "Vietnam",
"country_code": "VN",
"province": "Tây Ninh",
"province_code": "TN",
"district": "Huyện Gò Dầu",
"district_code": "TN519",
"ward": "Xã Cẩm Giang",
"ward_code": "25660"
},
"location": {
"id": 498250,
"name": "Kho Tây Ninh",
"location_type": "default",
"email": "[email protected]",
"address1": "182 Lê Đại Hành",
"address2": null,
"zip": "700000",
"city": null,
"province": "Hồ Chí Minh",
"country": null,
"phone": "0868946949",
"country_code": "VN",
"country_name": "Vietnam",
"province_code": "HC",
"district": "Quận 11",
"district_code": "HC476",
"ward": "Phường 15",
"ward_code": "27208",
"created_at": "2022-08-22T07:22:05.726Z",
"updated_at": "2022-09-09T06:51:15.618Z",
"is_primary": true,
"is_unavailable_quantity": false,
"type": "default"
},
"created_at": "2022-08-25T05:15:12.917Z",
"updated_at": "2022-09-05T02:27:46.779Z",
"received_at": "2022-08-25T05:15:12.917Z",
"notes": "Notes",
"status": "Đã nhập hàng",
"total": 1100,
"total_cost": 1080100,
"tags": "tag1,tag2,tag3",
"ref_purchase_order_id": null,
"ref_number": "#732000",
"line_items": [
{
"id": 1001007428,
"product_name": "open-api purchase-receives",
"product_id": 10041037168,
"product_variant_id": 142568269,
"variant_title": "OK-2",
"sku": null,
"barcode": null,
"original_cost": 1200,
"discount_amount": 120,
"cost": 1080,
"quantity": 1000,
"total_cost": 1080000,
"variant_unit": {
"id": 1000002202,
"unit": "Thùng",
"base": true,
"sellable": true,
"ratio": 1,
"barcode": null,
"sku": null,
"price": 0
},
"lots": []
},
{
"id": 1001007429,
"product_name": "open-api purchase-receives",
"product_id": 10041037168,
"product_variant_id": 142568260,
"variant_title": "OK",
"sku": "open-api-purchase-receives",
"barcode": "open-api-purchase-receives",
"original_cost": 1000,
"discount_amount": 999,
"cost": 1,
"quantity": 100,
"total_cost": 100,
"variant_unit": {
"id": 1000002199,
"unit": "Cái",
"base": true,
"sellable": true,
"ratio": 1,
"barcode": "open-api-purchase-receives",
"sku": "open-api-purchase-receives",
"price": 0
},
"lots": [
{
"lot_no": "Lô 902",
"expire_date": "2022-09-10T17:00:00Z",
"quantity": 100
}
]
}
]
}
}