openapi: 3.2.0 info: title: Online Store Discount Rules API version: '1.0' description: Online Store API servers: - url: https://www.yoursite.com/api/v1 description: '' security: - X-AC-Auth-Token: [] tags: - name: Discount Rules paths: /discount_rules: get: summary: Get Discount Rules tags: - Discount Rules responses: '200': description: OK content: application/json: schema: type: object properties: total_count: type: integer discount_rules: type: array items: $ref: '#/components/schemas/discount_rules' operationId: get-discount_rules description: 'Gets an array of discount rules. ' post: summary: Create a Discount Rule operationId: post-discount_rules responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/discount_rules' description: 'Creates a discount rule. ' tags: - Discount Rules requestBody: content: application/json: schema: description: '' type: object x-examples: example-1: discount_method_id: 41 type: coupon code target: Hello There operator_type: equal to target_quantity: 1 target_quantity_type: MinimumOf discount_action_id: null is_action_rule: false bogo_discount_buy_quantity: null bogo_discount_quantity: null bogo_max_use_per_order: null discount_from_high_to_low: false properties: discount_method_id: type: integer type: type: string target: type: string operator_type: type: string target_quantity: type: integer target_quantity_type: type: string discount_action_id: type: integer is_action_rule: type: boolean bogo_discount_buy_quantity: type: integer bogo_discount_quantity: type: integer bogo_max_use_per_order: type: integer discount_from_high_to_low: type: boolean required: - discount_method_id - type - target examples: Example: value: discount_method_id: 41 type: coupon code target: Hello There operator_type: equal to target_quantity: 1 target_quantity_type: MinimumOf discount_action_id: null is_action_rule: false bogo_discount_buy_quantity: null bogo_discount_quantity: null bogo_max_use_per_order: null discount_from_high_to_low: false /discount_rules/{id}: parameters: - schema: type: integer name: id in: path required: true description: The ID of the `discount_rule` delete: summary: Deletes a Discount Rule operationId: delete-discount_rules-id description: 'Deletes a discount rule. ' tags: - Discount Rules responses: '200': description: OK '404': $ref: '#/components/responses/404' put: summary: Update a Discount Rule operationId: put-discount_rules-id responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/discount_rules' description: Updates a discount rule. tags: - Discount Rules requestBody: content: application/json: schema: $ref: '#/components/schemas/discount_rules' components: responses: '404': description: Resource Not Found content: application/json: schema: description: Not Found type: object x-examples: example-1: status_code: 404 message: Not Found details: No resource found properties: status_code: type: number message: type: string details: type: string examples: {} headers: {} schemas: discount_rules: type: object properties: id: type: integer discount_method_id: type: integer type: type: string target: type: string updated_at: type: string created_at: type: string operator_type: type: string target_quantity: type: integer target_quantity_type: type: string discount_action_id: type: integer is_action_rule: type: boolean bogo_discount_buy_quantity: type: integer bogo_discount_quantity: type: integer bogo_max_use_per_order: type: integer discount_from_high_to_low: type: boolean securitySchemes: X-AC-Auth-Token: name: X-AC-Auth-Token type: apiKey in: header