SUZURI API は、新しい商品の作成や、商品データの読み込みなど、SUZURIの基本的な機能へのアクセスを提供します。APIを使うことで、SUZURIの機能を利用した色々なアプリケーションやサービスを作ることができるようになります。

Overview

SUZURI API v1の概要について説明します。なお、ドキュメントの構成について、Qiita API v2のドキュメントを参考にさせていただきました。この場を借りて御礼申し上げます。

リクエスト

APIとの通信にはHTTPSプロトコルを利用します。エンドポイントは suzuri.jp/api/v1 です。

パラメータ

GET、POST、PUT、DELETEの4種類のHTTPメソッドを利用します。パラメータは、GETリクエストではURIクエリ、それ以外の場合にはapplication/json形式のリクエストボディに含めることができます。各APIには任意で利用できるパラメータと、必ず含めなければならないパラメータがあります。どのようなパラメータがあるのかについては、このドキュメントの各API項目に記載しています。

ステータスコード

通常の処理が完了すると、APIはレスポンスボディとともにステータスコード200(一部204) を返します。また、正常な処理が行われなかった場合、APIは40x系または50x系のステータスコードを返します。このとき、レスポンスボディの中身は保証されないため、APIにリクエストした後は、はじめにステータスコードを確認するようにしてください。

レートリミット

一部APIにはレートリミットを設けてあります。レートリミットに関する情報はレスポンスヘッダに含められ、X-RateLimit-Limitは最大回数、X-RateLimit-Remainingは残り利用可能回数、X-RateLimit-Resetは制限リセット時刻(UTC)を示します。

Auth(認証)

すべてのリクエストにはアクセストークンの送信が必要です。アクセストークンは、後述するOAuthを利用した認可フローで発行するか、ユーザごとに付与されるAPIキーを利用することができます。

APIキー

ユーザ1人につき1つずつ、APIキーが付与されます。これは、開発や個人利用にお使いいただける、readwriteスコープを持つ、ユーザのアクセストークンです。アプリケーションの管理画面で確認ができます。

アクセストークン

アクセストークンは、以下のようにAuthorizationリクエストヘッダに含められます。

Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd

本ドキュメントには、各リクエストポイントにcurlサンプルが記載されていますが、上記ヘッダオプションについては省略されているものとします。実際にcurlコマンドでAPIを利用する際は、下記オプションを追加する必要があります。

-H "Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"

スコープ

アクセストークンはそれぞれ、スコープを持ちます。readwriteという二種類のスコープがあります。開発者は、アプリケーションを登録する際に要求するスコープを指定する必要があり、アプリケーションを利用するユーザはどのスコープが要求されているかを認可画面で確認できます。すべての操作にはreadスコープが必須であり、情報の書き込みや削除、更新に関わるAPIではさらにwriteスコープが必要になります。適切なスコープを持たないアクセストークンでのリクエストには401 Unauthorizedが返ります。

GET https://suzuri.jp/oauth/authorize

認可リクエストです。アクセストークンを発行するには、アプリケーションのユーザに認可画面を表示する必要があります。ユーザがアプリケーションからのアクセスを認可すると、アプリケーション登録時に指定されたURLにリダイレクトされ、その際にcodeが付与されます。アプリケーションでは、このcodeの値を利用して POST https://suzuri.jp/oauth/token にリクエストを送り、アクセストークンを発行します。

Required Parameters

Name Type Description Example
client_id string 登録されたAPIクライアントを特定するためのIDです。 "b9f0b0a3ae23e9e93c5989829498d173e735024abe807c8e507036187e8c20fb"
scope string アプリケーションが利用するスコープをスペース区切りで指定してください。 "read write"
redirect_uri string 認可コード付きでリダイレクトするuriを指定してください。 "http://yourapplication.com/callback"
response_type string 値は"code"でなければなりません。 "code"

POST https://suzuri.jp/oauth/token

トークンリクエストです。以下のパラメータを application/x-www-form-urlencoded フォーマットでリクエストすることで、アクセストークンを取得します。

Required Parameters

Name Type Description Example
grant_type string 値は"authorization_code"でなければなりません。 "authorization_code"
code string リダイレクトURIに付与された認可コードです。 "07bedccac71b7ec68dfb6b5e77b07752414a7f76ed83055e98ceed8f4508e05c"
redirect_uri string 認可リクエストに含まれていたものと同一の redirect_uri を指定してください。 "http://yourapplication.com/callback"
client_id string 認可リクエストに含まれていたものと同一の client_id を指定してください。 "b9f0b0a3ae23e9e93c5989829498d173e735024abe807c8e507036187e8c20fb"
client_secret string アプリケーション管理ページで確認できる client_secret を指定してください。 "bc75e3bcb3dac20eb8e18931ba4de36c0dbbd301c83813fb84891742659fabe9"

JSON Schema

SUZURI APIは、APIを定義するJSON Schemaを公開しています。

下記コマンド、あるいはこのリンクより取得することができます。

$ curl -n -X GET https://suzuri.jp/api/v1/schema

お問い合わせ or ご意見・ご要望

本APIに関するお問い合わせや、ご意見・ご要望等ございましたら、 どうかお気軽に@suzurijpまでご連絡ください!お待ちしております!

Activity(できごと)

ログインユーザに対しての、SUZURI内のできごとです。(売れた/ズッキュンがついたなど)

Activity(できごと) List

Details

Activityのリストを取得します。

GET /api/v1/activities

Optional Parameters

Name Type Description Example
limit string 取得するActivityの数を指定します(デフォルトは30、最大30) pattern: [1-9]|[1-2][0-9]|30$ 30

Curl Example

$ curl -n /api/v1/activities
 -G \
  -d limit=30

Response Example

HTTP/1.1 200 OK
{
  "activities": [
    {
      "id": "335104feaace0fe03d3348994486eaec",
      "message": "鹿さん が【去年の暮れあたりから蝶がついてきてるモグラ Tシャツ】にズッキュンしたよ。",
      "timeago": "2時間前",
      "eventType": "favorite",
      "eventAction": "provide",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "sender": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
        "profile": {
          "url": "https://suzuri.jp/",
          "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
          "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
        },
        "identities": [
          {
            "id": 1,
            "provider": "twitter",
            "uid": 1181557592,
            "nickname": "surisurikun",
            "url": "https://twitter.com/surisurikun"
          }
        ],
        "official": true
      },
      "receiver": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
        "profile": {
          "url": "https://suzuri.jp/",
          "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
          "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
        },
        "identities": [
          {
            "id": 1,
            "provider": "twitter",
            "uid": 1181557592,
            "nickname": "surisurikun",
            "url": "https://twitter.com/surisurikun"
          }
        ],
        "official": true
      },
      "event": null
    }
  ]
}

Activity(できごと) Unreads Count

Details

未読のActivityの数を取得します。

GET /api/v1/activities/unreads

Curl Example

$ curl -n /api/v1/activities/unreads

Response Example

HTTP/1.1 200 OK
{
  "unreads": 3
}

LPやセール情報のバナー

Attributes

Details

Name Type Description Example
displaySize string Bannerのディスプレイサイズ "1440w"
id integer Bannerの一意なID 1
imageUrl string Bannerの画像URL "https://dijsur42hqnz1.cloudfront.net/assets/banner/top/2020/five-panel-cap/360-801a0bc6242bd566de9b17c1a36690f83fdbc0eb51e7aa3827334b3f363d1eba.png"

Category(アイテムのカテゴリ)

Category(カテゴリ)は、SUZURIでつくることができるアイテムの分類です。ファッションや日用品などのCategory(カテゴリ)があります。

Attributes

Details

Name Type Description Example
imageUrls string Categoryの画像のURL {"png":"/assets/images/categories/t-shirts.png"}
items array [{"id":1,"name":"t-shirt","angles":[1],"humanizeName":"スタンダードTシャツ","availablePrintPlaces":["front","back"],"defaultPrintPlace":"front","displayOrder":9,"essentialAngles":["front","back"],"extraAngles":["front-wearing-mens","front-wearing-ladies"],"iconUrls":{"png":"/assets/items/t-shirt.png"},"wearingImageUrls":{"png":"/assets/wearing_by_item/t-shirt.png"},"isMultiPrintable":true,"printPlaceDisplayNames":{"front":"前面","back":"背面"},"printPlaceForExtraAngles":{"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}},"imageDescriptions":["","","男性モデル: 179cm","女性モデル: 163cm"],"productImageUrlTemplates":{"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"}}]
name string Categoryの一意な名前 "Apparel"

Choice(オモイデ)

Choiceは、UserがProductを集めて作れるリストです。サイト内ではChoiceのことはオモイデと呼ばれています。

Attributes

Details

Name Type Description Example
bannerUrl nullable uri Choiceページのバナー画像URL "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246"
description nullable string Choiceの説明文 "猫の商品を沢山あつめてみました。"
id integer Choiceのid 7
productsCount integer Choiceに入っているProductの数 1
secret boolean Choiceの非公開フラグ(通常はfalse) false
title string Choiceのタイトル "スリスリピックアップ"
user:avatarUrl nullable string Userのアバター画像のURL "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
user:displayName nullable string ウェブページなどに表示するUserの名前 "忍者スリスリくん"
user:id integer Userの一意なID 1
user:name string Userの一意な名前 "surisurikun"

Choice(オモイデ) Info

Details

idで指定したChoiceの情報を取得します。

GET /api/v1/choices/{choice_id}

Curl Example

$ curl -n /api/v1/choices/$CHOICE_ID

Response Example

HTTP/1.1 200 OK
{
  "choice": {
    "id": 7,
    "title": "スリスリピックアップ",
    "description": "猫の商品を沢山あつめてみました。",
    "secret": false,
    "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
    "productsCount": 1,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  }
}

Choice(オモイデ) Create

Details

Choiceを作成します。

POST /api/v1/choices

Required Parameters

Name Type Description Example
title string 作成するChoiceのタイトル "スリスリピックアップ"

Optional Parameters

Name Type Description Example
bannerUrl string 作成するChoiceのバナー画像URL "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246"
choiceProducts/itemVariantId integer アイテムバリエーションの一意なID 1
choiceProducts/productId integer Productの一意なID 1
description string 作成するChoiceの説明 "猫の商品を沢山あつめてみました。"

Curl Example

$ curl -n -X POST /api/v1/choices \
  -d '{
  "title": "スリスリピックアップ",
  "description": "猫の商品を沢山あつめてみました。",
  "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
  "choiceProducts": [
    {
      "productId": 1,
      "itemVariantId": 1
    }
  ]
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "choice": {
    "id": 7,
    "title": "スリスリピックアップ",
    "description": "猫の商品を沢山あつめてみました。",
    "secret": false,
    "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
    "productsCount": 1,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  }
}

Choice(オモイデ) Delete

Details

Choiceを削除します。成功すると204を返します。

DELETE /api/v1/choices/{choice_id}

Curl Example

$ curl -n -X DELETE /api/v1/choices/$CHOICE_ID \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 204 No Content
レスポンスヘッダのみ返します

Choice(オモイデ) Add product

Details

Choiceに指定したProductを追加します。

POST /api/v1/choices/{choice_id}

Optional Parameters

Name Type Description Example
itemVariantId integer Choiceに追加したいProductのItem Variant (色とサイズの組み合わせ) id Range: 1 <= value 1
productId integer Choiceに追加したいProductのid Range: 1 <= value 1

Curl Example

$ curl -n -X POST /api/v1/choices/$CHOICE_ID \
  -d '{
  "productId": 1,
  "itemVariantId": 1
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "choice": {
    "id": 7,
    "title": "スリスリピックアップ",
    "description": "猫の商品を沢山あつめてみました。",
    "secret": false,
    "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
    "productsCount": 1,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  }
}

Choice(オモイデ) Remove product

Details

Choiceから指定したProductを削除します。

POST /api/v1/choices/{choice_id}/remove

Optional Parameters

Name Type Description Example
itemVariantId integer Choiceから削除したいProductのItem Variant (色とサイズの組み合わせ) id Range: 1 <= value 1
productId integer Choiceから削除したいProductのid Range: 1 <= value 1

Curl Example

$ curl -n -X POST /api/v1/choices/$CHOICE_ID/remove \
  -d '{
  "productId": 1,
  "itemVariantId": 1
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "choice": {
    "id": 7,
    "title": "スリスリピックアップ",
    "description": "猫の商品を沢山あつめてみました。",
    "secret": false,
    "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
    "productsCount": 1,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  }
}

Choice(オモイデ) Update

Details

Choiceのタイトルや説明を更新します。

PUT /api/v1/choices/{choice_id}/

Optional Parameters

Name Type Description Example
bannerUrl nullable uri Choiceページのバナー画像URL "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246"
choiceProducts/itemVariantId integer アイテムバリエーションの一意なID 1
choiceProducts/productId integer Productの一意なID 1
description nullable string Choiceの説明文 "猫の商品を沢山あつめてみました。"
title string Choiceのタイトル "スリスリピックアップ"

Curl Example

$ curl -n -X PUT /api/v1/choices/$CHOICE_ID/ \
  -d '{
  "title": "スリスリピックアップ",
  "description": "猫の商品を沢山あつめてみました。",
  "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
  "choiceProducts": [
    {
      "productId": 1,
      "itemVariantId": 1
    }
  ]
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "choice": {
    "id": 7,
    "title": "スリスリピックアップ",
    "description": "猫の商品を沢山あつめてみました。",
    "secret": false,
    "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
    "productsCount": 1,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  }
}

Choice(オモイデ) List

Details

Choiceの一覧を取得します。

GET /api/v1/choices

Optional Parameters

Name Type Description Example
limit string 取得するChoiceの数の上限(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 15
offset string 取得するChoiceの開始位置 (デフォルトは0, 数字が大きいほど古い) pattern: [0-9][0-9]*$ 100
userId string 取得するChoiceをUser id で絞り込む pattern: [1-9][0-9]*$ 2
userName string 取得するChoiceをUser name で絞り込む pattern: [\w-]*$ "surisurikun"

Curl Example

$ curl -n /api/v1/choices
 -G \
  -d limit=15 \
  -d offset=100 \
  -d userId=2 \
  -d userName=surisurikun

Response Example

HTTP/1.1 200 OK
{
  "choices": [
    {
      "id": 7,
      "title": "スリスリピックアップ",
      "description": "猫の商品を沢山あつめてみました。",
      "secret": false,
      "bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
      "productsCount": 1,
      "user": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Favorite(ズッキュン)

Favorite(ズッキュン)は、UserがProductを気に入った時にするアクションです(Facebookのいいね!やtwitterのお気に入りのようなものです)

Attributes

Details

Name Type Description Example
count integer Favoriteの数 3
id integer Favoriteのid 7
productId integer Favoriteの対象となる商品のid 14

Favorite(ズッキュン) Product favorite list

Details

指定したProductへのFavorite情報を取得します。(ズッキュンを行なったUser情報がレスポンスに含まれます)

GET /api/v1/products/{product_id}/favorites

Optional Parameters

Name Type Description Example
itemId string 取得するFavoriteをItemのIDで絞り込む pattern: [1-9][0-9]*$ 1
limit string 取得するFavoriteの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
offset string 取得するFavoriteの開始位置を指定します。 pattern: [0-9][0-9]*$ 100

Curl Example

$ curl -n /api/v1/products/$PRODUCT_ID/favorites
 -G \
  -d itemId=1 \
  -d limit=30 \
  -d offset=100

Response Example

HTTP/1.1 200 OK
{
  "favorites": [
    {
      "id": 7,
      "count": 3,
      "productId": 14,
      "user": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Favorite(ズッキュン) User favorite List

Details

指定したUserによるFavorite情報を取得します。(対象のProduct情報がレスポンスに含まれます)

GET /api/v1/users/{user_id}/favorites

Curl Example

$ curl -n /api/v1/users/$USER_ID/favorites

Response Example

HTTP/1.1 200 OK
{
  "favorites": [
    {
      "id": 7,
      "count": 3,
      "product": {
        "id": 1,
        "title": "AAスリスリくん スタンダードTシャツ",
        "published": true,
        "publishedAt": "2015-01-14 11:58:29 +0900",
        "createdAt": "2015-01-14 11:58:29 +0900",
        "updatedAt": "2015-01-14 11:58:29 +0900",
        "examplaryAngle": "back",
        "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
        "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
        "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
        "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
        "priceWithTax": 2080,
        "discountedPriceWithTax": 2288,
        "item": {
          "id": 1,
          "name": "t-shirt",
          "angles": [
            1
          ],
          "humanizeName": "スタンダードTシャツ",
          "availablePrintPlaces": [
            "front",
            "back"
          ],
          "defaultPrintPlace": "front",
          "displayOrder": 9,
          "essentialAngles": [
            "front",
            "back"
          ],
          "extraAngles": [
            "front-wearing-mens",
            "front-wearing-ladies"
          ],
          "iconUrls": {
            "png": "/assets/items/t-shirt.png"
          },
          "wearingImageUrls": {
            "png": "/assets/wearing_by_item/t-shirt.png"
          },
          "isMultiPrintable": true,
          "printPlaceDisplayNames": {
            "front": "前面",
            "back": "背面"
          },
          "printPlaceForExtraAngles": {
            "t-shirt": {
              "front-wearing-mens": "front",
              "front-wearing-ladies": "front"
            }
          },
          "imageDescriptions": [
            "",
            "",
            "男性モデル: 179cm",
            "女性モデル: 163cm"
          ],
          "productImageUrlTemplates": {
            "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
          }
        },
        "material": {
          "id": 31106,
          "title": "AAスリスリくん",
          "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
          "price": 100,
          "priceWithTax": 110,
          "violation": false,
          "published": true,
          "publishedAt": "2014-05-07 11:05:25 +0900",
          "uploadedAt": "2014-05-07 11:03:15 +0900",
          "dominantRgb": "#ffffff",
          "originalWidth": 1920,
          "originalHeight": 1080,
          "user": {
            "id": 1,
            "name": "surisurikun",
            "displayName": "忍者スリスリくん",
            "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
          }
        },
        "sampleItemVariant": {
          "id": 1,
          "price": 2080,
          "exemplary": true,
          "enabled": true,
          "isLightColor": true,
          "isDarkColor": true,
          "color": {
            "id": 1,
            "name": "white",
            "displayName": "ホワイト",
            "rgb": "#ffffff"
          },
          "size": {
            "id": 1,
            "name": "s",
            "displayName": "S"
          },
          "printPlaces": [
            {
              "id": 1,
              "place": "front",
              "price": 500,
              "itemVariantId": 2
            }
          ],
          "priceWithTax": 2288
        }
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Favorite(ズッキュン) Create

Details

ProductをFavoriteします。レートリミットが設けてあります。

POST /api/v1/products/{product_id}/favorites

Optional Parameters

Name Type Description Example
anonymouse boolean 匿名のFavoriteとする場合true true
count integer Favoriteの更新数(最大: 100) 10

Curl Example

$ curl -n -X POST /api/v1/products/$PRODUCT_ID/favorites \
  -d '{
  "anonymouse": true,
  "count": 10
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 201 Created
{
  "favorite": {
    "id": 7,
    "count": 3,
    "rotation": 138,
    "x": 0.5702,
    "y": 0.5702
  },
  "meta": {
    "totalCount": 10
  }
}

Favorite(ズッキュン) Delete

Details

ズッキュンを削除します。

DELETE /api/v1/products/{product_id}/favorites

Curl Example

$ curl -n -X DELETE /api/v1/products/$PRODUCT_ID/favorites \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "id": 7,
  "count": 3,
  "productId": 14
}

Identity(外部サービス連携)

SUZURIユーザが認証に利用した外部サービス

Attributes

Details

Name Type Description Example
id integer Identityの一意なID 1
nickname nullable string 連携サービス上でのユーザの一意な名前 "surisurikun"
provider string 連携サービスの名前 "twitter"
uid nullable string 連携サービス上でのユーザの一意なID 1181557592
url nullable string 連携サービス上のユーザのURL "https://twitter.com/surisurikun"

Item(アイテム)

Item(アイテム)は、SUZURIでつくることができる商品の種類です。TシャツやマグカップなどのItem(アイテム)があります。

Attributes

Details

Name Type Description Example
angles array Itemの画像におけるアングルの種類 [1]
availablePrintPlaces array プリント可能な箇所 ["front","back"]
defaultPrintPlace string デフォルトのプリント箇所 "front"
displayOrder integer アイテム一覧に表示する際の並び順 9
essentialAngles array 一覧に表示するアングルとして選べる角度 ["front","back"]
extraAngles array 一覧に表示するアングルとして選択できない角度 ["front-wearing-mens","front-wearing-ladies"]
humanizeName string Itemを表す名前 "スタンダードTシャツ"
iconUrls object アイテムアイコンのURL {"png":"/assets/items/t-shirt.png"}
id integer Itemのid 1
imageDescriptions array 商品ページの各画像の説明 ["","","男性モデル: 179cm","女性モデル: 163cm"]
isMultiPrintable boolean プリント可能な箇所が複数あるかを示すフラグ true
name string Itemの一意な名前 "t-shirt"
printPlaceDisplayNames object プリント箇所の表示名 {"front":"前面","back":"背面"}
printPlaceForExtraAngles object {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}}
productImageUrlTemplates object 商品の各アングル画像URLのテンプレート {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"}
wearingImageUrls object アイテムの着用画像のURL {"png":"/assets/wearing_by_item/t-shirt.png"}

Item(アイテム) List

Details

全Itemのリストを取得します。

GET /api/v1/items

Curl Example

$ curl -n /api/v1/items

Response Example

HTTP/1.1 200 OK
{
  "items": [
    {
      "id": 1,
      "name": "t-shirt",
      "angles": [
        1
      ],
      "humanizeName": "スタンダードTシャツ",
      "availablePrintPlaces": [
        "front",
        "back"
      ],
      "defaultPrintPlace": "front",
      "displayOrder": 9,
      "essentialAngles": [
        "front",
        "back"
      ],
      "extraAngles": [
        "front-wearing-mens",
        "front-wearing-ladies"
      ],
      "iconUrls": {
        "png": "/assets/items/t-shirt.png"
      },
      "wearingImageUrls": {
        "png": "/assets/wearing_by_item/t-shirt.png"
      },
      "isMultiPrintable": true,
      "printPlaceDisplayNames": {
        "front": "前面",
        "back": "背面"
      },
      "printPlaceForExtraAngles": {
        "t-shirt": {
          "front-wearing-mens": "front",
          "front-wearing-ladies": "front"
        }
      },
      "imageDescriptions": [
        "",
        "",
        "男性モデル: 179cm",
        "女性モデル: 163cm"
      ],
      "productImageUrlTemplates": {
        "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
      },
      "variants": [
        {
          "id": 1,
          "price": 2080,
          "exemplary": true,
          "enabled": true,
          "isLightColor": true,
          "isDarkColor": true,
          "color": {
            "id": 1,
            "name": "white",
            "displayName": "ホワイト",
            "rgb": "#ffffff"
          },
          "size": {
            "id": 1,
            "name": "s",
            "displayName": "S"
          },
          "printPlaces": [
            {
              "id": 1,
              "place": "front",
              "price": 500,
              "itemVariantId": 2
            }
          ],
          "priceWithTax": 2288
        }
      ]
    }
  ]
}

Item color(アイテムカラー)

アイテムのカラー

Attributes

Details

Name Type Description Example
displayName string アイテムカラーの表示名 "ホワイト"
id integer アイテムカラーの一意なID 1
name string アイテムカラーの一意な名前 "white"
rgb string アイテムカラーのRGB "#ffffff"

Item size(アイテムサイズ)

アイテムのサイズ

Attributes

Details

Name Type Description Example
displayName string アイテムサイズの表示名 "S"
id integer アイテムサイズの一意なID 1
name string アイテムサイズの一意な名前 "s"

Item variant(アイテムバリエーション)

アイテムカラーとアイテムサイズの組み合わせ

Attributes

Details

Name Type Description Example
color:displayName string アイテムカラーの表示名 "ホワイト"
color:id integer アイテムカラーの一意なID 1
color:name string アイテムカラーの一意な名前 "white"
color:rgb string アイテムカラーのRGB "#ffffff"
enabled boolean 有効フラグ true
exemplary boolean 代表フラグ(代表のアイテムバリエーションが、SUZURIサイトの商品リストページに使用されます) true
id integer アイテムバリエーションの一意なID 1
isDarkColor boolean 濃色フラグ true
isLightColor boolean 淡色フラグ true
price integer アイテムバリエーションの価格(税抜)※ 原価を計算したい場合はprintPlacesのpriceを加算してください 2080
priceWithTax integer アイテムバリエーションの価格(税込)※ 原価を計算したい場合はprintPlacesのpriceを加算してください 2288
printPlaces array [{"id":1,"place":"front","price":500,"itemVariantId":2}]
size:displayName string アイテムサイズの表示名 "S"
size:id integer アイテムサイズの一意なID 1
size:name string アイテムサイズの一意な名前 "s"

Material(素材)

Material(素材)は、Userがアップロードした画像によって生成される、Product(商品)を作るための素材です。ひとつのMaterialからは、Item一種類につき一つずつのProductを作ることができます。Materialから作ることのできる商品の種類は、Item List API を使って取得することができます。

Attributes

Details

Name Type Description Example
description nullable string Materialの説明 "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah."
dominantRgb nullable string Materialの主張色のRGB "#ffffff"
id integer Materialのid 31106
originalHeight integer Materialの画像の縦幅 1080
originalWidth integer Materialの画像の横幅 1920
price integer Materialの値段 (いわゆるトリブン)。 100
priceWithTax integer Materialの値段(いわゆるトリブン)の税込価格。 110
published boolean 公開・非公開フラグ (Materialが公開されているときtrue) true
publishedAt nullable date-time Materialが公開された時間 "2014-05-07 11:05:25 +0900"
title string Materialのタイトル "AAスリスリくん"
uploadedAt date-time Materialが更新された時間 "2014-05-07 11:03:15 +0900"
user:avatarUrl nullable string Userのアバター画像のURL "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
user:displayName nullable string ウェブページなどに表示するUserの名前 "忍者スリスリくん"
user:id integer Userの一意なID 1
user:name string Userの一意な名前 "surisurikun"
violation boolean 違反フラグ (Materialが規約違反しているかどうか) false

Material(素材) List

Details

Materialの一覧を取得します。

GET /api/v1/materials

Optional Parameters

Name Type Description Example
limit string 取得するMaterialの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
offset string 取得するMaterialの開始位置を指定します。 pattern: [0-9][0-9]*$ 100
userId string 取得するProductを Userのid で絞り込む pattern: [1-9][0-9]*$ 2

Curl Example

$ curl -n /api/v1/materials
 -G \
  -d limit=30 \
  -d offset=100 \
  -d userId=2

Response Example

HTTP/1.1 200 OK
{
  "materials": [
    {
      "id": 31106,
      "title": "AAスリスリくん",
      "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
      "price": 100,
      "priceWithTax": 110,
      "violation": false,
      "published": true,
      "publishedAt": "2014-05-07 11:05:25 +0900",
      "uploadedAt": "2014-05-07 11:03:15 +0900",
      "dominantRgb": "#ffffff",
      "originalWidth": 1920,
      "originalHeight": 1080,
      "user": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Material(素材) Create

Details

画像からMaterialとProductを作ります。レートリミットが設けてあります。

POST /api/v1/materials

Required Parameters

Name Type Description Example
texture string Materialの画像URL (データURIでも可) "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg"
title string Materialのタイトル "AAスリスリくん"

Optional Parameters

Name Type Description Example
description nullable string Materialの説明 "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah."
price integer Materialの値段 (いわゆるトリブン)。 100
products/exemplaryItemVariantId integer 作るProductの代表的なItem Variant(色とサイズの組み合わせ)のid 151
products/itemId integer 作るProductのItemのid 1
products/published boolean 作ったProductを公開する場合はtrue true
products/resizeMode nullable string 自動でリサイズするオプションです。contain を指定すると、プリント領域にぴったり収まるように画像を拡大・縮小します。cover を指定すると、できるだけプリント領域をちょうど埋めるように画像を拡大・縮小します。(cover は、スマホケース、ノート、フルグラフィックTシャツでのみ有効) "contain"
products/sub_materials/enabled boolean 有効にする場合はtrue true
products/sub_materials/printSide string SubMaterial のプリント箇所を指定します。商品によって選択可能なプリント箇所が異なります。 "back"
products/sub_materials/texture string SubMaterialの画像URL (データURIでも可) "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg"

Curl Example

$ curl -n -X POST /api/v1/materials \
  -d '{
  "texture": "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg",
  "title": "AAスリスリくん",
  "price": 100,
  "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
  "products": [
    {
      "itemId": 1,
      "exemplaryItemVariantId": 151,
      "published": true,
      "resizeMode": "contain",
      "sub_materials": [
        {
          "texture": "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg",
          "printSide": "back",
          "enabled": true
        }
      ]
    }
  ]
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "material": {
    "id": 31106,
    "title": "AAスリスリくん",
    "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
    "price": 100,
    "priceWithTax": 110,
    "violation": false,
    "published": true,
    "publishedAt": "2014-05-07 11:05:25 +0900",
    "uploadedAt": "2014-05-07 11:03:15 +0900",
    "dominantRgb": "#ffffff",
    "originalWidth": 1920,
    "originalHeight": 1080,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  },
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ]
}

Material(素材) Update

Details

MaterialおよびProductの情報を更新します。Productsパラメータを指定した場合、このMaterialと指定したitemIdから成るProductがすでに存在する場合はProductの更新操作となり、存在しない場合はProductの作成操作となります。レートリミットが設けてあります

PUT /api/v1/materials/{material_id}

Optional Parameters

Name Type Description Example
description nullable string Materialの説明 "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah."
price integer Materialの値段 (いわゆるトリブン)。 100
products/exemplaryItemVariantId integer 更新するProductの代表的なItem Variant(色とサイズの組み合わせ)のid 151
products/itemId integer 更新するProductのItemのid 1
products/published boolean trueだと公開、falseだと非公開 true
products/resizeMode nullable string 自動でリサイズするオプション。contain を指定すると、プリント領域にぴったり収まるように画像を拡大・縮小 "contain"
title string Materialのタイトル "AAスリスリくん"

Curl Example

$ curl -n -X PUT /api/v1/materials/$MATERIAL_ID \
  -d '{
  "title": "AAスリスリくん",
  "price": 100,
  "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
  "products": [
    {
      "itemId": 1,
      "exemplaryItemVariantId": 151,
      "published": true,
      "resizeMode": "contain"
    }
  ]
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "material": {
    "id": 31106,
    "title": "AAスリスリくん",
    "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
    "price": 100,
    "priceWithTax": 110,
    "violation": false,
    "published": true,
    "publishedAt": "2014-05-07 11:05:25 +0900",
    "uploadedAt": "2014-05-07 11:03:15 +0900",
    "dominantRgb": "#ffffff",
    "originalWidth": 1920,
    "originalHeight": 1080,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  },
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ]
}

Material(素材) Delete

Details

Materialを削除します。紐付いたProductsもすべて削除されます。成功した時は204を返します。

DELETE /api/v1/materials/{material_id}

Curl Example

$ curl -n -X DELETE /api/v1/materials/$MATERIAL_ID \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 204 No Content
レスポンスヘッダのみ返します

Material(素材) Text

Details

テキストからMaterialとスタンダードTシャツを作ります。レートリミットが設けてあります。

POST /api/v1/materials/text

Required Parameters

Name Type Description Example
text string Materialの元となるテキスト。255文字以下です。 "AAスリスリくん"

Optional Parameters

Name Type Description Example
itemVariantId integer 作るスタンダードTシャツのItemVariantId。スタンダードTシャツのItemVariant以外はエラーとなります。利用できる値については、ItemList APIを参照してください。指定されなかった場合、白のMで作られます。 1

Curl Example

$ curl -n -X POST /api/v1/materials/text \
  -d '{
  "text": "AAスリスリくん",
  "itemVariantId": 1
}' \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "material": {
    "id": 31106,
    "title": "AAスリスリくん",
    "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
    "price": 100,
    "priceWithTax": 110,
    "violation": false,
    "published": true,
    "publishedAt": "2014-05-07 11:05:25 +0900",
    "uploadedAt": "2014-05-07 11:03:15 +0900",
    "dominantRgb": "#ffffff",
    "originalWidth": 1920,
    "originalHeight": 1080,
    "user": {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
    }
  },
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ]
}

プリント加工可能な箇所

Attributes

Details

Name Type Description Example
id integer プリント箇所の一意なID 1
itemVariantId integer 関連するアイテムバリエーションの一意なID 2
place string プリント箇所の名称 "front"
price integer この箇所にプリントした場合に加算される価格 500

Product(商品)

Productは、Materialから生まれた各商品のことです。商品の値段は material:priceitemVariant:price によって決定されます。

Attributes

Details

Name Type Description Example
createdAt date-time Product作成された時間 "2015-01-14 11:58:29 +0900"
discountedPriceWithTax integer 値引後の商品の税込価格 2288
examplaryAngle nullable string Productの代表的角度(SUZURIのウェブサイトで使用されます) "back"
id integer Productの一意なID 1
imageUrl string Product画像のURL。{} で囲まれた箇所は変数です。 次の値を入れて使用してください。{width}x{height} に画像のサイズ。(有効な値は 323x323765x765) {size}/{color} にアイテムサイズ/カラーの名前、[/angle]にはアングルの名前または空文字。 (有効な組み合わせは itemVariantsを参照) "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b"
item:angles array Itemの画像におけるアングルの種類 [1]
item:availablePrintPlaces array プリント可能な箇所 ["front","back"]
item:defaultPrintPlace string デフォルトのプリント箇所 "front"
item:displayOrder integer アイテム一覧に表示する際の並び順 9
item:essentialAngles array 一覧に表示するアングルとして選べる角度 ["front","back"]
item:extraAngles array 一覧に表示するアングルとして選択できない角度 ["front-wearing-mens","front-wearing-ladies"]
item:humanizeName string Itemを表す名前 "スタンダードTシャツ"
item:iconUrls object アイテムアイコンのURL {"png":"/assets/items/t-shirt.png"}
item:id integer Itemのid 1
item:imageDescriptions array 商品ページの各画像の説明 ["","","男性モデル: 179cm","女性モデル: 163cm"]
item:isMultiPrintable boolean プリント可能な箇所が複数あるかを示すフラグ true
item:name string Itemの一意な名前 "t-shirt"
item:printPlaceDisplayNames object プリント箇所の表示名 {"front":"前面","back":"背面"}
item:printPlaceForExtraAngles object {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}}
item:productImageUrlTemplates object 商品の各アングル画像URLのテンプレート {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"}
item:wearingImageUrls object アイテムの着用画像のURL {"png":"/assets/wearing_by_item/t-shirt.png"}
material:description nullable string Materialの説明 "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah."
material:dominantRgb nullable string Materialの主張色のRGB "#ffffff"
material:id integer Materialのid 31106
material:originalHeight integer Materialの画像の縦幅 1080
material:originalWidth integer Materialの画像の横幅 1920
material:price integer Materialの値段 (いわゆるトリブン)。 100
material:priceWithTax integer Materialの値段(いわゆるトリブン)の税込価格。 110
material:published boolean 公開・非公開フラグ (Materialが公開されているときtrue) true
material:publishedAt nullable date-time Materialが公開された時間 "2014-05-07 11:05:25 +0900"
material:title string Materialのタイトル "AAスリスリくん"
material:uploadedAt date-time Materialが更新された時間 "2014-05-07 11:03:15 +0900"
material:user:avatarUrl nullable string Userのアバター画像のURL "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
material:user:displayName nullable string ウェブページなどに表示するUserの名前 "忍者スリスリくん"
material:user:id integer Userの一意なID 1
material:user:name string Userの一意な名前 "surisurikun"
material:violation boolean 違反フラグ (Materialが規約違反しているかどうか) false
priceWithTax integer 商品の税込価格 2080
published boolean 公開フラグ (公開されていれば真) true
publishedAt nullable date-time Productが公開された時間 "2015-01-14 11:58:29 +0900"
sampleImageUrl string Product画像URLのサンプル "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b"
sampleItemVariant:color:displayName string アイテムカラーの表示名 "ホワイト"
sampleItemVariant:color:id integer アイテムカラーの一意なID 1
sampleItemVariant:color:name string アイテムカラーの一意な名前 "white"
sampleItemVariant:color:rgb string アイテムカラーのRGB "#ffffff"
sampleItemVariant:enabled boolean 有効フラグ true
sampleItemVariant:exemplary boolean 代表フラグ(代表のアイテムバリエーションが、SUZURIサイトの商品リストページに使用されます) true
sampleItemVariant:id integer アイテムバリエーションの一意なID 1
sampleItemVariant:isDarkColor boolean 濃色フラグ true
sampleItemVariant:isLightColor boolean 淡色フラグ true
sampleItemVariant:price integer アイテムバリエーションの価格(税抜)※ 原価を計算したい場合はprintPlacesのpriceを加算してください 2080
sampleItemVariant:priceWithTax integer アイテムバリエーションの価格(税込)※ 原価を計算したい場合はprintPlacesのpriceを加算してください 2288
sampleItemVariant:printPlaces array [{"id":1,"place":"front","price":500,"itemVariantId":2}]
sampleItemVariant:size:displayName string アイテムサイズの表示名 "S"
sampleItemVariant:size:id integer アイテムサイズの一意なID 1
sampleItemVariant:size:name string アイテムサイズの一意な名前 "s"
sampleUrl string ProductページURLのサンプル "https://suzuri.jp/surisurikun/31106/t-shirt/s/white"
title string Productのタイトル "AAスリスリくん スタンダードTシャツ"
updatedAt date-time Productが更新された時間 "2015-01-14 11:58:29 +0900"
url string ProductのWebページのURL。{} で囲まれた箇所は変数です。 {size}/{color} にアイテムサイズ/カラーの名前を入れて使用してください。(有効な組み合わせは itemVariantsを参照) "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}"

Product(商品) List

Details

複数のProduct情報を取得します。

GET /api/v1/products

Optional Parameters

Name Type Description Example
itemId string 取得するProductをItemのIDで絞り込む pattern: [1-9][0-9]*$ 1
limit string 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
materialId string 取得するProductを Material id で絞り込む pattern: [1-9][0-9]*$ 101
offset string 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ 100
userId string 取得するProductを User id で絞り込む pattern: [1-9][0-9]*$ 2
userName string 取得するProductを User name で絞り込む pattern: [\w-]*$ "surisurikun"

Curl Example

$ curl -n /api/v1/products
 -G \
  -d itemId=1 \
  -d limit=30 \
  -d offset=100 \
  -d userId=2 \
  -d userName=surisurikun \
  -d materialId=101

Response Example

HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Product(商品) Choice product list

Details

指定したChoiceのProduct情報を取得します。

GET /api/v1/choices/{choice_id}/products

Optional Parameters

Name Type Description Example
limit string 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
offset string 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ 100

Curl Example

$ curl -n /api/v1/choices/$CHOICE_ID/products
 -G \
  -d limit=30 \
  -d offset=100

Response Example

HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Details

Productをキーワード検索します。

GET /api/v1/products/search

Optional Parameters

Name Type Description Example
itemId string 取得するProductをItemのIDで絞り込む pattern: [1-9][0-9]*$ 1
limit string 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
offset string 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ 100
q string 検索キーワード Length: 0..100 "NINJYA"

Curl Example

$ curl -n /api/v1/products/search
 -G \
  -d limit=30 \
  -d offset=100 \
  -d q=NINJYA \
  -d itemId=1

Response Example

HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Product(商品) On Sale

Details

セール対象の商品を取得します

GET /api/v1/products/on_sale

Optional Parameters

Name Type Description Example
limit string 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
offset string 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ 100

Curl Example

$ curl -n /api/v1/products/on_sale
 -G \
  -d limit=30 \
  -d offset=100

Response Example

HTTP/1.1 200 OK
{
  "products": [
    {
      "id": 1,
      "title": "AAスリスリくん スタンダードTシャツ",
      "published": true,
      "publishedAt": "2015-01-14 11:58:29 +0900",
      "createdAt": "2015-01-14 11:58:29 +0900",
      "updatedAt": "2015-01-14 11:58:29 +0900",
      "examplaryAngle": "back",
      "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
      "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
      "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
      "priceWithTax": 2080,
      "discountedPriceWithTax": 2288,
      "item": {
        "id": 1,
        "name": "t-shirt",
        "angles": [
          1
        ],
        "humanizeName": "スタンダードTシャツ",
        "availablePrintPlaces": [
          "front",
          "back"
        ],
        "defaultPrintPlace": "front",
        "displayOrder": 9,
        "essentialAngles": [
          "front",
          "back"
        ],
        "extraAngles": [
          "front-wearing-mens",
          "front-wearing-ladies"
        ],
        "iconUrls": {
          "png": "/assets/items/t-shirt.png"
        },
        "wearingImageUrls": {
          "png": "/assets/wearing_by_item/t-shirt.png"
        },
        "isMultiPrintable": true,
        "printPlaceDisplayNames": {
          "front": "前面",
          "back": "背面"
        },
        "printPlaceForExtraAngles": {
          "t-shirt": {
            "front-wearing-mens": "front",
            "front-wearing-ladies": "front"
          }
        },
        "imageDescriptions": [
          "",
          "",
          "男性モデル: 179cm",
          "女性モデル: 163cm"
        ],
        "productImageUrlTemplates": {
          "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
        }
      },
      "material": {
        "id": 31106,
        "title": "AAスリスリくん",
        "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
        "price": 100,
        "priceWithTax": 110,
        "violation": false,
        "published": true,
        "publishedAt": "2014-05-07 11:05:25 +0900",
        "uploadedAt": "2014-05-07 11:03:15 +0900",
        "dominantRgb": "#ffffff",
        "originalWidth": 1920,
        "originalHeight": 1080,
        "user": {
          "id": 1,
          "name": "surisurikun",
          "displayName": "忍者スリスリくん",
          "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
        }
      },
      "sampleItemVariant": {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    }
  ],
  "meta": {
    "hasNext": true
  }
}

Product(商品) Info

Details

idを指定してProduct情報を取得します。

GET /api/v1/products/{product_id}

Curl Example

$ curl -n /api/v1/products/$PRODUCT_ID

Response Example

HTTP/1.1 200 OK
{
  "products": {
    "id": 1,
    "title": "AAスリスリくん スタンダードTシャツ",
    "published": true,
    "publishedAt": "2015-01-14 11:58:29 +0900",
    "createdAt": "2015-01-14 11:58:29 +0900",
    "updatedAt": "2015-01-14 11:58:29 +0900",
    "examplaryAngle": "back",
    "imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
    "sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
    "url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
    "sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
    "item": {
      "id": 1,
      "name": "t-shirt",
      "angles": [
        1
      ],
      "humanizeName": "スタンダードTシャツ",
      "availablePrintPlaces": [
        "front",
        "back"
      ],
      "defaultPrintPlace": "front",
      "displayOrder": 9,
      "essentialAngles": [
        "front",
        "back"
      ],
      "extraAngles": [
        "front-wearing-mens",
        "front-wearing-ladies"
      ],
      "iconUrls": {
        "png": "/assets/items/t-shirt.png"
      },
      "wearingImageUrls": {
        "png": "/assets/wearing_by_item/t-shirt.png"
      },
      "isMultiPrintable": true,
      "printPlaceDisplayNames": {
        "front": "前面",
        "back": "背面"
      },
      "printPlaceForExtraAngles": {
        "t-shirt": {
          "front-wearing-mens": "front",
          "front-wearing-ladies": "front"
        }
      },
      "imageDescriptions": [
        "",
        "",
        "男性モデル: 179cm",
        "女性モデル: 163cm"
      ],
      "productImageUrlTemplates": {
        "front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
      }
    },
    "material": {
      "id": 31106,
      "title": "AAスリスリくん",
      "description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
      "price": 100,
      "priceWithTax": 110,
      "violation": false,
      "published": true,
      "publishedAt": "2014-05-07 11:05:25 +0900",
      "uploadedAt": "2014-05-07 11:03:15 +0900",
      "dominantRgb": "#ffffff",
      "originalWidth": 1920,
      "originalHeight": 1080,
      "user": {
        "id": 1,
        "name": "surisurikun",
        "displayName": "忍者スリスリくん",
        "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
      }
    },
    "itemVariants": [
      {
        "id": 1,
        "price": 2080,
        "exemplary": true,
        "enabled": true,
        "isLightColor": true,
        "isDarkColor": true,
        "color": {
          "id": 1,
          "name": "white",
          "displayName": "ホワイト",
          "rgb": "#ffffff"
        },
        "size": {
          "id": 1,
          "name": "s",
          "displayName": "S"
        },
        "printPlaces": [
          {
            "id": 1,
            "place": "front",
            "price": 500,
            "itemVariantId": 2
          }
        ],
        "priceWithTax": 2288
      }
    ],
    "sampleItemVariant": {
      "id": 1,
      "price": 2080,
      "exemplary": true,
      "enabled": true,
      "isLightColor": true,
      "isDarkColor": true,
      "color": {
        "id": 1,
        "name": "white",
        "displayName": "ホワイト",
        "rgb": "#ffffff"
      },
      "size": {
        "id": 1,
        "name": "s",
        "displayName": "S"
      },
      "printPlaces": [
        {
          "id": 1,
          "place": "front",
          "price": 500,
          "itemVariantId": 2
        }
      ],
      "priceWithTax": 2288
    }
  }
}

Profile(プロフィール)

ユーザのプロフィール

Attributes

Details

Name Type Description Example
body nullable string プロフィールの詳細 "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?"
headerUrl nullable string ユーザプロフィールページのヘッダ画像URL "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
url nullable string ユーザのホームページのURL "https://suzuri.jp/"

Promotion(LPやセール情報)

トップページに掲載するLPやセール情報

Attributes

Details

Name Type Description Example
category string Promotionのカテゴリー "lp"
id integer Promotionの一意なID 1
name string Promotionの名前 "jet-cap-sale"
url string PromotionのURL "https://suzuri.jp/lp/five-panel-cap"

User(ユーザ)

User(ユーザ)とは、SUZURIのユーザです。

Attributes

Details

Name Type Description Example
avatarUrl nullable string Userのアバター画像のURL "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
displayName nullable string ウェブページなどに表示するUserの名前 "忍者スリスリくん"
id integer Userの一意なID 1
identities array ユーザが認証に利用した外部サービス [{"id":1,"provider":"twitter","uid":1181557592,"nickname":"surisurikun","url":"https://twitter.com/surisurikun"}]
name string Userの一意な名前 "surisurikun"
official boolean 認証バッジフラグ(認証バッジが付与されていたらtrue) true
profile:body nullable string プロフィールの詳細 "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?"
profile:headerUrl nullable string ユーザプロフィールページのヘッダ画像URL "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
profile:url nullable string ユーザのホームページのURL "https://suzuri.jp/"

User(ユーザ) List

Details

複数のUser情報を取得します。

GET /api/v1/users

Optional Parameters

Name Type Description Example
limit string 取得するUsertの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ 30
name string Userのname pattern: [\w-]*$ "surisurikun"
offset string 取得するUserの開始位置を指定します。 pattern: [0-9][0-9]*$ 100

Curl Example

$ curl -n /api/v1/users
 -G \
  -d name=surisurikun \
  -d limit=30 \
  -d offset=100

Response Example

HTTP/1.1 200 OK
{
  "users": [
    {
      "id": 1,
      "name": "surisurikun",
      "displayName": "忍者スリスリくん",
      "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
      "profile": {
        "url": "https://suzuri.jp/",
        "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
        "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
      },
      "identities": [
        {
          "id": 1,
          "provider": "twitter",
          "uid": 1181557592,
          "nickname": "surisurikun",
          "url": "https://twitter.com/surisurikun"
        }
      ],
      "official": true
    }
  ],
  "meta": {
    "hasNext": true
  }
}

User(ユーザ) Info

Details

idで指定したUserの情報を取得します

GET /api/v1/users/{user_id}

Curl Example

$ curl -n /api/v1/users/$USER_ID

Response Example

HTTP/1.1 200 OK
{
  "user": {
    "id": 1,
    "name": "surisurikun",
    "displayName": "忍者スリスリくん",
    "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
    "profile": {
      "url": "https://suzuri.jp/",
      "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
      "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
    },
    "identities": [
      {
        "id": 1,
        "provider": "twitter",
        "uid": 1181557592,
        "nickname": "surisurikun",
        "url": "https://twitter.com/surisurikun"
      }
    ],
    "official": true
  }
}

User(ユーザ) self

Details

認証されたUserの情報を取得します

GET /api/v1/user

Curl Example

$ curl -n /api/v1/user

Response Example

HTTP/1.1 200 OK
{
  "user": {
    "id": 1,
    "email": "hoge@suzuri.jp",
    "name": "surisurikun",
    "displayName": "忍者スリスリくん",
    "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
    "profile": {
      "url": "https://suzuri.jp/",
      "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
      "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
    },
    "identities": [
      {
        "id": 1,
        "provider": "twitter",
        "uid": 1181557592,
        "nickname": "surisurikun",
        "url": "https://twitter.com/surisurikun"
      }
    ],
    "official": true
  }
}

User(ユーザ) update

Details

認証されたUserの情報を更新します

PUT /api/v1/user

Curl Example

$ curl -n -X PUT /api/v1/user \
  -H "Content-Type: application/json"

Response Example

HTTP/1.1 200 OK
{
  "user": {
    "id": 1,
    "name": "surisurikun",
    "displayName": "忍者スリスリくん",
    "avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
    "profile": {
      "url": "https://suzuri.jp/",
      "body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
      "headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
    },
    "identities": [
      {
        "id": 1,
        "provider": "twitter",
        "uid": 1181557592,
        "nickname": "surisurikun",
        "url": "https://twitter.com/surisurikun"
      }
    ],
    "official": true
  }
}