All Release Notes

Error status code 400 for POST request

5 November 2021
Composable Commerce
Import API
Announcement
General

Effective on 7 December 2021, Import API POST endpoints will respond with the HTTP status code 400 for errors. Currently you receive the status code 200 if one or more resources in your Import Request have errors.

For the users to be able to prepare for this change, we will update the SDK before the actual change to the API takes place. The next SDK release will reflect this change. Before 7 December 2021, this new part of the SDK cannot be used.

The following change will take place:

  • In case one or more resources in an Import Request is invalid, the Import API respond with statusCode: 400:

    {
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Validation failed",
    "errors": [
    {
    "code": "InvalidField",
    "message": "\"resources[1].key\" is required",
    "field": "resources.1.key",
    "resourceIndex": 1
    },
    .
    .
    .
    ]
    }

The response code remains the same in the following cases:

  • In case the JSON payload of an Import Request is invalid, the Import API will continue to respond with statusCode": 400.
  • In case all the resources in am Import Request are valid, the Import API will continue to respond with statusCode": 200.