From 90a24fd7879d3e37b3cc5f2ed7e7255b79c96b2f Mon Sep 17 00:00:00 2001 From: Thomas Brinkmann Date: Wed, 1 Jun 2022 20:31:28 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EPOST=20/order=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- POST-%2Forder.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 POST-%2Forder.md diff --git a/POST-%2Forder.md b/POST-%2Forder.md new file mode 100644 index 0000000..0e7d1cf --- /dev/null +++ b/POST-%2Forder.md @@ -0,0 +1,98 @@ +## **POST /order** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| paymentmethod | string | Die Zahlungsmethode für diese Bestellung (Kann in der Rechnung trotzdem frei verändert werden!) +| pid | array | Ein integer array mit den Produkt IDs die man bestellen möchte +| billingcycle | array | Ein string array mit den Billing Cycles der Produkte (monthly, quarterly, semiannually, annually) +| hostname | array | Ein string array mit den Hostnamen der Produkte +| rootpw | array | Ein string array mit den Passwörtern für die Produkte + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | - | - + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/order', + CURLOPT_CUSTOMREQUEST => 'GET', +CURLOPT_POSTFIELDS =>'{ + "paymentmethod": "paypal", + "pid": [1,2], + "billingcycle": ["monthly", "monthly"], + "hostname": ["a.server.de", "b.server.de"], + "rootpw": ["passwort-server-a", "password-server-b"] +}' + 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 GET 'control.local/api/v2/order' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "paymentmethod": "paypal", + "pid": [1,2], + "billingcycle": ["monthly", "monthly"], + "hostname": ["a.server.de", "b.server.de"], + "rootpw": ["passwort-server-a", "password-server-b"] +}' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "orderid": "12345678910", + "serviceids": "1,2" + +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied + +> :warning: Status Code **500** - Order could not be placed \ No newline at end of file