Stripe Assistant

Stripe Assistant · GPT 작업

Stripe Payment API

  • POST /chargesCreate a new charge
  • GET /charges/{charge_id}Retrieve a specific charge
원본 API 스키마
{
  "openapi": "3.0.0",
  "info": {
    "title": "Stripe Payment API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.stripe.com/v1"
    }
  ],
  "paths": {
    "/charges": {
      "post": {
        "operationId": "createCharge",
        "summary": "Create a new charge",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "Amount to be charged"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency in which the charge is made"
                  },
                  "customer": {
                    "type": "string",
                    "description": "The ID of the customer to be charged"
                  },
                  "source": {
                    "type": "string",
                    "description": "Source identifier, e.g., a token representing card details"
                  },
                  "description": {
                    "type": "string",
                    "description": "Charge description"
                  }
                },
                "required": [
                  "amount",
                  "currency",
                  "source"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Charge successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                }
              }
            }
          }
        },
        "security": [
          {
            "StripeOAuth2": []
          }
        ]
      }
    },
    "/charges/{charge_id}": {
      "get": {
        "operationId": "getCharge",
        "summary": "Retrieve a specific charge",
        "parameters": [
          {
            "name": "charge_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Unique identifier for the charge"
          }
        ],
        "responses": {
          "200": {
            "description": "Details of the charge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                }
              }
            }
          }
        },
        "security": [
          {
            "StripeOAuth2": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Charge": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the charge"
          },
          "amount": {
            "type": "integer",
            "description": "Amount charged"
          },
          "currency": {
            "type": "string",
            "description": "Currency of the charge"
          },
          "description": {
            "type": "string",
            "description": "Description of the charge"
          }
        }
      }
    },
    "securitySchemes": {
      "StripeOAuth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://connect.stripe.com/oauth/authorize",
            "tokenUrl": "https://connect.stripe.com/oauth/token",
            "scopes": {
              "read_write": "Full read/write access"
            }
          }
        }
      }
    }
  }
}