OrderStatusesApiV2Controller

Extends \HttpApiV2Controller

Class HttpApiV2Controller

Contains common functionality for all the GX2 APIv2 controllers. You can use the $api instance in the child-controllers in order to gain access to request and response information. The $uri variable is an array that contains the requested resource path.

You can use a protected "__initialize" method in your child controllers for performing common operations without overriding the parent constructor method.

This class contains some private methods that define the core operations of each controller and should not be called from a child-controller (like validation, authorization, rate limiting). The only way to disable the execution of these methods is to override the controller.

package

Default

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.

Initialize Controller

__initialize() 

delete

delete() 
api
apiVersion

2.4.0

apiName

DeleteOrderStatus

apiGroup

OrderStatus

apiDescription

Removes a order status record from the system. This method will always return success.

apiExample

{curl} Delete Order Status with ID = 2 curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses/2

apiSuccessExample

{json} Success-Response { "code": 200, "status": "success", "action": "delete", "orderStatusId": 2 }

get

get() 
api
apiVersion

2.4.0

apiName

GetOrderStatus

apiGroup

OrderStatus

apiDescription

Get a single order status entry. This method is currently limited to only fetching a single order status resource so make sure that you provide the order status ID in the request URI.

apiExample

{curl} Get all order statuses curl --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses

{curl} Get order status with ID = 2 curl --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses/2

apiSuccess

Response-Body If successful, this method will return the order status resource in JSON format.

apiError

(Error 5xx) 500-InternalError If the record is not found or something else goes wrong the API will return a 500 error status. Read the message for more info.

(Error 4xx) 400-Bad Request If the ID is not numeric in the request URI then the API will return a 400 error status because it cannot return the order status resource.

getCallableResource

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

Arguments

$controller

$mappedURI

array

$api

\Slim\Slim

post

post() 
api
apiVersion

2.4.0

apiName

CreateOrderStatus

apiGroup

OrderStatus

apiDescription

This method creates a new order status in the database.

apiExample

{curl} Creates New Order Status curl -X POST --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses

apiParamExample

{json} Create new order status { "names": { "EN": "new order status name", "DE": "neuer order status name" }, "color": "adad1313" }

apiParam

{object} names Language related order status names. Provide the language id as object key.

{string} color Label color of order status.

apiSuccess

(Success 201) Response-Body If successful, this method returns the created order status resource in the response body.

apiError

400-Bad Request The API will return this status code if the order status data was not provided.

put

put() 
api
apiVersion

2.4.0

apiName

UpdateOrderStatus

apiGroup

OrderStatus

apiDescription

This method updates a order status in the database.

apiExample

{curl} Update Order Status with ID = 2 curl -X PUT --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses/2

apiParamExample

{json} Create new order status { "names": { "EN": "updated order status name", "DE": "aktualisierter order status name" }, "color": "adad1313" }

apiParam

{object} names Language related order status names. Provide the language id as object key.

{string} color Label color of order status.

apiSuccess

(Success 201) Response-Body If successful, this method returns the updated order status resource in the response body.

apiError

400-Bad Request The API will return this status code if the order status data or order status id was not provided.

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