# Upgrade Starter to Growth

`POST /api/billing/upgrade`

Browser session only, signed-in account owner. No body. Origin must exactly match the configured application origin. Growth applies after confirmation. The prorated difference is included on the next invoice. Usage does not reset. Resolve outstanding payments or scheduled changes first.

Send API requests to your Wildmail application origin. The documentation host does not serve API requests.

## Authentication

- session: Send the credential in the cookie named `better-auth.session_token`. Browser session cookie used by the hosted app. It may use the __Secure- cookie prefix. Use the auth client to manage cookies.

Audience: session.

## Responses

### 200

Success

Content type: `application/json`.

Schema:

```json
{
  "type": "object",
  "properties": {
    "billing": {
      "$ref": "#/components/schemas/Billing"
    }
  },
  "required": [
    "billing"
  ]
}
```

### 401

Missing, invalid or revoked credentials.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 403

Required scope or account access missing.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 404

account missing.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 409

Subscription cannot be changed or has a conflicting operation.

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 429



### 503

Billing/provider unavailable. Shared request limiting can also return 503 rate_limit_unavailable with Cache-Control: no-store.

Headers:

```json
{
  "Cache-Control": {
    "description": "Request limiter responses use no-store.",
    "schema": {
      "type": "string"
    }
  }
}
```

Content type: `application/json`.

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

## Referenced schemas

References resolve against the [OpenAPI specification](/openapi.json).

### #/components/schemas/Billing

```json
{
  "type": "object",
  "properties": {
    "plan": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "hasCustomer": {
      "type": "boolean"
    },
    "hasSubscription": {
      "type": "boolean"
    },
    "currentPeriodEnd": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "graceUntil": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelAtPeriodEnd": {
      "type": "boolean"
    },
    "lastSyncedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "suspendedDomains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "plan",
    "status",
    "hasCustomer",
    "hasSubscription",
    "currentPeriodEnd",
    "graceUntil",
    "cancelAtPeriodEnd",
    "lastSyncedAt",
    "suspendedDomains"
  ]
}
```

### #/components/schemas/Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "limit": {
      "type": "integer"
    }
  },
  "required": [
    "error"
  ]
}
```
