<?php
$item = array(
array(
"external_ref" => 12345,
"style" => "mens",
"size" => "Medium",
"color" => "White",
"print_location" => "FRONT",
"print_x_offset" => "0",
"print_y_offset" => "0",
"quantity" => 1,
"external_url" => "url.png",
"external_thumbnail_url" => "url.jpg"
)
);
//The JSON data.
$jsonData = array(
"external_ref"=> 12345,
"sale_datetime" => "2016-03-01 22:09:00",
"customer_name" => "Foo Bar",
"shipping_address_1" => "123 Test Street",
"shipping_address_2" => "",
"shipping_address_3" => "City",
"shipping_address_4" => "County",
"shipping_postcode" => "AB12 3AB",
"shipping_country" => 'England',
"shipping_country_code" => "GB",
"shipping_method" => "STANDARD",
"phone" => "01234567890",
"items" => $item
);
echo json_encode($jsonData, true);
preferences:
27.74 ms | 404 KiB | 5 Q