Start a shoot
const url = 'https://api.shootika.com/v1/frames';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"product_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","source_image_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","scene_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","regenerate_of":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","garment_photo_type":"flat-lay"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.shootika.com/v1/frames \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source_image_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scene_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "regenerate_of": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "garment_photo_type": "flat-lay" }'Starts making one frame: your product photo, worn by the scene’s model, in the scene’s style. The answer is 202 with the frame in status queued. Poll GET /frames/{frame_id} until it is ready or failed. One frame is used from your allowance when you start, and it is refunded if the frame fails.
Pass regenerate_of with the id of an earlier frame to record that this one is a retry of it. The scene must be ready. A listed scene can, rarely, be refused with 422 scene_unsupported. Pick another scene when that happens.
When your plan is used up the answer is 402 quota_exceeded, with the allowance in details. If your plan could bill an extra frame but this key is not allowed extra frames, details also carries key_allows_overage: false and the message says so. Allow extra frames on the key in the web app, or wait for your plan to refill. Without that field, no key could get another frame on your plan right now.
Send an Idempotency-Key to make a retry safe, so one network error does not cost you two frames. Only 2xx answers are stored and replayed, for 24 hours. A request still running under the same key answers 409 idempotency_in_progress, and a claim older than 5 minutes is treated as abandoned.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”A unique string you choose, 1 to 255 characters, for this request. Repeating the request with the same key and the same body replays the first answer for 24 hours instead of doing the work again. Only 2xx answers are stored. Using the same key with a different request answers 409 idempotency_conflict.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A photo of that product.
A scene whose status is ready.
The id of an earlier frame this one retries.
What the source photo shows. flat-lay is the garment laid flat; model is the garment worn.
Responses
Section titled “Responses”The shoot was accepted. Poll the frame until it finishes.
object
object
The frame this one retries, or null.
queued waiting to start, processing being made, ready finished, failed could not be made (and refunded), canceled stopped.
When an unapproved frame is deleted. Null once the frame is approved.
True when the frame failed, because a failed frame is always refunded. Null otherwise.
Example
{ "frame": { "status": "queued", "error": { "code": "generation_failed" } }}bad_request: the request could not be read, for example a multipart body with no boundary.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}unauthorized: the Authorization header is missing, or the key is not valid or has been revoked.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}quota_exceeded when no frames are left (with key_allows_overage: false in the details when the plan could bill an extra frame but this key may not), or daily_cap_reached when the store reached today’s limit.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}api_not_enabled when the API is not switched on for your store yet, store_uninstalled when the store has uninstalled Shootika, or forbidden when the key is not allowed to do that.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}not_found: the product, the photo, the scene or the frame in regenerate_of does not exist in your store.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}method_not_allowed: this address does not accept that method. The Allow header lists the ones it does.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}Headers
Section titled “Headers”scene_generating when the scene is still being prepared, scene_failed when it could not be prepared, family_unsupported when the product is not clothing, idempotency_conflict when the key was used for a different request, or idempotency_in_progress when the same key is still running.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}validation_error when a field is missing or wrong, source_image_too_small when the photo’s short side is under 600 pixels, or scene_unsupported when the scene does not suit this product.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}rate_limited: more than 120 requests in a minute with this key. Wait the number of seconds in Retry-After.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}Headers
Section titled “Headers”internal_error: something went wrong on our side. Try again.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}service_busy: Shootika is busy right now. Try again in a moment.
object
What went wrong. Read code in your software; message is for people.
object
A plain sentence for a person.
Only present for some codes. For validation_error it maps each wrong field to a list of problems. For quota_exceeded and daily_cap_reached it describes the allowance.
object
Example
{ "error": { "code": "api_not_enabled" }}