openapi: 3.2.0 info: version: 1.0.0 title: Subskribe Discounts API servers: - url: https://api.app.subskribe.com security: - ApiKeyAuth: [] tags: - name: Discounts paths: /discounts: get: tags: - Discounts summary: Get discounts description: Returns all discounts that have been defined operationId: getDiscounts responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/DiscountJson' post: tags: - Discounts summary: Create a discount description: Creates a discount with the specified details. On success, the ID of the new discount is returned. operationId: addDiscount requestBody: content: application/json: schema: $ref: '#/components/schemas/DiscountJson' description: details of the discount responses: '200': description: successful operation content: application/json: schema: type: string /discounts/{id}: get: tags: - Discounts summary: Get discount description: Returns the details of the specified discount. operationId: getDiscount parameters: - name: id in: path description: id of the discount required: true schema: type: string responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/DiscountJson' put: tags: - Discounts summary: Update discount details description: Updates the details of the specified discount. Note that a discount cannot be updated once it is in use by an order. operationId: updateDiscount parameters: - name: id in: path description: id of the discount required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/DiscountJson' responses: default: description: successful operation delete: tags: - Discounts summary: Delete a discount description: Deletes a discount. Note that a discount may not be deleted if it is in use. operationId: deleteDiscount parameters: - name: id in: path required: true schema: type: string responses: default: description: successful operation /discounts/{id}/status/{status}: put: tags: - Discounts summary: Update discount status description: Updates the status of a discount operationId: updateDiscountStatus parameters: - name: id in: path description: id of the discount required: true schema: type: string - name: status in: path description: new status to set required: true schema: type: string enum: - ACTIVE - DEPRECATED responses: default: description: successful operation components: schemas: DiscountJson: type: object properties: name: type: string percent: type: number discountAmount: type: number status: type: string enum: - ACTIVE - DEPRECATED discountedPrice: type: number securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key