POST Purchase Order
Developing
POST
{{url}}api/v1/admin/purchase/orders
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'http://ecompulse.test/api/v1/admin/purchase/orders' \
--header 'Accept: application/json' \
--header 'X-API-Key: exzbLclGAzBCyL0k1Yv29Evu6mwoYOATBF0lWPyT' \
--header 'Content-Type: application/json' \
--data-raw '{
"reference_no": "PO-00003",
"vendor_id": 2,
"warehouse_id": 1,
"expected_date": "2024-01-07",
"note": "new po",
"status": 1,
"products": [
{
"id": 10,
"cost": 99.00,
"product_net_cost": 99.00,
"qty": 4,
"discount": 0.00,
"weight_based_price": 0.00,
"product_cost_tax": 0.00,
"subtotal": 99.00
},
{
"id": 15,
"cost": 200.00,
"product_net_cost": 180.00,
"qty": 11,
"discount": 20.00,
"weight_based_price": 0.00,
"product_cost_tax": 10.80,
"subtotal": 190.80,
"option_id": 2,
"option_values": [
{
"label": "Blue",
"qty": 11
}
]
}
],
"order_tax": 17.39,
"order_shipping": 0.00,
"order_discount": 0.00,
"grand_total": 307.19
}'
Response Response Example
{
"status": "success",
"message": "Purchase created successfully",
"data": {
"id": 3,
"reference_no": "PO-00003",
"draft_date": null,
"open_date": "2024-05-27T02:29:07.749645Z",
"closed_date": null,
"canceled_date": null,
"expected_date": "2024-01-07",
"note": "new po",
"order_tax": "17.39",
"order_shipping": "0.00",
"order_discount": "0.00",
"grand_total": "307.19",
"warehouse": {
"id": 1,
"name": "Warehouse 1"
},
"vendor": {
"id": 2,
"name": "Simson Poll"
},
"status": 1,
"products": [
{
"id": 10,
"sku": "P10",
"name": "Girl Summer bracelets",
"total_qty": 26,
"price": "119.00",
"qty": 4,
"cost": "99.00",
"product_net_cost": "99.00",
"discount": "0.00",
"weight_based_price": "0.00",
"product_cost_tax": "0.00",
"subtotal": "396.00",
"tax_method_id": null,
"tax_id": null,
"option_id": null,
"option_values": null
},
{
"id": 15,
"sku": "SKU 15",
"name": "iPhone 6S",
"total_qty": 33,
"price": "235.00",
"qty": 11,
"cost": "200.00",
"product_net_cost": "180.00",
"discount": "220.00",
"weight_based_price": "0.00",
"product_cost_tax": "118.80",
"subtotal": "2,098.80",
"tax_method_id": 2,
"tax_id": 3,
"option_id": 2,
"option_values": [
{
"label": "Blue",
"qty": 11
}
]
}
]
}
}
Request
Header Params
Accept
stringÂ
required
Example:
application/json
X-API-Key
stringÂ
required
Example:
{{key}}
Body Params application/json
Responses
Modified at 2024-05-27 02:28:32