スターバックス注文API仕様書

概要

本記事はperplexityで作成しました。

このAPIは、スターバックスでの注文プロセスをシミュレートします。

エンドポイント

POST /order

リクエストボディ

{
  "size": string,
  "temperature": string,
  "drinkName": string,
  "customizations": [
    {
      "type": string,
      "value": string
    }
  ]
}

パラメータ

パラメータ必須説明
sizestringはいドリンクのサイズ(”Short”, “Tall”, “Grande”, “Venti”)
temperaturestringはい温度(”Hot”, “Iced”)
drinkNamestringはい注文するドリンク名
customizationsarrayいいえカスタマイズの配列

カスタマイズオプション

タイプ説明
milkstringミルクの種類(”Soy”, “Almond”, “Oats”など)
syrupstringシロップの種類(”Vanilla”, “Caramel”など)
shotnumberエスプレッソショットの追加数
whipbooleanホイップクリームの有無

レスポンス

成功時のレスポンス (200 OK)

{
  "orderId": string,
  "status": "success",
  "message": "注文が完了しました"
}

エラーレスポンス (400 Bad Request)

{
  "status": "error",
  "message": "無効なリクエストです"
}

使用例

リクエスト

{
  "size": "Tall",
  "temperature": "Hot",
  "drinkName": "スターバックスラテ",
  "customizations": [
    {
      "type": "milk",
      "value": "Soy"
    },
    {
      "type": "shot",
      "value": 1
    },
    {
      "type": "whip",
      "value": true
    }
  ]
}

レスポンス

{
  "orderId": "SB12345",
  "status": "success",
  "message": "トールサイズのホットスターバックスラテ(豆乳変更、エスプレッソショット追加、ホイップクリーム追加)の注文が完了しました"
}

注意事項

  • カスタマイズによっては追加料金が発生する場合があります。
  • 一部のカスタマイズは特定のドリンクでのみ利用可能です。
  • 店舗の状況により、一部のカスタマイズが利用できない場合があります。

Citations:
[1] https://sqripts.com/2022/08/25/20386/
[2] https://coffee-labo.co.jp/starbucks-custom
[3] https://www.watch.impress.co.jp/docs/topic/1558436.html
[4] https://coffee-labo.co.jp/starbucks-paid-customization
[5] https://www.kunimiya.info/notes/starbucks-and-webapi/
[6] https://giftee.zendesk.com/hc/ja/articles/13643598052249-%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%90%E3%83%83%E3%82%AF%E3%82%B9%E3%82%AE%E3%83%95%E3%83%88%E3%81%AE%E8%B3%BC%E5%85%A5%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6
[7] https://connpass.com/event/154561/