Class OrdersTotalsApiV2Controller
Notice: This controller is a sub-resource of the OrdersV2Controller.
category |
System |
---|---|
package |
ApiV2Controllers |
__construct(\Slim\Slim $api, array $uri)
Call this constructor from every child controller class in order to set the Slim instance and the request routes arguments to the class.
deprecated |
The "__initialize" method will is deprecated and will be removed in a future version. Please use the new "init" for bootstrapping your child API controllers. |
---|---|
Throws |
|
\Slim\Slim
Slim framework instance, used for request/response manipulation.
array
This array contains all the segments of the current request, starting from the resource.
delete()
apiVersion |
2.1.0 |
---|---|
apiName |
DeleteOrderTotal |
apiGroup |
Orders |
apiDescription |
Use this method to remove an order total from an existing order. |
apiSuccessExample |
{json} Success-Response { "code" => 200, "status" => "success", "action" => "delete", "resource" => "OrderTotal", "orderId" => 400345, "orderTotalId" => 1 } |
apiError |
400-BadRequest The order total ID in the URI was not provided or is invalid. 404-NotFound The provided order total was not found in the given order. |
apiErrorExample |
Error-Response HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order total record ID was not provided in the resource URL." } |
get()
apiVersion |
2.1.0 |
---|---|
apiName |
GetOrderTotal |
apiGroup |
Orders |
apiDescription |
Returns all or just a single order total from an existing orders. All the GET manipulation parameters are applied with this method (search, sort, minimize, paginate etc). |
apiExample |
{curl} Get All Entries curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400785/totals {curl} Get Entry With ID = 4 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400242/totals/4 |
getCallableResource( $controller, array $mappedURI, \Slim\Slim $api)
array
\Slim\Slim
post()
apiVersion |
2.1.0 |
---|---|
apiName |
CreateOrderTotal |
apiGroup |
Orders |
apiDescription |
Creates a new order total entry to the existing order. The order total JSON format must be the same with the "totals" entries in the original order total. |
apiExample |
{json} Request-Body { "title": "Zwischensumme:", "value": 50, "valueText": "50,00 EUR", "class": "ot_subtotal", "sortOrder": 10 } |
apiSuccess |
(Success 201) Response-Body If successful, this method returns a complete Order Total resource in the response body. |
apiError |
400-BadRequest The request body was empty. (Error 5xx) 500-InternalError One of the given properties has an invalid value type. |
apiErrorExample |
Error-Response (Empty request body) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order total data were not provided." } |
put()
apiVersion |
2.1.0 |
---|---|
apiName |
UpdateOrderTotal |
apiGroup |
Orders |
apiDescription |
Use this method to update an existing order total. Use the same order total JSON format as in the POST method. |
apiSuccess |
Response-Body If successful, this method returns the updated Order Total resource in the response body. |
apiError |
400-BadRequest The order total ID in the URI was not provided or is invalid. 400-BadRequest The request body is empty. 404-NotFound The provided order total was not found in the given order. |
apiErrorExample |
Error-Response (Missing ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order total record ID was not provided or is invalid." } Error-Response (Empty request body) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order total data were not provided." } Error-Response (Not found in order) HTTP/1.1 404 Not Found { "code": 404, "status": "error", "message": "The provided order total ID does not exist in the given order!" } |
DEFAULT_PAGE_ITEMS
var |
---|
DEFAULT_CONTROLLER_NAME
var |
---|
DEFAULT_RATE_LIMIT
var |
---|
DEFAULT_RATE_RESET_PERIOD
var |
---|