Orders
POST /orders
(
Header
string
Content-Type,
string
Apikey,
string
TicUID,
Body
(optional) string
reference,
(optional) string
remarks,
array
products,
int
ean,
int
qty,
)
Place an order
string
Content-Type
Content-Type=application/json
string
ApiKey
Apikey=x
string
TicUID
TicUID=XXXXXXXXXXXXXXXXXXXX
array
products
products=[Array of products]
int
ean
ean=0000000000000
int
qty
qty=0
Optional:
string
reference
reference=X
string
remarks
remarks=X
Return value string/json: Orders
Header
Body
JSON data
- <?php
- $ApiKey = '************************************';
- $TicUID = 'XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX';
- $Url = 'https://api.tyrenet.nl/rest/orders';
- $headers = array(
- 'Content-Type: application/json',
- 'Apikey: ' . $ApiKey,
- 'TicUID: ' . $TicUID,
- );
- $post = array(
- 'reference' => 'Kenteken XX-XXX-X',
- 'remarks' => 'Hier kan een opmerking geplaatst worden.',
- 'products' => array(
- array(
- 'ean' => 0000000000000,
- 'qty' => 0
- ),
- array(
- 'ean' => 0000000000000,
- 'qty' => 0
- )
- )
- );
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $Url);
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post));
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec($curl);
- curl_close($curl);
- header("Content-Type: application/json");
- echo $output;
- ?>