openapi: 3.0.3 info: version: "1.0" title: isu payment gateway servers: - url: "http://localhost:12345/" description: api paths: /payments: post: summary: 決済を行う description: "" operationId: post-payment parameters: # 現状のdraft的にはIdempotency-Keyを要求するエンドポイントでは、このヘッダーが送られてこなかったら400を返すことになっている # しかし、このエンドポイントではそうではなく、通常通り処理をすることにしている - in: header name: Idempotency-Key schema: type: string description: https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/ を参照してください。 - in: header name: Authorization schema: type: string description: "'Bearer ${token}' という形式で、認証トークンを指定してください。" requestBody: content: application/json: schema: type: object properties: amount: type: integer description: 決済額 required: - amount responses: "204": description: 決済を完了した "400": description: 決済トークンが存在しない、不正な決済額など content: application/json: schema: $ref: "#/components/schemas/Error" "409": description: 同じkeyでの決済が実行中である content: application/json: schema: $ref: "#/components/schemas/Error" "422": description: keyの有効期限が切れているなど content: application/json: schema: $ref: "#/components/schemas/Error" get: summary: 決済の状態を取得する description: "" operationId: get-payments parameters: - in: header name: Authorization schema: type: string description: "'Bearer ${token}' という形式で、認証トークンを指定してください。" responses: "200": description: 指定した認証トークンに紐づく決済のリストを返す content: application/json: schema: type: array items: type: object properties: amount: type: integer description: 決済額 status: type: string description: 決済の状態 required: - amount - status "400": description: 決済トークンが存在しないなど content: application/json: schema: $ref: "#/components/schemas/Error" components: schemas: Error: type: object title: Error properties: message: type: string required: - message