Skip to content

Extract several PDP photographs, sharing models and locations between them

POST
/v1/pdp-batch-extractions
curl --request POST \
--url https://example.com/v1/pdp-batch-extractions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "photos": [ { "pdp_image_public_id": "01JUPLOAD0000000000000000A", "product_name": "Emerald Silk Saree" }, { "pdp_image_public_id": "01JUPLOAD0000000000000000B", "product_name": "Ivory Cotton Kurta" }, { "pdp_image_public_id": "01JUPLOAD0000000000000000C" }, { "pdp_image_public_id": "01JUPLOAD0000000000000000D" } ] }'

Dispatch a batch PDP extraction: the same read-a-photograph-back-into-its-parts journey as POST /v1/pdp-extractions, over several photographs from one shoot.

Before extracting, one pass works out which of your photographs show the same model and which were shot in the same place. Each shared model and each shared location is then extracted once and reused, instead of once per photograph — so a shoot of eight photographs across two sets with two models costs four extractions of those parts rather than sixteen. The garment and the photography recipe are still read from every photograph, because those are what differ.

Send at most ten photographs. Charged per photograph at the single-extraction rate: the saving is in what we spend, and the price is the one you were quoted. Supply grouping yourself to override what we would work out.

Returns 202 with the PARENT job_id. Each photograph also gets its own child job, so GET /v1/jobs shows per-photograph progress. Partial success is normal at both levels: one arm of one photograph can produce nothing while everything else lands, and one photograph failing does not fail its siblings.

X-Shopify-Hmac-Sha256
Any of:
string
Media typeapplication/json
PdpBatchExtractionRequest

POST /v1/pdp-batch-extractions — several photographs from one shoot (TRI-49).

POST /v1/pdp-extractions reads one photograph into four entities. This does the same for a batch, and first works out which photographs share a model or a location so each of those is extracted ONCE rather than once per photograph. A shoot of eight photographs across two sets with two models costs four extractions of those parts instead of sixteen.

Charged per photograph, at the single-extraction rate. The saving is in what we spend, and the price is the one you were quoted before you submitted.

Order matters only in that it fixes the indices grouping refers to. Send at most ten photographs per batch: the grouping pass compares every photograph against every other in a single call, and that is the input limit of the model doing the comparing.

Ownership is absent by design and extra="forbid" keeps it that way.

object
photos
required
Photos

The photographs, in any order. At most ten per batch.

Array<object>
>= 1 items <= 10 items
PdpBatchPhotoRequest

One photograph in a batch extraction.

object
pdp_image_public_id
required
Pdp Image Public Id

The asset_id from POST /v1/uploads.

string
>= 26 characters <= 26 characters
product_name
Any of:
string
>= 1 characters <= 200 characters
grouping
Any of:
PdpBatchGroupingRequest

A caller-supplied grouping, which REPLACES the automatic one.

Two independent groupings rather than one list with flags, because the axes genuinely differ: several photographs can share a studio while only two of them share a model.

Send this when you already know how your own shoot was organised, or to correct what we proposed. It is taken at face value — you are the authority on your own photographs.

object
person_groups
Person Groups
Array<object>
PdpBatchAxisGroupRequest

One group of photograph indices that share a person or a place.

object
member_indices
Member Indices

0-based indices into photos.

Array<integer>
confidence
Confidence
number
default: 1 <= 1
evidence
Evidence

Why they were grouped. Free text; not interpreted.

string
""
location_groups
Location Groups
Array<object>
PdpBatchAxisGroupRequest

One group of photograph indices that share a person or a place.

object
member_indices
Member Indices

0-based indices into photos.

Array<integer>
confidence
Confidence
number
default: 1 <= 1
evidence
Evidence

Why they were grouped. Free text; not interpreted.

string
""
Examples
Exampleone_shoot

Four photographs from one shoot

{
"photos": [
{
"pdp_image_public_id": "01JUPLOAD0000000000000000A",
"product_name": "Emerald Silk Saree"
},
{
"pdp_image_public_id": "01JUPLOAD0000000000000000B",
"product_name": "Ivory Cotton Kurta"
},
{
"pdp_image_public_id": "01JUPLOAD0000000000000000C"
},
{
"pdp_image_public_id": "01JUPLOAD0000000000000000D"
}
]
}

Accepted — parent job queued. Poll /v1/jobs/{job_id}.

Media typeapplication/json
WorkflowAcceptedResponse

Returned synchronously from any POST /v1/{name} (202).

object
request_id
required
Request Id

26-char ULID — correlates with the row in credit_operations.

string
job_id
required
Any of:
string
status
JobStatus

Studio’s job status at submit time. Almost always NOT_STARTED in this 202.

string
default: NOT_STARTED
Allowed values: NOT_STARTED SUCCESS FAILURE IN_PROGRESS
credits_cost
required
Credits Cost

Credits deducted from the calling client. Refunded automatically on any failure path.

integer
Example
{
"request_id": "01JREQREQREQREQREQREQREQ00",
"job_id": "01JOBJOBJOBJOBJOBJOBJOBJOB0",
"status": "NOT_STARTED",
"credits_cost": 10
}

Insufficient credit balance — the request cost exceeds the client’s balance. No job created.

Media typeapplication/json
Example
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Account balance is below the cost of this request.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}

Request body failed validation (missing/invalid fields). No credits charged.

Media typeapplication/json
Example
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request body or parameters failed validation.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}

Per-credential rate limit exceeded. Retry after a short backoff.

Media typeapplication/json
Example
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded; try again shortly.",
"request_id": "01JREQREQREQREQREQREQREQ00"
}
}