Ananas APItest bench
staging api.qa2.ananastest.com
TC-STOCK-02 Functional changes data

Updating quantity to 0

Verify that quantity can be set to 0 (out-of-stock status)

Specification · xlsx

Steps

  1. Send the request with quantity 0

Expected result

HTTP 200; quantity is updated to 0

Endpoints

PUT /product/api/v1/merchant-integration/product/bulk

Run

API_URL
https://api.qa2.ananastest.com
TARGET_ID
2555660

Change parameters

A dry run builds every request without sending it; responses come from a local stub.

Test code

mirrors tests/BulkTest.php::tc_stock_02()
168// Verify that quantity can be set to 0 (out-of-stock status)
169public function tc_stock_02(): void
170{
171 $targetId = (int) $_ENV['TARGET_ID'];
172
173 $productData = [
174 [
175 'id' => $targetId,
176 'stockLevel' => 0,
177 ],
178 ];
179
180 $response = $this->ananas->editInBulk($productData);
181
182 $this->assertEquals(200, $response['statusCode']);
183 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
184}

web/app/Scenarios/BulkScenarios.php · line numbers refer to this file

Not run yet. Run it against the API, or do a dry run to see the requests it would send.