Create a product
const url = 'https://api.shootika.com/v1/products';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"example","garment_category":"tops","external_id":"example","image_urls":["example"]}'};
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/products \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "garment_category": "tops", "external_id": "example", "image_urls": [ "example" ] }'Creates a product, optionally with photos fetched from public web addresses in image_urls. The product is created even if some photos cannot be fetched. Each photo that failed is listed in images_failed with its own code, so check that list before you rely on the images.
Photos fetched from a web address must use http or https on the standard port (80 or 443), must be on a public address, are not followed through redirects, may be at most 15 MB, and each fetch may take at most 20 seconds. All image_urls together may take at most 30 seconds on one create. To upload a file instead, create the product first and then use POST /products/{product_id}/images.
Products created here cannot be made on a Shopify store, because Shopify stores get their products from Shopify.
Send an Idempotency-Key to make a retry safe. 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
Your own id for the product. It must be unique among your products.
Public http or https addresses of photos to fetch.
Responses
Section titled “Responses”The product was created. images_failed is only present when image_urls was sent.
object
object
Your own id for the product, or null.
object
Photos from image_urls that could not be added. Only present when image_urls was sent.
object
One of invalid_url, unreachable_url, not_an_image, too_large, upload_failed.
Example
{ "product": { "garment_category": "tops" }}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" }}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" }}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”catalog_managed_by_shopify when the store is a Shopify store, external_id_taken when another product already uses that external_id, 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, and the details name the fields that are wrong.
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" }}