Skip to main content

Update spare part(s) information

POST 

https://api.mobility-work.com/partners/v1/spare-parts/attributes

StarterPremiumUltimate
✔️✔️✔️

Update all spare part(s) by replacing information with the provided information.

⚠️ The request is processed in background. It can takes up to several minutes to see the change if there is a lot of changes.

Omit the property if you do not want to make any changes to the attribute. For instance, the following request will only update the spare part name:

[
{
"id": {
"type": "externalReference",
"value": "c6d6f829-6c36-30cc-93be-d5202ca28aa4"
},
"name": "Rotor"
}
]

To unset an attribute, set it to null. For instance, the following request will remove the minimum stock:

[
{
"id": {
"type": "externalReference",
"value": "c6d6f829-6c36-30cc-93be-d5202ca28aa4"
},
"minimumStock": null
}
]

Unit price amount must be passed as an integer in the lowest unit of the currency. For example, EUR and USD have a cent unit, 10 EUR = 1000 cents, 10 USD = 1000 pennies.

For instance, if one spare part has a unit price of €35.00 and another has a unit price of $499.99, the request to update unit price should be:

[
{
"id": {
"type": "externalReference",
"value": "c6d6f829-6c36-30cc-93be-d5202ca28aa4"
},
"unitPrice": {
"amount": 3500,
"currency": "EUR"
}
},
{
"id": {
"type": "externalReference",
"value": "d8194f1f-050d-4f74-a592-2d541e6127aa"
},
"unitPrice": {
"amount": 49999,
"currency": "USD"
}
}
]

⚠️ A maximum of 10.000 updates can be processed in a single request. You need to split in several requests if you have more changes.

Request

Responses

Request accepted (e.g. all changes will be processed as soon as possible)

Authorization: Api-Key

name: Api-Keytype: apiKeyin: headerdescription: Every requests to the API **must be** authenticated.
You must provide the API Key to authenticate as an HTTP header `Api-Key`.

For instance:

```curl
POST /partners/v1/tasks
Api-Key: 913a8f7cef6ff084f1635511b9c7d07c3bab2816
[...]
```

Each API Key is associated to a single network providing an access to all features available on the network
subscription plan.

To get an API Key, send an email to [sales@mobility-work.com](mailto:sales@mobility-work.com) or contact your CSM.
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.mobility-work.com/partners/v1/spare-parts/attributes");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Api-Key", "<Api-Key>");
var content = new StringContent("[\n {\n \"id\": \"string\",\n \"unitPrice\": {\n \"amount\": 0,\n \"currency\": \"string\"\n },\n \"name\": \"string\",\n \"description\": \"string\",\n \"externalReference\": \"string\",\n \"minimumStock\": 0,\n \"maximumStock\": 0,\n \"replenishmentLot\": 0,\n \"gtin\": \"string\",\n \"customFields\": [\n {\n \"field\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"tags\": [\n {\n \"operation\": \"add\",\n \"values\": [\n \"string\"\n ]\n }\n ],\n \"costCenter\": \"string\"\n }\n]", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://api.mobility-work.com
Auth
Body
[
  {
    "id": "string",
    "unitPrice": {
      "amount": 0,
      "currency": "string"
    },
    "name": "string",
    "description": "string",
    "externalReference": "string",
    "minimumStock": 0,
    "maximumStock": 0,
    "replenishmentLot": 0,
    "gtin": "string",
    "customFields": [
      {
        "field": "string",
        "value": "string"
      }
    ],
    "tags": [
      {
        "operation": "add",
        "values": [
          "string"
        ]
      }
    ],
    "costCenter": "string"
  }
]
ResponseClear

Click the Send API Request button above and see the response here!