公開APIの概要
PASTA公開APIはOpenAPI 3.1準拠のRESTful APIです。すべてのエンドポイントは @hono/zod-openapi で定義されており、スキーマとドキュメントは常に同期されています。
APIリファレンス
Section titled “APIリファレンス”インタラクティブなAPIリファレンス(Redoc形式)は以下のURLで公開されています:
- 本番環境:https://api.passes.me/redoc
- OpenAPIスキーマ:https://api.passes.me/openapi.json
Swagger UIも利用できます:https://api.passes.me/docs
主要エンドポイント
Section titled “主要エンドポイント”POST /v1/passesX-Api-Key: pasta_xxxx...Content-Type: application/json
{ "template_id": "019xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "holder_name": "山田 太郎", "fields": { "event_name": "夏フェス2026", "seat": "A-001" }}レスポンスには pass_id と各配布形態のURLが含まれます。
Apple Wallet 用パスのダウンロード
Section titled “Apple Wallet 用パスのダウンロード”GET /v1/passes/{pass_id}/apple.pkpass バンドルが返されます。保有者のiPhoneでこのURLを開くと直接ウォレットアプリに追加されます。
Google Wallet リンクの取得
Section titled “Google Wallet リンクの取得”GET /v1/passes/{pass_id}/google「Save to Google Wallet」リンクのURLが返されます。
QRペイロードの取得
Section titled “QRペイロードの取得”GET /v1/passes/{pass_id}/qrJWS形式の署名済みQRペイロードが返されます。紙チケットの印字や独自配布に使用できます。
パスの検証・償却
Section titled “パスの検証・償却”POST /v1/validateX-Api-Key: pasta_xxxx...Content-Type: application/json
{ "qr": "eyJhbGciOiJFUzI1NiJ9..."}レスポンス status | 意味 |
|---|---|
redeemed | 正常に償却(入場承認) |
already_redeemed | すでに償却済み(二重入場) |
invalid | 無効なパス(署名不正・期限切れ・取消済みなど) |
POST /v1/passes/{pass_id}/revokeX-Api-Key: pasta_xxxx...償却ログの取得
Section titled “償却ログの取得”GET /v1/redemptionsX-Api-Key: pasta_xxxx...エラーレスポンス
Section titled “エラーレスポンス”すべてのエラーは統一フォーマットで返されます:
{ "error": { "code": "pass_not_found", "message": "指定されたパスが見つかりません" }}HTTPステータスコードと error.code を組み合わせてエラーハンドリングを実装してください。
APIリクエストにはレート制限が適用されます。制限値は本番環境とAPIキーのスコープによって異なります。詳細は https://api.passes.me/redoc を参照してください。