Before you can use the Rest API you need to create an authorisation token and at least one webshop.
Code examples to create orders
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'YOUR_CREATED_AUTH_TOKEN',
])
->post('http://rtdashboards.com/api/v1/create-order', [
'price' => 12.25,
'order_id' => 10,
'shop_id' => 10,
]);
$jsonResponse = $response->json();
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'YOUR_CREATED_AUTH_TOKEN',
]]);
$response = $client->post('http://rtdashboards.com/api/v1/create-order', [
\GuzzleHttp\RequestOptions::JSON => ['price' => 12.25, 'order_id' => 10, 'shop_id' => 10]
]);
$body = $response->getBody();
$jsonResponse = json_decode($body, true);
Examples how to delete orders with the Rest API
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'YOUR_CREATED_AUTH_TOKEN',
])
->post('http://rtdashboards.com/api/v1/delete-order', [
'order_id' => 10,
'shop_id' => 10,
]);
$jsonResponse = $response->json();
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'YOUR_CREATED_AUTH_TOKEN',
]]);
$response = $client->post('http://rtdashboards.com/api/v1/delete-order', [
\GuzzleHttp\RequestOptions::JSON => ['order_id' => 10, 'shop_id' => 10]
]);
$body = $response->getBody();
$jsonResponse = json_decode($body, true);