Import a dataset
POSThttps://euwest.api.elasticpath.com/v2/inventories/imports
Import a dataset
Request
- multipart/form-data
Body
external_refExternalRef (string)
A unique attribute that you could use to contain information from another company system, for example. The maximum length is 2048 characters.
Possible values: <= 2048 characters
Example:
abc123
import_filebinaryrequired
The JSONL file you want to upload.
Responses
- 201
- 400
- 500
Success. The import was started.
- application/json
- Schema
- Example (auto)
Schema
data Import
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "inventories_import",
"attributes": {
"external_ref": "abc123",
"status": "pending"
},
"meta": {
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z",
"started_at": "2017-01-10T11:41:19.244842Z",
"finished_at": "2017-01-10T11:41:19.244842Z"
},
"records": {
"uploaded": {
"stock": 50000
},
"imported": {
"stock": 50000
}
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- missing-name
Schema
errors object[]required
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "Your request was invalid"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors object[]required
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": "500"
}
]
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/inventories/imports");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent(string.Empty);
content.Headers.ContentType = new MediaTypeHeaderValue("multipart/form-data");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear