AlayaCare offer inbox API

The offer inbox API from AlayaCare — 4 operation(s) for offer inbox.

OpenAPI Specification

alayacare-offer-inbox-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.19-oas3
  title: AlayaCare Accounting Accounts offer inbox API
  description: '**AlayaCare IDs:**

    The following terms are used to reference IDs that identify resources in AlayaCare:

    - id

    - visit_id

    - premium_id

    - visit_premium_id

    - employee_id

    - cost_centre_id

    - client_id


    **External IDs**

    The following terms are used to reference IDs that identify resources systems external to AlayaCare:

    - employee_external_id

    - client_external_id


    External IDs are required to be unique.

    No other assumptions are made regarding their format they are treated as strings.

    '
servers:
- url: https://example.alayacare.com/ext/api/v2/accounting
security:
- basic_auth: []
tags:
- name: offer inbox
paths:
  /v1/inbox/offers:
    get:
      tags:
      - offer inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get a collection of Offers matched to the Supply Organization.

        '
      parameters:
      - in: query
        name: status
        description: 'Filter on an Offer Match status. Filtering on multiple statuses is not supported.

          '
        schema:
          $ref: '#/components/schemas/OfferMatchStatusCore'
      - $ref: '#/components/parameters/ShiftIdQueryParam'
      - $ref: '#/components/parameters/PageNumberParam'
      - $ref: '#/components/parameters/ItemsPerPageParam'
      - $ref: '#/components/parameters/SortByParam'
      - $ref: '#/components/parameters/SortOrderParam'
      responses:
        200:
          description: Successfully returned Offer Inbox Collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxOfferPageResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/offers/{offer_id}:
    parameters:
    - $ref: '#/components/parameters/OfferIdPathParam'
    get:
      tags:
      - offer inbox
      description: '# Authorization

        Required role: `org_admin`


        # Description

        Get the anonamyzed details of Offers matched to the Supply

        organization. This must contain no PHI.

        '
      responses:
        200:
          description: Successfully returned Offer Inbox Scalar
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxOfferDetailResponse'
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/offers/{offer_id}/accept:
    parameters:
    - $ref: '#/components/parameters/OfferIdPathParam'
    post:
      tags:
      - offer inbox
      description: '# Authorization

        Required role: `org_admin`


        Required offer state: `sent`


        # Description

        Accept an Offer matched to the Supply organization.

        '
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxOfferAcceptRequest'
      responses:
        204:
          description: Successfully marked Offer as Accepted
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
  /v1/inbox/offers/{offer_id}/decline:
    parameters:
    - $ref: '#/components/parameters/OfferIdPathParam'
    post:
      tags:
      - offer inbox
      description: '# Authorization

        Required role: `org_admin`


        Required offer state: `sent`


        # Description

        Decline an Offer matched to the Supply organization.

        '
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InboxOfferDeclineRequest'
      responses:
        204:
          description: Successfully marked Offer as Declined
      x-amazon-apigateway-integration:
        uri:
          Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${OfferApiFunctionV2.Arn}:live/invocations
        httpMethod: POST
        passthroughBehavior: when_no_match
        type: aws_proxy
components:
  schemas:
    InboxOfferPageResponse:
      allOf:
      - $ref: '#/components/schemas/PageCore'
      - type: object
        properties:
          items:
            type: array
            items:
              $ref: '#/components/schemas/InboxOfferCollectionResponse'
        required:
        - items
    InboxOfferCore:
      description: 'Core representation of an offer on the inbox API.

        Meant to be used in the nested `offer` in a top level (API) response schema.

        '
      allOf:
      - $ref: '#/components/schemas/OfferReasonCodeCore'
      - type: object
        properties:
          id:
            type: string
            format: uuid
          shift_id:
            type: string
            format: uuid
          care_type:
            $ref: '#/components/schemas/CareTypeCore'
          offer_type:
            $ref: '#/components/schemas/OfferTypeCore'
          expires_at:
            type: string
            format: date-time
          start_at:
            type: string
            format: date-time
          end_at:
            type: string
            format: date-time
          comment:
            type: string
          created_at:
            type: string
            format: date-time
          updated_at:
            type: string
            format: date-time
        required:
        - id
        - care_type
        - offer_type
        - expires_at
        - start_at
        - created_at
    InboxOfferAlayaCareResponse:
      type: object
      properties:
        authorizations:
          type: array
          items:
            $ref: '#/components/schemas/AuthorizationCore'
        care_plan:
          $ref: '#/components/schemas/InboxOfferCarePlanResponse'
        form_templates:
          type: array
          items:
            $ref: '#/components/schemas/InboxOfferFormTemplateResponse'
    CaseManagerCore:
      type: object
      properties:
        name:
          type: string
        phone_number:
          type: string
        fax_number:
          type: string
        email:
          type: string
    InboxOfferDetailResponse:
      description: 'API response for the anonymous representation of an offer on the inbox API.

        Similarly to the `InboxOfferCore`, this schema is meant to be used in the nested `offer`

        in a top level (API) response schema, e.g. the `InboxOfferScalarApiResponse`

        This includes everything from the `InboxOfferCore` along with some additional information

        on the client, service and visits.

        Not all client information is included here, hence the "anon" (anonymous) prefix.

        '
      type: object
      properties:
        offer:
          $ref: '#/components/schemas/InboxOfferCore'
        alayacare:
          $ref: '#/components/schemas/InboxOfferAlayaCareResponse'
        case_manager:
          $ref: '#/components/schemas/CaseManagerCore'
        price:
          $ref: '#/components/schemas/PriceCore'
        client:
          title: InboxOfferDetailClientResponse
          type: object
          properties:
            address:
              $ref: '#/components/schemas/AddressAnonCore'
            allergies:
              type: array
              items:
                $ref: '#/components/schemas/AllergyCore'
            risks:
              type: array
              items:
                $ref: '#/components/schemas/RiskCore'
            custom_fields:
              type: array
              items:
                $ref: '#/components/schemas/CustomFieldCore'
          required:
          - address
        service:
          title: InboxOfferDetailServiceResponse
          allOf:
          - $ref: '#/components/schemas/ServiceCore'
          - type: object
            properties:
              id:
                type: string
                format: uuid
              use_client_address:
                type: boolean
              address:
                $ref: '#/components/schemas/AddressAnonCore'
            required:
            - id
        visits:
          type: array
          items:
            $ref: '#/components/schemas/InboxOfferVisitResponse'
        match:
          $ref: '#/components/schemas/OfferMatchCore'
        demand:
          $ref: '#/components/schemas/OrganizationLeanCore'
      required:
      - offer
      - match
      - demand
      - client
      - service
    PageNumberCore:
      type: integer
      minimum: 1
      default: 1
    SortOrderCore:
      type: string
      enum:
      - asc
      - desc
      default: desc
    PriceCore:
      type: object
      properties:
        rate:
          type: number
          format: decimal
          description: The dollar amount for offer per unit.
          example: 30.0
        unit:
          type: string
          description: The unit for the rate.
          enum:
          - per_visit
          - per_hour
          - amount
      required:
      - rate
      - unit
    InboxOfferFormTemplateResponse:
      allOf:
      - $ref: '#/components/schemas/FormTemplateCore'
      - type: object
        properties:
          fields:
            type: array
            items:
              $ref: '#/components/schemas/FormTemplateFieldCore'
    SortByCore:
      type: string
      enum:
      - last_modified
      default: last_modified
    AuthorizationCore:
      type: object
      properties:
        authorization_number:
          type: string
        authorization_status:
          type: string
        end_date:
          type: string
          format: date
        first_day_of_week:
          type: integer
        id:
          type: integer
        import_id:
          type: string
        member_number:
          type: string
        notes:
          type: string
        program_id:
          type: string
        custom_number_of_days:
          type: integer
        rule_type:
          type: string
        rule_custom:
          type: number
          format: decimal
        rule_daily:
          type: number
          format: decimal
        rule_weekly:
          type: number
          format: decimal
        rule_monthly:
          type: number
          format: decimal
        rule_period:
          type: number
          format: decimal
        rule_monday:
          type: number
          format: decimal
        rule_tuesday:
          type: number
          format: decimal
        rule_wednesday:
          type: number
          format: decimal
        rule_thursday:
          type: number
          format: decimal
        rule_friday:
          type: number
          format: decimal
        rule_saturday:
          type: number
          format: decimal
        rule_sunday:
          type: number
          format: decimal
        start_date:
          type: string
          format: date
      required:
      - authorization_status
      - first_day_of_week
      - rule_type
      - start_date
    FormTemplateFieldCore:
      type: object
      properties:
        field_tag:
          type: string
        field_type:
          type: string
        id:
          type: integer
        instructions:
          type: string
        json_logic:
          type: object
        label:
          type: string
        parent_id:
          type: integer
        rank:
          type: integer
        required:
          type: boolean
        settings:
          type: object
      required:
      - field_type
      - id
      - label
      - parent_id
      - rank
      - required
    OfferMatchResponseCore:
      type: string
      enum:
      - pending
      - accepted
      - declined
    OrganizationLeanCore:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
      required:
      - id
      - name
    CareTypeCore:
      type: string
      enum:
      - psw
      - nursing
    AllergyCore:
      type: object
      properties:
        name:
          type: string
        category:
          type: string
        severity:
          type: string
        start_date:
          type: string
          format: date
        treatment:
          type: string
    ItemsPerPageCore:
      type: integer
      minimum: 1
      default: 100
    RiskCore:
      type: object
      properties:
        name:
          type: string
        category:
          type: string
          example: allergy
        severity:
          type: integer
        start_date:
          type: string
          format: date
    OfferMatchCore:
      description: 'Core representation of an Offer Match.

        Meant to be used in the nested `match` in a top level (API) response schema.

        '
      allOf:
      - $ref: '#/components/schemas/OfferMatchReasonCodeCore'
      - type: object
        properties:
          id:
            type: string
            format: uuid
          response:
            $ref: '#/components/schemas/OfferMatchResponseCore'
          status:
            $ref: '#/components/schemas/OfferMatchStatusCore'
          sequence_id:
            type: string
            format: uuid
          created_at:
            type: string
            format: date-time
          updated_at:
            type: string
            format: date-time
        required:
        - id
        - response
        - status
        - sequence_id
        - created_at
    ServiceCore:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        start_at:
          type: string
          format: date-time
        expected_start_at:
          type: string
          format: date-time
        end_at:
          type: string
          format: date-time
        instructions:
          type: string
        notes:
          type: string
        skills:
          type: array
          items:
            type: string
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldCore'
      required:
      - name
    PageCore:
      description: Root page schema for returning collections.
      type: object
      properties:
        page:
          $ref: '#/components/schemas/PageNumberCore'
        items_per_page:
          $ref: '#/components/schemas/ItemsPerPageCore'
        total_items:
          type: integer
          minimum: 0
        total_pages:
          type: integer
          minimum: 0
      required:
      - page
      - items_per_page
      - total_items
      - total_pages
    InboxOfferCarePlanResponse:
      type: object
      properties:
        name:
          type: string
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        status:
          type: string
        interventions:
          type: array
          items:
            $ref: '#/components/schemas/CarePlanInterventionCore'
        updated_at:
          type: string
          format: date-time
      required:
      - name
      - start_date
    OfferTypeCore:
      type: string
      enum:
      - visit
      - service
    InboxOfferCollectionResponse:
      description: 'API response for the core representation of an offer response on the inbox API.

        '
      type: object
      properties:
        offer:
          $ref: '#/components/schemas/InboxOfferCore'
        match:
          $ref: '#/components/schemas/OfferMatchCore'
    InboxOfferVisitTaskResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
        description:
          type: string
        is_required:
          type: boolean
      required:
      - id
      - name
      - is_required
    CustomFieldCore:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        value:
          type: string
      required:
      - name
      - value
    CarePlanInterventionCore:
      type: object
      properties:
        description:
          type: string
        end_date:
          type: string
          format: date
        external_link:
          title: CarePlanInterventionExternalLinkCore
          type: object
          properties:
            label:
              type: string
            url:
              type: string
          required:
          - label
          - url
        has_duration:
          type: boolean
        is_from_library:
          type: boolean
        is_required:
          type: boolean
        name:
          type: string
        rank:
          type: integer
        recurrence:
          title: CarePlanInterventionRecurrenceCore
          type: object
          properties:
            count:
              type: integer
            frequency:
              type: string
            interval:
              type: integer
            weekdays:
              type: array
              items:
                type: string
            monthday:
              type: integer
            available_from:
              type: string
            available_to:
              type: string
          required:
          - frequency
          - interval
        recurrence_type:
          type: string
        start_date:
          type: string
          format: date
        status:
          type: string
        timezone:
          type: string
        type:
          type: string
        updated_at:
          type: string
          format: date-time
      required:
      - has_duration
      - is_required
      - name
      - rank
      - recurrence_type
      - start_date
      - status
      - type
    AddressAnonCore:
      type: object
      properties:
        city:
          type: string
          minLength: 1
        state:
          type: string
          minLength: 1
        zip:
          type: string
          minLength: 1
        country:
          type: string
          minLength: 1
        approx_latitude:
          type: number
          format: double
          minimum: -90
          maximum: 90
        approx_longitude:
          type: number
          format: double
          minimum: -180
          maximum: 180
        approx_radius_meters:
          type: number
          format: double
          minimum: 0
      required:
      - city
      - state
      - zip
      - country
    InboxOfferVisitResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        start_at:
          type: string
          format: date-time
        end_at:
          type: string
          format: date-time
        instructions:
          type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/InboxOfferVisitTaskResponse'
      required:
      - id
      - start_at
      - end_at
    InboxOfferDeclineRequest:
      allOf:
      - $ref: '#/components/schemas/OfferMatchReasonCodeCore'
    OfferMatchStatusCore:
      type: string
      nullable: true
      enum:
      - open
      - expired
      - closed
      - assigned
      - fulfilled
    OfferReasonCodeCore:
      description: '`reason_code` and `reason_comment` associated to a cancelled or closed offer.

        '
      type: object
      properties:
        reason_code:
          type: string
          enum:
          - datetime_change
          - client_request
          - client_hospitalization
          - client_passed_away
          - client_refused_service
          - processing_error
          - other
        reason_comment:
          type: string
    InboxOfferAcceptRequest:
      type: object
      properties:
        comment:
          type: string
    OfferMatchReasonCodeCore:
      description: '`reason_code` associated with a declined Offer Match.

        '
      type: object
      properties:
        reason_code:
          type: string
        comment:
          type: string
    FormTemplateCore:
      type: object
      properties:
        admin_eyes_only:
          type: boolean
        approve_automatically:
          type: boolean
        clinical_event_name:
          type: string
        display_instructions_in_pdf:
          type: boolean
        display_report:
          type: boolean
        exclude_from_shift_report:
          type: boolean
        form_type:
          type: string
        id:
          type: integer
        instructions:
          type: string
        language_code:
          type: string
        name:
          type: string
        notify_alert_queue:
          type: boolean
        pre_populate:
          type: boolean
        requires_clock_in:
          type: boolean
        schema_id:
          type: string
          format: uuid
        schema_version:
          type: integer
        visit_link_required:
          type: boolean
      required:
      - admin_eyes_only
      - approve_automatically
      - display_instructions_in_pdf
      - display_report
      - exclude_from_shift_report
      - form_type
      - id
      - language_code
      - name
      - notify_alert_queue
      - pre_populate
      - requires_clock_in
      - schema_id
      - schema_version
      - visit_link_required
  parameters:
    ShiftIdQueryParam:
      in: query
      name: shift_id
      schema:
        type: string
        format: uuid
    SortOrderParam:
      in: query
      name: sort_order
      schema:
        $ref: '#/components/schemas/SortOrderCore'
    OfferIdPathParam:
      in: path
      name: offer_id
      schema:
        type: string
        format: uuid
      required: true
      description: ID of an offer
    PageNumberParam:
      in: query
      name: page
      schema:
        $ref: '#/components/schemas/PageNumberCore'
    SortByParam:
      in: query
      name: sort_by
      schema:
        $ref: '#/components/schemas/SortByCore'
    ItemsPerPageParam:
      in: query
      name: items_per_page
      schema:
        $ref: '#/components/schemas/ItemsPerPageCore'
  securitySchemes:
    basic_auth:
      type: http
      description: Basic HTTP auth over https
      scheme: basic