# Renew an existing VPN subscription

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/public/v1/subscription/renew:
    post:
      summary: Renew an existing VPN subscription
      deprecated: false
      description: ''
      tags:
        - 📢 Public
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - serverId
                - duration
                - wgPublicKey
              properties:
                serverId:
                  type: string
                duration:
                  type: integer
                  enum:
                    - 1
                    - 3
                    - 6
                    - 12
                wgPublicKey:
                  type: string
              x-apidog-orders:
                - serverId
                - duration
                - wgPublicKey
              x-apidog-ignore-properties: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenewalOrder'
          headers: {}
          x-apidog-name: ''
        '403':
          description: Forbidden (Migration Required to us3)
          headers: {}
          x-apidog-name: ''
        '404':
          description: Subscription not found on target server
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: 📢 Public
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/361232/apis/api-4063132-run
components:
  schemas:
    RenewalOrder:
      type: object
      required:
        - invoice
        - paymentHash
        - oldExpiry
        - newExpiry
        - renewalId
      properties:
        invoice:
          type: string
        paymentHash:
          type: string
        oldExpiry:
          type: string
          format: date-time
        newExpiry:
          type: string
          format: date-time
        renewalId:
          type: string
          format: uuid
      x-apidog-orders:
        - invoice
        - paymentHash
        - oldExpiry
        - newExpiry
        - renewalId
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: bearer
      scheme: bearer
      description: Authenticate using your TunnelSats API Key (sk_live_...).
    NostrAuth:
      type: bearer
      scheme: bearer
      description: >-
        NIP-98 Nostr Authentication. The 'token' should be the base64-encoded
        NIP-98 event JSON.
servers:
  - url: https://tunnelsats.com
    description: Prod Env
security: []

```