> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.iklim.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Subscription Plan

> Updates the account's subscription plan with the provided details.



## OpenAPI

````yaml /open-api/en/accounts-version-1.json post /v1/accounts/update-subscription
openapi: 3.0.1
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.iklim.co
    description: Production server
  - url: https://api-test.iklim.co
    description: Test server
  - url: http://localhost:8080
    description: Local development environment with api gateway
security: []
tags:
  - name: User Accounts Service
    description: Manages Account Related Services
paths:
  /v1/accounts/update-subscription:
    post:
      tags:
        - User Accounts Service
      summary: Update Subscription Plan
      description: Updates the account's subscription plan with the provided details.
      operationId: updateSubscription
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionPlanRequest'
        required: true
      responses:
        '200':
          description: Subscription Plan Successfully Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateSubscriptionPlanResponse'
        '400':
          description: Required Headers Missing or Payload Invalid for Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Bad Request Example:
                  summary: Example response
                  description: Bad Request Example
                  value:
                    timestamp: '2025-04-14T16:26:54.203118461'
                    status: 400
                    error: Bad Request
                    message: Missing X-Idempotency-Key header
                    path: /endpoint/uri/here
        '401':
          description: Unauthorized Request or Invalid Signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Unauthorized Example 1:
                  summary: Example response 1
                  description: Unauthorized Example 1
                  value:
                    timestamp: '2025-04-14T16:57:50.083970026'
                    status: 401
                    error: Unauthorized
                    message: Bad Credentials
                    path: /endpoint/uri/here
                Unauthorized Example 2:
                  summary: Example response 2
                  description: Unauthorized Example 2
                  value:
                    timestamp: '2025-04-14T16:57:50.083970026'
                    status: 401
                    error: Unauthorized
                    message: Invalid request signature
                    path: /auth/login
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '409':
          description: Redundant Request Made
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Conflict Example 1:
                  summary: Example response 1
                  description: Conflict Example 1
                  value:
                    timestamp: '2025-04-14T16:57:21.168927321'
                    status: 409
                    error: Conflict
                    message: Replay attack detected (nonce reused)
                    path: /endpoint/uri/here
                Conflict Example 2:
                  summary: Example response 2
                  description: Conflict Example 2
                  value:
                    timestamp: '2025-04-14T16:56:28.671809875'
                    status: 409
                    error: Conflict
                    message: Duplicate request detected (X-Idempotency-Key)
                    path: /endpoint/uri/here
        '500':
          description: Internal Server Error During Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
              examples:
                Internal Server Error Example:
                  summary: Example response
                  description: Internal Server Error Example
                  value:
                    timestamp: '2025-04-14T16:58:10.414972912'
                    status: 500
                    error: Internal Server Error
                    message: An Error Occurred During Login
                    path: /endpoint/uri/here
components:
  schemas:
    UpdateSubscriptionPlanRequest:
      required:
        - accountId
        - subscriptionPlan
        - userId
      type: object
      properties:
        accountId:
          type: string
          description: Account Identifier whose Subscription will be Updated
          format: uuid
          example: 296ff917-9b4b-4dc1-987d-2c17bdac7133
        userId:
          type: string
          description: User Identifier whose Subscription will be Updated
          format: uuid
          example: 296ff917-9b4b-4dc1-987d-2c17bdac7133
        subscriptionPlan:
          type: string
          description: New Subscription Plan
          example: >-
            NONE/TRIAL/BASIC_MONTHLY/BASIC_YEARLY/PREMIUM_MONTHLY/PREMIUM_YEARLY/CUSTOM
          enum:
            - NONE
            - TRIAL
            - BASIC_MONTHLY
            - BASIC_YEARLY
            - PREMIUM_MONTHLY
            - PREMIUM_YEARLY
            - CUSTOM
        planDetails:
          $ref: '#/components/schemas/SubscriptionPlanDetails'
    UpdateSubscriptionPlanResponse:
      type: object
      properties:
        userId:
          type: string
          format: uuid
        accountId:
          type: string
          format: uuid
        subscriptionPlan:
          type: string
          enum:
            - NONE
            - TRIAL
            - BASIC_MONTHLY
            - BASIC_YEARLY
            - PREMIUM_MONTHLY
            - PREMIUM_YEARLY
            - CUSTOM
        subscriptionExpirationEpoch:
          type: integer
          format: int64
        warnings:
          type: array
          items:
            type: string
    StandardErrorResponse:
      required:
        - error
        - message
        - path
        - status
        - timestamp
      type: object
      properties:
        timestamp:
          type: string
          description: Error Time Stamp
          format: date-time
        status:
          type: integer
          description: Error Status Code
          format: int32
        error:
          type: string
          description: Error Name
          example: Error Name
        message:
          type: string
          description: Error Description
          example: Error Message
        path:
          type: string
          description: Erroring Endpoint URI
          example: /endpoint/uri/here
    SubscriptionPlanDetails:
      required:
        - details
        - subscriptionExpirationEpoch
      type: object
      properties:
        subscriptionExpirationEpoch:
          type: integer
          description: Subscription Expiration Date
          format: int64
          example: 1767214799999
        details:
          type: array
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details
          items:
            $ref: '#/components/schemas/SubscriptionPlanDetail'
    SubscriptionPlanDetail:
      required:
        - apiServiceLimits
        - limitResetRecurrence
      type: object
      properties:
        limitResetRecurrence:
          $ref: '#/components/schemas/LimitResetRecurrence'
        geoBoundary:
          $ref: '#/components/schemas/GeoBoundary'
        apiServiceLimits:
          type: array
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.api-service-limits
          items:
            $ref: '#/components/schemas/ApiServiceLimit'
      description: swagger.schema.accounts.update-subscription-request.details.plan-details
    LimitResetRecurrence:
      required:
        - limitType
      type: object
      properties:
        limitType:
          type: string
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.limit-type
          example: DAILY/WEEKLY/MONTHLY/YEARLY/QUOTA
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - YEARLY
            - QUOTA
        limitResetInterval:
          type: integer
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.limit-reset-interval
          format: int32
          example: 1
      description: >-
        swagger.schema.accounts.update-subscription-request.details.plan-details.limit-reset-recurrence
    GeoBoundary:
      required:
        - country
        - region
      type: object
      properties:
        country:
          type: string
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.geo-boundary.country
          example: Türkiye
        region:
          type: string
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.geo-boundary.region
          example: All
      description: >-
        swagger.schema.accounts.update-subscription-request.details.plan-details.geo-boundary
    ApiServiceLimit:
      required:
        - maxInvocation
        - serviceName
        - version
      type: object
      properties:
        version:
          type: string
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.service.version
          example: v1
        serviceName:
          type: string
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.service.name
          example: lightnings
        maxInvocation:
          type: integer
          description: >-
            swagger.schema.accounts.update-subscription-request.details.plan-details.service.max-invocation
          format: int64
          example: 1000
      description: >-
        swagger.schema.accounts.update-subscription-request.details.plan-details.api-service-limits

````