Set a draft’s questions
Replaces the draft’s unanswered questions with open, identifying affected rows or none for whole-file questions; these appear in the preview’s Questions filter. Adds chat answers with settled as read-only decisions on the review page so the merchant is not asked again; allowed until the draft is imported.
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.
Idempotent-Replayed: true. Responses are saved for 24 hours.Headers
Bearer and your key, opk_….
Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.
application/json. A body is at most 256 KB.
Parameters
The id of one of this key’s drafts, or a send’s batch_id to set the questions of several of its drafts by kind (kinds).
Body
JSONOnly by a send’s batch_id, in place of open and settled: by kind, each kind’s { open, settled } as above for that kind’s draft ({ "vendors": { "open": [] }, "customers": { "settled": [...] } }). A kind left out keeps its questions.
What you still ask the merchant about this draft’s data, up to 50; it replaces the open questions there were. An empty list: none left. Left out: they stay as they are.
The rows it is about, up to 500 (as you sent them: the first data row is 2). Left out: the whole file.
The question as you ask it in the chat, up to 1,000 characters.
What the merchant answered in the chat, up to 50 points, each title and answer up to 1,000 characters. Added to what the review page shows read-only, one row per title.
What was settled, as one plain sentence: “Leave the 16 missing line prices blank for the merchant to fill in.”
A short title for the point, a few words: “Missing prices”, “Currency”. Settling the same title again replaces its answer.
Returns
OK: 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.
The request isn’t valid (see error.code), or the API version isn’t supported.
No valid access token or API key.
The store’s subscription isn’t active.
Not allowed: the API is off for this store, or the caller lacks the scope or permission.
Not found, or not visible to this caller.
Wrong method for this path; Allow lists every method the path takes.
The request body didn’t arrive in time.
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.
The request body is too large.
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.
The app is older than the oldest version still served (error.code CLIENT_TOO_OLD); see error.min_version and error.upgrade_url.
Over a rate limit; wait Retry-After seconds.
Something went wrong on our side. A write may have partly happened: check the record before retrying it.
Busy, switched off, or billing couldn’t be checked; wait Retry-After seconds.