Skip to content

Create a report to be processed

You call thislegacyreport

POST
/v1/report
curl --request POST \
--url https://api.zentail.com/v1/report \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "label": "example", "isExport": false, "data": "example", "extension": "csv", "overwriteWithBlank": false, "createNewProducts": false, "columnTypes": [ "example" ], "delimiter": ",", "activeOnly": false, "insertOnly": false, "includeHeader": true, "exportForExcel": false, "filter": "example", "headersOnly": false }'

You can use this endpoint to create an import or an export. The parameters used in each case are different so definitely check out the model to see what each parameter is used for. Please note the prefixes ‘For exports only:’ and ‘For imports only:’.

Import

You’ll need to build a file that has a header row that describes the contents of the corresponding column. You can find a list of acceptable column headers here. For example, if you were importing a file to set the MSRP for a set of SKUs, the first column header would have to be ‘SKU’ and the second column header would be ‘MSRP’.

Export

If you don’t supply any columnTypes in your request, we will include all of the possible columns that can be exported. If you’d like to restrict the number of columns you can pass the column types as an array. You can find a list of acceptable column headers here. For example if you were trying to export the MSRP for SKUs you would send ["SKU", "MSRP"] in the columnType parameter.
You can also use filters to limit the results of a report. You can find find more information on how to build a filter query here

Details of the report to be created

Media typeapplication/json
object
label
required

Assigns a label to this report.

string
isExport

If true, this is an export. Otherwise it’s an import.

boolean
data

For imports only: This should be a csv, xls, xlsx, xslsm, txt, or tsv file encoded in base 64 (e.g. base64_encode(data) in PHP).

string
extension

For imports only: This tells us the type of file that was encoded in the data parameter.

string
default: csv
Allowed values: csv xls xlsx xlsm txt tsv
overwriteWithBlank

For imports only: If set to true, blank values supplied in the upload , data will overwrite.

boolean
createNewProducts

For imports only: If set to true, if a SKU doesn’t exist in zentail, we will create one.

boolean
columnTypes

For exports only: Use this field to provide the columns you’d like to export. You can find the columns eligible for export at here. If no columns are supplied, all the possible columns will be exported (there are lot!).

Array<string>
delimiter

For exports only: We will use this delimiter to separate the data in the export.

string
default: ,
activeOnly

For exports only: If set to true, export will only include active products.

boolean
insertOnly

For imports only: If set to true, report will only fill in blank data on Zentail. Any data that already exists on Zentail will not be overwritten by data in the file.

boolean
includeHeader

For exports only: If set to true, export will include a header

boolean
default: true
exportForExcel

For exports only: If set to true, will export as an Excel file.

boolean
filter

For exports only: Use this to pass in filters to restrict the products being exported. See how to write a filter formula here., we will create one.

string
headersOnly

For exports only: If true, this export will only have header rows.

boolean

Success

Media typeapplication/json
object
reportId
integer
label
string
isExport

If true, this is an export. Otherwise it’s an import.

boolean
requestedTs

Timestamp when the report was requested to be run.

string format: date-time
completedTs

Timestamp when the report was completed.

string format: date-time
columnTypes

Array of the column headers in this report.

Array<string>
status
string
Allowed values: PENDING PROCESSING CANCELED COMPLETE
totalLines

Total number of lines processed successfully.

integer
linesSuccessfullyProcessed
integer
filePath

Path to access the stored file. Use this to download an exported file when it is “COMPLETE”

string
errorMessage

Returns an error message if we ran into an error processing the report.

string
overwriteWithBlank

For imports only: If set to true, blank values supplied in the upload data will overwrite. NULL is equivalent to false.

boolean
createNewProducts

For imports only: If set to true, if a SKU doesn’t exist in zentail we will create one. NULL is equivalent to false.

boolean
activeOnly

For exports only: If set to true, export will only include active products.

boolean
insertOnly

For imports only: If set to true, report will only fill in blank data on Zentail. Any data that already exists on Zentail will not be overwritten by data in the file.

boolean
includeHeader

For exports only: If set to true, export will include a header

boolean
default: true
exportForExcel

For exports only: If set to true, will export as an Excel file.

boolean
filter

For exports only: Use this to pass in filters to restrict the products being exported. See how to write a filter formula here.

string
delimiter

For exports only: We will use this delimiter to separate the data in the export.

string
default: ,
headersOnly

For exports only: If true, this export will only have header rows.

boolean
uploader

If this is null, then the report was created by the API.

string
Example
{
"isExport": false,
"status": "PENDING",
"overwriteWithBlank": false,
"createNewProducts": false,
"activeOnly": false,
"insertOnly": false,
"includeHeader": true,
"exportForExcel": false,
"delimiter": ",",
"headersOnly": false
}

Bad Request

Media typeapplication/json
object
errorCode
number
errorMessages
Array<string>
referenceId
string format: uuid
Example
{
"errorCode": 400
}

Permission Denied

Media typeapplication/json
object
errorCode
number
errorMessages
Array<string>
referenceId
string format: uuid
Example
{
"errorCode": 403
}

Not Found

Media typeapplication/json
object
errorCode
number
errorMessages
Array<string>
referenceId
string format: uuid
Example
{
"errorCode": 404
}

Zentail Error

Media typeapplication/json
object
errorCode
number
errorMessages
Array<string>
referenceId
string format: uuid
errorMessage
string
Example
{
"errorCode": 500
}

Zentail Error

Media typeapplication/json
object
errorCode
number
errorMessages
Array<string>
referenceId
string format: uuid
Example
{
"errorCode": 503
}

Sourcesnapshot of https://app.zentail.com/api/swagger, committed at spec/v1/zentail-api.json

Built0c509dd3

API changelog