Skip to main content

Import a Price

POST 

https://euwest.api.elasticpath.com/pcm/pricebooks/import

You can create and update product price books and prices in bulk, at both organization and store level, using the Price Book Import API. This is useful, for example, if you have a promotion and want to update 50,000 product prices. Rather than having to go to each price book and manually edit 50,000 prices, you can use the Price Book Import API to bulk update all your product prices at the same time, including setting different prices for different currencies.

The API uses a JSONL file. The JSONL file can be compressed to a GZIP file. Here is an example of a JSONL file.

The API works on a "best endeavours" approach. In other words, the API does its best to create/update the price book objects based on the file that you provide. If there are any errors, then the import is aborted, and the job fails with an error. You can then use the job results to understand what objects the API created/updated until the import failed, and to troubleshoot any errors. See Import Results.

Price book imports are processed sequentially in the order that you send your import API requests.

Responses

The created price book

Schema
    data objectrequired

    Top level entity in the jobs domain model. It contains a job details.

    idstringrequired
    Example: 0dd4e7de-006f-460f-a43e-a581f375cedc
    attributes objectrequired
    created_atdate-timerequired
    Example: 2020-09-22T09:00:00Z
    updated_atdate-timerequired
    Example: 2020-09-22T09:00:00Z
    started_atdate-timenullable
    Example: 2020-09-22T09:00:00Z
    completed_atdate-timenullable
    Example: 2020-09-22T09:00:00Z
    typestringrequired
    Example: pricebook-import
    statusstringrequired
    Example: pending
    meta objectrequired
    x_request_idstringrequired
    Example: 2d70776e-c2b0-4446-84e6-d08a24edfca4

Authorization: Authorization

name: Authorizationtype: httpin: headerscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/pcm/pricebooks/import");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
ResponseClear

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