openapi: 3.0.0
info:
version: 1.0.19-oas3
title: AlayaCare Accounting Accounts take rates 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: take rates
paths:
/v1/sys_admin/take_rates/demand_take_rates:
get:
tags:
- take rates
description: '# Authorization
Required role: `sys_admin`
# Description
Get a collection of take rates specific to demand organizations.
'
parameters:
- in: query
name: demand_persona_id
schema:
type: string
format: uuid
responses:
200:
description: Successfully returned demand take rates collection
content:
application/json:
schema:
$ref: '#/components/schemas/DemandTakeRateCollectionResponse'
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/sys_admin/take_rates/demand_take_rates/{demand_persona_id}:
parameters:
- in: path
name: demand_persona_id
schema:
type: string
format: uuid
required: true
description: ID of an organization.
post:
tags:
- take rates
description: '# Authorization
Required role: `sys_admin`
# Description
Set the take rate specific to a demand organization.
Note: a null take rate means the system will clear the demand-specific take rate
and apply the next available take rate (e.g., the regional take rate).
A take rate of 0 is a take rate of 0%.
'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DemandTakeRateCreateRequest'
responses:
204:
description: Successfully set the demand-specific take rate.
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/sys_admin/take_rates/regional_take_rate:
get:
tags:
- take rates
description: '# Authorization
Required role: `sys_admin`
# Description
Get a regional take rate.
'
responses:
200:
description: Successfully returned regional take rate
content:
application/json:
schema:
$ref: '#/components/schemas/RegionalTakeRateDetailResponse'
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
post:
tags:
- take rates
description: '# Authorization
Required role: `sys_admin`
# Description
Set the regional take rate.
'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegionalTakeRateUpdateRequest'
responses:
200:
description: Successfully returned regional take rate
content:
application/json:
schema:
$ref: '#/components/schemas/RegionalTakeRateDetailResponse'
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:
DemandTakeRateCore:
type: object
properties:
demand_persona_id:
type: string
format: uuid
rate:
$ref: '#/components/schemas/TakeRateCore'
required:
- demand_persona_id
- rate
RegionalTakeRateDetailResponse:
type: object
properties:
rate:
$ref: '#/components/schemas/TakeRateCore'
required:
- rate
TakeRateCore:
type: number
format: decimal
minimum: 0
maximum: 1
description: 'A percentage of the offer price set by demand, represented by a fraction
between 0 and 1. For example, a regional take rate of 0.1 is 10%.
'
DemandTakeRateCollectionResponse:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/DemandTakeRateCore'
DemandTakeRateCreateRequest:
type: object
properties:
rate:
$ref: '#/components/schemas/TakeRateCore'
RegionalTakeRateUpdateRequest:
type: object
properties:
rate:
$ref: '#/components/schemas/TakeRateCore'
required:
- rate
securitySchemes:
basic_auth:
type: http
description: Basic HTTP auth over https
scheme: basic