Skip to main content
POST
Import an image from a URL and attach it to a product

Authorizations

Authorization
string
header
required

Use a project API key from Settings > API Access. Send it as Authorization: Bearer wpk_.... See authentication and scopes for setup and permissions.

Headers

Idempotency-Key
string

Reuse this key for retries of the same write. Scoped to this API key; retained for 30 days, after which the key may be reused. Different requests with the same key return 409.

Required string length: 1 - 128
Pattern: ^[!-~]+$

Body

application/json
url
string
required

Public http(s) address of the image.

Required string length: 1 - 2000
product_id
integer | null

The product to attach the image to.

Required range: 0 < x <= 9223372036854776000
sku
string | null

The product's SKU, instead of product_id.

Required string length: 1 - 255
position
integer | null

Sort key within the product's images. Appended when omitted.

Required range: 0 <= x <= 1000000
is_main
boolean
default:false

Put the image first so it becomes the main image. Takes precedence over position.

Response

Accepted

id
integer
required
url
string
required
status
string
required

pending, processing, linked or failed.

product_id
integer
required
position
integer
required
is_main
boolean
required
asset_id
string | null
required

The asset the URL became. Set once the import is linked.

error
string | null
required
created_at
string<date-time>
required
settled_at
string<date-time> | null
required