Skip to content

Import a product catalog from CSV

POST
/api/v1/products/import
curl --request POST \
--url 'https://app.prokure.ca/api/v1/products/import?dry_run=true' \
--header 'Content-Type: multipart/form-data' \
--form file=@file

Imports a product catalog from a CSV file of at most 500 rows and 2097152 bytes. All or nothing: the whole file is validated first, and a single bad cell rejects the import with a per-row issue list and writes nothing. Saves the catalog and durably requests background indexing and staged matching for every product the file created or changed; success does not mean indexing has finished. The file must be UTF-8 encoded; a byte-order mark is fine. Any other encoding is refused as invalid_import — save the spreadsheet as CSV UTF-8. The header row must carry all seven columns, in any order: oem_partner, name, model, description, commodity_codes, rep_status, source_url. They are matched by name, ignoring case and surrounding spaces. (optional) below describes the cell value, which may be left blank; the column itself is always required. oem_partner (required) - the manufacturer’s name; matched case-insensitively against manufacturers already on the account, and created and authorized when it is new. name (required) - the product name; at most 200 characters. model (optional) - at most 100 characters. Together with oem_partner and name it identifies the product: a repeat updates that row instead of adding a second one. description (optional) - at most 4000 characters. Quote the cell if it contains a comma or a line break. commodity_codes (optional) - semicolon-separated, at most 50 codes of at most 50 characters each. rep_status (optional) - carried or catalog; blank means carried. source_url (optional) - an http or https URL.

dry_run
string
Allowed values: true false

Set to true to validate the file and preview the counts without writing anything.

Media typemultipart/form-data
object
file
required
string format: binary

Default Response

Media typeapplication/json
One of:
object
dry_run
required
boolean
rows
required

Data rows the file contains, header excluded.

integer
>= -9007199254740991 <= 9007199254740991
partners_to_create
required

Manufacturer names in the file that are not yet on the account.

Array<string>
partners_to_reauthorize
required

Manufacturers already on the account but currently unauthorized, which the import would re-authorize.

Array<string>
products_to_create
required
integer
>= -9007199254740991 <= 9007199254740991
products_to_update
required

Rows whose manufacturer, name and model already match an existing product.

integer
>= -9007199254740991 <= 9007199254740991
Example
{
"dry_run": true
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}

Default Response

Media typeapplication/json
object
error
required
string
Allowed values: unauthorized forbidden no_membership membership_disabled unverified_email identity_conflict insufficient_scope validation_failed not_found missing_file unsupported_type file_too_large empty_document unreadable_document context_doc_cap_reached rule_cap_reached already_reverted superseded already_exists partner_not_authorized invalid_import rate_limited internal
message
required
string
requestId
required
string
issues
Array
issue_count
integer
>= -9007199254740991 <= 9007199254740991
Example
{
"error": "unauthorized"
}