Set Product Status on Multiple Products

The Set Product Status integration point (IP) allows you to set the status of multiple products in a single request. This integration point is an asynchronous long-running operation (LRO).

Request URL

To start the operation, send a POST request to:

http://[hostName]:[portNumber]/[api-context-root]/setproductstatus

The payload specifies which status the user wants to set, followed by the product list:

{
  "status": "T",
  "productList": [
    { "productCode": "<product-code>" }
  ]
}
Field Type Required Description

status

Enum

Yes

The status to which all listed products must transition. Allowed values are E (Edit), R (Review), T (Test), and A (Approved).

productList

Array

Yes

The list of products to transition. Must contain at least one element.

productList[].productCode

String

Yes

The unique code of the product.

Processing

Validation

The following request-level validations are performed on the request as a whole:

  • Validate that the requested status is supported by this operation

  • Validate that the product list contains at least one product

  • Validate that the request contains no more than 1000 product codes

  • Validate that each product exists

Before the long-running operation starts, the IP validates that every product can make the requested status transition. If a product fails a request-level or transition validation, the request is rejected and no product statuses are changed.

For details about each status transition, see:

The following table gives an overview of the supported statuses and the validation that is applied per product:

Table 1. Error codes
Status Product Must Be in Status Error Codes

Edit

Queued, Review, Test or Approved

PRD-HTTP-003

Test

Review

PRD-HTTP-004

Approved

Test

PRD-HTTP-005

Review

Edit

PRD-HTTP-001

Status Transition

After all validations pass, the long-running operation performs the status transition for each product. The operation:

  • Sets the product status.

  • Updates the product status history.

  • Builds the product when changing its status from Edit to Review. This generates the product specification and benefit specifications.

    • If the build fails, the product status returns to Edit.

Response

The integration point responds with HTTP 201 (Created) and a location header that points to the status resource of the long-running operation:

Location: http://[hostName]:[portNumber]/[api-context-root]/setproductstatus/{id}/status

Use the status resource to monitor the operation and obtain its processing messages. For more information, see Long-Running Operations Through REST.

Response Messages

Failure

The following operation-specific errors can occur at the request level. If any of these errors occurs, the request is rejected and no products are processed:

Table 2. Error Messages
Code Severity Message Text

PRD-IP-PSET-001

Fatal

The product list must contain at least one product.

PRD-IP-PSET-002

Fatal

The status {status} is unknown or missing.

PRD-IP-PSET-003

Fatal

The product {productCode} does not exist.

PRD-IP-PSET-004

Fatal

A maximum of 1000 product codes is supported per request.

PRD-HTTP-001

Fatal

Product must be in status edit to start the "build" process.

PRD-HTTP-003

Fatal

To change the product status back to edit, the product must be in status Queued, Review, Test or Approved.

PRD-HTTP-004

Fatal

To change the product status to Test, the product must be in status Review.

PRD-HTTP-005

Fatal

To change the product status to Approved, the product must be in a status Test.

Authorization

A user authorization configuration protects this integration point. Access requires both of the following grants:

  • The setproductstatus IP access restriction.

  • The access restriction for the requested status transition.

For example, to set Products to status Edit:

  • The user needs a grant on setproductstatus IP and products.edit IP.

  • A user with only setproductstatus IP cannot perform any status transition through this operation.

  • A user with only the individual access restriction can change single Products through the corresponding individual integration point, but cannot use this bulk operation.