openapi: 3.2.0 info: title: Lokki Price Rules API description: The main API powering the Lokki Dashboard and Online Store version: '2.0' contact: {} servers: [] security: - x-access-token: [] tags: - name: Price Rules paths: /v2/price-rules: get: operationId: listCompanyPriceRules parameters: [] responses: '200': description: '' content: application/json: schema: type: array items: $ref: '#/components/schemas/ItemPriceRule' tags: - Price Rules post: operationId: createPriceRule parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePriceRulesDto' responses: '201': description: '' content: application/json: schema: $ref: '#/components/schemas/ItemPriceRule' tags: - Price Rules /v2/price-rules/{id}: put: operationId: updatePriceRule parameters: - name: id required: true in: path schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreatePriceRulesDto' responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/ItemPriceRule' tags: - Price Rules delete: operationId: deletePriceRule parameters: - name: id required: true in: path schema: type: string responses: '200': description: '' tags: - Price Rules components: schemas: CreatePriceRulesDto: type: object properties: rule: $ref: '#/components/schemas/PriceRulesDto' required: - rule PriceRuleDate: type: object properties: day: type: number time: type: string required: - day - time PriceRulesDto: type: object properties: title: type: string rules: type: array items: $ref: '#/components/schemas/PriceRule' required: - title - rules ItemPriceRule: type: object properties: id: type: string companyId: type: string title: type: string rules: type: array items: $ref: '#/components/schemas/PriceRule' required: - id - companyId - title - rules PriceRule: type: object properties: _id: type: string startDate: $ref: '#/components/schemas/PriceRuleDate' endDate: $ref: '#/components/schemas/PriceRuleDate' type: type: string enum: - in - include - overlap variation: type: number required: - startDate - endDate - type - variation securitySchemes: x-access-token: scheme: bearer bearerFormat: JWT type: apiKey in: header name: x-access-token