# MatchOwnArticleNumbers

**Description**

The database of the shop does not contain the customer's own articlenumbers but if this REST API function is implemented the shop can facilitate the use of the customer's own article numbers in the shop's search box.&#x20;

This function can be implemented if the ERP system supports the storage of the customer own article numbers for the articles in the ERP.

The shop will pass on the terms found in search query to the MatchOwnArticleNumbers endpoint. The endpoint checks in the ERP if the terms correspond with the own articlenumbers of the current customer and and returns the matched articlenumbers that are used in the shop. The shop will then complete the search query with this matched/translated articlenumbers. SearchTerms that could not be matched are not returned in the result.

## REST API:

**URL:** /Shoxl/v1/MatchOwnArticleNumbers\
**Method:** POST

**Request body:**

### MatchOwnArticleNumbersRequest{

| accountNumber | <p>string<br>required</p>        | Account number of the customer that is logged in into the shop.                |
| ------------- | -------------------------------- | ------------------------------------------------------------------------------ |
| searchTerms   | <p>\[string] </p><p>required</p> | List of seachterms that may (but does not have to) contain own articlenumbers. |

}

#### Example:

```
{
  "accountNumber": "128",
  "searchTerms": [ "4321", "dummy", "123456789" ]
}
```

###

**Response body:**

### MatchOwnArticleNumbersResult{

| Parameter        | Type                            | Description                                                                |
| ---------------- | ------------------------------- | -------------------------------------------------------------------------- |
| errorCode        | <p>string<br>nullable: true</p> | An error code returned by the ERP system                                   |
| errorDescription | <p>string<br>nullable: true</p> | The error description related to the error code returned by the ERP system |
| matchedArticles  | \[ArticleNumberMatch]           | List of article number matches                                             |

}

### ArticleNumberMatc&#x68;**{**

| Parameter        | Type                            | Description                                                      |
| ---------------- | ------------------------------- | ---------------------------------------------------------------- |
| ownArticleNumber | <p>string<br>nullable: true</p> | Matched own article number                                       |
| articleNumber    | <p>string<br>nullable: true</p> | Article number of the ERP system (that is also used in the shop) |

}&#x20;

#### Example:

```
{
  "errorCode": "string",
  "errorDescription": "string",
  "matchedArticles": [
    {
      "ownArticleNumber": "4321",
      "articleNumber": "90001"
    }.
    {
      "ownArticleNumber": "123456789",
      "articleNumber": "70001"
    }
  ],
}
```
