Create Purchase Order
Function
To create purchase order
建立進貨單
URL
POST <<api_domain>>/v1/pos/purchase_orders
Request Parameters
Parameter | Type | Description | Example |
---|---|---|---|
purchase_order.type *Required | String | type of PurchaseOrder purchase return | purchase |
purchase_order.scheduled_time | DateTime | Purchase Order Scheduled Arrival Date | 2018-01-10T06:33:45.231+00:00 |
purchase_order.actual_time | DateTime | Purchase Order Completed Date | 2018-01-10T06:33:45.231+00:00 |
purchase_order.other_fee | Float | Purchase Order Other Fee | 111 |
purchase_order.note | String | Purchase Order Remarks | remark |
purchase_order.issuer_id | String | Purchase Order Issuer ID | 6095098351f9cf003e6768fe |
purchase_order.executor_id | String | Purchase Order Executor ID | 6095098351f9cf003e6768fe |
purchase_order.channel_id *Required | String | Purchase Order Channel ID | 6095098351f9cf003e6768fe |
purchase_order.items *Required | Array | Purchase Order Products |
Parameter | Type | Description | Example |
---|---|---|---|
item.product_id | String | Product ID | 6095098351f9cf003e6768fe |
item.variation_id | String | Variation ID | 6095098351f9cf003e6768fe |
item.total_quantity | Integer | Total Quantity | 1 |
item.current_quantity | Integer | Current Quantity | 1 |
item.supplier_id | String | Product Supplier ID If supplier is set in Product, then this field will be set to product's supplier ID | 6095098351f9cf003e6768fe |
item.purchase_price | Float | If the type of the purchase order is return, it means refund If the type of the purchase order is purchase, it means purchase price | 111 |
Request Example
curl --location --request POST '<<api_domain>>/v1/pos/purchase_orders' \
--header 'Authorization: Bearer ${token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"purchase_order": {
"type": "purchase",
"channel_id": "62de16f6d7043e0047a0942e",
"items": [
{"product_id": "64059daa9843a6003ce3e805", "total_quantity": 1}
]
}
}'
Response Body
{
"created_at": "2023-03-21T08:54:31.806Z",
"updated_at": "2023-03-21T08:54:31.806Z",
"type": "purchase",
"number": "20230321085431306",
"custom_number": null,
"status": "pending",
"arrival_status": "pending_to_receive",
"scheduled_time": null,
"actual_time": null,
"other_fee": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"total_amount": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"current_amount": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"total_quantity": 1,
"current_quantity": 0,
"note": null,
"child_id": null,
"group_id": null,
"wapos_id": null,
"id": "641970c7f5f261003f2feab8",
"issuer": null,
"executor": null,
"channel": {
"name": {
"en": "He貓店3",
"zh-hant": "He貓店3"
},
"id": "62de16f6d7043e0047a0942e",
"warehouse_id": "60f6654a0c801333984b34c7"
},
"items": [
{
"product_id": "64059daa9843a6003ce3e805",
"variation_id": null,
"product_name": {
"zh-hant": "GIF不會動"
},
"variation_titles": null,
"variation_name": null,
"image_url": "https://img-shoplineapp-com.s3.amazonaws.com/media/image_clips/6405a1579843a6003ce3e815/original.gif?1678090582",
"sku": "fku6900",
"gtin": "64264990",
"total_quantity": 1,
"current_quantity": 0,
"purchase_price": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"supplier_id": null,
"subtotal": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"price": {
"cents": 100,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$100",
"dollars": 100.0
},
"product_removed": false,
"id": "641970c7f5f261003f2feab7",
"stocks": {
"60f6654a0c801333984b34c7": 0
},
"unlimited_quantity": true,
"same_price": false,
"supplier_name": null
}
],
"has_removed_items": false,
"group_purchase_orders": null
}
Updated about 1 month ago