Kategorie

Operations with customer roles

Operations with customer roles - GET, INSERT, UPDATE, DELETE

How to get all customer roles
GET /odata/customerrole

Request Type: GET

Enter the request URL: http://StoreURL/odata/customerrole

Auth type: Bearer Token - paste the token generated in the previous steps

GET all customer roles results

How to get customer role by id
GET /odata/customerrole('id')

Request Type: GET

Enter the request URL: http://StoreURL/odata/customerrole('id')

Auth type: Bearer Token - paste the token generated in the previous steps

GET customer role by id

How to delete customer role
DELETE /odata/customerrole('id')

Request Type: DELETE

Enter the request URL: http://StoreURL/odata/customerrole('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Please note that in DELETE operations, you will get only "Status: 200 OK" information if the item was successfully deleted. Please note that you are not able to delete system roles. If you try to do that, you will get 403 Forbidden error.

How to add new customer role
POST /odata/customerrole

Request Type: POST

Enter the request URL: http://StoreURL/odata/customerrole

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. 

{
    "Name": "Enter the name",
    "FreeShipping": True/False,
    "TaxExempt": True/False,
    "Active": True/False,
    "IsSystemRole": True/False,
    "SystemName": "",
    "EnablePasswordLifetime": True/False,
    "PurchasedWithProductId": Enter the ID of product if necessary,
    "Id": "Leave it empty"
}

How to update customer role
POST /odata/customerrole

Request Type: POST

Enter the request URL: http://StoreURL/odata/customerrole

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page. You can use the previous body request. Please note that you need to have all fields in your request.

back to top