Start an import draft

Preview: may change during v1

Creates a draft for one data kind, without changing the store; the merchant imports it from the review page after submission. Read GET /imports/guide first, then add rows with POST /imports/{id}/rows. Reuse the first draft’s batch_id for the same migration and put the merchant’s agreed decisions in settled.

POST/imports
Base URLhttps://api.meetorderpilot.com/connect/v1
Preview: may change during v1

Required access

API key
Any ofChange the catalogCreate and change customersManage purchase ordersCreate and change quotesChange ordersWork warranty claimspermissions
Request limit
Counts as 1 request. Each key has a capacity of 15, restored at 0.6 a second.
Idempotency-Key requiredRetry with the same key and body to get the original response without repeating the change. The response includes Idempotent-Replayed: true. Responses are saved for 24 hours.

Headers

AuthorizationheaderRequired

Bearer and your key, opk_….

Idempotency-KeyheaderRequired

Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.

Content-Typeheader

application/json. A body is at most 256 KB.

Body

JSON
batch_idstringOptional

The batch_id of one of this key’s sends, to add these drafts to it (the merchant reviews them together). Left out: a new send.

checkbooleanOptional

true: check each draft with rows once they are in (it answers checking). Left out: check it later with POST /imports/{id}/check.

csvstringOptional

The rows as CSV text, in place of rows: the file’s header row, then its rows (commas, semicolons or tabs). A header names a column by its header, key or alias, ignoring case and spaces, as an upload does; a column the kind doesn’t use is named in a note. 500 rows a call in all.

kindstringOptional

The kind of data: products (Shopify products), product_templates, options, categories, customers, vendors, stock (stock on hand), quotes, orders, purchase_orders or warranty_claims. One kind’s draft; for several at once, send kinds instead.

One of products, product_templates, options, categories, customers, vendors, stock, quotes, orders, purchase_orders, warranty_claims.

kindsobjectOptional

Several kinds at once, in place of kind: by kind, each with the rows or csv, last, settled and open a one-kind create takes ({ "vendors": { "rows": [...] }, "categories": { "csv": "..." } }). They are one send: there is no batch_id to pass on. The answer is the first draft in review order, and drafts lists each.

lastbooleanOptional

As on POST /imports/{id}/rows: these are all the rows. A new draft has no rows after them, so it changes nothing here.

openarray of objectOptional

What you still ask the merchant about this data, as POST /imports/{id}/questions takes it: each { text, rows }, the rows it is about (left out: the whole file).

rowsarray of integerOptional

The rows it is about (the first is 2).

textstringRequired

The question as you ask it in the chat.

rowsarray of objectOptional

Rows, in order: row 2 first (row 1 is the header). 500 rows a call in all.

settledarray of objectOptional

What you and the merchant settled in the chat about this data, up to 50 points, each title and answer up to 1,000 characters. The review page lists them read-only by title, so the merchant isn’t asked again.

answerstringRequired

What was settled, as one plain sentence: “Leave the 16 missing line prices blank for the merchant to fill in.”

questionstringRequired

A short title for the point, a few words: “Missing prices”, “Currency”. Settling the same title again replaces its answer.

Returns

201

Created: batch_id, counts, created_at, created_by, drafts, existing_choice, expires_at, failure, id, import_mode and more

Errors

Errors use { "error": { "code", "message" } }. Use code to handle the error. View all error codes.

400

The request isn’t valid (see error.code), or the API version isn’t supported.

401

No valid access token or API key.

402

The store’s subscription isn’t active.

403

Not allowed: the API is off for this store, or the caller lacks the scope or permission.

404

Not found, or not visible to this caller.

405

Wrong method for this path; Allow lists every method the path takes.

408

The request body didn’t arrive in time.

409

The same Idempotency-Key is still being processed (REQUEST_IN_PROGRESS), its outcome is unknown (OUTCOME_UNKNOWN: check the record), or the record changed since it was read.

413

The request body is too large.

422

The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body.

426

The app is older than the oldest version still served (error.code CLIENT_TOO_OLD); see error.min_version and error.upgrade_url.

429

Over a rate limit; wait Retry-After seconds.

500

Something went wrong on our side. A write may have partly happened: check the record before retrying it.

503

Busy, switched off, or billing couldn’t be checked; wait Retry-After seconds.

Was this page useful?