protected
|
#
__initialize( )
Initialize controller components.
Initialize controller components.
|
public
|
#
get( )
Api
{get} /customer_groups/:id Get customer groups
Apidescription
Get multiple or a single customer groups record through the GET method
Apierror
400-BadRequest CustomerGroups data were not provided or customer groups record ID was not
provided or is invalid.
404-NotFound CustomerGroups record could not be found.
Apierrorexample
Error-Response (Missing or invalid ID)
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "CustomerGroups record ID was not provided or is invalid."
}
Error-Response (CustomerGroups Not Found)
HTTP/1.1 404 Not Found
{
"code": 404,
"status": "error",
"message": "CustomerGroups record could not be found."
}
Apiexample
{curl} Get All CustomerGroups records
curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/customer_groups
{curl} Get CustomerGroups record With ID = 982
curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/customer_groups/982
Apigroup
CustomerGroups
Apiname
GetCustomerGroups
Apiversion
2.5.0
|
public
|
#
post( )
Api
{post} /customer_groups Create CustomerGroups
Apidescription
This method enables the creation of a new CustomerGroups into the system.
Apierror
400-BadRequest The body of the request was empty.
Apierrorexample
Error-Response
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "CustomerGroups data were not provided."
}
Apigroup
CustomerGroups
Apiname
CreateCustomerGroups
Apiparam
{Object} names Object with language code as keys and name as values.
{Object} settings Object with customer group settings, visit the example for further information.
{Object} configurations Object with customer group configurations, visit the example for further
information.
Apiparamexample
{json} CustomerGroups entity
{
"names": {
"EN": "Kids",
"DE": "Kinder"
},
"settings": {
"public": false,
"otDiscountFlag": false,
"graduatedPrices": false,
"showPrice": true,
"showPriceTax": false,
"addTaxOt": false,
"discountAttributes": false,
"fsk18": false,
"fsk18Display": false,
"writeReviews": false,
"readReviews": false
},
"configurations": {
"minOrder": 2.50,
"maxOrder": 20.00,
"discount": 0.5,
"otDiscount": 0,
"unallowedPaymentModules": [
"paypal", "cod", "moneyorder"
],
"unallowedShippingModules": [
"selfpickup"
]
}
}
Apisuccess
(201) Request-Body If successful, this method returns the complete customerGroups resource
in the response body.
Apisuccessexample
{json} Success-Response
{
"id": 2,
"names": {
"EN": "Kids",
"DE": "Kinder"
},
"settings": {
"public": false,
"otDiscountFlag": false,
"graduatedPrices": false,
"showPrice": true,
"showPriceTax": false,
"addTaxOt": false,
"discountAttributes": false,
"fsk18": false,
"fsk18Display": false,
"writeReviews": false,
"readReviews": false
},
"configurations": {
"minOrder": 2.50,
"maxOrder": 20.00,
"discount": 0.5,
"otDiscount": 0,
"unallowedPaymentModules": [
"paypal", "cod", "moneyorder"
],
"unallowedShippingModules": [
"selfpickup"
]
}
}
Apiversion
2.5.0
|
public
|
#
patch( )
Api
{patch} /customer_groups/:id Updates CustomerGroup entity
Apidescription
Use this method if you want to update an existing customer groups record.
Apierror
400-BadRequest CustomerGroups data were not provided or customerGroups record ID was not
provided or is invalid.
404-NotFoundRequest CustomerGroups data were not provided or customerGroups record ID was not
provided or is invalid.
Apierrorexample
Error-Response (Empty request body)
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "CustomerGroups data were not provided."
}
Error-Response (Missing or invalid ID)
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "CustomerGroups record ID was not provided or is invalid."
}
Error-Response (Entity not found)
HTTP/1.1 400 Bad Request
{
"code": 404,
"status": "error",
"message": "Customer group entity was not found with provided id [ID]"
}
Apigroup
CustomerGroups
Apiname
UpdateCustomerGroups
Apiparam
{Object} names Object with language code as keys and name as values.
{Object} settings Object with customer group settings, visit the example for further information.
{Object} configurations Object with customer group configurations, visit the example for further
information.
Apiparamexample
{json} CustomerGroups entity
{
"names": {
"EN": "Kids",
"DE": "Kinder"
},
"settings": {
"public": false,
"otDiscountFlag": false,
"graduatedPrices": false,
"showPrice": true,
"showPriceTax": false,
"addTaxOt": false,
"discountAttributes": false,
"fsk18": false,
"fsk18Display": false,
"writeReviews": false,
"readReviews": false
},
"configurations": {
"minOrder": 2.50,
"maxOrder": 20.00,
"discount": 0.5,
"otDiscount": 0,
"unallowedPaymentModules": [
"paypal", "cod", "moneyorder"
],
"unallowedShippingModules": [
"selfpickup"
]
}
}
Apisuccess
(200) Request-Body If successful, this method returns the complete customerGroups resource
in the response body.
Apisuccessexample
{json} Success-Response
{
"id": 2,
"names": {
"EN": "Kids",
"DE": "Kinder"
},
"settings": {
"public": false,
"otDiscountFlag": false,
"graduatedPrices": false,
"showPrice": true,
"showPriceTax": false,
"addTaxOt": false,
"discountAttributes": false,
"fsk18": false,
"fsk18Display": false,
"writeReviews": false,
"readReviews": false
},
"configurations": {
"minOrder": 2.50,
"maxOrder": 20.00,
"discount": 0.5,
"otDiscount": 0,
"unallowedPaymentModules": [
"paypal", "cod", "moneyorder"
],
"unallowedShippingModules": [
"selfpickup"
]
}
}
Apiversion
2.5.0
|
public
|
#
delete( )
Api
{delete} /customer_groups/:id Delete CustomerGroups
Apidescription
Removes a customer groups record from the system. This method will always return success
even if the customer group does not exist.
Apiexample
{curl} Delete CustomerGroups with ID = 84
curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/customer_groups/84
Apigroup
CustomerGroups
Apiname
DeleteCustomerGroups
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "delete",
"customerGroupId": 84
}
Apiversion
2.5.0
|
protected
array
|
#
_serializeCustomerGroupCollection( CustomerGroupCollection $customerGroupCollection )
Serializes customer group collections.
Serializes customer group collections.
Parameters
- $customerGroupCollection
- Customer group collection to be serialized.
Returns
array Serialized customer group collection array.
|
protected
array
|
#
_serializeCustomerGroup( CustomerGroupInterface $customerGroup )
Serializes customer group entities.
Serializes customer group entities.
Parameters
- $customerGroup
- Customer group entity to be serialized.
Returns
array Serialized customer group array.
|
protected
QuantityUnitInterface
|
#
_deserializeCustomerGroup( string $customerGroupJson, integer|null $id = null )
Deserialize a json string to a customer unit entity.
Deserialize a json string to a customer unit entity.
Parameters
- $customerGroupJson
- Customer group json to be serialized.
- $id
- (Optional) Id of entity to be deserialize.
Returns
|
protected
array
|
#
_serializeCustomerGroupNames( array $customerGroupNames )
Serializes customer group names array.
Serializes customer group names array.
Parameters
- $customerGroupNames
- Customer group names array to be serialized.
Returns
array Serialized customer group names array.
|
protected
array
|
|
protected
CustomerGroupSettingsInterface
|
#
_deserializeCustomerGroupSettings( array $settings )
Deserialize customer group settings.
Deserialize customer group settings.
Parameters
- $settings
- Customer group settings to be serialzed.
Returns
|
protected
array
|
|
protected
CustomerGroupConfigurationsInterface
|
#
_deserializeCustomerGroupConfigurations( array $configurations )
Deserialize customer group configurations.
Deserialize customer group configurations.
Parameters
- $configurations
- Customer group configurations to be serialzed.
Returns
|