# Create articles

This workflow allows third parties to create and update articles in Ultimo.&#x20;

The following parameters are used in the request.

| Parameter                 | Description                                                                                                      |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Id                        | Id of the article. This parameter is optional.                                                                   |
| ExternalId                | The external identification number. This parameter is optional.                                                  |
| ArticleGroupId            | Id of entity ArticleGroup                                                                                        |
| ChargeRaiseExternalId     | Id of entity ChargeRaiseExternal.                                                                                |
| ChargeRaiseInternalId     | Id of entity ChargeRaiseExternal.                                                                                |
| DataProvider              | DataProvider for article and pricemutation.                                                                      |
| Description               | Description for article.                                                                                         |
| ManufacturerId            | Id of entity Vendor. This parameter is optional.                                                                 |
| MaximumStock              | Maximum stock of the article. This property is optional.                                                         |
| Purchase                  | Purchase (True/False) of the article. This indicates if the article can be purchased. The default value is True. |
| PurchaseLevel             | Purchase level of the article. This parameter is optional.                                                       |
| PurchasePrice             | Purchase price of the article. This parameter is optional.                                                       |
| PurchaseText              | Text for order specifications. This parameter is optional.                                                       |
| RaiseId                   | Id of entity Raise. This parameter is optional.                                                                  |
| RegisterStock             | Register stock (True/False) of the article. Default value is True.                                               |
| ServingOutUnitDescription | Unit description of the article. This parameter is optional.                                                     |
| ShowInWebShop             | Show (True/False). This indicates if the article is available in the webshop.                                    |
| SiteId                    | Id of entity Site. This parameter is optional.                                                                   |
| Text                      | Text for article specifications. This parameter property is optional.                                            |
| VatId                     | Id of entity VAT. This property is optional.                                                                     |

### Functional details

The article workflow can be used to create and update articles. The properties Id and ExternalId are both optional. If left empty then articles will be created using the autokey functionality.

For updating the workflow will search on Id and ExternalId, first on Id and then on ExternalId. If the article is not found a new one will be created.

Price mutations will be created when the provided purchase price differs from the current one.&#x20;

## Technical details

### Basic URL (POST):

`https://customer.ultimo.com/api/V1/Action/REST_Article_Import`

Header data:

| Parameter            | Description                                               |
| -------------------- | --------------------------------------------------------- |
| ApiKey               | Request an API key at (application manager or consultant) |
| ApplicationElementId | Fixed value “363b35dc-309a-4947-919b-b5e1bd2b5c47"        |

### Body (example):

```csharp
{
   "ExternalId":"0403",
   "ArticleGroupId":"014",
   "ChargeRaiseExternalId":null,
   "ChargeRaiseInternalId":null,
   "DataProvider":null,
   "Description":"Toner copier",
   "Id":"",
   "ManufacturerId":null,
   "MaximumStock":20.00,
   "Purchase":true,
   "PurchaseLevel":10.00,
   "PurchasePrice":104.86000,
   "PurchaseText":null,
   "RaiseId":null,
   "RegisterStock":true,
   "ServingOutUnitDescription":"Box",
   "ShowInWebShop":true,
   "SiteId":"01",
   "Text":null,
   "VatId":"1"
}
```

### Normal response:

{% hint style="success" %}
Status: 200 OK
{% endhint %}

```csharp
{
    "properties": {}
}
```

### Response when the action is not allowed:

{% hint style="danger" %}
Status: 400 Bad Request
{% endhint %}

```csharp
{
   "message":"The article could not be created or updated.\nCause: ExternalId is not provided.",
   "type":3,
   "code":"9900"
}
```

### Response when the API-key is invalid:

{% hint style="danger" %}
Status: 401 Unauthorized
{% endhint %}

```csharp
{
    "message": "Missing API key",
    "code": "MissingApikey"
}
```
