Create an option

Stable throughout v1

Create an option in the library, as Settings › Options’ Add option does, with its values: a dropdown (or swatches), a number, a size (its measurements), text, a text area or text with a picture, and where Shopify catalog lines offer it (products, categories, locations). It is attached to no template: attach it to a template with POST /product-templates/{id}/options or put it in a bundle. A name the library already has is 409 CONFLICT. 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. 201 with the option.

POST/options
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 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
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.

exclude_from_skubooleanOptional

Leave it out of generated SKUs.

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.

namestringRequired

The name staff see, unique in the library (up to 255 characters).

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).

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).

typestringRequired

dropdown (a list), swatch (a list shown as colours), number, dimensions (a size), text, textarea or text_image (text with a picture; no values).

One of dropdown, swatch, number, dimensions, text, textarea, text_image.

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.

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).

Returns

201

Created: 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?