POST /admin-api/discounts

Details

Steps

Step Description Expected result
In BO, Go to Advanced Parameters > New & Experimental Features New & Experimental Features is displayed correctly
Enable Experimental Feature “Discount” Experimental Feature “Discount” is enabled
In BO, Go to Advanced Parameters > Authorization Server Authorization Server Page is displayed correctly.
No records found in the table
Click on the button “Add new API access” New API access Page is displayed correctly
* Fill the form with following data
* Click on “Generate client secret & Save” button
* The message “The API access and Client secret has been generated sucessfully” is displayed
* The message “Client secret: " is displayed
In BO, Go to Catalog > Discounts Discounts Page is displayed correctly.
No records in the list.
Request with method POST the endpoint “https://[url of your shop]/admin-api/discounts” with relative data The HTTP code is 201.

The return value is in JSON

The return value data are consistent relative to sent data.
Reload the Discounts page Discounts Page is displayed correctly.
1 record in the list.
Click on Edit for the filtered discount The Edit page will be displayed correctly

The return data keys are consistent relative to BackOffice data.
In BO, Go to Catalog > Discounts Discounts Page is displayed correctly.
Delete the filtered discount > Click Yes Message “Successful deletion” is displayed

The filtered discount is deleted
Reload the discounts page Discounts Page is displayed correctly.
No records in the list.
In BO, Go to Advanced Parameters > New & Experimental Features New & Experimental Features is displayed correctly
Disable Experimental Feature “Discount” Experimental Feature “Discount” is disabled
In BO, Go to Advanced Parameters > Authorization Server Authorization Server Page is displayed correctly.
1 record found in the table
On the first row, click on the button “Three points” The dropdown is displayed
Click on the Delete Button in the dropdown A modal appeared
Click on the Confirm Button in the modal The message “Successful deletion” is displayed
No records found in the table