31 lines
808 B
PHP
31 lines
808 B
PHP
<?php
|
|
$data = [
|
|
"order_id" => 100, // Update mode
|
|
"table_number" => null,
|
|
"order_type" => "takeaway",
|
|
"customer_id" => null,
|
|
"outlet_id" => 1,
|
|
"payment_type_id" => 1,
|
|
"total_amount" => 1.5,
|
|
"vat" => 0.0,
|
|
"items" => [
|
|
[
|
|
"product_id" => 1,
|
|
"quantity" => 1,
|
|
"unit_price" => 1.5,
|
|
"variant_id" => null,
|
|
"vat_percent" => 0,
|
|
"vat_amount" => 0
|
|
]
|
|
],
|
|
"redeem_loyalty" => false
|
|
];
|
|
$ch = curl_init('http://127.0.0.1/api/order.php');
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
$result = curl_exec($ch);
|
|
echo "Result:\n$result\n";
|
|
curl_close($ch);
|
|
|