Change an option

Stable throughout v1

Change an option of the library, as its editor saves it: its settings, its values (edited in place by option_id, new ones added, remove_option_ids deleted with every template’s prices for them), or turn it off (disabled: true: it leaves every template’s new lines; past orders keep it) and on again. Only what is sent changes. Send its version (or its updated_at as expected_updated_at): a change made since is 409 STALE_VERSION with the current version. A price on a new value needs Change the catalog or Prices and exceptions; a changed price, Change the catalog; any cost, Enter and correct costs. Every template using it syncs to Shopify in the background. Recorded on the option’s Activity.

PATCH/options/{id}
Base URLhttps://api.meetorderpilot.com/connect/v1
Stable throughout v1

Required access

API key
Change the catalogpermission
Request limit
Counts as 5 requests. Each key has a capacity of 15, restored at 0.6 a second.
Idempotency-Key optionalRetry 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-Keyheader

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

Content-Typeheader

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

Parameters

idpath · stringRequired

The option’s id from GET /options.

Body

JSON
allow_otherbooleanOptional

A dropdown also takes a value typed in (Other…).

applies_tostringOptional

Which Shopify catalog lines offer it: every one (all, at location_ids), the products in product_ids, or those in category_ids. A template offers it only when it is attached.

One of all, products, categories.

category_idsarray of string, can be nullOptional

Categories, ids from GET /categories (up to 100); null or []: none.

default_valuestring, can be nullOptional

Starts as: a dropdown’s value by name (one of its values), or a typed option’s text or number as text.

descriptionstring, can be nullOptional

Help text under it.

disabledbooleanOptional

true turns it off: it leaves every template’s new lines, past orders keep it. false turns it on again.

exclude_from_skubooleanOptional

Leave it out of generated SKUs.

expected_updated_atstringOptional

The option’s updated_at from GET /options/{id}, when you don’t send version.

labelstring, can be nullOptional

What customers see, when it differs from the name.

location_idsarray of string, can be nullOptional

The locations it is offered at, ids from GET /locations (up to 250); null or []: every location.

lookstring, can be nullOptional

Its default look online; null: automatic.

One of dropdown, buttons, segmented, radio_list, colour_swatches, image_swatches, image_cards, add_on_checkbox, number_box, stepper, slider, text_box, text_area, info_block.

look_settingsobjectOptional

The online look’s settings, by key: columns (2–6), shape (square, round), show_value_names (always, selected), show_prices. null drops one.

columnsinteger, can be nullOptional
shapestring, can be nullOptional

One of square, round.

show_pricesboolean, can be nullOptional
show_value_namesstring, can be nullOptional

One of always, selected.

max_lengthinteger, can be nullOptional

A text’s most characters.

namestringOptional

Unique in the library.

number_maxnumber, can be nullOptional
number_minnumber, can be nullOptional
number_stepnumber, can be nullOptional
placeholderstring, can be nullOptional
price_in_itembooleanOptional

Its values’ prices read as part of the item’s price, never as “+$”.

product_idsarray of stringOptional

Shopify products, ids from GET /products (up to 500).

remove_option_idsarray of stringOptional

Dropdown values to delete, by option_id (GET /options/{id}): every template’s price, cost and lead time for them go too; past orders keep their lines. Up to 500.

requiredbooleanOptional
size_partsarray of objectOptional

A size’s 2 or 3 measurements in order, as its editor sets them: label (up to 40 characters), key (made from the label when left out), min, max, step. A new size without them measures Length × Width × Height.

keystringOptional

Lower-case letters, digits and _; an edit keeps a part by its key from GET /options/{id}.

labelstringRequired
maxnumber, can be nullOptional
minnumber, can be nullOptional
stepnumber, can be nullOptional
track_stockbooleanOptional

Track each value’s stock in Shopify (not for a size).

typestringOptional

A dropdown shown as a list (dropdown) or as colours (swatch).

One of dropdown, swatch.

unitstring, can be nullOptional

A number’s or a size’s unit (in, cm, …).

valuesarray of objectOptional

A dropdown’s values (up to 500, the most an option holds). A typed option takes at most one: its price, cost and lead time.

costnumber, can be nullOptional

Its cost; null: unknown. Needs costs.

descriptionstring, can be nullOptional

One sentence shown online, up to 160 characters.

image_file_idstring, can be nullOptional

The picture’s shopify_file_id from POST /files: required with image_url, null with it.

image_urlstring, can be nullOptional

Its picture: the url POST /files answered (a Shopify Files address); null removes it.

labelstring, can be nullOptional

What customers see, when it differs.

lead_time_daysinteger, can be nullOptional

Days it adds to the lead time (0 is Same day); null: none.

option_idstringOptional

Edit this value in place: a values[].option_id of GET /options/{id} (a typed option’s one row is found without it). Without it, a new value.

positionintegerOptional

Its place in the list, from 0.

pricenumberOptional

Its price, 0 or more (0 is Included).

swatch_colorstring, can be nullOptional

#rrggbb, for a swatches option.

valuestringOptional

Its name, up to 255 characters: required for a dropdown’s value (a typed option’s one row is named after the option).

versionstringOptional

The version of GET /options/{id} (or the last change) answered, sent back as it is: no read needed first. A change made since is 409 STALE_VERSION with the current version and what changed. Send this or expected_updated_at.

Returns

200

OK: allow_other, applies_to, category_ids, created_at, default_value, description, disabled, exclude_from_sku, id, label 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?