x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v1
consumes:
  - application/json
produces:
  - application/json
paths:
  /coupons:
    get:
      tags:
        - Coupons
      summary: List all available coupons.
      operationId: Coupons_GetCoupons
      parameters:
        - type: string
          name: limit
          in: query
          description: >-
            *(Deprecated)* The maximum number of items to return in the current
            page of the collection.
          x-nullable: true
        - type: string
          name: offset
          in: query
          description: '*(Deprecated)* The number of pages to offset into the collection.'
          x-nullable: true
        - type: string
          name: _filter
          in: query
          description: >-
            One or more filter operations to be performed on the collection.

            The referenced fields must allow filtering. See the respective
            report's schema for which fields can be filtered. 
                        
            Supports most of the [OData filter
            syntax](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part2-url-conventions/odata-v4.01-cs01-part2-url-conventions.html#sec_SystemQueryOptionfilter).
                        
            Supported operations:
                * eq,
                * ne,
                * gt,
                * ge,
                * lt,
                * le,
                * and,
                * or,
                * not,
                * ()

            Supported functions:
                * substringof('value',fieldName),
                * endswith(fieldName,'value'),
                * startswith(fieldName,'value'),
                * tolower(fieldName),
                * toupper(fieldName)
                        
            Examples:

            * _filter=`firstname eq 'Jeffrey'`

            * _filter=`id eq guid'a14c149a-2ce0-41d4-b532-02189ad3cb22'`

            * _filter=`startsWith(lastname,'leb') or dateAdded ge
            datetime'1998-03-06T20:38:07Z'`
          x-nullable: true
        - type: string
          name: _sort
          in: query
          description: >-
            Optional list of comma-separated fields to sort the collection by.


            The referenced fields must allow sorting. See the respective
            report's schema for which fields can be sorted. 

            If not specified, all report fields are returned.


            To sort in a descending manner, prefix the field name with `-`. For
            example, 

            `_sort=name,-date`, sorts the collection of items by `name`
            (ascending) 

            and then by `date` (descending).
          x-nullable: true
        - type: string
          name: _limit
          in: query
          description: >-
            The maximum number of items to return in the current page of the
            collection.
          x-nullable: true
        - type: string
          name: _offset
          in: query
          description: The number of pages to offset into the collection.
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/CouponsResource'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /coupons/{couponId}:
    get:
      tags:
        - Coupons
      summary: Get an individual coupon by ID.
      operationId: Coupons_GetCouponById
      parameters:
        - type: string
          name: couponId
          in: path
          required: true
          description: The coupon ID.
          format: guid
          x-nullable: false
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '1'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/NonPagedCouponResource'
        '404':
          x-nullable: false
          description: Coupon not found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  CouponsResource:
    type: object
    description: Represents a collection of CouponResource objects.
    properties:
      totalItems:
        type: integer
        description: The total number of items in the unbounded collection
        format: int32
      returnedItems:
        type: integer
        description: The number of items in the bound collection being returned
        format: int32
      limit:
        type: integer
        description: The current page size for the collection
        format: int32
      offset:
        type: integer
        description: The current offset for the collection
        format: int32
      coupons:
        type: array
        items:
          $ref: '#/definitions/CouponResource'
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  CouponResource:
    type: object
    description: Represents information about a coupon for an Integration API endpoint.
    properties:
      id:
        type: string
        description: |-
          `Filterable` 

          The coupon ID.
        format: guid
      courseIds:
        type: array
        description: |-
          `Filterable` 

          The list of course IDs this coupon is for.
        items:
          type: string
          format: guid
      name:
        type: string
        description: |-
          `Default Sort` `Sortable` `Filterable` 

          The coupon name.
      description:
        type: string
        description: |-
          `Filterable` 

          The coupon description.
      code:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The coupon code.
      discount:
        type: number
        description: |-
          `Sortable` `Filterable` 

          The coupon discount.
        format: decimal
      discountType:
        description: |-
          `Sortable` `Filterable` 

          The coupon's type of discount.

          Possible Enum Values: `0 = Percentage` `1 = Dollars` 
        allOf:
          - $ref: '#/definitions/DiscountType'
      expiryDate:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The coupon's expiry date.
        format: date-time
      maxUses:
        type: integer
        description: |-
          `Sortable` `Filterable` 

          The coupon's max number of uses.
        format: int32
      isActive:
        type: boolean
        description: |-
          `Sortable` `Filterable` 

          True if the coupon is active, false otherwise.
      departmentId:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The coupon department ID.
        format: guid
      dateAdded:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The date the coupon was added.
        format: date-time
      dateEdited:
        type: string
        description: |-
          `Sortable` `Filterable` 

          The date the coupon was last edited.
        format: date-time
  DiscountType:
    type: integer
    description: >-
      The possible values for the type of discount a coupon can apply to a
      shopping cart
    x-enumNames:
      - Percentage
      - Dollars
    enum:
      - 0
      - 1
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
  NonPagedCouponResource:
    type: object
    description: >-
      This class is NOT to be used as an actual response. This is to be used as
      the `SwaggerResponse` return type for

      non-paginated endpoints that return CouponResource.
    properties:
      id:
        type: string
        description: The coupon ID.
        format: guid
      courseIds:
        type: array
        description: The list of course IDs this coupon is for.
        items:
          type: string
          format: guid
      name:
        type: string
        description: The coupon name.
      description:
        type: string
        description: The coupon description.
      code:
        type: string
        description: The coupon code.
      discount:
        type: number
        description: The coupon discount.
        format: decimal
      discountType:
        description: |-
          The coupon's type of discount.

          Possible Enum Values: `0 = Percentage` `1 = Dollars` 
        allOf:
          - $ref: '#/definitions/DiscountType'
      expiryDate:
        type: string
        description: The coupon's expiry date.
        format: date-time
      maxUses:
        type: integer
        description: The coupon's max number of uses.
        format: int32
      isActive:
        type: boolean
        description: True if the coupon is active, false otherwise.
      departmentId:
        type: string
        description: The coupon department ID.
        format: guid
      dateAdded:
        type: string
        description: The date the coupon was added.
        format: date-time
      dateEdited:
        type: string
        description: The date the coupon was last edited.
        format: date-time
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Coupons
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
