Quickstart
This walks through one shoot with curl: check your key, add a product with a photo, pick a
scene, start a shoot, poll the frame until it is ready, and approve it.
Starting the shoot in step 6 uses one frame from your plan.
You need:
- an API key for your web app store. An admin creates it in the web app under Settings, API Keys (see Authentication);
curl, and a shell such as bash or zsh. The id in step 6 comes fromuuidgen, which macOS and most Linux systems include.
1. Put your key in a variable
Section titled “1. Put your key in a variable”export SHOOTIKA_API_KEY="shootika_sk_..."Paste your whole key between the quotes. Every command below reads it from this variable.
2. Check the key
Section titled “2. Check the key”curl https://api.shootika.com/v1/account \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"The answer names your store in account.shop and your plan in account.plan.
account.quota.available is how many frames you can still make now. A 401 with the code
unauthorized means the key was not sent, is mistyped or has been revoked.
3. Add a product with a photo
Section titled “3. Add a product with a photo”curl https://api.shootika.com/v1/products \ -H "Authorization: Bearer $SHOOTIKA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Ribbed crew sweater", "garment_category": "tops", "image_urls": ["https://shootika.tryoncdn.com/website/source/flatlay.jpg"] }'The URL is a sample flat-lay photo of a sweater. Use one of your own, a public http or https
address of a PNG, JPEG or WebP image, to shoot your own product.
The answer is 201 with the new product. Shootika creates the product even when a photo
cannot be fetched, and lists each one that failed in images_failed, so check it. Keep the
product’s id and the id of its photo in product.images:
PRODUCT_ID="the product id"IMAGE_ID="the photo id"4. Choose a model and a style
Section titled “4. Choose a model and a style”A scene is one model in one pose in one style. Look at the models and the poses each can take:
curl https://api.shootika.com/v1/models \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"Then the styles:
curl https://api.shootika.com/v1/styles \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"Keep a model’s id, one of that model’s poses, and a style’s key:
MODEL_ID="the model id"POSE="one of the model's poses"STYLE="the style key"5. Request the scene
Section titled “5. Request the scene”curl https://api.shootika.com/v1/scenes \ -H "Authorization: Bearer $SHOOTIKA_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"model_id\": \"$MODEL_ID\", \"style\": \"$STYLE\", \"pose\": \"$POSE\"}"The answer is 200 if your store already had that scene, or 201 if the scene was added to your
store now. Either way, look at its status: a ready scene can be shot with at once, and a
generating one is still being prepared, which can take a minute or more. Keep its id:
SCENE_ID="the scene id"If it is not ready yet, ask for the scene again until it is:
curl https://api.shootika.com/v1/scenes/$SCENE_ID \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"If it ends failed, run the request in this step again.
6. Start the shoot
Section titled “6. Start the shoot”This uses one frame. First make an idempotency key for this shoot, once:
SHOOT_KEY=$(uuidgen)Then start the shoot:
curl https://api.shootika.com/v1/frames \ -H "Authorization: Bearer $SHOOTIKA_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $SHOOT_KEY" \ -d "{\"product_id\": \"$PRODUCT_ID\", \"source_image_id\": \"$IMAGE_ID\", \"scene_id\": \"$SCENE_ID\", \"garment_photo_type\": \"flat-lay\"}"If the network fails and you get no answer, run only this curl command again, in the same
shell. Do not make a new SHOOT_KEY: with the same key Shootika returns the first answer
instead of starting, and charging, a second shoot.
The answer is 202 with the frame in status queued. Keep its id:
FRAME_ID="the frame id"7. Poll the frame
Section titled “7. Poll the frame”curl https://api.shootika.com/v1/frames/$FRAME_ID \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"Run it every few seconds until status is ready, failed or canceled. A ready frame has
the picture in image.url. A failed frame has an error and its frame is refunded. See
Frames.
8. Approve it
Section titled “8. Approve it”Look at image.url. To keep the frame, approve it:
curl -X POST https://api.shootika.com/v1/frames/$FRAME_ID/approval \ -H "Authorization: Bearer $SHOOTIKA_API_KEY"The frame is saved as a photo on its product and no longer expires. An unapproved frame is
deleted at its expires_at. See Approval for the review pattern we
recommend before anything reaches your store.
- Products and images: your own ids, file uploads, removing photos.
- Idempotency and retries: retry without paying twice.
- Errors and limits: every error code and the rate limit.
- API reference: every endpoint and field.