OrdersItemsApiV2Controller

Extends \HttpApiV2Controller

Class OrdersItemsApiV2Controller

Notice: This controller is a sub-resource of the OrdersApiV2Controller.

category

System

package

ApiV2Controllers

Methods

AbstractApiV2Controller Constructor

__construct(\Slim\Slim $api, array $uri) 
inherited

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
\HttpApiV2Exception

Through _validateRequest

Arguments

$api

\Slim\Slim

Slim framework instance, used for request/response manipulation.

$uri

array

This array contains all the segments of the current request, starting from the resource.

delete

delete() 
api
apiVersion

2.1.0

apiName

DeleteOrderItem

apiGroup

Orders

apiDescription

Use this method to remove an order item from an existing order.

apiSuccessExample

{json} Success-Response { "code": 200, "status": "success", "action" :"delete", "resource": "OrderItem", "orderId": 400883, "orderItemId": 1 }

apiError

400-BadRequest The order item ID in the URI was not provided or is invalid.

404-NotFound The provided order item was not found in the given order.

apiErrorExample

Error-Response (Missing ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item record ID was not provided in the resource URL." }

Error-Response (Not found in order) HTTP/1.1 404 Not Found { "code": 404, "status": "error", "message": "The provided order item ID does not exist in the given order!" }

get

get() 
api
apiVersion

2.4.0

apiName

GetOrderItem

apiGroup

Orders

apiDescription

Get all or just a single order item 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/items

{curl} Get Entry With ID=8 curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400242/items/8

{curl} Minimize Responses curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/orders/400871/items?fields=id,model,name,quanity

apiParam

{Number} [id] Record ID of resource to be returned. If omitted all records will be included in the response.

getCallableResource

getCallableResource( $controller, array $mappedURI, \Slim\Slim $api) 
inherited static

Arguments

$controller

$mappedURI

array

$api

\Slim\Slim

post

post() 
api
apiVersion

2.1.0

apiName

CreateOrderItem

apiGroup

Orders

apiDescription

Use this method to create a new order item to an existing order. The order item JSON format must be the same with the "items" entries in the original order item.

apiExample

{json} Request-Body { "model": "12345-s-black", "name": "Ein Artikel", "quantity": 1, "price": 11, "finalPrice": 11, "tax": 19, "isTaxAllowed": true, "discount": 0, "shippingTimeInformation": "", "checkoutInformation": "Checkout information goes here ...", "quantityUnitName": "Liter", "attributes": [ { "id": 1, "name": "Farbe", "value": "rot", "price": 0, "priceType": "+", "optionId": 1, "optionValueId": 1, "combisId": null } ], "downloadInformation": { "filename": "Dokument.pdf", "maxDaysAllowed": 5, "countAvailable": 14 }, "addonValues": { "productId": "2", "quantityUnitId": "1" } }

apiSuccess

(Success 201) Response-Body If successful, this method returns a complete Order Item 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 HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item data were not provided." }

put

put() 
api
apiVersion

2.1.0

apiName

UpdateOrderItem

apiGroup

Orders

apiDescription

Use this method to update an existing order item. Use the same order item JSON format as in the POST method.

apiSuccess

Response-Body If successful, this method returns the updated Order Item resource in the response body.

apiError

400-BadRequest The request body is empty or the order item ID in the URI was not provided or is invalid.

404-NotFound The provided order item was not found in the given order.

apiErrorExample

Error-Response (Empty request body) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item data were not provided." }

Error-Response (Missing or invalid ID) HTTP/1.1 400 Bad Request { "code": 400, "status": "error", "message": "Order item record ID was not provided or is invalid." }

Error-Response (Not found in order) HTTP/1.1 404 Not Found { "code": 404, "status": "error", "message": "The provided order item ID does not exist in the given order!" }

Constants

Defines the default page offset for responses that return multiple items.

DEFAULT_PAGE_ITEMS
inherited
var

Default controller to be loaded when no resource was selected.

DEFAULT_CONTROLLER_NAME
inherited
var

Defines the maximum request limit for an authorized client.

DEFAULT_RATE_LIMIT
inherited
var

Defines the duration of an API session in minutes.

DEFAULT_RATE_RESET_PERIOD
inherited
var

Properties