# Retrieve order timeline messages

`GET /subscriptions/{id}/timeline`

> This is a subset of the full specification, limited to the `GET /subscriptions/{id}/timeline` operation.
>
> You can find the full specification here: /_bundle/docs/dev-docs/api/index.yaml

```yaml
openapi: 3.1.1
info:
  version: latest
  title: Core APIs
  contact:
    name: Rebilly API Support
    url: https://www.rebilly.com/contact/
    email: integrations@rebilly.com
  license:
    name: Rebilly
    url: https://www.rebilly.com/api-license/
  termsOfService: https://www.rebilly.com/terms-of-use/
  x-logo:
    url: https://rebilly-core.redoc.ly/rb_apiLogo.svg
    backgroundColor: '#0044d4'
  description: This is a subset of the full specification, limited to the `GET /subscriptions/{id}/timeline` operation. Components more than 3 `$ref` hops away are not included.
  x-metadata:
    description: The most common APIs used to automate common workflows.
    redocly_category: API Reference
servers:
  - url: https://api-sandbox.rebilly.com/organizations/{organizationId}
    description: Sandbox server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
  - url: https://api.rebilly.com/organizations/{organizationId}
    description: Live server
    variables:
      organizationId:
        default: '{organizationId}'
        description: |-
          Unique organization identifier.
          An organization is an entity that represents a company.
          For more information, see [Obtain an organization ID](https://www.rebilly.com/docs/settings/organizations-and-websites/#obtain-your-organization-id-and-website-id).
security:
  - SecretApiKey: []
  - JWT: []
tags:
  - name: Orders timeline
    description: Use order timelines to maintain an audit trail of changes and activity for each order.
x-tagGroups:
  - name: Orders & Invoices
    tags:
      - Orders timeline
paths:
  /subscriptions/{id}/timeline:
    parameters:
      - $ref: '#/components/parameters/resourceId'
    get:
      x-products:
        - Core
      tags:
        - Orders timeline
      summary: Retrieve order timeline messages
      operationId: GetSubscriptionTimelineCollection
      x-sdk-operation-name: getAllTimelineMessages
      description: Retrieves a list of order timeline messages.
      parameters:
        - $ref: '#/components/parameters/collectionLimit'
        - $ref: '#/components/parameters/collectionOffset'
        - $ref: '#/components/parameters/collectionFilter'
        - $ref: '#/components/parameters/collectionSort'
        - $ref: '#/components/parameters/collectionQuery'
      responses:
        '200':
          description: List of order timeline messages retrieved.
          headers:
            Pagination-Total:
              $ref: '#/components/headers/Pagination-Total'
            Pagination-Limit:
              $ref: '#/components/headers/Pagination-Limit'
            Pagination-Offset:
              $ref: '#/components/headers/Pagination-Offset'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrderTimeline'
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-codeSamples:
        - lang: JavaScript
          source: |
            // all parameters are optional except for the `id`
            const firstCollection = await api.subscriptions
                .getAllTimelineMessages({id: 'my-transaction'});

            // alternatively you can specify one or more of them
            const params = {id: 'my-transaction', limit: 20, offset: 100};
            const secondCollection = await api.subscriptions.getAllTimelineMessages(params);

            // access the collection items, each item is a SubscriptionTimeline
            secondCollection.items
                .forEach(message => console.log(message.fields.eventType));
components:
  securitySchemes:
    JWT:
      description: |-
        JWT is a short lifetime token that can be assigned a specific expiration time.

        Usage format: `Bearer <JWT>`.
      type: http
      scheme: bearer
      bearerFormat: JWT
    SecretApiKey:
      description: |-
        Never share your secret keys.
        Keep them guarded and secure.

        Use your secret API key only to make requests from the server side.
        To authenticate, provide your secret key in the request header.
      name: REB-APIKEY
      type: apiKey
      in: header
  parameters:
    collectionLimit:
      name: limit
      in: query
      description: |-
        Limit the number of collection items to be returned.
        Use `0` to return an empty collection and still receive the count of matching items in `Pagination-Total`.
      schema:
        type: integer
        minimum: 0
        maximum: 1000
    collectionOffset:
      name: offset
      in: query
      description: Specifies the starting point within the collection of items to be returned.
      schema:
        type: integer
        minimum: 0
        maximum: 1000
    collectionSort:
      name: sort
      in: query
      description: |-
        Sorts and orders the collection of items. To sort in descending
        order, prefix with `-`. Multiple fields can be sorted by separating each with `,`.
      style: form
      explode: false
      schema:
        type: array
        items:
          type: string
    collectionFilter:
      name: filter
      in: query
      description: |-
        Criteria for filtering collection items.
        This field requires a special format.
        Use `,` to specify multiple allowed values.
        Use `;` to specify multiple fields.

        For more information, see [Search filters](https://www.rebilly.com/docs/dev-docs/search-filters).
      schema:
        type: string
    collectionQuery:
      name: q
      in: query
      description: Use this field to perform a partial search of text fields.
      schema:
        type: string
    resourceId:
      name: id
      in: path
      description: ID of the resource.
      required: true
      schema:
        type: string
        maxLength: 50
        pattern: ^[@~\-\.\w]+$
  headers:
    Pagination-Total:
      description: |-
        Total number of items that match the request.
        The value is independent of `limit`, including when `limit` is `0`.
      schema:
        type: integer
      example: 332
    Pagination-Limit:
      description: Maximum number of items per page.
      schema:
        type: integer
      example: 100
    Pagination-Offset:
      description: |-
        Specifies the starting point within the
        collection of resource results. For example, a request with
        `limit=20` retrieves and displays the first 20 results on a page. A
        following request with `limit=20` and `offset=20`, retrieves the next
        page of 20 results.
      schema:
        type: integer
      example: 2
  schemas:
    ResourceId:
      type: string
      description: Unique resource ID.
      maxLength: 50
      example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
    SelfLink:
      type: array
      description: Related links.
      readOnly: true
      items:
        type: object
        properties:
          href:
            description: Link URL.
            type: string
          rel:
            description: Type of link.
            type: string
            enum:
              - self
    BaseProblem:
      type: object
      additionalProperties: true
      minProperties: 1
      description: RFC-7807 [problem details](https://tools.ietf.org/html/rfc7807) JSON object.
      properties:
        type:
          type: string
          description: |-
            Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference.
            It should provide human-readable documentation for the problem type.
            When this member is not present, its value is assumed to be "about:blank".
          format: uri
        title:
          type: string
          description: |-
            Short, human-readable summary of the problem type.
            Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem.
        detail:
          type: string
          description: Human-readable explanation that is specific to this occurrence of the problem.
        instance:
          type: string
          description: |-
            URI reference that identifies the specific occurrence of the problem.
            It may or may not yield further information if dereferenced.
    Unauthorized:
      allOf:
        - title: Unauthorized
        - type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
              minimum: 401
              maximum: 401
        - $ref: '#/components/schemas/BaseProblem'
    TimelineAction:
      type: object
      discriminator:
        propertyName: action
        mapping:
          redemption-cancel: '#/components/schemas/RedemptionCancelTimelineAction'
          resend-email: '#/components/schemas/ResendEmailTimelineAction'
          ruleset-restore: '#/components/schemas/RulesetRestoreTimelineAction'
      oneOf:
        - $ref: '#/components/schemas/RedemptionCancelTimelineAction'
        - $ref: '#/components/schemas/ResendEmailTimelineAction'
        - $ref: '#/components/schemas/RulesetRestoreTimelineAction'
    TimelineTable:
      type: object
      description: Additional timeline message information.
      discriminator:
        propertyName: type
        mapping:
          three-columns: '#/components/schemas/ThreeColumnsTimelineTable'
          two-columns: '#/components/schemas/TwoColumnsTimelineTable'
          one-column: '#/components/schemas/OneColumnTimelineTable'
          list: '#/components/schemas/ListTimelineTable'
      properties:
        type:
          type: string
          enum:
            - list
            - one-columns
            - two-columns
            - three-columns
        title:
          type: string
          description: Data table title.
        footer:
          type: string
          description: Data table footer.
    ThreeColumnsTimelineTable:
      allOf:
        - $ref: '#/components/schemas/TimelineTable'
        - type: object
          properties:
            data:
              type: array
              description: |-
                Table data.
                Each array element represents a table row.
              items:
                type: object
                properties:
                  attribute:
                    type: string
                  previousValue:
                    type:
                      - string
                      - integer
                      - number
                      - boolean
                  newValue:
                    type:
                      - string
                      - integer
                      - number
                      - boolean
                example:
                  attribute: Descriptor
                  previousValue: test.com
                  newValue: new-test.com
    TwoColumnsTimelineTable:
      allOf:
        - $ref: '#/components/schemas/TimelineTable'
        - type: object
          properties:
            data:
              type: array
              description: |-
                Table data.
                Each array element represents a table row.
              items:
                type: object
                properties:
                  attribute:
                    type: string
                  value:
                    type:
                      - string
                      - integer
                      - number
                      - boolean
                example:
                  attribute: Who
                  value: John Doe
    OneColumnTimelineTable:
      allOf:
        - $ref: '#/components/schemas/TimelineTable'
        - type: object
          properties:
            data:
              type: array
              description: |-
                Table data.
                Each array element represents a table row.
              items:
                type: object
                properties:
                  attribute:
                    type: string
                  value:
                    type:
                      - string
                      - integer
                      - number
                      - boolean
                example:
                  attribute: Who
                  value: John Doe
    ListTimelineTable:
      allOf:
        - $ref: '#/components/schemas/TimelineTable'
        - type: object
          properties:
            data:
              type: array
              description: |-
                Table data.
                Each array element represents a table row.
              items:
                type: string
    TimelineExtraData:
      type: object
      description: Additional data.
      readOnly: true
      properties:
        actions:
          description: |-
            Actions available for a timeline message.
            If no actions are available, this field is empty.
          type: array
          minItems: 0
          items:
            $ref: '#/components/schemas/TimelineAction'
        tables:
          description: Table data that is attached to the timeline message.
          type: array
          minItems: 0
          items:
            $ref: '#/components/schemas/TimelineTable'
        author:
          type: object
          description: Author of the timeline message.
          properties:
            userFullName:
              description: Full name of the author.
              type: string
            userId:
              description: ID of the author.
              type: string
              maxLength: 50
              example: usr_0YVCEENYJ3D7Q9EN6BN16HA0G4
        mentions:
          description: User mentions, or tags, in a timeline.
          type: object
          additionalProperties:
            type: string
          example:
            '@test@mail.com': userId-1
        links:
          description: Links that are attached to a timeline message.
          type: array
          items:
            type: object
            properties:
              resourceType:
                type: string
                enum:
                  - kyc-document
                  - invoice
                  - subscription
                  - transaction
                  - email-message
                  - dispute
                  - coupon
                  - external
                  - payout-request-batch
                  - replay-promotion-claim
                  - replay-player-level-reward-award
              resourceId:
                $ref: '#/components/schemas/ResourceId'
              placeholder:
                type: string
                example: KYC document
              externalUrl:
                type: string
                example: http://example.com
    ServerTimestamp:
      type: string
      description: Read-only timestamp in ISO 8601 date-time format.
      format: date-time
      readOnly: true
    OrderTimeline:
      type: object
      properties:
        id:
          type: string
          description: ID of the timeline message.
          readOnly: true
          maxLength: 50
          example: tmln_0YV8Q9WEF5DTA8HFXS27D1G6GC
        type:
          description: Type of timeline message.
          type: string
          readOnly: true
          enum:
            - coupon-applied
            - email-message-sent
            - invoice-abandoned
            - invoice-disputed
            - invoice-issued
            - invoice-paid
            - invoice-partially-paid
            - invoice-partially-refunded
            - invoice-past-due
            - invoice-refunded
            - invoice-reissued
            - invoice-renewal-payment-declined
            - invoice-voided
            - order-activated
            - order-autopay-changed
            - order-billing-address-changed
            - order-billing-anchor-changed
            - order-canceled
            - order-churned
            - order-completed
            - order-custom-fields-changed
            - order-delivery-address-changed
            - order-downgraded
            - order-change-applied
            - order-change-canceled
            - order-change-created
            - order-items-changed
            - order-paid-early
            - order-quantity-changed
            - order-reactivated
            - order-recurring-interval-changed
            - order-renewal-time-changed
            - order-renewed
            - order-risk-metadata-changed
            - order-trial-converted
            - order-trial-ended
            - order-upgraded
            - order-voided
            - order-abandoned
            - quote-accepted
            - subscription-paused
            - subscription-pause-created
            - subscription-pause-modified
            - subscription-pause-revoked
            - subscription-resumed
            - subscription-trial-end-changed
            - timeline-comment-created
        triggeredBy:
          description: Specifies who, or what, triggered the timeline event.
          type: string
          readOnly: true
          enum:
            - rebilly
            - app
            - direct-api
        message:
          description: Contents of the timeline message.
          type: string
        extraData:
          $ref: '#/components/schemas/TimelineExtraData'
        occurredTime:
          description: Date and time when the timeline message occurred.
          readOnly: true
          $ref: '#/components/schemas/ServerTimestamp'
        _links:
          $ref: '#/components/schemas/SelfLink'
  responses:
    Unauthorized:
      description: |-
        Unauthorized access.
        Invalid credentials used.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
```
