Class OrdersItemsAttributesApiV2Controller
Class OrdersItemsAttributesApiV2Controller
Notice: This controller is a sub-resource of the OrdersItemsApiV2Controller.
-
AbstractApiV2Controller
-
┗
HttpApiV2Controller
-
┗
OrdersItemsAttributesApiV2Controller
Methods summary
protected
__initialize( void )
Initializes API Controller
Initializes API Controller
Throws
public
post( void )
Api
{post} /orders/:id/items/:id/attributes Create Order Item Attribute
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.
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."
}
Apigroup
Orders
Apiname
CreateOrderItemAttribute
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.
Apiparamexample
{json} Request-Example
{
"name": "Color",
"value": "blue",
"price": 0.00,
"priceType": "+",
"optionId": 1,
"optionValueId": 1,
"combisId": null
}
Apisuccess
(Success 201) Response-Body If successful, this method returns a complete Order Item Attribute
resource in the response body.
Apiversion
2.1.0
public
put( void )
Api
{put} /orders/:id/items/:id/attributes/:id Update Order Item Attribute/Property
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.
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."
}
Apigroup
Orders
Apiname
UpdateOrderIteAttribute
Apisuccess
Response-Body If successful, this method returns the updated Order Item Attribute resource in the
response body.
Apiversion
2.1.0
public
delete( void )
Api
{delete} /orders/:id/items/:id/attributes/:id Delete Order Item Attribute/Property
Apidescription
Removes a single order item attribute/property entry from an existing order item record.
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."
}
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
Apigroup
Orders
Apiname
DeleteOrderItemAttribute
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "delete",
"resource": "Order",
"orderId": 400953,
"orderItemId": 1,
"orderItemAttributeId": 3
}
Apiversion
2.1.0
public
get( void )
Api
{get} /orders/:id/items/:id/attributes/:id Get Order Item Attribute/Property
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
Apigroup
Orders
Apiname
GetOrderItemAttribute
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