Class OrdersTotalsApiV2Controller
Class OrdersTotalsApiV2Controller
Notice: This controller is a sub-resource of the OrdersV2Controller.
-
AbstractApiV2Controller
-
┗
HttpApiV2Controller
-
┗
OrdersTotalsApiV2Controller
Methods summary
protected
__initialize( void )
Initializes API Controller
Initializes API Controller
Throws
public
post( void )
Api
{post} /orders/:id/totals Create Order Total
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.
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."
}
Apiexample
{json} Request-Body
{
"title": "Zwischensumme:",
"value": 50,
"valueText": "50,00 EUR",
"class": "ot_subtotal",
"sortOrder": 10
}
Apigroup
Orders
Apiname
CreateOrderTotal
Apisuccess
(Success 201) Response-Body If successful, this method returns a complete Order Total resource in the
response body.
Apiversion
2.1.0
public
put( void )
Api
{put} /orders/:id/totals/:id Update Order Total
Apidescription
Use this method to update an existing order total. Use the same order total JSON format as in the POST method.
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!"
}
Apigroup
Orders
Apiname
UpdateOrderTotal
Apisuccess
Response-Body If successful, this method returns the updated Order Total resource in the
response body.
Apiversion
2.1.0
public
delete( void )
Api
{delete} /orders/:id/totals/:id Delete Order Total
Apidescription
Use this method to remove an order total from an existing order.
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."
}
Apigroup
Orders
Apiname
DeleteOrderTotal
Apisuccessexample
{json} Success-Response
{
"code" => 200,
"status" => "success",
"action" => "delete",
"resource" => "OrderTotal",
"orderId" => 400345,
"orderTotalId" => 1
}
Apiversion
2.1.0
public
get( void )
Api
{get} /orders/:id/totals/:id Get Order Total
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
Apigroup
Orders
Apiname
GetOrderTotal
Apiversion
2.1.0
_linkResponse(),
_locateResource(),
_mapResponse(),
_minimizeResponse(),
_paginateResponse(),
_searchResponse(),
_setJsonValue(),
_sortResponse(),
_writeResponse()
__construct(),
_prepareResponse(),
_setRateLimitHeader(),
_validateRequest()
Constants summary
DEFAULT_CONTROLLER_NAME,
DEFAULT_PAGE_ITEMS,
DEFAULT_RATE_LIMIT,
DEFAULT_RATE_RESET_PERIOD
Properties summary
$api,
$uri