Skip to main content

Import a dataset

POST 

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

Import a dataset

Request

Query Parameters

    filter string

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)

    The unique identifier.

    Example: 11111111-2222-3333-4444-555555555555
    typeSubscriptionImportType (string)required

    Possible values: [subscription_import]

    Example: subscription_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
    ownerstringrequired

    The owner of a resource, either store or organization.

    Example: store
    timestamps JobTimestamps
    updated_atstringrequired

    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 into Subscriptions. However, this does not mean they are valid subscription 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 to Subscriptions.

    uploaded objectrequired
    subscription_productintegerrequired

    The total number of products uploaded.

    Example: 50000
    subscription_planintegerrequired

    The total number of plans uploaded.

    Example: 50000
    subscription_featureintegerrequired

    The total number of features uploaded.

    Example: 50000
    subscription_subscriberintegerrequired

    The total number of subscribers uploaded.

    Example: 50000
    subscription_offeringintegerrequired

    The total number of offerings uploaded.

    Example: 50000
    subscriptionintegerrequired

    The total number of subscriptions uploaded.

    Example: 50000
    imported required
    subscription_productintegerrequired

    The total number of products imported.

    Example: 45090
    subscription_planintegerrequired

    The total number of plans imported.

    Example: 45090
    subscription_featureintegerrequired

    The total number of features uploaded.

    Example: 50000
    subscription_subscriberintegerrequired

    The total number of subscribers imported.

    Example: 45090
    subscription_offeringintegerrequired

    The total number of offerings imported.

    Example: 45090
    subscriptionintegerrequired

    The total number of subscriptions imported.

    Example: 45090

Authorization: http

name: BearerTokentype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/subscriptions/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
Parameters
— query
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.