This api is used for updating stock status of product via sku list.

1. Get admin token

Using for authentication, we need token from an admin with roles allowed for Magento_Catalog::products or admin user with all resources.

Api Call:

  • End Point: /V1/integration/admin/token (example: https://eztoro.com/rest/V1/integration/admin/token)
  • Method: POST
  • Authentication: None
  • Parameters: username (Admin username) and password (Admin user password)

For more information, please read more in this link (Magento token-based authentication).

Notes: Admin token has expiration time or being clear in admin portal, afterthat you need to get new token for all usages.


2. Update stock status

This api allow user to update stock status of product in Magento with specified skus list.

  • End Point: /V1/products/status/update (example: https://eztoro.com/rest/V1/products/status/update)
  • Method: POST
  • Authentication: Bearer Token
  • Parameters:
    • skus: List sku for update, using in array
    • status: Status that need to update. Accepted Value: 1 (Available) or 0 (Not Available)

3. API Response:

  • success: Result of api request (true or false).
  • updated_successful_items: Number of successfully updated items.
  • updated_fail_items: Number of unsuccessfully updated items.
  • message: Message.
  • failed_skus: List of unsuccessfully updated sku.
  • errors: Detail of error messages.


4. Exception Message:

  • SKU_INVALID - One or more sku is invalid or not found.
  • INPUT_INVALID - One or more input exceptions have occurred.
  • INVALID_FIELD_RANGE - The %fieldName value of "%value" must be between %minValue and %maxValue.
  • INVALID_FIELD_MIN_VALUE - The %fieldName value of "%value" must be greater than or equal to %minValue.
  • INVALID_FIELD_MAX_VALUE - The %fieldName value of "%value" must be less than or equal to %maxValue.
  • INVALID_FIELD_VALUE - Invalid value of "%value" provided for the %fieldName field.
  • REQUIRED_FIELD - "%fieldName" is required. Enter and try again.

  • No labels