HubSpot Commerce Subscriptions API

The subscriptions API allows you to retrieve data about recurring subscription records in HubSpot Commerce. Subscriptions are created when a customer purchases a recurring product through HubSpot payments or a connected payment processor.

Documentation

Specifications

Code Examples

💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-association-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-batch-create-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-batch-read-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-batch-response-subscription-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-batch-update-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-collection-response-association-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-collection-response-subscription-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-filter-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-filter-group-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-paging-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-search-request-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-simple-public-object-input-example.json
💻
CodeExamples
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/examples/commerce-subscriptions-api-subscription-example.json

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-association-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-batch-create-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-batch-read-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-batch-response-subscription-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-batch-update-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-collection-response-association-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-collection-response-subscription-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-filter-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-filter-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-paging-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-search-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-simple-public-object-input-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/json-schema/commerce-subscriptions-api-subscription-schema.json
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure
📊
JSONSchema
JSON Structure

OpenAPI Specification

hubspot-commerce-subscriptions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: HubSpot Commerce Subscriptions API
  description: >-
    The subscriptions API allows you to retrieve data about recurring
    subscription records in HubSpot Commerce. Subscriptions are created when a
    customer purchases a recurring product through HubSpot payments or a
    connected payment processor. Subscription records follow the standard CRM
    object pattern at /crm/v3/objects/subscriptions.
  version: v3
  contact:
    name: HubSpot Developer Support
    url: https://developers.hubspot.com/
servers:
- url: https://api.hubapi.com
  description: HubSpot API
security:
- oauth2: []
tags:
- name: Associations
  description: Operations for managing subscription associations
- name: Batch
  description: Batch operations for subscriptions
- name: Subscriptions
  description: Operations for managing subscription records
paths:
  /crm/v3/objects/subscriptions:
    get:
      operationId: listSubscriptions
      summary: Hubspot List Subscriptions
      description: >-
        Returns a page of commerce subscription records. Use the limit and after
        parameters to paginate through subscriptions. You can also specify which
        properties to return using the properties parameter.
      tags:
      - Subscriptions
      parameters:
      - name: limit
        in: query
        description: The maximum number of results to return per page.
        schema:
          type: integer
          default: 10
          maximum: 100
        example: 10
      - name: after
        in: query
        description: The cursor for pagination to get the next page of results.
        schema:
          type: string
        example: example-value
      - name: properties
        in: query
        description: A comma-separated list of property names to return.
        schema:
          type: string
        example: example-value
      - name: archived
        in: query
        description: Whether to return archived subscriptions.
        schema:
          type: boolean
          default: false
        example: false
      responses:
        '200':
          description: Successful response with a list of subscriptions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionResponseSubscription'
              examples:
                Listsubscriptions200Example:
                  summary: Default listSubscriptions 200 response
                  x-microcks-default: true
                  value:
                    results: &id005
                    - id: '500123'
                      properties: &id001
                        key: value
                      createdAt: '2025-03-15T14:30:00Z'
                      updatedAt: '2025-03-15T14:30:00Z'
                      archived: true
                      associations: &id002
                        key: value
                    paging:
                      next: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createSubscription
      summary: Hubspot Create a Subscription
      description: >-
        Creates a new subscription record with the provided properties. Subscription
        records track recurring revenue relationships with customers.
      tags:
      - Subscriptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimplePublicObjectInput'
            examples:
              CreatesubscriptionRequestExample:
                summary: Default createSubscription request
                x-microcks-default: true
                value:
                  properties: &id003
                    key: value
      responses:
        '201':
          description: Subscription created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
              examples:
                Createsubscription201Example:
                  summary: Default createSubscription 201 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    properties: *id001
                    createdAt: '2025-03-15T14:30:00Z'
                    updatedAt: '2025-03-15T14:30:00Z'
                    archived: true
                    associations: *id002
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/{subscriptionId}:
    get:
      operationId: getSubscription
      summary: Hubspot Get a Subscription
      description: >-
        Returns a single subscription record by its ID. You can specify which
        properties to return using the properties parameter.
      tags:
      - Subscriptions
      parameters:
      - name: subscriptionId
        in: path
        required: true
        description: The ID of the subscription to retrieve.
        schema:
          type: string
        example: '500123'
      - name: properties
        in: query
        description: A comma-separated list of property names to return.
        schema:
          type: string
        example: example-value
      - name: archived
        in: query
        description: Whether to return archived subscriptions.
        schema:
          type: boolean
          default: false
        example: false
      responses:
        '200':
          description: Successful response with the subscription record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
              examples:
                Getsubscription200Example:
                  summary: Default getSubscription 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    properties: *id001
                    createdAt: '2025-03-15T14:30:00Z'
                    updatedAt: '2025-03-15T14:30:00Z'
                    archived: true
                    associations: *id002
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      operationId: updateSubscription
      summary: Hubspot Update a Subscription
      description: >-
        Performs a partial update of a subscription record. Only the properties
        included in the request body will be updated; other properties will
        remain unchanged.
      tags:
      - Subscriptions
      parameters:
      - name: subscriptionId
        in: path
        required: true
        description: The ID of the subscription to update.
        schema:
          type: string
        example: '500123'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimplePublicObjectInput'
            examples:
              UpdatesubscriptionRequestExample:
                summary: Default updateSubscription request
                x-microcks-default: true
                value:
                  properties: *id003
      responses:
        '200':
          description: Subscription updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
              examples:
                Updatesubscription200Example:
                  summary: Default updateSubscription 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    properties: *id001
                    createdAt: '2025-03-15T14:30:00Z'
                    updatedAt: '2025-03-15T14:30:00Z'
                    archived: true
                    associations: *id002
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteSubscription
      summary: Hubspot Archive a Subscription
      description: >-
        Archives (soft deletes) a subscription record by its ID. Archived
        subscriptions can be restored using the HubSpot UI or API.
      tags:
      - Subscriptions
      parameters:
      - name: subscriptionId
        in: path
        required: true
        description: The ID of the subscription to archive.
        schema:
          type: string
        example: '500123'
      responses:
        '204':
          description: Subscription archived successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/batch/read:
    post:
      operationId: batchReadSubscriptions
      summary: Hubspot Batch Read Subscriptions
      description: >-
        Reads a batch of subscription records by their IDs. Useful for
        retrieving multiple subscriptions in a single API call.
      tags:
      - Batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchReadInput'
            examples:
              BatchreadsubscriptionsRequestExample:
                summary: Default batchReadSubscriptions request
                x-microcks-default: true
                value:
                  properties: &id006
                  - example-value
                  inputs: &id007
                  - id: '500123'
      responses:
        '200':
          description: Batch read completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponseSubscription'
              examples:
                Batchreadsubscriptions200Example:
                  summary: Default batchReadSubscriptions 200 response
                  x-microcks-default: true
                  value:
                    status: active
                    results: &id004
                    - id: '500123'
                      properties: *id001
                      createdAt: '2025-03-15T14:30:00Z'
                      updatedAt: '2025-03-15T14:30:00Z'
                      archived: true
                      associations: *id002
                    completedAt: '2025-03-15T14:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/batch/create:
    post:
      operationId: batchCreateSubscriptions
      summary: Hubspot Batch Create Subscriptions
      description: >-
        Creates multiple subscription records in a single API call.
      tags:
      - Batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateInput'
            examples:
              BatchcreatesubscriptionsRequestExample:
                summary: Default batchCreateSubscriptions request
                x-microcks-default: true
                value:
                  inputs: &id008
                  - properties: *id003
      responses:
        '201':
          description: Subscriptions created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponseSubscription'
              examples:
                Batchcreatesubscriptions201Example:
                  summary: Default batchCreateSubscriptions 201 response
                  x-microcks-default: true
                  value:
                    status: active
                    results: *id004
                    completedAt: '2025-03-15T14:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/batch/update:
    post:
      operationId: batchUpdateSubscriptions
      summary: Hubspot Batch Update Subscriptions
      description: >-
        Updates multiple subscription records in a single API call.
      tags:
      - Batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchUpdateInput'
            examples:
              BatchupdatesubscriptionsRequestExample:
                summary: Default batchUpdateSubscriptions request
                x-microcks-default: true
                value:
                  inputs: &id009
                  - id: '500123'
                    properties:
                      key: value
      responses:
        '200':
          description: Subscriptions updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponseSubscription'
              examples:
                Batchupdatesubscriptions200Example:
                  summary: Default batchUpdateSubscriptions 200 response
                  x-microcks-default: true
                  value:
                    status: active
                    results: *id004
                    completedAt: '2025-03-15T14:30:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/search:
    post:
      operationId: searchSubscriptions
      summary: Hubspot Search Subscriptions
      description: >-
        Searches for subscription records using filter groups, sorts, and other
        query parameters.
      tags:
      - Subscriptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
            examples:
              SearchsubscriptionsRequestExample:
                summary: Default searchSubscriptions request
                x-microcks-default: true
                value:
                  filterGroups: &id010
                  - filters:
                    - {}
                  sorts: &id011
                  - propertyName: Example Record
                    direction: ASCENDING
                  query: example-value
                  properties: &id012
                  - example-value
                  limit: 100
                  after: example-value
      responses:
        '200':
          description: Search results returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionResponseSubscription'
              examples:
                Searchsubscriptions200Example:
                  summary: Default searchSubscriptions 200 response
                  x-microcks-default: true
                  value:
                    results: *id005
                    paging:
                      next: {}
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /crm/v3/objects/subscriptions/{subscriptionId}/associations/{toObjectType}:
    get:
      operationId: listSubscriptionAssociations
      summary: Hubspot List Subscription Associations
      description: >-
        Returns all associations of a subscription record to objects of a
        specified type, such as contacts, companies, or deals.
      tags:
      - Associations
      parameters:
      - name: subscriptionId
        in: path
        required: true
        description: The ID of the subscription.
        schema:
          type: string
        example: '500123'
      - name: toObjectType
        in: path
        required: true
        description: The type of associated object.
        schema:
          type: string
        example: standard
      responses:
        '200':
          description: List of associations returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionResponseAssociation'
              examples:
                Listsubscriptionassociations200Example:
                  summary: Default listSubscriptionAssociations 200 response
                  x-microcks-default: true
                  value:
                    results: &id013
                    - id: '500123'
                      type: standard
                    paging:
                      next: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  securitySchemes:
    oauth2:
      type: http
      scheme: bearer
      description: OAuth 2.0 Bearer token (access token from OAuth flow)
  schemas:
    Subscription:
      type: object
      description: A HubSpot commerce subscription record.
      properties:
        id:
          type: string
          description: The unique identifier for the subscription.
          example: '500123'
        properties:
          type: object
          description: The subscription's properties as key-value pairs.
          additionalProperties:
            type: string
          example: *id001
        createdAt:
          type: string
          format: date-time
          example: '2025-03-15T14:30:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2025-03-15T14:30:00Z'
        archived:
          type: boolean
          example: true
        associations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CollectionResponseAssociation'
          example: *id002
    CollectionResponseSubscription:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
          example: *id005
        paging:
          $ref: '#/components/schemas/Paging'
    BatchResponseSubscription:
      type: object
      properties:
        status:
          type: string
          example: active
        results:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
          example: *id004
        completedAt:
          type: string
          format: date-time
          example: '2025-03-15T14:30:00Z'
    SimplePublicObjectInput:
      type: object
      properties:
        properties:
          type: object
          additionalProperties:
            type: string
          example: *id003
    BatchReadInput:
      type: object
      properties:
        properties:
          type: array
          items:
            type: string
          example: *id006
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
          example: *id007
    BatchCreateInput:
      type: object
      properties:
        inputs:
          type: array
          items:
            $ref: '#/components/schemas/SimplePublicObjectInput'
          example: *id008
    BatchUpdateInput:
      type: object
      properties:
        inputs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              properties:
                type: object
                additionalProperties:
                  type: string
          example: *id009
    SearchRequest:
      type: object
      properties:
        filterGroups:
          type: array
          items:
            $ref: '#/components/schemas/FilterGroup'
          example: *id010
        sorts:
          type: array
          items:
            type: object
            properties:
              propertyName:
                type: string
              direction:
                type: string
                enum: [ASCENDING, DESCENDING]
          example: *id011
        query:
          type: string
          example: example-value
        properties:
          type: array
          items:
            type: string
          example: *id012
        limit:
          type: integer
          maximum: 200
          example: 100
        after:
          type: string
          example: example-value
    FilterGroup:
      type: object
      properties:
        filters:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
          example:
          - propertyName: Example Record
            operator: EQ
            value: example-value
    Filter:
      type: object
      properties:
        propertyName:
          type: string
          example: Example Record
        operator:
          type: string
          enum: [EQ, NEQ, LT, LTE, GT, GTE, BETWEEN, IN, NOT_IN, HAS_PROPERTY, NOT_HAS_PROPERTY, CONTAINS_TOKEN, NOT_CONTAINS_TOKEN]
          example: EQ
        value:
          type: string
          example: example-value
    Association:
      type: object
      properties:
        id:
          type: string
          example: '500123'
        type:
          type: string
          example: standard
    CollectionResponseAssociation:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Association'
          example: *id013
        paging:
          $ref: '#/components/schemas/Paging'
    Paging:
      type: object
      properties:
        next:
          type: object
          properties:
            after:
              type: string
          example:
            after: example-value
    Error:
      type: object
      properties:
        status:
          type: string
          example: active
        message:
          type: string
          example: This is an example description.
        correlationId:
          type: string
          example: '500123'
        category:
          type: string
          example: standard
  responses:
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request is invalid or missing required parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'