The Reports API enables you to obtain reports about your items. Walmart runs reports for each seller once a day. The Item report provides all information about a seller’s items that are currently set up on Walmart platform.
Generate Item Report
How to call Item Reports APIs
To get the Item Report, call GET /v3/getReport and specify item_mx
for the type
query parameter.
The item report lists all information that pertains to a seller’s items.
The Item report is generated once daily by Walmart
The API downloads a zip file which has the item report. Example name of the zip file : MxItemReport2021-09-03T15_52_58.631Z.zip
The Item Report is returned in a .CSV file, with report name listed in content-disposition header, (e.g. filename=ReporteDeProductos_10001027534_2021-09-03T094105.5300000.csv). Your Partner ID is attached to report as a prefix, (e.g. 10001027534) followed by file generation timestamp.
What’s in the Item Report CSV file?
The Item Report CSV file contains these fields:
Name |
ID de la Tienda |
SKU |
Nombre del Producto |
Categoria del Producto |
Precio |
Moneda |
Estatus de publicacion |
Razon en Cambio de Estatus |
Ciclo de la publicacion |
Identificador de producto en Walmart (WPID) |
GTIN |
UPC |
Url de Imagen Principal |
Departamento |
Categoria principal |
Fecha De Inicio De La Oferta |
Fecha De Finalizacion De La Oferta |
Fecha de Creacion del Articulo |
Fecha de Ultima actualizacion del Articulo |
Marca |
Codigo fiscal del producto |
MSI elegible |
Parse Report CSV file with Java
You can specify how to parse the Reports CSV files using Java code that we provide.
Parse CSV File with Java
To format the CSV file, you can use this Java code to parse your response to a CSV file. This example demonstrates the use of the header and the body to process the response.
Example: Java code to parse CSV file
if (response.getStatus() == Response.Status.OK.getStatusCode() && response.hasEntity()) {
InputStream inputStream = (InputStream)response.getEntity();
try {
String header = response.getHeaderString("Content-Disposition");
if(header != null && !("").equals(header)) {
if(header.contains("filename")){
//header value will be something like:
//attachment; filename=10000000354_2016-01-15T23:09:54.438+0000.zip
int length = header.length();
String fileName = header.substring(header.indexOf("filename="),length);
System.out.println("filenameText " + fileName);
String [] str = fileName.split("=");
System.out.println("fileName: " + str[1]);
//replace "/Users/anauti1/Documents/" below with your values
File reportFile = new File("/Users/anauti1/Documents/" + str[1].toString());
OutputStream outStream = new FileOutputStream(reportFile);
byte[] buffer = new byte[8 * 1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outStream.write(buffer, 0, bytesRead);
}
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outStream);
}
}
}
catch (Exception ex){
System.out.print("Exception: " + ex.getMessage());
}
}