Skip to content

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 from uuidgen, which macOS and most Linux systems include.
Terminal window
export SHOOTIKA_API_KEY="shootika_sk_..."

Paste your whole key between the quotes. Every command below reads it from this variable.

Terminal window
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.

Terminal window
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:

Terminal window
PRODUCT_ID="the product id"
IMAGE_ID="the photo id"

A scene is one model in one pose in one style. Look at the models and the poses each can take:

Terminal window
curl https://api.shootika.com/v1/models \
-H "Authorization: Bearer $SHOOTIKA_API_KEY"

Then the styles:

Terminal window
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:

Terminal window
MODEL_ID="the model id"
POSE="one of the model's poses"
STYLE="the style key"
Terminal window
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:

Terminal window
SCENE_ID="the scene id"

If it is not ready yet, ask for the scene again until it is:

Terminal window
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.

This uses one frame. First make an idempotency key for this shoot, once:

Terminal window
SHOOT_KEY=$(uuidgen)

Then start the shoot:

Terminal window
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:

Terminal window
FRAME_ID="the frame id"
Terminal window
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.

Look at image.url. To keep the frame, approve it:

Terminal window
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.