{
  "openapi": "3.0.3",
  "info": {
    "title": "Payment API",
    "version": "3.0",
    "contact": {
      "email": "admin@vsee.com"
    },
    "description": "\n\nPayment is integrated with Stripe. Use `GET /billing/settings` to retrieve the Stripe publishable key, then use Stripe.js client-side to tokenize card details before sending to VSee.\n\nPayment sources are scoped by `room_code` and optionally `provider_id`."
  },
  "servers": [
    {
      "url": "https://api.vseepreview.com/api_v3",
      "description": "Staging"
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "javascript",
      "java"
    ]
  },
  "paths": {
    "/billing/settings": {
      "get": {
        "summary": "Get payment settings",
        "description": "Retrieve payment settings for the account",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "stripe": {
                          "type": "object",
                          "properties": {
                            "publishable_key": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "value": {
                      "data": {
                        "stripe": {
                          "publishable_key": "2342342"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/billing/sources": {
      "get": {
        "summary": "List payment sources",
        "description": "Retrieve all payment sources from user account",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Payment type (e.g. 'card')",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "card"
          },
          {
            "name": "room_code",
            "in": "query",
            "description": "Room code to scope the payment source",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "abc"
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "Provider ID (optional) to scope the payment source",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "12312"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "brand": {
                            "type": "string"
                          },
                          "last4": {
                            "type": "string"
                          },
                          "exp_month": {
                            "type": "integer"
                          },
                          "exp_year": {
                            "type": "integer"
                          },
                          "is_default": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Multiple Cards": {
                    "value": {
                      "data": [
                        {
                          "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
                          "type": "card",
                          "brand": "Visa",
                          "last4": "4242",
                          "exp_month": 8,
                          "exp_year": 2017,
                          "is_default": true
                        },
                        {
                          "id": "card_19DrgXBY2jn2BCqQNpjjzub",
                          "type": "card",
                          "brand": "Visa",
                          "last4": "4242",
                          "exp_month": 8,
                          "exp_year": 2017,
                          "is_default": false
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "post": {
        "summary": "Add payment source",
        "description": "Add a new payment source to user account",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "room_code",
            "in": "query",
            "description": "Room code to scope the payment source",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "abc"
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "Provider ID (optional) to scope the payment source",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "12312"
          }
        ],
        "requestBody": {
          "description": "Payment source details",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Payment type (e.g. 'card')"
                  },
                  "token": {
                    "type": "string",
                    "description": "Token from Stripe"
                  }
                },
                "required": [
                  "type",
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful creation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "brand": {
                          "type": "string"
                        },
                        "last4": {
                          "type": "string"
                        },
                        "exp_month": {
                          "type": "integer"
                        },
                        "exp_year": {
                          "type": "integer"
                        },
                        "is_default": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Card Added": {
                    "value": {
                      "data": {
                        "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
                        "type": "card",
                        "brand": "Visa",
                        "exp_month": 8,
                        "exp_year": 2017,
                        "last4": "4242",
                        "is_default": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/billing/sources/{id}": {
      "get": {
        "summary": "Get payment source",
        "description": "Retrieve a specific payment source",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Payment source ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "card_19DrgXBY2jn2BCqQNpjjzuay"
          },
          {
            "name": "room_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Room code to scope the payment source"
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Provider ID (optional) to scope the payment source"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "brand": {
                          "type": "string"
                        },
                        "last4": {
                          "type": "string"
                        },
                        "exp_month": {
                          "type": "integer"
                        },
                        "exp_year": {
                          "type": "integer"
                        },
                        "is_default": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Card Details": {
                    "value": {
                      "data": {
                        "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
                        "type": "card",
                        "brand": "Visa",
                        "exp_month": 8,
                        "exp_year": 2017,
                        "last4": "4242",
                        "is_default": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "put": {
        "summary": "Set default payment source",
        "description": "Set a payment source as default",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Payment source ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "card_19DrgXBY2jn2BCqQNpjjzuay"
          }
        ],
        "requestBody": {
          "description": "Update default status",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "is_default": {
                    "type": "boolean"
                  },
                  "room_code": {
                    "type": "string"
                  },
                  "provider_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful update",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                },
                "examples": {
                  "Updated": {
                    "value": {
                      "data": {
                        "id": "card_19DrgXBY2jn2BCqQNpjjzuay",
                        "type": "card",
                        "brand": "Visa",
                        "exp_month": 8,
                        "exp_year": 2017,
                        "last4": "4242",
                        "is_default": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "delete": {
        "summary": "Delete payment source",
        "description": "Delete a payment source from user account",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Payment source ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "card_19DrgXBY2jn2BCqQNpjjzuay"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful deletion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array"
                    }
                  }
                },
                "examples": {
                  "Deleted": {
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/billing/invoices/process": {
      "post": {
        "summary": "Process invoice",
        "description": "Process an invoice with optional coupon code\n\nProcess an invoice, optionally applying a promo/coupon code.\n\n**Parameters:**\n- `promo_code` \u2014 Coupon code\n- `intake_id` \u2014 Required \u2014 intake ID to apply the coupon to\n- `create_invoice` \u2014 Set to `1` to create the invoice",
        "tags": [
          "Payment"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "X-AccountCode",
            "in": "header",
            "description": "Account code",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "vclinic"
          }
        ],
        "requestBody": {
          "description": "Invoice processing details",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "promo_code": {
                    "type": "string"
                  },
                  "intake_id": {
                    "type": "string"
                  },
                  "create_invoice": {
                    "type": "integer"
                  }
                },
                "required": [
                  "intake_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string"
                        },
                        "consultation": {
                          "type": "object"
                        },
                        "coupon": {
                          "type": "object"
                        },
                        "amount_due": {
                          "type": "number"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Invoice Processed": {
                    "value": {
                      "data": {
                        "currency": "USD",
                        "consultation": {
                          "description": "30 mins",
                          "amount": 30,
                          "duration": 30,
                          "id": "58244a53-0f28-4ff9-bdbc-7468ac1f0144"
                        },
                        "coupon": {
                          "id": "10_percents_1479363579",
                          "percent_off": 10,
                          "valid": true
                        },
                        "amount_due": 27
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    }
  }
}