Product Option Import

This documentation describes the technical process for importing product option data using the API.

Step-by-Step Process

Generate Signed Upload URL

Get Upload URL

Request

POST /temporary-upload-url HTTP/1.1

{
  "content_type": "text/csv",
  "file_name": "example.csv"
}

Response

{
  "path": "tmp/d24c7338-5eeb-4129-bae6-2f8e30f004bb-metaZXhhbXBsZS5jc3Y=-.csv",
  "url": "https://smake-public.s3.eu-west-1.amazonaws.com/tmp/d24c7338-5e ...",
  "headers": {
    "Content-Type": "text/csv"
  }
}

Note: The upload URL is valid for 10 minutes.

Upload Content

Upload the Content

Request

PUT /temporary-upload-url?...  HTTP/1.1
Content-Type: text/csv

option_handle,locale,option_name,option_order,value_handle,value_name,value_order,image_url
size,en,Size,1,s,S,1,
size,en,Size,2,m,M,2,

Response

HTTP/1.1 200 OK

Note: Uploaded files will be automatically deleted after 24 hours.

Create a new import

Creates a new asynchronous import of product options based on a CSV file uploaded to S3.

Parameters for creating a product option import
Field Type Description Required
path string A path of csv file uploaded to S3 Yes

Request

POST /product-option-imports HTTP/1.1

{
    "path": "tmp/d24c7338-5eeb-4129-bae6-2f8e30f004bb-metaZXhhbXBsZS5jc3Y=-.csv"
}

Response

HTTP/1.1 202 Accepted
Location: /product-option-imports/1

Check Import Status

Returns a result of product option import with the given id = x.

Request

GET /product-option-imports/1

Response

{
    "id": 1,
    "options": [],
    "state": "finished",
    "failure_message": null,
    "total_rows": 2,
    "failed_rows": 0,
    "processed_rows": 2,
    "ignored_rows": 0,
    "started_at": "2026-01-12T09:39:28+00:00",
    "finished_at": "2026-01-12T09:39:28+00:00",
    "source_file": {
        "id": 5461,
        "collection_name": "source-file",
        "file_name": "example.csv",
        "size": 188,
        "mime_type": "text/plain",
        "download_url": "https://api.smake.test/storage/files/99af8a25607f4c0e95e49fd00bc9dc40/example.csv?expires=1768225652&signature=44e1808541d94c18bd0962d2ee483a9d09a0c27b51f94a481345abe9c939e9a7",
        "state": null,
        "requested": null,
        "failure_message": null,
        "created_at": "2026-01-12T09:39:28+00:00",
        "updated_at": "2026-01-12T09:39:28+00:00"
    },
    "failed_report_file": null,
    "created_at": "2026-01-12T09:39:28+00:00",
    "updated_at": "2026-01-12T09:39:28+00:00"
}

Example Import File

option_handle,locale,option_name,option_order,value_handle,value_name,value_order,image_url
size,en,Size,1,s,S,1,
size,en,Size,2,m,M,2,
color,en,Color,3,yellow,Yellow,3,
color,en,Color,4,green,Green,4,