Clonely App

Copy options

View Markdown

POST /copies and POST /products/copy take the same optional objects: destination, options and applyToEach. Unknown fields anywhere in the body are refused with 400 invalid_request, and issues in the error names each one.

destination

The collection the copied products are added to. Send exactly one of these fields:

Field
collectionIdThe Admin API GID of an existing collection, like gid://shopify/Collection/123456789. A bare number is refused.
collectionHandleThe handle of an existing collection, like boots.
newCollectionTitleThe title of a collection to create. Each request creates a new one, even if a collection with this title exists.

Clonely checks an existing collection before the copy starts; an unknown one is 400 invalid_request. Leave destination out to add the products to no collection. Smart (automated) collections are left as they are, since Shopify fills them by their conditions.

{ "destination": { "collectionId": "gid://shopify/Collection/123456789" } }

options

Settings for this copy only, the same ones as the copy page’s advanced options. Any field you leave out takes the value saved in Settings at the moment the copy starts. The saved settings don’t change.

FieldValues
publishbooleanPublish new products, or save them as drafts.
importTagsbooleanCopy tags.
importTaxbooleanCopy the “charge tax” setting.
importSkubooleanCopy SKUs.
onDuplicateskip, updateWhat to do when the product is already in your store.
updateMatchcopied, handle, handle_skuWhich existing products an update may change. copied: only products Clonely copied. handle: any product with the same URL handle. handle_sku: the same URL handle or SKU.
updateScopeall, selectedUpdate every field, or only the ones turned on below.
updatePricebooleanUpdate the price.
updateCompareAtPricebooleanUpdate the compare-at price.
updateCostbooleanUpdate the cost.
updateImagesModenone, add, match, replaceadd: only new images. match: also remove images the source dropped. replace: all images.
updateTitlebooleanUpdate the title.
updateDescriptionbooleanUpdate the description.
updateTagsModenone, merge, replacemerge keeps the product’s tags and adds the source’s. replace uses only the source’s.
updateAddVariantsbooleanAdd variants that are new at the source.
updateRemoveVariantsbooleanRemove variants the source no longer has.
updateStockbooleanApply the stock rules to products that already exist.
priceobjectSee price.
stockobjectSee stock.

The update... fields only matter when onDuplicate is update. To see every value a copy runs with, read options on GET /copies/{id}.

{
  "options": {
    "publish": false,
    "onDuplicate": "update",
    "updateMatch": "copied",
    "updateScope": "selected",
    "updatePrice": true,
    "updateCompareAtPrice": true
  }
}

price

How prices are set, as under Pricing in Settings. Fields you leave out keep their saved value, field by field inside price, compareAt and cost.

Field
enabledfalse copies prices unchanged, whatever the other fields say.
priceRule for the price. base: supplierPrice or fromSupplierPrice.
compareAtRule for the compare-at price. base: supplierCompare, supplierPrice, fromSupplierCompare, fromSupplierPrice, fromNewPrice or none.
costRule for the cost. base: supplierPrice, fromSupplierPrice, fromNewPrice or none.

The bases without from copy the value as it is (supplierCompare is the supplier’s compare-at price). The from... bases start from that value and apply the adjustment; fromNewPrice starts from the price Clonely just worked out. none sets no value.

Each rule also takes the adjustment:

Field
typenone, percentage or amount.
valueThe percentage or amount. Positive raises the price, negative lowers it.
roundingThe cents the result ends in, 0 to 99 (99 makes 12.99), or null for no rounding.
roundingDirectionstandard, up or down.

This sets the price to the supplier price plus 20%, ending in .99, and the compare-at price to 30% above the new price:

{
  "options": {
    "price": {
      "enabled": true,
      "price": { "base": "fromSupplierPrice", "type": "percentage", "value": 20, "rounding": 99, "roundingDirection": "up" },
      "compareAt": { "base": "fromNewPrice", "type": "percentage", "value": 30, "rounding": 0, "roundingDirection": "standard" }
    }
  }
}

stock

Stock quantities per location, as under Stock in Settings. The rules need inventory access, which you grant in Clonely’s Settings. Without it, Clonely skips them.

Field
enabledTurn the stock rules on or off.
rulesUp to 100 rules, one per location. When you send rules, they replace the saved rules for this copy. A location with no rule is never changed.

Each rule:

Field
locationIdThe location’s GID, like gid://shopify/Location/123456789.
locationNameOptional. Shown on the task page.
inStockFor variants the supplier has in stock: { "action": "set", "quantity": 100 } sets the quantity, { "action": "ignore" } leaves it alone.
outOfStockFor variants the supplier has sold out, the same way.
{
  "options": {
    "stock": {
      "enabled": true,
      "rules": [
        {
          "locationId": "gid://shopify/Location/123456789",
          "inStock": { "action": "set", "quantity": 100 },
          "outOfStock": { "action": "set", "quantity": 0 }
        }
      ]
    }
  }
}

applyToEach

Applied to each product the copy creates.

Field
categoryIdA Shopify product category GID, like gid://shopify/TaxonomyCategory/aa-1-13-8. Set on every product the copy creates or updates.
handleStartText added to the start of each new URL handle, up to 100 characters.
handleEndText added to the end of each new URL handle, up to 100 characters.
{ "applyToEach": { "categoryId": "gid://shopify/TaxonomyCategory/aa-1-13-8", "handleStart": "acme-" } }

sourcePassword

If the source store is password protected, send its storefront password as sourcePassword. Clonely uses it once to log in and doesn’t store it. Without it, the request gets 400 password_required; a wrong one gets 400 password_wrong.