diff --git a/DELETE-%2Forder%2F%7Borderid%7D.md b/DELETE-%2Forder%2F%7Borderid%7D.md new file mode 100644 index 0000000..6777218 --- /dev/null +++ b/DELETE-%2Forder%2F%7Borderid%7D.md @@ -0,0 +1,83 @@ +## **DELETE /order/{orderid}** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|orderid | integer | Die ID der Bestellung die man stornieren möchte + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | - | - + + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/order/1', + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'X-TOKEN: test-token', + 'Content-Type: application/json' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + +##### cURL +```bash +curl --location --request DELETE 'control.local/api/v2/order/1' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **400** - The Order is already paid and cannot be cancelled by the api anymore. + +> :warning: Status Code **404** - No order with ID {orderId} found! + +> :warning: Status Code **500** - Order could not be cancelled \ No newline at end of file