Skip to main content

Import a dataset

POST 

https://euwest.api.elasticpath.com/v2/inventories/imports

Import a dataset

Request

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

Success. The import was started.

Schema
    data Import
    idUUID (string)required

    The unique identifier.

    Example: 00000000-0000-0000-0000-000000000000
    typeInventoriesImportType (string)required

    Possible values: [inventories_import]

    Example: inventories_import
    attributes ImportAttributesrequired
    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
    statusstringrequired

    The status of job.

    • pending - Commerce has received the request but is currently busy processing other requests.
    • started - Commerce has started processing the job.
    • success - The job has successfully completed.
    • failed - The job has failed.

    Possible values: [pending, started, success, failed]

    Example: pending
    meta ImportMetarequired
    timestamps JobTimestamps
    updated_atstring

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z
    started_atstring

    The date and time a job is started.

    Example: 2017-01-10T11:41:19.244842Z
    finished_atstring

    The date and time a job finished.

    Example: 2017-01-10T11:41:19.244842Z
    records objectrequired

    You can track the number of records imported to ensure the completeness, accuracy and integrity of the import. Uploaded shows the number of records ready to be imported. However, this does not mean they are valid objects, only that they have the correct type and their JSON format is properly formatted. Imported shows the number of records that have been both validated and successfully added.

    uploaded objectrequired
    stockintegerrequired

    The total number of product transactions uploaded.

    Example: 50000
    imported required
    stockintegerrequired

    The total number of product transactions uploaded.

    Example: 50000

Authorization: http

name: bearerAuthtype: httpscheme: bearer
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());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Body
required
The JSONL file you want to upload.
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.