Class OrderStatusesApiV2Controller
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.
-
AbstractApiV2Controller
-
HttpApiV2Controller
-
OrderStatusesApiV2Controller
Methods summary
public
|
|
public
|
#
get( )
Api
{get} /order_statuses/:id Get order statuses
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.
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.
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
Apigroup
OrderStatus
Apiname
GetOrderStatus
Apisuccess
Response-Body If successful, this method will return the order status resource in JSON format.
Apiversion
2.4.0
|
public
|
#
post( )
Api
{post} /order_statuses Create Order Status
Apidescription
This method creates a new order status in the database.
Apierror
400-Bad Request The API will return this status code if the order status data was not provided.
Apiexample
{curl} Creates New Order Status
curl -X POST --user admin@shop.de:12345 http://shop.de/api.php/v2/order_statuses
Apigroup
OrderStatus
Apiname
CreateOrderStatus
Apiparam
{object} names Language related order status names. Provide the language id as object key.
{string} color Label color of order status.
Apiparamexample
{json} Create new order status
{
"names": {
"EN": "new order status name",
"DE": "neuer order status name"
},
"color": "adad1313"
}
Apisuccess
(Success 201) Response-Body If successful, this method returns the created order status resource in
the response body.
Apiversion
2.4.0
|
public
|
#
put( )
Api
{put} /order_statuses/:id Update Order Status
Apidescription
This method updates a order status in the database.
Apierror
400-Bad Request The API will return this status code if the order status data or order status id was
not provided.
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
Apigroup
OrderStatus
Apiname
UpdateOrderStatus
Apiparam
{object} names Language related order status names. Provide the language id as object key.
{string} color Label color of order status.
Apiparamexample
{json} Create new order status
{
"names": {
"EN": "updated order status name",
"DE": "aktualisierter order status name"
},
"color": "adad1313"
}
Apisuccess
(Success 201) Response-Body If successful, this method returns the updated order status resource in
the response body.
Apiversion
2.4.0
|
public
|
#
delete( )
Api
{delete} /order_statuses/:id Delete Order Status
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
Apigroup
OrderStatus
Apiname
DeleteOrderStatus
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "delete",
"orderStatusId": 2
}
Apiversion
2.4.0
|