Class OrdersItemsAttributesApiV2Controller
Notice: This controller is a sub-resource of the OrdersItemsApiV2Controller.
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 |
DeleteOrderItemAttribute |
apiGroup |
Orders |
apiDescription |
Removes a single order item attribute/property entry from an existing order item record. |
apiExample |
{curl} Delete Attribute with ID = 3 curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400953/items/1/attributes/3 {curl} Delete Property with ID = 84 curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400953/items/1/properties/84 |
apiSuccessExample |
{json} Success-Response { "code": 200, "status": "success", "action": "delete", "resource": "Order", "orderId": 400953, "orderItemId": 1, "orderItemAttributeId": 3 } |
apiError |
400-BadRequest The order item attribute ID in the URI was not provided or is invalid. 404-NotFound The order item attribute was not found. |
apiErrorExample |
Error-Response (Missing ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item attribute record ID was not provided in the resource URL." } Error-Response (Not found) HTTP/1.1 404 Not Found { "code": 404, "status": "error", "message": "The order item attribute was not found." } |
get()
apiVersion |
2.1.0 |
---|---|
apiName |
GetOrderItemAttribute |
apiGroup |
Orders |
apiDescription |
Returns multiple or a single order item attribute/property records through a GET request. This method supports all the GET parameters that are mentioned in the "Introduction" section of this documentation. |
apiExample |
{curl} Get All Order Item Attributes curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400210/items/3/attributes {curl} Get All Order Item Properties curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400210/items/3/properties {curl} Get Attribute With ID = 2 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400210/items/3/attributes/2 {curl} Get Property With ID = 54 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400210/items/3/properties/54 |
getCallableResource( $controller, array $mappedURI, \Slim\Slim $api)
array
\Slim\Slim
post()
apiVersion |
2.1.0 |
---|---|
apiName |
CreateOrderItemAttribute |
apiGroup |
Orders |
apiDescription |
Use this method to create a new order item attribute to an existing order item. The order item attribute JSON object is the same as the one included in the full order representation. There are two different order item variation systems in the shop, the "attributes" and the "properties". Both of them define a variation of an order item (e.g. color, size etc). You must always use only one of them for a single order item. |
apiParamExample |
{json} Request-Example { "name": "Color", "value": "blue", "price": 0.00, "priceType": "+", "optionId": 1, "optionValueId": 1, "combisId": null } |
apiParam |
{String} name Attribute Name. {String} value Attribute Value. {Number} price Attribute Price as float. {String} priceType Must contain one of the existing price types of the shop. {Number} optionId Only attribute-records need this value. {Number} optionValueId Only attribute-records need this value. {Number} combisId Only property-records need this value. |
apiSuccess |
(Success 201) Response-Body If successful, this method returns a complete Order Item Attribute resource in the response body. |
apiError |
400-BadRequest The request body is empty. |
apiErrorExample |
Error-Response HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item attribute data were not provided." } |
put()
apiVersion |
2.1.0 |
---|---|
apiName |
UpdateOrderIteAttribute |
apiGroup |
Orders |
apiDescription |
Use this method to update an existing order item attribute record. It uses the same attribute JSON format as in the "Create Order Item Attribute" method. |
apiSuccess |
Response-Body If successful, this method returns the updated Order Item Attribute resource in the response body. |
apiError |
400-BadRequest The request body was empty or the order item attribute record ID was not provided or is invalid. |
apiErrorExample |
Error-Response (Missing ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item attribute data were not provided." } Error-Response (Empty request body) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item attribute data were not provided." } |
DEFAULT_PAGE_ITEMS
var |
---|
DEFAULT_CONTROLLER_NAME
var |
---|
DEFAULT_RATE_LIMIT
var |
---|
DEFAULT_RATE_RESET_PERIOD
var |
---|