From b302c9c5d883a36a96868457969ae84d4ebca1ce Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:57:04 +0200 Subject: [PATCH] fix --- reference/OpenAPI.json | 170 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 3f3d3e387..44871bafe 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -30675,6 +30675,174 @@ } } }, + "8_obj_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the `start_date` and `expiration_date` of the campaign or the earning rule's own `start_date` and `expiration_date`. \n\n- `true` indicates an *active* earning rule\n- `false` indicates an *inactive* earning rule" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, "17_res_obj_get_async_action_result_campaign_vouchers_update": { "title": "CAMPAIGN.VOUCHERS_UPDATE", "type": "object", @@ -79766,4 +79934,4 @@ } } } -} \ No newline at end of file +}