# Breaking changes in Web API 5

#### Authentication

[HMAC authentication](https://en.wikipedia.org/wiki/HMAC) is no longer supported. For the highest level of interoperability with generic clients, the Web API now uses [Basic authentication](/framework/web-api/authentication.md) over HTTPS, as recommended by the *OData protocol version 4.0*.

#### Querying related entities

The following path is no longer supported:

```
GET /EntitySet({id})/RelatedEntity({relatedId})
```

Simply use the endpoint for the related entity directly.

{% code title="Example" %}

```
old /Customers(1)/Addresses(2)
new /Addresses(2)
```

{% endcode %}

#### Querying properties

The following path is no longer supported:

```
GET /EntitySet({id})/PropertyName
```

Use the more flexible `$select` instead:

{% code title="Example" %}

```
old /Categories(14)/Name
new /Categories(14)?$select=Name
```

{% endcode %}

#### Response of PUT and PATCH requests

For PUT and PATCH requests, the HTTP header **Prefer** with the value `return=representation` must be sent to get a status code `200` with an entity content response. This is the default behavior of *AspNetCore.OData v.8*, otherwise `204 No Content` is returned.

#### Return types of media endpoints

* */MediaFiles* returns the type `FileItemInfo` that wraps and enriches the media file entity.
* */MediaFolders* returns the type `FolderNodeInfo` that wraps and enriches the media folder entity.

Both are flattened objects without navigation properties.

#### Request parameters

Request parameters must be written in camel case.

{% code title="Example" %}

```
old /MediaFiles/GetFileByPath {"Path": "catalog/my-image.jpg"}
new /MediaFiles/GetFileByPath {"path": "catalog/my-image.jpg"}
```

{% endcode %}

#### Entity fulfillment

The query string parameter **SmNetFulfill** has been renamed to **SmApiFulfill**.

## Changed endpoints

<table><thead><tr><th width="445">Old endpoint -> New endpoint</th><th>Remarks</th></tr></thead><tbody><tr><td>GET MediaFiles/Download({Id}) -><br>GET MediaFiles/DownloadFile({id})</td><td></td></tr><tr><td>POST OrderItems({id})/Infos -><br>GET OrderItems/GetShipmentInfo({id})</td><td></td></tr><tr><td>POST Orders({id})/Infos -><br>GET Orders/GetShipmentInfo({id})</td><td></td></tr><tr><td>POST Orders({id})/Pdf -><br>GET Orders/DownloadPdf({id})</td><td></td></tr><tr><td><mark style="color:orange;">GET Payments/Methods</mark> -><br>GET PaymentMethods/GetAllPaymentMethods({active},{storeId})</td><td>New method. Now returns a list of payment method system names.</td></tr><tr><td>ProductPictures/... -><br>ProductMediaFiles/...</td><td>The controller name has changed.</td></tr><tr><td>Products/ProductPictures -><br>Products/ProductMediaFiles</td><td>The navigation property name has changed.</td></tr><tr><td><mark style="color:orange;">POST Uploads/ProductImages</mark> -><br><mark style="color:green;">POST Products/ProductMediaFiles</mark></td><td><p>New method. Now returns a list of <strong>ProductMediaFile</strong>.</p><p>SKU, GTIN or MPN to identify the product can optionally be sent via query string. ContentDisposition parameter <strong>pictureId</strong> renamed to <strong>fileId</strong>.</p></td></tr><tr><td>POST Products/FinalPrice|LowestPrice -><br>POST Products/CalculatePrice</td><td>New method. Now returns <strong>CalculatedProductPrice</strong>.</td></tr></tbody></table>

{% hint style="info" %}
Notes:

* <mark style="color:orange;">Route</mark> <mark style="color:orange;">**/api/v1/**</mark> <mark style="color:orange;">no longer exists.</mark>
* <mark style="color:green;">The parameterization has been changed to support</mark> *<mark style="color:green;">Swagger</mark>*<mark style="color:green;">.</mark>
  {% endhint %}

## Changed response header names

<table><thead><tr><th width="386.3333333333333">Old -> new name</th><th>Remarks</th></tr></thead><tbody><tr><td>SmartStore-Net-Api-... -><br>Smartstore-Api-...</td><td>Name prefix changed.</td></tr><tr><td>SmartStore-Net-Api-HmacResultId -><br>Smartstore-Api-AuthResultId</td><td><a href="#authentication">New values</a>.</td></tr><tr><td>SmartStore-Net-Api-HmacResultDesc -><br>Smartstore-Api-AuthResultDesc</td><td><a href="#authentication">New values</a>.</td></tr><tr><td>SmartStore-Net-Api-MissingPermission -> -</td><td>Obsolete, no longer sent.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.smartstore.com/framework/web-api/breaking-changes-in-web-api-5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
