SoraiDocs
GuidesAPI reference

sorai media upload

Upload an image (JPEG, PNG, WebP or GIF, up to 20 MB) to the store's media library.

Use its id as a product's cover_media_id or in gallery_media_ids.

sorai media upload --file <path> [flags]

Flags

  • --file <path> (required): The file on this machine.
  • --store <id|slug>: A store id or slug. Defaults to SORAI_STORE, the saved login's store, or the only store.
  • --dry-run: Print what would be uploaded without uploading it.

Permissions

Needs a key with the catalog:write permission.

This command changes data. Run it with --dry-run first to see what it would do.

On this page