<?php
$ch = curl_init('https://shipping-api.stidner.com/api/v1/order');
$headers[] = 'Authorization: Basic MjAwOnN0aWRuZXJfc2FuZGJveF8zMGQ2NWI5Ni0zMWI4LTRmOTQtYmU4NC02YjE2ZDI1YjFiZDM=';
$headers[] = 'Content-Type: application/json';
$body = '{
"order_status": "created",
"source": "__api_demo",
"external_reference": "434",
"currency": "SEK",
"items": [
{
"article_number": "sku_50",
"name": "X-box 2009",
"description": "A gaming pod",
"quantity": 1,
"unit_price": 2000,
"weight": 300
}
],
"addresses": [
{
"type": "recipient",
"customer_type": "person",
"name": null,
"country_code": "SE",
"postal_code": "46153",
"city": null,
"address_line": null,
"contact_name": null,
"contact_phone": null,
"contact_email": null
}
],
"test_mode": true,
"notification_url": "https://wordpress-site.loc/notify/434"
}';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_POST, 1);
$response = curl_exec($ch);
echo $response;