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

# Renew cancelled subscription

> Renew a cancelled subscription by removing its end date. Requires externalCustomerId to verify the customer matches the subscription.



## OpenAPI

````yaml https://platform.runonatlas.com/external/schema post /external/subscriptions/{id}/renew
openapi: 3.0.0
info:
  title: Atlas API
  version: 1.0.0
servers:
  - url: https://platform.runonatlas.com
security: []
paths:
  /external/subscriptions/{id}/renew:
    post:
      tags:
        - Subscriptions
      summary: Renew cancelled subscription
      description: >-
        Renew a cancelled subscription by removing its end date. Requires
        externalCustomerId to verify the customer matches the subscription.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: The Atlas subscription ID
            example: atlas-internal-subscription-id-123
          required: true
          description: The Atlas subscription ID
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                externalCustomerId:
                  type: string
                  minLength: 1
                  description: >-
                    The external ID of the customer (e.g. the customer ID in
                    your system)
                  example: external-customer-id-123
              required:
                - externalCustomerId
              additionalProperties: false
      responses:
        '200':
          description: The subscription that has been renewed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  billingCadence:
                    type: string
                    nullable: true
                    enum:
                      - oneTime
                      - monthly
                      - quarterly
                      - annually
                    description: The billing cadence for this subscription
                    example: monthly
                  createdAt:
                    type: string
                    format: date
                    description: The date and time the subscription was created
                    example: '2021-01-01T00:00:00.000Z'
                  currency:
                    type: string
                    nullable: true
                    enum:
                      - USD
                    description: The currency for this subscription
                    example: USD
                  endDate:
                    anyOf:
                      - type: string
                        format: date
                      - type: string
                        format: date-time
                      - nullable: true
                    description: The end date of the subscription
                    example: '2021-12-31T00:00:00.000Z'
                  id:
                    type: string
                    minLength: 1
                    description: The Atlas subscription ID
                    example: atlas-internal-subscription-id-123
                  netTerms:
                    type: string
                    nullable: true
                    enum:
                      - uponReceipt
                      - net30
                      - net60
                      - net90
                    description: >-
                      The net terms for this subscription; applies only if
                      autoChargeInvoice is false. Determines the number of days
                      after the invoice is issued before the payment is due.
                    example: net30
                  startDate:
                    anyOf:
                      - type: string
                        format: date
                      - type: string
                        format: date-time
                    description: The start date of the subscription
                    example: '2021-01-01T00:00:00.000Z'
                  status:
                    type: string
                    enum:
                      - draft
                      - pendingActivation
                      - active
                      - ended
                      - deleted
                    description: The status of the subscription
                    example: active
                  updatedAt:
                    type: string
                    format: date
                    description: The date and time the subscription was last updated
                    example: '2021-01-01T00:00:00.000Z'
                  allowCustomerChanges:
                    type: boolean
                    description: >-
                      Whether the customer can change the subscription, for
                      example by cancelling it or creating another.
                    example: true
                  autoChargeInvoice:
                    type: boolean
                    description: >-
                      Whether to automatically charge invoices for this
                      subscription to the associated payment gateway. Requires a
                      valid Stripe connection. Only compatible with a Stripe
                      payment gateway.
                    example: false
                  autoSyncInvoice:
                    type: boolean
                    description: >-
                      Whether to automatically sync invoices for this
                      subscription to the associated payment gateway.
                    example: true
                  autoSendInvoice:
                    type: boolean
                    description: >-
                      Whether to automatically send invoices for this
                      subscription from the associated payment gateway to the
                      customers email address.
                    example: true
                  paymentGateway:
                    type: string
                    nullable: true
                    enum:
                      - Stripe
                      - QuickBooks
                      - Xero
                    description: The selected payment gateway for this subscription
                    example: Stripe
                  isTrial:
                    type: boolean
                    description: Whether this subscription is a trial subscription
                    example: false
                  chargeForUsageBasedPricesDuringTrial:
                    type: boolean
                    nullable: true
                    description: >-
                      Whether to charge for usage-based prices during the trial
                      period. Only applies if isTrial is true.
                    example: false
                  customerId:
                    type: string
                    minLength: 1
                    description: The Atlas customer ID
                    example: atlas-internal-customer-id-123
                  planId:
                    type: string
                    minLength: 1
                    description: The Atlas plan ID
                    example: atlas-internal-plan-id-123
                  merchantId:
                    type: string
                    minLength: 1
                    description: The Atlas merchant ID
                    example: atlas-internal-merchant-id-123
                required:
                  - createdAt
                  - id
                  - startDate
                  - status
                  - updatedAt
                  - allowCustomerChanges
                  - autoChargeInvoice
                  - autoSyncInvoice
                  - autoSendInvoice
                  - paymentGateway
                  - isTrial
                  - customerId
                  - planId
                  - merchantId
        '400':
          description: >-
            There is an issue with the request data. See the response for more
            details.
        '401':
          description: Invalid API key provided.
        '403':
          description: This endpoint is only available for standard merchants.
        '404':
          description: Subscription not found.
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        You can obtain this key from the Atlas dashboard. It must be of type
        `secret`

````