{
  "openapi": "3.0.3",
  "info": {
    "title": "sondahub Stripe sandbox",
    "version": "0.6.1",
    "description": "An independent imitation of Stripe’s API for testing, run by sondahub — not affiliated with or endorsed by Stripe, Inc. No money moves and no Stripe account is involved.\n\nAuth: Bearer with any Stripe test key — sk_test_sondahub works. Bodies are form-encoded with brackets, as Stripe takes them (JSON is taken too).\n\nThe example ids come from the seed account, so each request works on its own. Writes live in the X-Sondahub-Session token each answer carries: send the newest one back as a header and the next request sees what you made; without it every request starts from the seed account.\n\nStripe’s test cards and pm_card_… ids decline, ask for 3D Secure or succeed as Stripe documents them. More at https://sondahub.com/sandboxes/stripe/",
    "contact": {
      "name": "sondahub",
      "url": "https://sondahub.com/sandboxes/stripe/"
    }
  },
  "externalDocs": {
    "description": "The sandbox, in full",
    "url": "https://sondahub.com/sandboxes/stripe/"
  },
  "servers": [
    {
      "url": "https://api.sondahub.com"
    }
  ],
  "security": [
    {
      "stripeKey": []
    }
  ],
  "tags": [
    {
      "name": "Customers",
      "description": "Customers and the cards saved on them."
    },
    {
      "name": "PaymentMethods",
      "description": "Cards, made from Stripe’s published test card numbers."
    },
    {
      "name": "PaymentIntents",
      "description": "Payments: create, confirm (test cards decline or ask for 3D Secure as Stripe documents), capture, cancel."
    },
    {
      "name": "Charges",
      "description": "The charge each payment attempt makes."
    },
    {
      "name": "Refunds",
      "description": "Whole or partial refunds of a payment."
    },
    {
      "name": "Products",
      "description": "The catalogue."
    },
    {
      "name": "Prices",
      "description": "One-time and recurring prices of the products."
    },
    {
      "name": "Checkout",
      "description": "Checkout Sessions with a hosted test payment page."
    },
    {
      "name": "Events",
      "description": "What your calls caused, newest first: the last 30 of your session."
    },
    {
      "name": "WebhookEndpoints",
      "description": "Where events are sent, signed with Stripe-Signature and the endpoint’s whsec_ secret."
    },
    {
      "name": "Balance",
      "description": "The account’s balance."
    }
  ],
  "paths": {
    "/v1/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "operationId": "ListCustomers",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only the customers with this email.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a customer",
        "operationId": "CreateCustomer",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email.",
                    "example": "ada@example.com"
                  },
                  "name": {
                    "type": "string",
                    "description": "Full name.",
                    "example": "Ada Lovelace"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone."
                  },
                  "description": {
                    "type": "string",
                    "description": "A note."
                  },
                  "payment_method": {
                    "type": "string",
                    "description": "A PaymentMethod to attach, e.g. pm_card_visa."
                  },
                  "address[city]": {
                    "type": "string",
                    "description": "Address: line1, line2, city, state, postal_code, country."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "email": "ada@example.com",
                  "name": "Ada Lovelace",
                  "metadata[crm_id]": "C-1001"
                }
              },
              "example": {
                "email": "ada@example.com",
                "name": "Ada Lovelace",
                "metadata[crm_id]": "C-1001"
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customer}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Retrieve a customer",
        "operationId": "GetCustomer",
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "A customer id.",
            "schema": {
              "type": "string"
            },
            "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "operationId": "UpdateCustomer",
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "A customer id.",
            "schema": {
              "type": "string"
            },
            "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Full name.",
                    "example": "Ada King"
                  },
                  "email": {
                    "type": "string",
                    "description": "Email."
                  },
                  "description": {
                    "type": "string",
                    "description": "A note."
                  },
                  "invoice_settings[default_payment_method]": {
                    "type": "string",
                    "description": "One of the customer’s PaymentMethods."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "name": "Ada King"
                }
              },
              "example": {
                "name": "Ada King"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "operationId": "DeleteCustomer",
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "A customer id.",
            "schema": {
              "type": "string"
            },
            "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/customers/{customer}/payment_methods": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List a customer’s payment methods",
        "operationId": "ListCustomerPaymentMethods",
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "A customer id.",
            "schema": {
              "type": "string"
            },
            "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "card",
            "schema": {
              "type": "string"
            },
            "example": "card"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/payment_methods": {
      "post": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "Create a payment method from a test card",
        "operationId": "CreatePaymentMethod",
        "description": "Only Stripe’s test card numbers are taken; a real card number is refused.",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "card",
                    "example": "card"
                  },
                  "card[number]": {
                    "type": "string",
                    "description": "A Stripe test card number.",
                    "example": "4242424242424242"
                  },
                  "card[exp_month]": {
                    "type": "integer",
                    "description": "Expiry month.",
                    "example": 12
                  },
                  "card[exp_year]": {
                    "type": "integer",
                    "description": "Expiry year.",
                    "example": 2030
                  },
                  "card[cvc]": {
                    "type": "string",
                    "description": "Any three digits.",
                    "example": "123"
                  },
                  "billing_details[name]": {
                    "type": "string",
                    "description": "Cardholder name."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "type"
                ],
                "example": {
                  "type": "card",
                  "card[number]": "4242424242424242",
                  "card[exp_month]": 12,
                  "card[exp_year]": 2030,
                  "card[cvc]": "123"
                }
              },
              "example": {
                "type": "card",
                "card[number]": "4242424242424242",
                "card[exp_month]": 12,
                "card[exp_year]": 2030,
                "card[cvc]": "123"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "List payment methods",
        "operationId": "ListPaymentMethods",
        "parameters": [
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "The customer’s.",
            "schema": {
              "type": "string"
            },
            "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "card",
            "schema": {
              "type": "string"
            },
            "example": "card"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/payment_methods/{payment_method}": {
      "get": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "Retrieve a payment method",
        "operationId": "GetPaymentMethod",
        "parameters": [
          {
            "name": "payment_method",
            "in": "path",
            "required": true,
            "description": "A PaymentMethod id.",
            "schema": {
              "type": "string"
            },
            "example": "pm_1Sh1Kbwe5TepX1BnZqKsSipG"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "Update a payment method",
        "operationId": "UpdatePaymentMethod",
        "parameters": [
          {
            "name": "payment_method",
            "in": "path",
            "required": true,
            "description": "A PaymentMethod id.",
            "schema": {
              "type": "string"
            },
            "example": "pm_1Sh1Kbwe5TepX1BnZqKsSipG"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "billing_details[name]": {
                    "type": "string",
                    "description": "Cardholder name.",
                    "example": "Ada Lovelace"
                  },
                  "card[exp_month]": {
                    "type": "integer",
                    "description": "Expiry month."
                  },
                  "card[exp_year]": {
                    "type": "integer",
                    "description": "Expiry year."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "billing_details[name]": "Ada Lovelace"
                }
              },
              "example": {
                "billing_details[name]": "Ada Lovelace"
              }
            }
          }
        }
      }
    },
    "/v1/payment_methods/{payment_method}/attach": {
      "post": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "Attach to a customer",
        "operationId": "AttachPaymentMethod",
        "description": "A test PaymentMethod id such as pm_card_visa in the path makes a new one and attaches it.",
        "parameters": [
          {
            "name": "payment_method",
            "in": "path",
            "required": true,
            "description": "A PaymentMethod id, or a test id like pm_card_visa.",
            "schema": {
              "type": "string"
            },
            "example": "pm_card_visa"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer": {
                    "type": "string",
                    "description": "The customer.",
                    "example": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
                  }
                },
                "required": [
                  "customer"
                ],
                "example": {
                  "customer": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
                }
              },
              "example": {
                "customer": "cus_1Sh1Kbwe5IqbUu2HEaPunt5R"
              }
            }
          }
        }
      }
    },
    "/v1/payment_methods/{payment_method}/detach": {
      "post": {
        "tags": [
          "PaymentMethods"
        ],
        "summary": "Detach from its customer",
        "operationId": "DetachPaymentMethod",
        "parameters": [
          {
            "name": "payment_method",
            "in": "path",
            "required": true,
            "description": "A PaymentMethod id.",
            "schema": {
              "type": "string"
            },
            "example": "pm_1Sh1Kbwe5TepX1BnZqKsSipG"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/payment_intents": {
      "get": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "List payments",
        "operationId": "ListPaymentIntents",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Only this customer’s.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Create a payment",
        "operationId": "CreatePaymentIntent",
        "description": "With confirm=true and a test card it succeeds, declines (402 card_error), or stops at requires_action for 3D Secure.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repeat a create safely: the same key answers the same result.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "In the smallest unit (cents).",
                    "example": 2000
                  },
                  "currency": {
                    "type": "string",
                    "description": "Three-letter code.",
                    "example": "usd"
                  },
                  "customer": {
                    "type": "string",
                    "description": "A customer id."
                  },
                  "payment_method": {
                    "type": "string",
                    "description": "A PaymentMethod id or a test id: pm_card_visa, pm_card_visa_chargeDeclinedInsufficientFunds, pm_card_authenticationRequired…",
                    "example": "pm_card_visa"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Confirm at once.",
                    "example": true
                  },
                  "capture_method": {
                    "type": "string",
                    "description": "automatic, automatic_async or manual."
                  },
                  "description": {
                    "type": "string",
                    "description": "A note."
                  },
                  "receipt_email": {
                    "type": "string",
                    "description": "Email for the receipt."
                  },
                  "return_url": {
                    "type": "string",
                    "description": "Where 3D Secure sends the browser back."
                  },
                  "off_session": {
                    "type": "boolean",
                    "description": "The customer is not there: a card that needs 3D Secure declines with authentication_required."
                  },
                  "setup_future_usage": {
                    "type": "string",
                    "description": "on_session or off_session."
                  },
                  "automatic_payment_methods[enabled]": {
                    "type": "boolean",
                    "description": "Let the sandbox pick card."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "amount",
                  "currency"
                ],
                "example": {
                  "amount": 2000,
                  "currency": "usd",
                  "payment_method": "pm_card_visa",
                  "confirm": true
                }
              },
              "example": {
                "amount": 2000,
                "currency": "usd",
                "payment_method": "pm_card_visa",
                "confirm": true
              }
            }
          }
        }
      }
    },
    "/v1/payment_intents/{intent}": {
      "get": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Retrieve a payment",
        "operationId": "GetPaymentIntent",
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "description": "A PaymentIntent id.",
            "schema": {
              "type": "string"
            },
            "example": "pi_1Sh1Kbwe5lqI1XPwHWwqG0O8"
          },
          {
            "name": "expand[]",
            "in": "query",
            "required": false,
            "description": "Expand a field into its object: latest_charge, customer, payment_method.",
            "schema": {
              "type": "string"
            },
            "example": "latest_charge"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Update a payment",
        "operationId": "UpdatePaymentIntent",
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "description": "A PaymentIntent id.",
            "schema": {
              "type": "string"
            },
            "example": "pi_1ShfIyK2VNekpeY1ZregMVWl"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "integer",
                    "description": "New amount (before it is paid)."
                  },
                  "description": {
                    "type": "string",
                    "description": "A note.",
                    "example": "Updated from the API"
                  },
                  "payment_method": {
                    "type": "string",
                    "description": "Another card."
                  },
                  "receipt_email": {
                    "type": "string",
                    "description": "Email for the receipt."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "description": "Updated from the API"
                }
              },
              "example": {
                "description": "Updated from the API"
              }
            }
          }
        }
      }
    },
    "/v1/payment_intents/{intent}/confirm": {
      "post": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Confirm a payment",
        "operationId": "ConfirmPaymentIntent",
        "description": "The example is a declined payment from the seed, retried with a good card. After 3D Secure, confirm again with no card to finish.",
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "description": "A PaymentIntent id.",
            "schema": {
              "type": "string"
            },
            "example": "pi_1ShfIyK2VNekpeY1ZregMVWl"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "payment_method": {
                    "type": "string",
                    "description": "A PaymentMethod id or test id.",
                    "example": "pm_card_visa"
                  },
                  "return_url": {
                    "type": "string",
                    "description": "Where 3D Secure sends the browser back."
                  },
                  "off_session": {
                    "type": "boolean",
                    "description": "The customer is not there."
                  }
                },
                "example": {
                  "payment_method": "pm_card_visa"
                }
              },
              "example": {
                "payment_method": "pm_card_visa"
              }
            }
          }
        }
      }
    },
    "/v1/payment_intents/{intent}/capture": {
      "post": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Capture a held payment",
        "operationId": "CapturePaymentIntent",
        "description": "For capture_method=manual; capture all or part of it, the rest is released.",
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "description": "A PaymentIntent in requires_capture.",
            "schema": {
              "type": "string"
            },
            "example": "pi_1ShodFwZ49NFBXBj02cnkofj"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount_to_capture": {
                    "type": "integer",
                    "description": "Up to the amount held; default all of it."
                  }
                },
                "example": {}
              },
              "example": {}
            }
          }
        }
      }
    },
    "/v1/payment_intents/{intent}/cancel": {
      "post": {
        "tags": [
          "PaymentIntents"
        ],
        "summary": "Cancel a payment",
        "operationId": "CancelPaymentIntent",
        "parameters": [
          {
            "name": "intent",
            "in": "path",
            "required": true,
            "description": "A PaymentIntent id.",
            "schema": {
              "type": "string"
            },
            "example": "pi_1ShgdaGgaFe69S2tRSxM7mLR"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "cancellation_reason": {
                    "type": "string",
                    "description": "duplicate, fraudulent, requested_by_customer or abandoned.",
                    "example": "abandoned"
                  }
                },
                "example": {
                  "cancellation_reason": "abandoned"
                }
              },
              "example": {
                "cancellation_reason": "abandoned"
              }
            }
          }
        }
      }
    },
    "/v1/charges": {
      "get": {
        "tags": [
          "Charges"
        ],
        "summary": "List charges",
        "operationId": "ListCharges",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Only this customer’s.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_intent",
            "in": "query",
            "required": false,
            "description": "Only this payment’s.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/charges/{charge}": {
      "get": {
        "tags": [
          "Charges"
        ],
        "summary": "Retrieve a charge",
        "operationId": "GetCharge",
        "parameters": [
          {
            "name": "charge",
            "in": "path",
            "required": true,
            "description": "A charge id.",
            "schema": {
              "type": "string"
            },
            "example": "ch_1Sh1Kbwe5DpCWGq7Z721mgWQ"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Charges"
        ],
        "summary": "Update a charge",
        "operationId": "UpdateCharge",
        "parameters": [
          {
            "name": "charge",
            "in": "path",
            "required": true,
            "description": "A charge id.",
            "schema": {
              "type": "string"
            },
            "example": "ch_1Sh1Kbwe5DpCWGq7Z721mgWQ"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "description": "A note.",
                    "example": "Checked by support"
                  },
                  "receipt_email": {
                    "type": "string",
                    "description": "Email for the receipt."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "description": "Checked by support"
                }
              },
              "example": {
                "description": "Checked by support"
              }
            }
          }
        }
      }
    },
    "/v1/refunds": {
      "get": {
        "tags": [
          "Refunds"
        ],
        "summary": "List refunds",
        "operationId": "ListRefunds",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_intent",
            "in": "query",
            "required": false,
            "description": "Only this payment’s.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "charge",
            "in": "query",
            "required": false,
            "description": "Only this charge’s.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Refunds"
        ],
        "summary": "Refund a payment",
        "operationId": "CreateRefund",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Repeat a refund safely.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "payment_intent": {
                    "type": "string",
                    "description": "The payment to refund.",
                    "example": "pi_1Sh1Kbwe5lqI1XPwHWwqG0O8"
                  },
                  "charge": {
                    "type": "string",
                    "description": "Or the charge."
                  },
                  "amount": {
                    "type": "integer",
                    "description": "Part of it; default what is left.",
                    "example": 500
                  },
                  "reason": {
                    "type": "string",
                    "description": "duplicate, fraudulent or requested_by_customer."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "payment_intent": "pi_1Sh1Kbwe5lqI1XPwHWwqG0O8",
                  "amount": 500
                }
              },
              "example": {
                "payment_intent": "pi_1Sh1Kbwe5lqI1XPwHWwqG0O8",
                "amount": 500
              }
            }
          }
        }
      }
    },
    "/v1/refunds/{refund}": {
      "get": {
        "tags": [
          "Refunds"
        ],
        "summary": "Retrieve a refund",
        "operationId": "GetRefund",
        "parameters": [
          {
            "name": "refund",
            "in": "path",
            "required": true,
            "description": "A refund id.",
            "schema": {
              "type": "string"
            },
            "example": "re_1Sh1Kbwe5NMqPzm4UbtekXYg"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Refunds"
        ],
        "summary": "Update a refund",
        "operationId": "UpdateRefund",
        "parameters": [
          {
            "name": "refund",
            "in": "path",
            "required": true,
            "description": "A refund id.",
            "schema": {
              "type": "string"
            },
            "example": "re_1Sh1Kbwe5NMqPzm4UbtekXYg"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "metadata[ticket]": "T-42"
                }
              },
              "example": {
                "metadata[ticket]": "T-42"
              }
            }
          }
        }
      }
    },
    "/v1/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List products",
        "operationId": "ListProducts",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true or false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create a product",
        "operationId": "CreateProduct",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name.",
                    "example": "Sandbox socks"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description."
                  },
                  "active": {
                    "type": "boolean",
                    "description": "On sale."
                  },
                  "default_price_data[currency]": {
                    "type": "string",
                    "description": "Make its price too: currency…",
                    "example": "usd"
                  },
                  "default_price_data[unit_amount]": {
                    "type": "integer",
                    "description": "…and amount.",
                    "example": 1200
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "name"
                ],
                "example": {
                  "name": "Sandbox socks",
                  "default_price_data[currency]": "usd",
                  "default_price_data[unit_amount]": 1200
                }
              },
              "example": {
                "name": "Sandbox socks",
                "default_price_data[currency]": "usd",
                "default_price_data[unit_amount]": 1200
              }
            }
          }
        }
      }
    },
    "/v1/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Retrieve a product",
        "operationId": "GetProduct",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A product id.",
            "schema": {
              "type": "string"
            },
            "example": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Update a product",
        "operationId": "UpdateProduct",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A product id.",
            "schema": {
              "type": "string"
            },
            "example": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description.",
                    "example": "Now in more colours"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "On sale."
                  },
                  "default_price": {
                    "type": "string",
                    "description": "One of its prices."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "description": "Now in more colours"
                }
              },
              "example": {
                "description": "Now in more colours"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete a product",
        "operationId": "DeleteProduct",
        "description": "Refused while the product has prices, as Stripe refuses it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "A product id.",
            "schema": {
              "type": "string"
            },
            "example": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/prices": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "List prices",
        "operationId": "ListPrices",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "description": "Only this product’s.",
            "schema": {
              "type": "string"
            },
            "example": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO"
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true or false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "one_time or recurring.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lookup_keys[]",
            "in": "query",
            "required": false,
            "description": "Only these lookup keys.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Create a price",
        "operationId": "CreatePrice",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "product": {
                    "type": "string",
                    "description": "The product.",
                    "example": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Three-letter code.",
                    "example": "usd"
                  },
                  "unit_amount": {
                    "type": "integer",
                    "description": "In cents.",
                    "example": 1500
                  },
                  "recurring[interval]": {
                    "type": "string",
                    "description": "day, week, month or year — for a recurring price."
                  },
                  "lookup_key": {
                    "type": "string",
                    "description": "Your own key for it."
                  },
                  "nickname": {
                    "type": "string",
                    "description": "A label."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "currency"
                ],
                "example": {
                  "product": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO",
                  "currency": "usd",
                  "unit_amount": 1500
                }
              },
              "example": {
                "product": "prod_1Sh1Kbwe5wCxMfW87U7fdWYO",
                "currency": "usd",
                "unit_amount": 1500
              }
            }
          }
        }
      }
    },
    "/v1/prices/{price}": {
      "get": {
        "tags": [
          "Prices"
        ],
        "summary": "Retrieve a price",
        "operationId": "GetPrice",
        "parameters": [
          {
            "name": "price",
            "in": "path",
            "required": true,
            "description": "A price id.",
            "schema": {
              "type": "string"
            },
            "example": "price_1Sh1Kbwe5cZsvNVgnpz0XLLe"
          },
          {
            "name": "expand[]",
            "in": "query",
            "required": false,
            "description": "product to expand it.",
            "schema": {
              "type": "string"
            },
            "example": "product"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Prices"
        ],
        "summary": "Update a price",
        "operationId": "UpdatePrice",
        "parameters": [
          {
            "name": "price",
            "in": "path",
            "required": true,
            "description": "A price id.",
            "schema": {
              "type": "string"
            },
            "example": "price_1Sh1Kbwe5cZsvNVgnpz0XLLe"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "On sale."
                  },
                  "nickname": {
                    "type": "string",
                    "description": "A label.",
                    "example": "Launch price"
                  },
                  "lookup_key": {
                    "type": "string",
                    "description": "Your own key for it."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "example": {
                  "nickname": "Launch price"
                }
              },
              "example": {
                "nickname": "Launch price"
              }
            }
          }
        }
      }
    },
    "/v1/checkout/sessions": {
      "get": {
        "tags": [
          "Checkout"
        ],
        "summary": "List Checkout Sessions",
        "operationId": "ListCheckoutSessions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open, complete or expired.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Only this customer’s.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "Checkout"
        ],
        "summary": "Create a Checkout Session",
        "operationId": "CreateCheckoutSession",
        "description": "The answer’s url opens a test payment page on sondahub; paying sends the webhooks and returns the browser to success_url.",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "payment.",
                    "example": "payment"
                  },
                  "line_items[0][price]": {
                    "type": "string",
                    "description": "A one-time price…",
                    "example": "price_1Sh6f3jEPI4ITgTMjX9qXCkR"
                  },
                  "line_items[0][quantity]": {
                    "type": "integer",
                    "description": "…and how many; more lines as line_items[1][…].",
                    "example": 2
                  },
                  "success_url": {
                    "type": "string",
                    "description": "Where paying returns; {CHECKOUT_SESSION_ID} is filled in.",
                    "example": "https://example.com/ok?session_id={CHECKOUT_SESSION_ID}"
                  },
                  "cancel_url": {
                    "type": "string",
                    "description": "Where “back” goes.",
                    "example": "https://example.com/cancel"
                  },
                  "customer_email": {
                    "type": "string",
                    "description": "Prefill the email."
                  },
                  "customer": {
                    "type": "string",
                    "description": "Or a customer id."
                  },
                  "client_reference_id": {
                    "type": "string",
                    "description": "Your own reference."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "mode",
                  "success_url"
                ],
                "example": {
                  "mode": "payment",
                  "line_items[0][price]": "price_1Sh6f3jEPI4ITgTMjX9qXCkR",
                  "line_items[0][quantity]": 2,
                  "success_url": "https://example.com/ok?session_id={CHECKOUT_SESSION_ID}",
                  "cancel_url": "https://example.com/cancel"
                }
              },
              "example": {
                "mode": "payment",
                "line_items[0][price]": "price_1Sh6f3jEPI4ITgTMjX9qXCkR",
                "line_items[0][quantity]": 2,
                "success_url": "https://example.com/ok?session_id={CHECKOUT_SESSION_ID}",
                "cancel_url": "https://example.com/cancel"
              }
            }
          }
        }
      }
    },
    "/v1/checkout/sessions/{session}": {
      "get": {
        "tags": [
          "Checkout"
        ],
        "summary": "Retrieve a Checkout Session",
        "operationId": "GetCheckoutSession",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "A Checkout Session id (create one first).",
            "schema": {
              "type": "string"
            },
            "example": "cs_test_1Sh1Kbwe5GQqxKnshlzDSKFD"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/checkout/sessions/{session}/line_items": {
      "get": {
        "tags": [
          "Checkout"
        ],
        "summary": "A session’s line items",
        "operationId": "ListCheckoutSessionLineItems",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "A Checkout Session id.",
            "schema": {
              "type": "string"
            },
            "example": "cs_test_1Sh1Kbwe5GQqxKnshlzDSKFD"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/checkout/sessions/{session}/expire": {
      "post": {
        "tags": [
          "Checkout"
        ],
        "summary": "Expire a Checkout Session",
        "operationId": "ExpireCheckoutSession",
        "parameters": [
          {
            "name": "session",
            "in": "path",
            "required": true,
            "description": "An open Checkout Session id.",
            "schema": {
              "type": "string"
            },
            "example": "cs_test_1Sh1Kbwe5GQqxKnshlzDSKFD"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List events",
        "operationId": "ListEvents",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only this type, e.g. payment_intent.succeeded.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "types[]",
            "in": "query",
            "required": false,
            "description": "Only these types.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Retrieve an event",
        "operationId": "GetEvent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "An event id from the list.",
            "schema": {
              "type": "string"
            },
            "example": "evt_1Sh1Kbwe5CJ2mpnmRfKhi8RW"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/webhook_endpoints": {
      "get": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "List webhook endpoints",
        "operationId": "ListWebhookEndpoints",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many, 1–100 (default 10).",
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "An id from the previous page: the page after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "required": false,
            "description": "An id: the page before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Create a webhook endpoint",
        "operationId": "CreateWebhookEndpoint",
        "description": "The answer holds the whsec_ secret, once. enabled_events takes exact event types, or * for every event.",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Your receiver.",
                    "example": "https://your-app.example/stripe/webhooks"
                  },
                  "enabled_events[0]": {
                    "type": "string",
                    "description": "An event type; more as enabled_events[1]…",
                    "example": "payment_intent.succeeded"
                  },
                  "enabled_events[1]": {
                    "type": "string",
                    "description": "Another.",
                    "example": "charge.refunded"
                  },
                  "description": {
                    "type": "string",
                    "description": "A note."
                  },
                  "metadata[order_id]": {
                    "type": "string",
                    "description": "Metadata: any metadata[key]=value pairs; an empty value removes the key.",
                    "example": "6735"
                  }
                },
                "required": [
                  "url",
                  "enabled_events[0]"
                ],
                "example": {
                  "url": "https://your-app.example/stripe/webhooks",
                  "enabled_events[0]": "payment_intent.succeeded",
                  "enabled_events[1]": "charge.refunded"
                }
              },
              "example": {
                "url": "https://your-app.example/stripe/webhooks",
                "enabled_events[0]": "payment_intent.succeeded",
                "enabled_events[1]": "charge.refunded"
              }
            }
          }
        }
      }
    },
    "/v1/webhook_endpoints/{webhook_endpoint}": {
      "get": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Retrieve a webhook endpoint",
        "operationId": "GetWebhookEndpoint",
        "parameters": [
          {
            "name": "webhook_endpoint",
            "in": "path",
            "required": true,
            "description": "A webhook endpoint id (create one first).",
            "schema": {
              "type": "string"
            },
            "example": "we_1Sh1Kbwe5CCOYBBjTveHBoTA"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      },
      "post": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Update a webhook endpoint",
        "operationId": "UpdateWebhookEndpoint",
        "parameters": [
          {
            "name": "webhook_endpoint",
            "in": "path",
            "required": true,
            "description": "A webhook endpoint id.",
            "schema": {
              "type": "string"
            },
            "example": "we_1Sh1Kbwe5CCOYBBjTveHBoTA"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Your receiver."
                  },
                  "enabled_events[0]": {
                    "type": "string",
                    "description": "Event types."
                  },
                  "disabled": {
                    "type": "boolean",
                    "description": "Stop sending.",
                    "example": true
                  },
                  "description": {
                    "type": "string",
                    "description": "A note."
                  }
                },
                "example": {
                  "disabled": true
                }
              },
              "example": {
                "disabled": true
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Delete a webhook endpoint",
        "operationId": "DeleteWebhookEndpoint",
        "parameters": [
          {
            "name": "webhook_endpoint",
            "in": "path",
            "required": true,
            "description": "A webhook endpoint id.",
            "schema": {
              "type": "string"
            },
            "example": "we_1Sh1Kbwe5CCOYBBjTveHBoTA"
          }
        ],
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        }
      }
    },
    "/v1/balance": {
      "get": {
        "tags": [
          "Balance"
        ],
        "summary": "Retrieve the balance",
        "operationId": "GetBalance",
        "responses": {
          "200": {
            "description": "The object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "stripeKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Any Stripe test secret key: sk_test_sondahub works. A live key is refused."
      }
    },
    "responses": {
      "E400": {
        "description": "invalid_request_error: a parameter is missing, unknown or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "decline_code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "doc_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "E401": {
        "description": "No key, or not a test key.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "decline_code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "doc_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "E402": {
        "description": "card_error: the test card declined; code, decline_code and the PaymentIntent are inside.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "decline_code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "doc_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "E404": {
        "description": "resource_missing, or a path the sandbox does not model.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "decline_code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "param": {
                      "type": "string"
                    },
                    "doc_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}