Requires write_products access scope.
For more info , refer to:
PUT https://{handle}.myshopline.com/admin/openapi/v20220601/products/variants/:variant_id.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .
Update SKU
Path Parameters
  • variant_id string required
    skuID
Request Headers
  • Content-Type required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
  • variantobject
    Variant information
  • barcode string
    Barcode, limited to 100 characters
  • compare_at_price string
    Original price
  • imageobject
    Images
  • alt string
    Alt information of the picture , limited to 255 characters
  • src string
    Corresponding img src link, limited to 255 characters
  • inventory_policy string
    Allows oversold ( deny ) to be oversold and continue to be allowed
  • inventory_quantity integer
    Inventory quantity, min -999999, max 999999
  • inventory_tracker boolean
    Tracking : true、 does not track : false , default not tracking
  • option1 string
    Corresponding option1 value , limited to 255 characters
  • option2 string
    Corresponding option2 value , limited to 255 characters
  • option3 string
    Corresponding option3 value , limited to 255 characters
  • option4 string
    Corresponding option4 value , limited to 255 characters
  • option5 string
    Corresponding option5 value , limited to 255 characters
  • price string
    Selling price
  • sku string
    Sku code , length can not exceed 100
  • weight string
    Weight
  • weight_unit string
    Weight units
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • variantobject
    Variant information
  • barcode string
    Bar code
  • compare_at_price string
    Original price
  • created_at string
    Creation time
  • id string
    id
  • imageobject
    Images
  • alt string
    Picture alt
  • src string
    Images src
  • inventory_item_id string
    Stock object id
  • inventory_policy string
    Allows oversold ( deny ) to be oversold and continue to be allowed
  • inventory_quantity integer
    Inventory quantity
  • inventory_tracker boolean
    Tracking : true、 does not track : false , default not tracking
  • option1 string
    Option1 value
  • option2 string
    Option2 value
  • option3 string
    Value of option3
  • option4 string
    Option4 value
  • option5 string
    Option5 value
  • price string
    Selling price
  • product_id string
    Product ID
  • sku string
    Sku
  • updated_at string
    Update time
  • weight string
    Weight
  • weight_unit string
    Weight units
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220601

ParamOptions

— path required
— header required

Body

required
{
  "variant": {
    "barcode": "",
    "compare_at_price": "",
    "image": {
      "alt": "",
      "src": ""
    },
    "inventory_policy": "",
    "inventory_quantity": 0,
    "inventory_tracker": false,
    "option1": "",
    "option2": "",
    "option3": "",
    "option4": "",
    "option5": "",
    "price": "",
    "sku": "",
    "weight": "",
    "weight_unit": ""
  }
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220601/products/variants/variant_id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"variant": {
"barcode": "",
"compare_at_price": "",
"image": {
"alt": "",
"src": ""
},
"inventory_policy": "",
"inventory_quantity": 0,
"inventory_tracker": false,
"option1": "",
"option2": "",
"option3": "",
"option4": "",
"option5": "",
"price": "",
"sku": "",
"weight": "",
"weight_unit": ""
}
}
'
Was this article helpful to you?

Error loading component.

Error loading component.