{
  "openapi": "3.0.1",
  "info": {
    "title": "Voucherify API - Customers",
    "version": "v2018-08-01",
    "description": "Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.",
    "contact": {
      "name": "Voucherify Team",
      "url": "https://www.voucherify.io/contact-support",
      "email": "support@voucherify.io"
    },
    "termsOfService": "https://www.voucherify.io/legal/subscription-agreement",
    "license": {
      "name": "MIT",
      "url": "https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE"
    }
  },
  "servers": [
    {
      "url": "https://{cluster}.voucherify.io",
      "description": "Base URL",
      "variables": {
        "cluster": {
          "default": "api",
          "enum": [
            "api",
            "us1.api",
            "as1.api",
            "download",
            "us1.download",
            "as1.download"
          ]
        }
      }
    }
  ],
  "paths": {
    "/v1/customers": {
      "get": {
        "operationId": "list-customers",
        "tags": [
          "Customers"
        ],
        "summary": "List Customers",
        "description": "Returns a list of customers.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ParameterPage99"
            },
            "description": "Which page of results to return. The lowest value is `1`, the highest value is `99`."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "name": "email",
            "description": "Limit the customers to the ones that have this specific email address."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "description": "Limit the customers to the ones that are located in the specified city.",
            "name": "city"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "description": "Filter customers by the name property.",
            "name": "name"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "description": "Filter customers by the segment ID.\n\nWarning: Passing additional query parameter filters that are in conflict with the segment filters may return unexpected results.",
            "name": "segment_id"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "description": "Filter customers by date customer was created.",
            "name": "created_at[before]"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "description": "Filter customers by date customer was created.",
            "name": "created_at[after]"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "description": "Filter customers by date customer was updated last time.",
            "name": "updated_at[before]"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "description": "Filter customers by date customer was updated last time.",
            "name": "updated_at[after]"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderListCustomers"
            },
            "in": "query",
            "name": "order",
            "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "name": "starting_after",
            "description": "A cursor for pagination. This is a date-time value that defines your place in the list based on `created_at` property from the customer object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list. \n\n| **Option** | **Format** | **Sorting** |\n|:---|:---|:---|\n| Return customers **before** a specific creation date  | - set `starting_after` parameter to the breakpoint date | Sorting order is **descending**; the most recent dates first and least recent dates last. |\n| Return customers **after** a specific create or update date | - include the `order` parameter set to `created_at` or `updated_at`<br />- set `starting_after` to the breakpoint date | Sorting order is **ascending**; the least recent dates first and the most recent dates last. |\n"
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with customer objects. The customers are returned sorted by creation date, with the most recent customers appearing first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "customers",
                      "customers": [
                        {
                          "id": "cust_CSnYd37MXmrbS19XCrghjBsv",
                          "source_id": "source_123",
                          "name": "Bob Smith",
                          "description": "A frequent customer",
                          "email": "bob.smith@email.com",
                          "phone": "+1 933 222 3333",
                          "birthdate": "2022-01-01",
                          "address": {
                            "city": "New York",
                            "state": "NY",
                            "line_1": "123 Main St.",
                            "line_2": "APT 3 BLG 5",
                            "country": "United States",
                            "postal_code": "10001"
                          },
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 1,
                              "total_failed": 0,
                              "total_succeeded": 1,
                              "total_rolled_back": 0,
                              "total_rollback_failed": 0,
                              "total_rollback_succeeded": 0,
                              "gift": {
                                "redeemed_amount": 0,
                                "amount_to_go": 0
                              },
                              "loyalty_card": {
                                "redeemed_points": 0,
                                "points_to_go": 4200
                              }
                            },
                            "orders": {
                              "total_amount": 1600,
                              "total_count": 1,
                              "average_amount": 1600,
                              "last_order_amount": 1600,
                              "last_order_date": "2022-08-30T10:17:39.220Z"
                            }
                          },
                          "loyalty": {
                            "points": 2200,
                            "referred_customers": 0,
                            "campaigns": {
                              "Christmas Campaign": {
                                "points": 1000,
                                "referred_customers": 0
                              },
                              "Fall Campaign": {
                                "points": 75,
                                "referred_customers": 0
                              },
                              "Winter Campaign": {
                                "points": 75,
                                "referred_customers": 0
                              },
                              "Summer Campaign": {
                                "points": 50,
                                "referred_customers": 0
                              },
                              "Spring Campaign": {
                                "points": 1000,
                                "referred_customers": 0
                              }
                            }
                          },
                          "referrals": {
                            "total": 1,
                            "campaigns": [
                              {
                                "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal",
                                "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
                                "related_object_id": "r_0b9d4c5121d64dd01d",
                                "related_object_type": "redemption",
                                "date": "2022-08-30T10:17:41.089Z"
                              }
                            ]
                          },
                          "metadata": {
                            "lang": "en",
                            "test": true
                          },
                          "system_metadata": {},
                          "created_at": "2022-08-30T06:32:07.380Z",
                          "updated_at": "2022-08-30T10:17:58.049Z",
                          "object": "customer"
                        },
                        {
                          "id": "cust_X0hU04x7FeisPnD5lctZcQkI",
                          "source_id": "jane.smith@email.com",
                          "name": "Jane Smith",
                          "description": "A nice customer",
                          "email": "jane.smith@email.com",
                          "phone": "+1 933 222 3333",
                          "birthdate": "2022-01-02",
                          "address": {
                            "city": "New Yorke",
                            "state": "NY",
                            "line_1": "123 Main Ste.",
                            "line_2": "APT 3 BLG 4e",
                            "country": "United Statese",
                            "postal_code": "10001e"
                          },
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 4,
                              "total_failed": 0,
                              "total_succeeded": 4,
                              "total_rolled_back": 1,
                              "total_rollback_failed": 0,
                              "total_rollback_succeeded": 1,
                              "gift": {
                                "redeemed_amount": 0,
                                "amount_to_go": 0
                              },
                              "loyalty_card": {
                                "redeemed_points": 0,
                                "points_to_go": 15549
                              }
                            },
                            "orders": {
                              "total_amount": 210000,
                              "total_count": 3,
                              "average_amount": 70000,
                              "last_order_amount": 70000,
                              "last_order_date": "2022-08-30T11:51:08.029Z"
                            }
                          },
                          "loyalty": {
                            "points": 15399,
                            "referred_customers": 0,
                            "campaigns": {
                              "Christmas Campaign": {
                                "points": 7000,
                                "referred_customers": 0
                              },
                              "Fall Campaign": {
                                "points": 2299,
                                "referred_customers": 0
                              },
                              "Winter Campaign": {
                                "points": 25,
                                "referred_customers": 0
                              },
                              "Summer Campaign": {
                                "points": 75,
                                "referred_customers": 0
                              },
                              "Spring Campaign": {
                                "points": 6000,
                                "referred_customers": 0
                              }
                            }
                          },
                          "referrals": {
                            "total": 2,
                            "campaigns": [
                              {
                                "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal",
                                "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
                                "related_object_id": "r_0b9d4cc4aa164dd073",
                                "related_object_type": "redemption",
                                "date": "2022-08-30T10:19:39.196Z"
                              },
                              {
                                "campaign_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3",
                                "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv",
                                "related_object_id": "r_0b9d61b6484ead0324",
                                "related_object_type": "redemption",
                                "date": "2022-08-30T11:51:10.445Z"
                              }
                            ]
                          },
                          "metadata": {
                            "lang": "en",
                            "test": false
                          },
                          "system_metadata": {},
                          "created_at": "2022-08-09T09:50:53.620Z",
                          "updated_at": "2022-08-30T11:51:24.327Z",
                          "object": "customer"
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create-customer",
        "tags": [
          "Customers"
        ],
        "summary": "Create Customer",
        "description": "Creates a customer object.\n\n\n\n<Note>\n\n<Badge color=\"blue\">Upsert Mode</Badge>\n\nIf you pass an `id` or a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.\n\n</Note>",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "requestBody": {
          "description": "Create a customer with specified parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomersCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "source_id": "source_123",
                    "name": "Bob Smith",
                    "description": "A frequent customer",
                    "email": "bob.smith@email.com",
                    "phone": "+1 933 222 3333",
                    "address": {
                      "city": "New York",
                      "country": "United States",
                      "line_1": "123 Main St.",
                      "line_2": "APT 3 BLG 4",
                      "postal_code": "10001",
                      "state": "NY"
                    },
                    "metadata": {
                      "lang": "en",
                      "test": true
                    },
                    "birthdate": "2022-01-01"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a customer object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "cust_CSnYd37MXmrbS19XCrghjBsv",
                      "source_id": "source_123",
                      "name": "Bob Smith",
                      "description": "A frequent customer",
                      "email": "bob.smith@email.com",
                      "phone": "+1 933 222 3333",
                      "birthdate": "2022-01-01",
                      "address": {
                        "city": "New York",
                        "state": "NY",
                        "line_1": "123 Main St.",
                        "line_2": "APT 3 BLG 4",
                        "country": "United States",
                        "postal_code": "10001"
                      },
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 0,
                          "total_failed": 0,
                          "total_succeeded": 0,
                          "total_rolled_back": 0,
                          "total_rollback_failed": 0,
                          "total_rollback_succeeded": 0,
                          "gift": {
                            "redeemed_amount": 0,
                            "amount_to_go": 0
                          },
                          "loyalty_card": {
                            "redeemed_points": 0,
                            "points_to_go": 0
                          }
                        },
                        "orders": {
                          "total_amount": 0,
                          "total_count": 0,
                          "average_amount": 0,
                          "last_order_amount": 0
                        }
                      },
                      "loyalty": {
                        "points": 0,
                        "referred_customers": 0,
                        "campaigns": {}
                      },
                      "referrals": {
                        "total": 0,
                        "campaigns": []
                      },
                      "metadata": {
                        "lang": "en",
                        "test": true
                      },
                      "system_metadata": {},
                      "created_at": "2022-08-30T06:32:07.380Z",
                      "object": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "A Voucherify customer's `id` or `source_id`."
        }
      ],
      "get": {
        "operationId": "get-customer",
        "tags": [
          "Customers"
        ],
        "summary": "Get Customer",
        "description": "Retrieves details of a given customer by customer's `id` or `source_id`.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a customer object if a valid identifier was provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersGetResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "cust_T849EgzNVVmn5icJ2FAkT2rO",
                      "source_id": "alice.morgan@email.com",
                      "name": "Alice Morgan",
                      "email": "alice.morgan@email.com",
                      "address": null,
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 2,
                          "total_failed": 0,
                          "total_succeeded": 2,
                          "total_rolled_back": 0,
                          "total_rollback_failed": 0,
                          "total_rollback_succeeded": 0,
                          "gift": {
                            "redeemed_amount": 0,
                            "amount_to_go": 0
                          },
                          "loyalty_card": {
                            "redeemed_points": 0,
                            "points_to_go": 3303
                          }
                        },
                        "orders": {
                          "total_amount": 203900,
                          "total_count": 2,
                          "average_amount": 101950,
                          "last_order_amount": 3900,
                          "last_order_date": "2022-07-26T14:59:52.814Z"
                        }
                      },
                      "loyalty": {
                        "points": 3303,
                        "referred_customers": 0,
                        "campaigns": {
                          "Summer Campaign": {
                            "points": 3303,
                            "referred_customers": 0
                          }
                        }
                      },
                      "referrals": {
                        "total": 0,
                        "campaigns": []
                      },
                      "system_metadata": {},
                      "created_at": "2022-02-07T08:28:23.644Z",
                      "updated_at": "2022-07-26T14:59:59.806Z",
                      "assets": {
                        "cockpit_url": "{{internalVoucherifyURL}}"
                      },
                      "object": "customer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. When requesting the ID of a customer that has been deleted or does not exist in the system, the resource will not be returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id cust_sehkNIi8Uq2qQuRqSr7xn4Z",
                      "request_id": "v-0b4c590350857970df",
                      "resource_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Z",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-customer",
        "tags": [
          "Customers"
        ],
        "summary": "Delete Customer",
        "description": "This method deletes a customer.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Returns no content if deletion is successful."
          },
          "404": {
            "description": "Returns an error indicating that the customer with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Customer Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id cust_7pm0hh0yemiydeFsdYXZlr1",
                      "request_id": "v-0ae398fd9ac683dc84",
                      "resource_id": "cust_7pm0hh0yemiydeFsdYXZlr1",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-customer",
        "tags": [
          "Customers"
        ],
        "summary": "Update Customer",
        "description": "Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the parameters to be updated.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomersUpdateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "Alice McDonald",
                    "email": "alice.mdconald@email.com",
                    "description": "Updating customer data",
                    "phone": "+1 (132) 222-2222",
                    "address": {
                      "city": "New York",
                      "country": "United States",
                      "line_1": "123 Main St.",
                      "line_2": "APT 3 BLG 4",
                      "postal_code": "10001",
                      "state": "NY"
                    },
                    "metadata": {
                      "lang": "en",
                      "test": true
                    },
                    "birthdate": "2022-01-01",
                    "birthday": "2022-01-02"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a customer object if updates were successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersUpdateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "cust_T849EgzNVVmn5icJ2FAkT2rO",
                      "source_id": "alice@morgan.com",
                      "name": "Alice McDonald",
                      "description": "Updating customer data",
                      "email": "alice.mdconald@email.com",
                      "phone": "+1 (132) 222-2222",
                      "birthday": "2022-01-02",
                      "birthdate": "2022-01-01",
                      "address": {
                        "city": "New York",
                        "state": "NY",
                        "line_1": "123 Main St.",
                        "line_2": "APT 3 BLG 4",
                        "country": "United States",
                        "postal_code": "10001"
                      },
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 2,
                          "total_failed": 0,
                          "total_succeeded": 2,
                          "total_rolled_back": 0,
                          "total_rollback_failed": 0,
                          "total_rollback_succeeded": 0,
                          "gift": {
                            "redeemed_amount": 0,
                            "amount_to_go": 0
                          },
                          "loyalty_card": {
                            "redeemed_points": 0,
                            "points_to_go": 4428
                          }
                        },
                        "orders": {
                          "total_amount": 203900,
                          "total_count": 2,
                          "average_amount": 101950,
                          "last_order_amount": 3900,
                          "last_order_date": "2022-07-26T14:59:52.814Z"
                        }
                      },
                      "loyalty": {
                        "points": 3403,
                        "referred_customers": 0,
                        "campaigns": {
                          "Summer Campaign": {
                            "points": 0,
                            "referred_customers": 0
                          },
                          "Spring Campaign": {
                            "points": 50,
                            "referred_customers": 0
                          },
                          "Fall Campaign": {
                            "points": 50,
                            "referred_customers": 0
                          },
                          "Winter Campaign": {
                            "points": 3303,
                            "referred_customers": 0
                          }
                        }
                      },
                      "referrals": {
                        "total": 0,
                        "campaigns": []
                      },
                      "metadata": {
                        "lang": "en",
                        "test": true
                      },
                      "system_metadata": {},
                      "created_at": "2022-02-07T08:28:23.644Z",
                      "updated_at": "2022-08-31T09:58:30.475Z",
                      "object": "customer"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error indicating that a customer with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id alice2@morgan.com",
                      "request_id": "v-0b9e924dd243bf26e2",
                      "resource_id": "alice2@morgan.com",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}/permanent-deletion": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "A Voucherify customer's `id` or `source_id`."
        }
      ],
      "post": {
        "operationId": "customer-permanently-deletion",
        "tags": [
          "Customers"
        ],
        "summary": "Delete Customer Permanently",
        "description": "The organization user can remove consumer data permanently from the Voucherify system by using this API method. It deletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a permanent deletion object and status of the deletion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersPermanentDeletionCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "del_7k3buMvBsJuXiLRmdh1WZvZs",
                      "created_at": "2022-09-02T17:50:29.302Z",
                      "related_object_id": "cust_XI8sPLvznzVpNI1BMIWGcUJa",
                      "related_object": "customer",
                      "status": "DONE",
                      "data_json": {
                        "events": 16,
                        "customer_events": 28,
                        "daily_events": 0,
                        "segments": 0,
                        "orders": 9,
                        "order_events": 5,
                        "customer": 1
                      },
                      "object": "pernament_deletion"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error indicating that a customer with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id cust_W8n9I8pJDXlM69j49iKJeYp",
                      "request_id": "v-0b4c62635a154e96f1",
                      "resource_id": "cust_W8n9I8pJDXlM69j49iKJeYp",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/importCSV": {
      "post": {
        "operationId": "import-customers-using-csv",
        "tags": [
          "Customers"
        ],
        "summary": "Import and Update Customers using CSV",
        "description": "This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas.  \n\n## Request Example\n\n```cURL\ncurl -X **POST** \\\n  https://api.voucherify.io/v1/customers/importCSV \\\n  -F file=@/path/to/customers.csv \\\n  -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n  -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n## CSV File Format\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.\n\n\n<Note>\n\n<Badge color=\"blue\">Standard customer fields mapping</Badge>\n\n**No spaces allowed in field names** `Id`, `Name`, `Email`, `Phone`, `Birthdate`, `Source_id`, `Address_line_1`, `Address_line_2`, `Address_Postal_Code`, `Address_City`, `Address_State`, `Address_Country`, `Description`, `Metadata_name_1`, `Metadata_name_2`\n\n</Note>\n\n## Update Customers using CSV\n\nIf you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](/api-reference/async-actions/get-async-action).",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "requestBody": {
          "description": "The file path is stored in the form `file` header.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CustomersImportCSVRequestBody"
              },
              "examples": {}
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersImportCsvCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/bulk/async": {
      "post": {
        "operationId": "update-customers-in-bulk",
        "tags": [
          "Customers"
        ],
        "summary": "Update Customers in Bulk",
        "description": "Updates customers in one asynchronous operation.\n\nThe request can include up to **10 MB** of data.\n\nThe response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:\n\n- The status of your request (in queue, in progress, done, or failed)\n\n- Resources that failed to be updated\n\n- The report file with details about the update\n\n\n\nIf a customer object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.\n\nThis API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "requestBody": {
          "description": "List the customer fields to be updated in each customer object.",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "title": "Update Customers in bulk Request Body",
                "description": "Request body schema for `/customers/bulk/async`.",
                "items": {
                  "$ref": "#/components/schemas/CustomersUpdateInBulkRequestBody"
                }
              },
              "examples": {
                "Example": {
                  "value": [
                    {
                      "source_id": "John.Smith@email.com",
                      "name": "John Smith",
                      "email": "john.smith@email.com",
                      "description": "Updating customer data",
                      "phone": "+1 (132) 222-2222",
                      "address": {
                        "city": "New York",
                        "country": "United States",
                        "line_1": "123 Main St.",
                        "line_2": "APT 3 BLG 4",
                        "postal_code": "10001",
                        "state": "NY"
                      },
                      "metadata": {
                        "lang": "en",
                        "test": true
                      },
                      "birthday": "2022-04-04"
                    },
                    {
                      "source_id": "Jane.Smith@email.com",
                      "name": "Jane Smith",
                      "email": "Jane.Smith@email.com",
                      "description": "Updating customer data",
                      "phone": "+1 (132) 222-2222",
                      "address": {
                        "city": "New York",
                        "country": "United States",
                        "line_1": "123 Main St.",
                        "line_2": "APT 3 BLG 4",
                        "postal_code": "10001",
                        "state": "NY"
                      },
                      "metadata": {
                        "lang": "en",
                        "test": true
                      },
                      "birthday": "2022-03-03"
                    },
                    {
                      "source_id": "Sally.Smith@email.com",
                      "name": "Sally Smith",
                      "email": "Sally.Smith@email.com",
                      "description": "Updating customer data",
                      "phone": "+1 (132) 222-2222",
                      "address": {
                        "city": "New York",
                        "country": "United States",
                        "line_1": "123 Main St.",
                        "line_2": "APT 3 BLG 4",
                        "postal_code": "10001",
                        "state": "NY"
                      },
                      "metadata": {
                        "lang": "en",
                        "test": true
                      },
                      "birthdate": "2022-02-02"
                    }
                  ]
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersUpdateInBulkResponseBody"
                }
              }
            }
          },
          "413": {
            "description": "Returns an error if the payload exceeds 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                },
                "examples": {
                  "Request Entity Too Large": {
                    "value": {
                      "statusCode": 413,
                      "error": "Request Entity Too Large",
                      "message": "Payload content length greater than maximum allowed: 10485760"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "default": 429
                    },
                    "message": {
                      "type": "string",
                      "default": "Too many requests hit the API too quickly."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/metadata/async": {
      "post": {
        "operationId": "update-customers-metadata-in-bulk",
        "tags": [
          "Customers"
        ],
        "summary": "Update Customers' Metadata in Bulk",
        "description": "Updates metadata parameters for a list of customers. Every resource in the list will receive the metadata defined in the request.\n\nThe request can include up to **10 MB** of data.\n\nThe response returns a unique asynchronous action ID. Use this ID in the query paramater of the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint to check, e.g.:\n\n- The status of your request (in queue, in progress, done, or failed)\n\n- Resources that failed to be updated\n\n- The report file with details about the update\n\nIf a customer object is not found, it is **upserted**. This is shown in the report file in the **GET** Async Action endpoint. The upserted resources have value `false` in the `found` column and `true` in the `updated` column.\n\nThis API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "requestBody": {
          "description": "List the `source_ids` of the customers you would like to update with the metadata key/value pairs.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomersMetadataUpdateInBulkRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "source_ids": [
                      "source_123",
                      "source_456"
                    ],
                    "metadata": {
                      "lang": "en",
                      "test": false
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the [GET Async Action](/api-reference/async-actions/get-async-action) endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersMetadataUpdateInBulkResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "async_action_id": "aa_0a875d56c805df6601"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Returns an error if the payload exceeds 10 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequest"
                },
                "examples": {
                  "Request Entity Too Large": {
                    "value": {
                      "statusCode": 413,
                      "error": "Request Entity Too Large",
                      "message": "Payload content length greater than maximum allowed: 10485760"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}/activity": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "A Voucherify customer's `id` or source ID of the customer who performed the activities."
        }
      ],
      "get": {
        "operationId": "list-customer-activity",
        "tags": [
          "Customers"
        ],
        "summary": "List Customer Activity",
        "description": "Retrieves activity details of a given customer by customer's `id` or `source_id`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderCreatedAt"
            },
            "in": "query",
            "name": "order",
            "description": "Apply this filter to order the events according the date and time when it was created. "
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "name": "starting_after_id",
            "description": "A cursor for pagination. It retrieves the events starting after an event with the given ID."
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "description": "Timestamp representing the date and time which results must begin on. Represented in ISO 8601 format."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "description": "Timestamp representing the date and time which results must end on. Represented in ISO 8601 format."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignId"
            },
            "in": "query",
            "name": "campaign_id",
            "description": "Requests only events related to specific campaign identified by its ID."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignType"
            },
            "in": "query",
            "name": "campaign_type",
            "description": "Filters related customer's activity for the selected campaign types. Allowed values: \n`DISCOUNT_COUPONS`,\n`REFERRAL_PROGRAM`,\n`GIFT_VOUCHERS`,\n`PROMOTION`,\n`LOYALTY_PROGRAM`."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterActivityCategory"
            },
            "in": "query",
            "name": "category",
            "description": "Filters activities for actions or effects. Allowed values: \n`ACTION`,\n`EFFECT`."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCustomerEvent"
            },
            "in": "query",
            "name": "type",
            "description": "Event name of the customer event."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with customer activities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersActivityListResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the customer ID could not be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Customer ID not found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id jck-wbh",
                      "request_id": "v-0fa4de30126b92bfb8",
                      "resource_id": "jck-wbh",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}/activities": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "A Voucherify customer's `id` or source ID of the customer who performed the activities."
        }
      ],
      "get": {
        "operationId": "list-customer-activities",
        "deprecated": true,
        "tags": [
          "Customers"
        ],
        "summary": "List Customer Activities",
        "description": "<Danger>\n\n<Badge color=\"red\">Deprecated</Badge>\n\nThis endpoint represents the deprecated version of the API responsible for listing customer activities and we do not recommend using it. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint.\n\n</Danger>\n\nRetrieve customer activities.",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/order"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "in": "query",
            "name": "starting_after",
            "description": "A cursor for pagination. `starting_after` is a date-time value that defines your place in the list based on `created_at` property from the activity object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "name": "starting_after_id",
            "description": "A cursor for pagination. It retrieves the events starting after an event with the given ID."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignType"
            },
            "in": "query",
            "name": "campaign_type",
            "description": "Through this parameter you can control a type of campaign by which Voucherify will filter related customer's activity. API will return only records related to that given type. Allowed values: DISCOUNT_COUPONS, REFERRAL_PROGRAM, GIFT_VOUCHERS, PROMOTION, LOYALTY_PROGRAM"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterCampaignId"
            },
            "in": "query",
            "name": "campaign_id",
            "description": "By applying this parameter you request only events related to specific campaign identified by its ID."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterProductId"
            },
            "in": "query",
            "name": "product_id",
            "description": "By applying this parameter you request only events related to specific product identified by its ID."
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "description": "Timestamp representing the date and time which results must end on. Represented in ISO 8601 format."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterDate"
            },
            "description": "Timestamp representing the date and time which results must end on. Represented in ISO 8601 format."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with customer activities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersActivitiesListResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}/segments": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID."
        }
      ],
      "get": {
        "operationId": "list-customer-segments",
        "tags": [
          "Customers"
        ],
        "summary": "List Customer's Segments",
        "description": "Returns the list of segments IDs to which the customer belongs to.  \n\nIf you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The method returns segment(s) to which the given customer belongs to.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersSegmentsListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "data",
                      "data": [
                        {
                          "id": "seg_DNAOhUtJffvX0f57ajLMFBYR",
                          "name": "area code not 123",
                          "object": "segment"
                        },
                        {
                          "id": "seg_IPIYx96l92Op0Sy5MOaImhgw",
                          "name": "not bob.smith@email.com",
                          "object": "segment"
                        },
                        {
                          "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2",
                          "name": "Birthday After Dec 31",
                          "object": "segment"
                        },
                        {
                          "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2",
                          "name": "Start with S",
                          "object": "segment"
                        },
                        {
                          "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt",
                          "name": "Loyalty Card",
                          "object": "segment"
                        }
                      ],
                      "total": 5
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/{customerId}/redeemables": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCustomerId"
          },
          "name": "customerId",
          "in": "path",
          "required": true,
          "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID."
        }
      ],
      "get": {
        "operationId": "list-customer-redeemables",
        "tags": [
          "Customers"
        ],
        "summary": "List Customer's Redeemables",
        "description": "Retrieves all the redeemables that have been assigned to the customer.\n\nTo use this endpoint, you must have the following permissions:\n\n- Read Customers (`customers.details.read`)",
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterOrderListRedeemables"
            },
            "in": "query",
            "name": "order",
            "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order."
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterString"
            },
            "in": "query",
            "name": "starting_after_id",
            "description": "A cursor for pagination. It retrieves the events starting after an event with the given ID."
          },
          {
            "name": "filters",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/ParameterFiltersListCustomerRedeemables"
            },
            "description": "Filters for listing customer redeemables.",
            "style": "deepObject",
            "explode": true
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "customers"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The method returns redeemable(s) to which the given customer is assigned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomersRedeemablesListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "data",
                      "data": [
                        {
                          "id": "rh_0e7b8db4700106a852",
                          "created_at": "2024-03-22T17:48:25.910Z",
                          "redeemable_id": "v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1",
                          "redeemable_object": "voucher",
                          "customer_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
                          "holder_role": "OWNER",
                          "campaign_id": "camp_weer1c3p5ZgktqfW56RfoNaG",
                          "campaign_type": "DISCOUNT_COUPONS",
                          "voucher_type": "DISCOUNT_VOUCHER",
                          "redeemable": {
                            "type": "voucher",
                            "voucher": {
                              "id": "v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1",
                              "code": "3xRUnMVG",
                              "campaign": "Gaz6Q29w1d",
                              "campaign_id": "camp_weer1c3p5ZgktqfW56RfoNaG",
                              "category": null,
                              "category_id": null,
                              "categories": [],
                              "type": "DISCOUNT_VOUCHER",
                              "discount": {
                                "type": "AMOUNT",
                                "amount_off": 1000
                              },
                              "gift": null,
                              "loyalty_card": null,
                              "start_date": null,
                              "expiration_date": null,
                              "validity_timeframe": null,
                              "validity_hours": null,
                              "validity_day_of_week": null,
                              "active": true,
                              "additional_info": null,
                              "metadata": {},
                              "assets": {
                                "qr": {
                                  "id": "fa250fcd-8d51-41e7-9dda-9288ce2799a7",
                                  "url": "{{internalVoucherifyURL}}"
                                },
                                "barcode": {
                                  "id": "1b876033-ad88-4e74-8344-27fca1767006",
                                  "url": "{{internalVoucherifyURL}}"
                                }
                              },
                              "is_referral_code": false,
                              "created_at": "2024-03-22T17:48:18.57+00:00",
                              "updated_at": "2024-03-22T17:48:25.910974+00:00",
                              "holder_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
                              "redemption": {
                                "quantity": null,
                                "redeemed_quantity": 0,
                                "object": "list",
                                "url": "/v1/vouchers/3xRUnMVG/redemptions?page=1&limit=10"
                              },
                              "publish": {
                                "object": "list",
                                "count": 1,
                                "url": "/v1/vouchers/3xRUnMVG/publications?page=1&limit=10"
                              },
                              "object": "voucher"
                            },
                            "status": "ACTIVE"
                          }
                        },
                        {
                          "id": "rh_0e79fe37e4926cafd6",
                          "created_at": "2024-03-21T12:43:02.915Z",
                          "redeemable_id": "v_nnxc1aFzFZCAhRlG6sm0kSO4jKUohc9b",
                          "redeemable_object": "voucher",
                          "customer_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
                          "holder_role": "REFERRER",
                          "campaign_id": "camp_ixXNxP8kRoV15RoyZU4HqqYJ",
                          "campaign_type": "REFERRAL_PROGRAM",
                          "voucher_type": "DISCOUNT_VOUCHER",
                          "redeemable": {
                            "type": "voucher",
                            "voucher": {
                              "id": "v_nnxc1aFzFZCAhRlG6sm0kSO4jKUohc9b",
                              "code": "PBF3ZYfS",
                              "campaign": "REFER_2",
                              "campaign_id": "camp_ixXNxP8kRoV15RoyZU4HqqYJ",
                              "category": null,
                              "category_id": null,
                              "categories": [],
                              "type": "DISCOUNT_VOUCHER",
                              "discount": {
                                "type": "AMOUNT",
                                "amount_off": 88800,
                                "effect": "APPLY_TO_ORDER"
                              },
                              "gift": null,
                              "loyalty_card": null,
                              "start_date": null,
                              "expiration_date": null,
                              "validity_timeframe": null,
                              "validity_hours": null,
                              "validity_day_of_week": null,
                              "active": true,
                              "additional_info": null,
                              "metadata": {},
                              "assets": {
                                "qr": {
                                  "id": "fc0471bf-0c7b-443f-9532-303437041eea",
                                  "url": "{{internalVoucherifyURL}}"
                                },
                                "barcode": {
                                  "id": "5b2f2007-494b-40c3-9d4c-ad27269a0cd0",
                                  "url": "{{internalVoucherifyURL}}"
                                }
                              },
                              "is_referral_code": true,
                              "created_at": "2024-03-21T12:42:49.771+00:00",
                              "updated_at": "2024-03-21T12:43:02.915953+00:00",
                              "holder_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
                              "referrer_id": "cust_p1ufreYbVbwZ1x70nFkH9rF9",
                              "redemption": {
                                "quantity": null,
                                "redeemed_quantity": 0,
                                "object": "list",
                                "url": "/v1/vouchers/PBF3ZYfS/redemptions?page=1&limit=10"
                              },
                              "publish": {
                                "object": "list",
                                "count": 1,
                                "url": "/v1/vouchers/PBF3ZYfS/publications?page=1&limit=10"
                              },
                              "object": "voucher"
                            },
                            "status": "ACTIVE"
                          }
                        }
                      ],
                      "total": 2,
                      "has_more": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if a resource is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Resource not found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find customer with id cstmr_15071410",
                      "request_id": "v-0eed8c98734a6e8706",
                      "resource_id": "cstmr_15071410",
                      "resource_type": "customer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterLimit"
        },
        "description": "Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items."
      },
      "order": {
        "name": "order",
        "in": "query",
        "required": false,
        "schema": {
          "$ref": "#/components/schemas/ParameterOrder"
        },
        "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order."
      }
    },
    "schemas": {
      "ParameterPage99": {
        "type": "integer",
        "minimum": 1,
        "maximum": 99
      },
      "ParameterString": {
        "type": "string"
      },
      "ParameterDate": {
        "type": "string",
        "example": "2023-12-22T10:13:06.487Z",
        "format": "date-time"
      },
      "ParameterOrderListCustomers": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at",
          "source_id",
          "-source_id"
        ]
      },
      "CustomersListResponseBody": {
        "title": "Customers List Response Body",
        "description": "Response body schema for **GET** `v1/customers`.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about customers in a dictionary."
          },
          "data_ref": {
            "type": "string",
            "default": "customers",
            "description": "Identifies the name of the attribute that contains the array of customer objects."
          },
          "customers": {
            "type": "array",
            "description": "Contains array of customer objects.",
            "items": {
              "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of customers."
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different end date filter) to get more records returned in the results."
          }
        },
        "required": [
          "object",
          "data_ref",
          "customers",
          "total"
        ]
      },
      "CustomersCreateRequestBody": {
        "title": "Customers Create Request Body",
        "description": "Request body schema for **POST** `v1/customers`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Customer"
          }
        ]
      },
      "CustomersCreateResponseBody": {
        "description": "Response body for **POST** `v1/customers`.",
        "title": "Customers Create Response Body",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        ]
      },
      "CustomersGetResponseBody": {
        "title": "Customers Get Response Body",
        "description": "Response body schema for **GET** `v1/customers/{customerId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        ]
      },
      "Error": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a885062c80375740f",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          },
          "resource_id": {
            "type": "string",
            "description": "Unique resource ID that can be used in another endpoint to get more details.",
            "example": "rf_0c5d710a87c8a31f86"
          },
          "resource_type": {
            "type": "string",
            "description": "The resource type.",
            "example": "voucher"
          },
          "error": {
            "type": "object",
            "description": "Includes additional information about the error.",
            "properties": {
              "message": {
                "type": "string",
                "description": "The message configured by the user in a validation rule."
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "ParameterCustomerId": {
        "type": "string",
        "example": "cust_nk0N1uNQ1YnupAoJGOgvsODC"
      },
      "CustomersUpdateRequestBody": {
        "title": "Customers Update Request Body",
        "description": "Request body schema for **PUT** `v1/customers/{customerId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerBase"
          }
        ]
      },
      "CustomersUpdateResponseBody": {
        "title": "Customers Update Response Body",
        "description": "Response body schema for **PUT** `v1/customers/{customerId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        ]
      },
      "CustomersPermanentDeletionCreateResponseBody": {
        "type": "object",
        "title": "Customers Permanent Deletion Create Response Body",
        "description": "Response body schema for **POST** `v1/customers/{customerId}/permanent-deletion`.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique permanent deletion object ID.",
            "example": "del_mgzqZNwUnwnt1Ddw6phEG90Q"
          },
          "created_at": {
            "type": "string",
            "example": "2022-09-02T17:55:47.865Z",
            "description": "Timestamp representing the date and time when the customer was requested to be deleted in ISO 8601 format.",
            "format": "date-time"
          },
          "related_object_id": {
            "type": "string",
            "example": "cust_m557pDDl4IGXexkU6KOQ2Dwi",
            "description": "Unique customer ID that is being deleted."
          },
          "related_object": {
            "type": "string",
            "description": "Object being deleted.",
            "default": "customer"
          },
          "status": {
            "type": "string",
            "description": "Deletion status.",
            "default": "DONE"
          },
          "data_json": {
            "type": "object",
            "description": "Statistics summarizing the number of related information that was deleted.",
            "required": [
              "events",
              "customer_events",
              "daily_events",
              "segments",
              "orders",
              "order_events",
              "customer"
            ],
            "properties": {
              "events": {
                "type": "integer",
                "description": "Number of events deleted."
              },
              "customer_events": {
                "type": "integer",
                "description": "Number of customer events deleted."
              },
              "daily_events": {
                "type": "integer",
                "description": "Number of daily events deleted."
              },
              "segments": {
                "type": "integer",
                "description": "Number of segments deleted."
              },
              "orders": {
                "type": "integer",
                "description": "Number of orders deleted."
              },
              "order_events": {
                "type": "integer",
                "description": "Number of order events deleted."
              },
              "customer": {
                "type": "integer",
                "description": "Number of customers deleted.",
                "default": 1
              }
            }
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "pernament_deletion"
          }
        },
        "required": [
          "id",
          "created_at",
          "related_object_id",
          "related_object",
          "status",
          "data_json",
          "object"
        ]
      },
      "CustomersImportCSVRequestBody": {
        "type": "object",
        "title": "Customers Import CSV Request Body",
        "description": "Response body schema for **POST** `v1/customers/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ImportCSVRequestBody"
          }
        ]
      },
      "CustomersImportCsvCreateResponseBody": {
        "type": "object",
        "title": "Customers Import Csv Create Response Body",
        "description": "Response body schema for **POST** `v1/customers/importCSV`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "CustomersUpdateInBulkRequestBody": {
        "title": "Customers Update In Bulk Request Body",
        "description": "Request body schema for **POST** `v1/customers/bulk/async`.",
        "allOf": [
          {
            "title": "CustomerSourceId",
            "type": "object",
            "properties": {
              "source_id": {
                "type": "string",
                "description": "Unique customer source ID."
              }
            },
            "required": [
              "source_id"
            ]
          },
          {
            "$ref": "#/components/schemas/CustomerBase"
          }
        ]
      },
      "CustomersUpdateInBulkResponseBody": {
        "type": "object",
        "title": "Customers Update In Bulk Response Body",
        "description": "Response body schema for **POST** `v1/customers/bulk/async`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "BadRequest": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "error": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          }
        }
      },
      "CustomersMetadataUpdateInBulkRequestBody": {
        "type": "object",
        "title": "Customers Metadata Update In Bulk Request Body",
        "description": "Request body schema for **POST** `v1/customers/metadata/async`.",
        "properties": {
          "source_ids": {
            "type": "array",
            "description": "An array of customer `source_id`'s.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments."
          }
        },
        "required": [
          "source_ids",
          "metadata"
        ]
      },
      "CustomersMetadataUpdateInBulkResponseBody": {
        "type": "object",
        "title": "Customers Metadata Update In Bulk Response Body",
        "description": "Response body schema for **POST** `v1/customers/metadata/async`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/AsyncActions"
          }
        ]
      },
      "ParameterOrderCreatedAt": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at"
        ]
      },
      "ParameterCampaignId": {
        "type": "string",
        "example": "camp_rRsfatlwN7unSeUIJDCYedal"
      },
      "ParameterCampaignType": {
        "type": "string",
        "enum": [
          "PROMOTION",
          "GIFT_VOUCHERS",
          "REFERRAL_PROGRAM",
          "DISCOUNT_COUPONS",
          "LOYALTY_PROGRAM"
        ]
      },
      "ParameterActivityCategory": {
        "type": "string",
        "enum": [
          "ACTION",
          "EFFECT"
        ]
      },
      "ParameterCustomerEvent": {
        "type": "string",
        "enum": [
          "customer.confirmed",
          "customer.created",
          "customer.updated",
          "customer.deleted",
          "customer.referred",
          "customer.custom_event",
          "customer.segment.entered",
          "customer.segment.left",
          "customer.sms.sent",
          "customer.sms.recovered",
          "customer.sms.failed",
          "customer.email.sent",
          "customer.email.recovered",
          "customer.email.failed",
          "customer.activecampaign.sent",
          "customer.activecampaign.recovered",
          "customer.activecampaign.failed",
          "customer.braze.sent",
          "customer.braze.recovered",
          "customer.braze.failed",
          "customer.mailchimp.sent",
          "customer.mailchimp.recovered",
          "customer.mailchimp.failed",
          "customer.intercom.sent",
          "customer.intercom.recovered",
          "customer.intercom.failed",
          "customer.shopify.sent",
          "customer.shopify.recovered",
          "customer.shopify.failed",
          "customer.klaviyo.sent",
          "customer.klaviyo.recovered",
          "customer.klaviyo.failed",
          "customer.batch.sent",
          "customer.batch.recovered",
          "customer.batch.failed",
          "customer.rewarded",
          "customer.rewarded.loyalty_points",
          "customer.voucher.gift.balance_added",
          "customer.voucher.loyalty_card.points_added",
          "customer.voucher.loyalty_card.points_transferred",
          "customer.voucher.loyalty_card.points_expired",
          "customer.voucher.deleted",
          "customer.publication.succeeded",
          "customer.publication.failed",
          "customer.validation.succeeded",
          "customer.validation.failed",
          "customer.redemption.failed",
          "customer.redemption.succeeded",
          "customer.redemption.rollback.failed",
          "customer.redemption.rollback.succeeded",
          "customer.order.canceled",
          "customer.order.created",
          "customer.order.fulfilled",
          "customer.order.paid",
          "customer.order.processing",
          "customer.order.updated",
          "customer.reward_redemptions.created",
          "customer.reward_redemptions.pending",
          "customer.reward_redemptions.completed",
          "customer.reward_redemptions.rolledback",
          "customer.loyalty.updated",
          "customer.loyalty.tier.upgraded",
          "customer.loyalty.tier.downgraded",
          "customer.loyalty.tier.prolonged",
          "customer.loyalty.tier.expiration.changed",
          "customer.loyalty.tier.joined",
          "customer.loyalty.tier.left"
        ]
      },
      "CustomersActivityListResponseBody": {
        "type": "object",
        "title": "Customers Activity List Response Body",
        "description": "Response body schema for **GET** `v1/customers/{customerId}/activity`.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about customer activities in a dictionary.",
            "enum": [
              "list"
            ]
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "description": "Identifies the name of the attribute that contains the array of customer activity objects."
          },
          "data": {
            "type": "array",
            "description": "Array of customer activity objects.",
            "items": {
              "$ref": "#/components/schemas/CustomerActivity"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results."
          },
          "more_starting_after": {
            "type": "string",
            "description": "Returns an ID that can be used to return another page of results. Use the event ID in the `starting_after_id` query parameter to display another page of the results starting after the event with that ID."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "has_more"
        ]
      },
      "ParameterProductId": {
        "type": "string",
        "example": "prod_3ttSkdxGuAfcv3"
      },
      "CustomersActivitiesListResponseBody": {
        "type": "object",
        "title": "Customers Activities List Response Body",
        "description": "Response body schema for **GET** `v1/customers/{customerId}/activities`.",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about customer activities in a dictionary."
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "description": "Identifies the name of the attribute that contains the array of customer activity objects."
          },
          "data": {
            "type": "array",
            "description": "Array of customer activity objects.",
            "items": {
              "$ref": "#/components/schemas/CustomerActivity"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of customer activities."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "CustomersSegmentsListResponseBody": {
        "type": "object",
        "title": "Customers Segments List Response Body",
        "description": "Response body schema for **GET** `v1/customers/{customerId}/segments`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerSegmentsList"
          }
        ]
      },
      "ParameterOrderListRedeemables": {
        "type": "string",
        "enum": [
          "id",
          "-id"
        ]
      },
      "ParameterFiltersListCustomerRedeemables": {
        "type": "object",
        "properties": {
          "id": {
            "type": "object",
            "description": "Unique redeemable holder ID, i.e. `rh_0e77502f84f0f4a6a8`.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "created_at": {
            "description": "Timestamp representing the date and time when the customer redeemable was created. The value is shown in the ISO 8601 format.",
            "type": "object",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsDateTime"
              }
            }
          },
          "redeemable_id": {
            "type": "object",
            "description": "Unique redeemable ID, e.g. `v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk`.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "redeemable_object": {
            "type": "object",
            "description": "Unique related object, i.e. `voucher`.",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "voucher"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "voucher"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "voucher"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "voucher"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "holder_role": {
            "type": "object",
            "description": "Holder role of the redeemable. Allowed values:\n`OWNER`,\n`REFEREE`,\n`REFERRER`.",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "OWNER",
                        "REFEREE",
                        "REFERRER"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "OWNER",
                        "REFEREE",
                        "REFERRER"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "OWNER",
                      "REFEREE",
                      "REFERRER"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "OWNER",
                      "REFEREE",
                      "REFERRER"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "campaign_id": {
            "type": "object",
            "description": "Unique campaign identifer, e.g. `camp_bfrwAVsP6Q1EM1ZjgHwheKYr`.",
            "properties": {
              "conditions": {
                "$ref": "#/components/schemas/FilterConditionsString"
              }
            }
          },
          "campaign_type": {
            "type": "object",
            "description": "Type of the campaign. Allowed values:\n`DISCOUNT_COUPONS`,\n`REFERRAL_PROGRAM`,\n`GIFT_VOUCHERS`,\n`LOYALTY_PROGRAM`",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "LOYALTY_PROGRAM",
                        "GIFT_VOUCHERS",
                        "DISCOUNT_COUPONS",
                        "REFERRAL_PROGRAM"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "LOYALTY_PROGRAM",
                        "GIFT_VOUCHERS",
                        "DISCOUNT_COUPONS",
                        "REFERRAL_PROGRAM"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "LOYALTY_PROGRAM",
                      "GIFT_VOUCHERS",
                      "DISCOUNT_COUPONS",
                      "REFERRAL_PROGRAM"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "LOYALTY_PROGRAM",
                      "GIFT_VOUCHERS",
                      "DISCOUNT_COUPONS",
                      "REFERRAL_PROGRAM"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "voucher_type": {
            "type": "object",
            "description": "Type of the voucher. Allowed values:\n`DISCOUNT_VOUCHER`,\n`GIFT_VOUCHER`,\n`LOYALTY_CARD`.",
            "properties": {
              "conditions": {
                "properties": {
                  "$in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GIFT_VOUCHER",
                        "DISCOUNT_VOUCHER",
                        "LOYALTY_CARD"
                      ]
                    }
                  },
                  "$not_in": {
                    "type": "array",
                    "description": "Array of resource values that should be included in the results (multiple values).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "GIFT_VOUCHER",
                        "DISCOUNT_VOUCHER",
                        "LOYALTY_CARD"
                      ]
                    }
                  },
                  "$is": {
                    "type": "string",
                    "description": "Value is exactly this value (single value).",
                    "enum": [
                      "GIFT_VOUCHER",
                      "DISCOUNT_VOUCHER",
                      "LOYALTY_CARD"
                    ]
                  },
                  "$is_not": {
                    "type": "string",
                    "description": "Results omit this value (single value).",
                    "enum": [
                      "GIFT_VOUCHER",
                      "DISCOUNT_VOUCHER",
                      "LOYALTY_CARD"
                    ]
                  },
                  "$has_value": {
                    "type": "string",
                    "description": "Value is NOT null. The value for this parameter is an empty string."
                  },
                  "$is_unknown": {
                    "type": "string",
                    "description": "Value is null. The value for this parameter is an empty string."
                  },
                  "$starts_with": {
                    "type": "string",
                    "description": "Value starts with the specified string."
                  },
                  "$ends_with": {
                    "type": "string",
                    "description": "Value ends with the specified string."
                  }
                }
              }
            }
          },
          "junction": {
            "$ref": "#/components/schemas/Junction"
          }
        }
      },
      "CustomersRedeemablesListResponseBody": {
        "type": "object",
        "title": "Customers Redeemables List Response Body",
        "description": "Response body schema for **GET** `v1/customers/{customerId}/redeemables`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerRedeemablesList"
          }
        ]
      },
      "ParameterLimit": {
        "type": "integer",
        "maximum": 100,
        "minimum": 1
      },
      "CustomerWithSummaryLoyaltyReferrals": {
        "title": "Customer With Summary Loyalty Referrals",
        "allOf": [
          {
            "type": "object",
            "title": "Customer Response Data",
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of an existing customer that will be linked to redemption in this request."
              },
              "source_id": {
                "type": "string",
                "description": "A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored."
              },
              "summary": {
                "nullable": true,
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerSummary"
                  }
                ]
              },
              "loyalty": {
                "nullable": true,
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerLoyalty"
                  }
                ]
              },
              "referrals": {
                "nullable": true,
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerReferrals"
                  }
                ]
              },
              "system_metadata": {
                "type": "object",
                "description": "Object used to store system metadata information."
              },
              "created_at": {
                "type": "string",
                "description": "Timestamp representing the date and time when the customer was created. The value is shown in the ISO 8601 format.",
                "example": "2022-08-30T06:32:07.380Z",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "description": "Timestamp representing the date and time when the customer was updated. The value is shown in the ISO 8601 format.",
                "example": "2022-08-31T06:32:07.380Z",
                "format": "date-time"
              },
              "assets": {
                "type": "object",
                "description": "Contains information about the customer's cockpit.\n\n⚠️ Warning: Customer cockpits were removed. The customer cockpit URLs redirect to customer preference center.",
                "properties": {
                  "cockpit_url": {
                    "type": "string",
                    "description": "URL address to customer preference center. Previously, a customer's cockpit URL address."
                  },
                  "cockpit_preference_center_url": {
                    "type": "string",
                    "description": "URL address to customer preference center."
                  }
                }
              },
              "object": {
                "type": "string",
                "description": "The type of the object represented by JSON.",
                "default": "customer",
                "enum": [
                  "customer"
                ]
              }
            },
            "required": [
              "summary",
              "loyalty",
              "referrals",
              "object"
            ]
          },
          {
            "$ref": "#/components/schemas/CustomerBase"
          }
        ]
      },
      "Customer": {
        "title": "Customer",
        "allOf": [
          {
            "type": "object",
            "title": "Customer Id And Source Id",
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of an existing customer."
              },
              "source_id": {
                "type": "string",
                "description": "A unique identifier of the customer who validates a voucher. It can be a customer ID or email from a CRM system, database, or a third-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored."
              }
            }
          },
          {
            "$ref": "#/components/schemas/CustomerBase"
          }
        ]
      },
      "CustomerBase": {
        "title": "Customer Base",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Customer's first and last name."
          },
          "description": {
            "type": "string",
            "description": "An arbitrary string that you can attach to a customer object."
          },
          "email": {
            "type": "string",
            "description": "Customer's email address."
          },
          "phone": {
            "type": "string",
            "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel."
          },
          "birthday": {
            "type": "string",
            "description": "`Deprecated`. ~~Customer's birthdate; format YYYY-MM-DD~~.",
            "format": "date"
          },
          "birthdate": {
            "type": "string",
            "description": "Customer's birthdate; format YYYY-MM-DD.",
            "format": "date"
          },
          "address": {
            "type": "object",
            "nullable": true,
            "description": "Customer's address.",
            "properties": {
              "city": {
                "type": "string",
                "description": "City"
              },
              "state": {
                "type": "string",
                "description": "State"
              },
              "line_1": {
                "type": "string",
                "description": "First line of address."
              },
              "line_2": {
                "type": "string",
                "description": "Second line of address."
              },
              "country": {
                "type": "string",
                "description": "Country."
              },
              "postal_code": {
                "type": "string",
                "description": "Postal code."
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments."
          }
        }
      },
      "ImportCSVRequestBody": {
        "type": "object",
        "title": "Import CSV file",
        "description": "Request body schema for importing data using a CSV file.",
        "format": "binary",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "File path."
          }
        },
        "required": [
          "file"
        ]
      },
      "AsyncActions": {
        "type": "object",
        "title": "Asynchronous Actions",
        "description": "Response to requests that are processed asynchronously.",
        "properties": {
          "async_action_id": {
            "type": "string",
            "example": "aa_0a875d56c805df6601",
            "description": "The ID of the scheduled asynchronous action."
          }
        },
        "required": [
          "async_action_id"
        ]
      },
      "CustomerActivity": {
        "title": "Customer Activity",
        "type": "object",
        "description": "This is an object representing customer activity.  \n\nThis is a general object which presents moments from customers' activity. There are all types of different events that customers perform during their journey once they participate in Promotions. Events describe moments when customers redeem coupons and earn points or rewards. The list of all types of activities is listed below.\n\nThe details describing the activity are collected in a property named `data`. In this object, software integrators will find all further information explaining the event context.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique event ID, assigned by Voucherify.",
            "example": "evcus_0c150c51730c6b60b1"
          },
          "type": {
            "type": "string",
            "description": "Event type.",
            "enum": [
              "customer.confirmed",
              "customer.created",
              "customer.updated",
              "customer.deleted",
              "customer.referred",
              "customer.custom_event",
              "customer.segment.entered",
              "customer.segment.left",
              "customer.sms.sent",
              "customer.sms.recovered",
              "customer.sms.failed",
              "customer.email.sent",
              "customer.email.recovered",
              "customer.email.failed",
              "customer.activecampaign.sent",
              "customer.activecampaign.recovered",
              "customer.activecampaign.failed",
              "customer.braze.sent",
              "customer.braze.recovered",
              "customer.braze.failed",
              "customer.mailchimp.sent",
              "customer.mailchimp.recovered",
              "customer.mailchimp.failed",
              "customer.intercom.sent",
              "customer.intercom.recovered",
              "customer.intercom.failed",
              "customer.shopify.sent",
              "customer.shopify.recovered",
              "customer.shopify.failed",
              "customer.klaviyo.sent",
              "customer.klaviyo.recovered",
              "customer.klaviyo.failed",
              "customer.batch.sent",
              "customer.batch.recovered",
              "customer.batch.failed",
              "customer.rewarded",
              "customer.rewarded.loyalty_points",
              "customer.voucher.gift.balance_added",
              "customer.voucher.loyalty_card.pending_points.activated",
              "customer.voucher.loyalty_card.pending_points.added",
              "customer.voucher.loyalty_card.pending_points.canceled",
              "customer.voucher.loyalty_card.pending_points.updated",
              "customer.voucher.loyalty_card.points_activated",
              "customer.voucher.loyalty_card.points_added",
              "customer.voucher.loyalty_card.points_transferred",
              "customer.voucher.loyalty_card.points_expired",
              "customer.voucher.deleted",
              "customer.publication.succeeded",
              "customer.publication.failed",
              "customer.validation.succeeded",
              "customer.validation.failed",
              "customer.redemption.failed",
              "customer.redemption.succeeded",
              "customer.redemption.rollback.failed",
              "customer.redemption.rollback.succeeded",
              "customer.order.canceled",
              "customer.order.created",
              "customer.order.fulfilled",
              "customer.order.paid",
              "customer.order.processing",
              "customer.order.updated",
              "customer.reward_redemptions.created",
              "customer.reward_redemptions.pending",
              "customer.reward_redemptions.completed",
              "customer.reward_redemptions.rolledback",
              "customer.loyalty.updated",
              "customer.loyalty.tier.upgraded",
              "customer.loyalty.tier.downgraded",
              "customer.loyalty.tier.prolonged",
              "customer.loyalty.tier.expiration.changed",
              "customer.loyalty.tier.joined",
              "customer.loyalty.tier.left",
              "customer.holder.assignment.created",
              "customer.holder.assignment.deleted"
            ]
          },
          "data": {
            "type": "object",
            "description": "Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.",
            "properties": {
              "data": {
                "$ref": "#/components/schemas/CustomerActivityData"
              },
              "event_source": {
                "$ref": "#/components/schemas/EventSource"
              }
            }
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.",
            "example": "2022-08-30T09:14:07.660Z",
            "format": "date-time"
          },
          "group_id": {
            "type": "string",
            "description": "Unique identifier of the request that caused the event.",
            "example": "v-1f36113948e50fc4ge"
          }
        }
      },
      "ParameterOrder": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at",
          "type",
          "-type",
          "code",
          "-code",
          "campaign",
          "-campaign",
          "category",
          "-category"
        ]
      },
      "CustomerSegmentsList": {
        "type": "object",
        "title": "Customer Segments List",
        "description": "List of customer's segments",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about customer segments.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of segment IDs.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of segment IDs and names.",
            "items": {
              "$ref": "#/components/schemas/SimpleSegment"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of segments the customer belongs to."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "FilterConditionsString": {
        "title": "Filter by conditions",
        "type": "object",
        "description": "Data filters used to narrow down the data records to be returned in the result.",
        "properties": {
          "$in": {
            "type": "array",
            "description": "Array of resource values that should be included in the results (multiple values).",
            "items": {
              "type": "string"
            }
          },
          "$not_in": {
            "type": "array",
            "description": "Array of resource values that should be included in the results (multiple values).",
            "items": {
              "type": "string"
            }
          },
          "$is": {
            "type": "string",
            "description": "Value is exactly this value (single value)."
          },
          "$is_not": {
            "type": "string",
            "description": "Results omit this value (single value)."
          },
          "$has_value": {
            "type": "string",
            "description": "Value is NOT null. The value for this parameter is an empty string."
          },
          "$is_unknown": {
            "type": "string",
            "description": "Value is null. The value for this parameter is an empty string."
          },
          "$starts_with": {
            "type": "string",
            "description": "Value starts with the specified string."
          },
          "$ends_with": {
            "type": "string",
            "description": "Value ends with the specified string."
          },
          "$contains": {
            "type": "string",
            "description": "Value includes the specified string."
          },
          "$not_contain": {
            "type": "string",
            "description": "Value does NOT include the specified string."
          }
        }
      },
      "FilterConditionsDateTime": {
        "title": "Filter by conditions",
        "type": "object",
        "description": "Data filters used to narrow down the data records to be returned in the result.",
        "properties": {
          "$after": {
            "type": "string",
            "description": "Value is after this date. The value for this parameter is shown in the ISO 8601 format.",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "$before": {
            "type": "string",
            "description": "Value is before this date. The value for this parameter is shown in the ISO 8601 format.",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "$has_value": {
            "type": "string",
            "description": "Value is NOT null. The value for this parameter is an empty string."
          },
          "$is_unknown": {
            "type": "string",
            "description": "Value is null. The value for this parameter is an empty string."
          },
          "$more_than": {
            "type": "integer",
            "description": "Value is more days ago before the current date and time, e.g. more than `10` days ago."
          },
          "$less_than": {
            "type": "integer",
            "description": "Value is less days before the current date and time, e.g. less than `10` days ago."
          }
        }
      },
      "Junction": {
        "title": "Junction",
        "description": "Logical Operator Between Filters. Filter by conditions set on the `junction` parameter indicating how the `conditions` should be accounted for in the query. An `AND` is an all-inclusive logical operator, meaning the `AND` operator displays a record if **ALL** the conditions separated by AND are TRUE, while  an `OR` operator displays a record if **ANY** of the conditions separated by OR is TRUE.",
        "enum": [
          "and",
          "or"
        ],
        "type": "string"
      },
      "CustomerRedeemablesList": {
        "type": "object",
        "title": "Customer Redeemables List",
        "description": "List of customer's redeemables",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about customer redeemables.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of redeemables.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of redeemables.",
            "items": {
              "$ref": "#/components/schemas/CustomerRedeemable"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of results returned."
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a `starting_after_id` query or a different limit to get more records returned in the results."
          },
          "more_starting_after": {
            "type": "string",
            "description": "Returns an ID that can be used to return another page of results. Use the ID in the `starting_after_id` query parameter to display another page of the results occuring after the field with that ID."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total",
          "has_more"
        ]
      },
      "CustomerSummary": {
        "title": "Customer Summary",
        "type": "object",
        "properties": {
          "redemptions": {
            "$ref": "#/components/schemas/CustomerSummaryRedemptions"
          },
          "orders": {
            "$ref": "#/components/schemas/CustomerSummaryOrders"
          }
        },
        "required": [
          "redemptions",
          "orders"
        ]
      },
      "CustomerLoyalty": {
        "title": "Customer Loyalty",
        "type": "object",
        "properties": {
          "points": {
            "type": "integer",
            "description": "Customer's loyalty points minus expired for all loyalty cards which the customer has."
          },
          "referred_customers": {
            "type": "integer",
            "description": "Total number of customers referred by the customer."
          },
          "campaigns": {
            "type": "object",
            "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.",
            "additionalProperties": {
              "type": "object",
              "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.",
              "properties": {
                "points": {
                  "type": "integer",
                  "description": "Remaining point balance in campaign."
                },
                "loyalty_tier": {
                  "type": "string",
                  "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x",
                  "description": "Customer's loyalty tier within the campaign."
                },
                "referred_customers": {
                  "type": "integer",
                  "description": "Number of customers referred by the customer in campaign."
                }
              }
            }
          }
        },
        "required": [
          "points",
          "referred_customers",
          "campaigns"
        ]
      },
      "CustomerReferrals": {
        "title": "Customer Referrals",
        "type": "object",
        "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of times this customer received a referral, i.e. was referred by another customer."
          },
          "campaigns": {
            "type": "array",
            "description": "Contains an array of campaigns that served as the source of a referral for the customer.",
            "items": {
              "title": "Customer Referrals Campaigns Item",
              "type": "object",
              "description": "Contains information about the source of the referral.",
              "properties": {
                "campaign_id": {
                  "type": "string",
                  "description": "Unique campaign ID, assigned by Voucherify.",
                  "example": "camp_rRsfatlwN7unSeUIJDCYedal"
                },
                "referrer_id": {
                  "type": "string",
                  "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi",
                  "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer."
                },
                "related_object_id": {
                  "type": "string",
                  "description": "Related object id",
                  "example": "r_0b9d4cc4aa164dd073"
                },
                "related_object_type": {
                  "type": "string",
                  "description": "Related object type, i.e. `redemption`."
                },
                "date": {
                  "type": "string",
                  "format": "date-time",
                  "example": "2022-08-30T10:19:39.196Z",
                  "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format."
                }
              },
              "required": [
                "campaign_id",
                "referrer_id",
                "related_object_id",
                "related_object_type",
                "date"
              ]
            }
          }
        },
        "required": [
          "total",
          "campaigns"
        ]
      },
      "CustomerActivityData": {
        "title": "Customer Activity Data",
        "type": "object",
        "description": "Event data object schema.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EventCustomerConfirmed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerCreated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerUpdated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerDeleted"
          },
          {
            "$ref": "#/components/schemas/EventCustomerReferred"
          },
          {
            "$ref": "#/components/schemas/EventCustomerCustomEvent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerSegmentEntered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerSegmentLeft"
          },
          {
            "$ref": "#/components/schemas/EventCustomerSmsSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerSmsRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerSmsFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerEmailSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerEmailRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerEmailFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerActiveCampaignSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerActiveCampaignRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerActiveCampaignFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBrazeSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBrazeRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBrazeFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerMailchimpSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerMailchimpRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerMailchimpFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerIntercomSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerIntercomRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerIntercomFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerShopifySent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerShopifyRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerShopifyFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerKlaviyoSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerKlaviyoRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerKlaviyoFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBatchSent"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBatchRecovered"
          },
          {
            "$ref": "#/components/schemas/EventCustomerBatchFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewarded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewardedLoyaltyPoints"
          },
          {
            "$ref": "#/components/schemas/EventCustomerGiftVoucherBalanceAdded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPendingPointsActivated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPendingPointsAdded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPendingPointsCanceled"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPendingPointsUpdated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPointsAdded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyCardPointsTransferred"
          },
          {
            "$ref": "#/components/schemas/EventCustomerVouchersLoyaltyPointsExpired"
          },
          {
            "$ref": "#/components/schemas/EventCustomerVoucherDeleted"
          },
          {
            "$ref": "#/components/schemas/EventCustomerPublicationSucceeded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerPublicationFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerValidationSucceeded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerValidationFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRedemptionSucceeded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRedemptionFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRedemptionRollbackSucceeded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRedemptionRollbackFailed"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderCanceled"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderCreated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderFulfilled"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderPaid"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderProcessing"
          },
          {
            "$ref": "#/components/schemas/EventCustomerOrderUpdated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptionsCreated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptionsPending"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptionsCompleted"
          },
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptionsRolledBack"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyUpdated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierUpgraded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierDowngraded"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierProlonged"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierExpirationChanged"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierJoined"
          },
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierLeft"
          },
          {
            "$ref": "#/components/schemas/EventCustomerHolderAssignmentCreated"
          },
          {
            "$ref": "#/components/schemas/EventCustomerHolderAssignmentDeleted"
          }
        ]
      },
      "EventSource": {
        "type": "object",
        "title": "Event Source",
        "description": "Contains the source of the object that initiated the event.",
        "required": [
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "Determines the channel that initiated the event.",
            "enum": [
              "USER_PORTAL",
              "API",
              "CLIENT_API",
              "INTERNAL"
            ],
            "example": "API"
          },
          "user": {
            "type": "object",
            "description": "Determines the Voucherify user who triggered the event.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the user.",
                "example": "user_xyzfghSTprSTUVWXYlk6tuvXYst7FGH7"
              }
            },
            "required": [
              "id"
            ]
          },
          "api_key": {
            "type": "object",
            "description": "Determines the API key used to initiate the event.",
            "required": [
              "name",
              "app_id"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Channel name in the application keys."
              },
              "app_id": {
                "type": "string",
                "description": "Contains the application ID from the Voucherify API key pair.",
                "example": "1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX"
              }
            }
          }
        }
      },
      "SimpleSegment": {
        "title": "Simple Segment",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique segment ID.",
            "example": "seg_DNAOhUtJffvX0f57ajLMFBYR"
          },
          "name": {
            "type": "string",
            "description": "Segment name."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the ID.",
            "default": "segment",
            "enum": [
              "segment"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "object"
        ]
      },
      "CustomerRedeemable": {
        "type": "object",
        "title": "Customer Redeemable",
        "description": "Single customer's redeemable",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique redeemable holder identifier.",
            "example": "rh_0e7b8db4700106a852"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the redeemable was assigned. The value is shown in the ISO 8601 format.",
            "example": "2024-03-22T17:48:25.910Z"
          },
          "redeemable_id": {
            "type": "string",
            "description": "Identifier of the redeemable item.",
            "example": "v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1"
          },
          "redeemable_object": {
            "type": "string",
            "description": "Type of the redeemable.",
            "example": "voucher"
          },
          "customer_id": {
            "type": "string",
            "description": "Identifier of the customer.",
            "example": "cust_p1ufreYbVbwZ1x70nFkH9rF9"
          },
          "holder_role": {
            "type": "string",
            "description": "Role of the holder.",
            "enum": [
              "OWNER",
              "REFERRER",
              "REFEREE"
            ],
            "default": "OWNER",
            "example": "OWNER"
          },
          "campaign_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique campaign identifier, assigned by Voucherify.",
            "example": "camp_weer1c3p5ZgktqfW56RfoNaG"
          },
          "campaign_type": {
            "type": "string",
            "nullable": true,
            "description": "Defines the type of the campaign.",
            "enum": [
              "LOYALTY_PROGRAM",
              "GIFT_VOUCHERS",
              "DISCOUNT_COUPONS",
              "PROMOTION",
              "REFERRAL_PROGRAM"
            ],
            "example": "DISCOUNT_COUPONS",
            "default": "DISCOUNT_COUPONS"
          },
          "voucher_type": {
            "type": "string",
            "description": "Defines the type of the voucher.",
            "enum": [
              "GIFT_VOUCHER",
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD"
            ],
            "default": "DISCOUNT_VOUCHER",
            "example": "DISCOUNT_VOUCHER"
          },
          "redeemable": {
            "type": "object",
            "description": "Detailed information about the customer's redeemable item",
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of the redeemable.",
                "example": "voucher"
              },
              "voucher": {
                "description": "Defines the details of the voucher.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RedeemableVoucher"
                  }
                ]
              },
              "status": {
                "type": "string",
                "description": "Status of the redeemable.",
                "enum": [
                  "ACTIVE",
                  "USED",
                  "DISABLED",
                  "NOT_ACTIVE_YET",
                  "EXPIRED",
                  "NO_BALANCE"
                ],
                "default": "ACTIVE",
                "example": "ACTIVE"
              }
            },
            "required": [
              "type",
              "voucher",
              "status"
            ]
          }
        },
        "required": [
          "id",
          "created_at",
          "redeemable_id",
          "redeemable_object",
          "customer_id",
          "holder_role",
          "campaign_id",
          "campaign_type",
          "voucher_type",
          "redeemable"
        ]
      },
      "CustomerSummaryRedemptions": {
        "title": "Customer Summary Redemptions",
        "type": "object",
        "properties": {
          "total_redeemed": {
            "type": "integer",
            "description": "Total number of redemptions made by the customer."
          },
          "total_failed": {
            "type": "integer",
            "description": "Total number of redemptions that failed."
          },
          "total_succeeded": {
            "type": "integer",
            "description": "Total number of redemptions that succeeded."
          },
          "total_rolled_back": {
            "type": "integer",
            "description": "Total number of redemptions that were rolled back for the customer."
          },
          "total_rollback_failed": {
            "type": "integer",
            "description": "Total number of redemption rollbacks that failed."
          },
          "total_rollback_succeeded": {
            "type": "integer",
            "description": "Total number of redemption rollbacks that succeeded."
          },
          "gift": {
            "type": "object",
            "description": "Summary of gift card credits.",
            "required": [
              "redeemed_amount",
              "amount_to_go"
            ],
            "properties": {
              "redeemed_amount": {
                "type": "integer",
                "description": "Total amount of gift card credits redeemed by customer. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.",
                "default": 0
              },
              "amount_to_go": {
                "type": "integer",
                "description": "Remaining gift card balance across all gift cards. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`.",
                "default": 0
              }
            }
          },
          "loyalty_card": {
            "type": "object",
            "description": "Summary of loyalty points.",
            "required": [
              "redeemed_points",
              "points_to_go"
            ],
            "properties": {
              "redeemed_points": {
                "type": "integer",
                "description": "Total number of loyalty points redeemed by the customer."
              },
              "points_to_go": {
                "type": "integer",
                "description": "Sum of remaining available point balance across all loyalty cards."
              }
            }
          }
        },
        "required": [
          "total_redeemed",
          "total_failed",
          "total_succeeded",
          "total_rolled_back",
          "total_rollback_failed",
          "total_rollback_succeeded",
          "gift",
          "loyalty_card"
        ]
      },
      "CustomerSummaryOrders": {
        "title": "Customer Summary Orders",
        "description": "Lists details about orders related to the customer. Lists only data for orders with the `PAID` or `FULFILLED` status. Data from orders with a `CREATED` or `CANCELED` status are not included. The data is updated also when an order changes status.",
        "type": "object",
        "properties": {
          "total_amount": {
            "type": "integer",
            "description": "The total amount spent by the customer. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "total_count": {
            "type": "integer",
            "description": "Total number of orders made by the customer."
          },
          "average_amount": {
            "type": "integer",
            "description": "Average amount spent on orders. `total_amount` &divide; `total_count`. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "last_order_amount": {
            "type": "integer",
            "description": "Amount spent on last order. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "last_order_date": {
            "type": "string",
            "format": "date-time",
            "example": "2022-08-30T11:51:08.029Z",
            "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format."
          }
        },
        "required": [
          "total_amount",
          "total_count",
          "average_amount",
          "last_order_amount"
        ]
      },
      "EventCustomerConfirmed": {
        "title": "Event Customer Confirmed",
        "description": "Event data object schema for `customer.confirmed`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          },
          "unconfirmed_customer": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "ucust_1qa70mVfYkl11Ab0ZxDPdWNa"
              }
            }
          }
        }
      },
      "EventCustomerCreated": {
        "title": "Event Customer Created",
        "description": "Event data object schema for `customer.created`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        }
      },
      "EventCustomerUpdated": {
        "title": "Event Customer Updated",
        "description": "Event data object schema for `customer.updated`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        }
      },
      "EventCustomerDeleted": {
        "title": "Event Customer Deleted",
        "description": "Event data object schema for `customer.deleted`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          }
        }
      },
      "EventCustomerReferred": {
        "title": "Event Customer Referred",
        "description": "Event data object schema for `customer.referred`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "referrer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "custom_event": {
            "$ref": "#/components/schemas/CustomEvent"
          },
          "redemption": {
            "$ref": "#/components/schemas/RedemptionInternal"
          }
        },
        "required": [
          "referrer",
          "campaign",
          "voucher",
          "custom_event"
        ]
      },
      "EventCustomerCustomEvent": {
        "type": "object",
        "title": "Event Customer Custom Event",
        "description": "Event data object schema for `customer.custom_event`.",
        "properties": {
          "event": {
            "$ref": "#/components/schemas/CustomEvent"
          },
          "event_schema": {
            "$ref": "#/components/schemas/SimpleCustomEvent"
          },
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "referral": {
            "type": "object",
            "nullable": true,
            "description": "Details about the referral.",
            "properties": {
              "referrer": {
                "description": "Details about the referrer.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SimpleCustomer"
                  }
                ]
              },
              "voucher": {
                "description": "Details about the referral code.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SimpleVoucher"
                  }
                ]
              },
              "campaign": {
                "description": "Details about the referral campaign.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SimpleCampaign"
                  }
                ]
              }
            },
            "required": [
              "referrer",
              "voucher",
              "campaign"
            ]
          },
          "loyalty": {
            "type": "object",
            "nullable": true,
            "description": "Details about the loyalty activity.",
            "properties": {
              "voucher": {
                "description": "Details about the loyalty code.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SimpleVoucher"
                  }
                ]
              },
              "campaign": {
                "description": "Details about the loyalty campaign.",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SimpleCampaign"
                  }
                ]
              }
            },
            "required": [
              "voucher",
              "campaign"
            ]
          }
        },
        "required": [
          "event",
          "event_schema",
          "customer",
          "referral",
          "loyalty"
        ]
      },
      "EventCustomerSegmentEntered": {
        "title": "Event Customer Segment Entered",
        "description": "Event data object schema for `customer.segment.entered`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          },
          "segment": {
            "$ref": "#/components/schemas/SimpleSegment"
          }
        },
        "required": [
          "customer",
          "segment"
        ]
      },
      "EventCustomerSegmentLeft": {
        "title": "Event Customer Segment Left",
        "description": "Event data object schema for `customer.segment.left`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          },
          "segment": {
            "$ref": "#/components/schemas/SimpleSegment"
          }
        },
        "required": [
          "customer",
          "segment"
        ]
      },
      "EventCustomerSmsSent": {
        "title": "Event Customer SMS Sent",
        "description": "Event data object schema for `customer.sms.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerSmsRecovered": {
        "title": "Event Customer SMS Recovered",
        "description": "Event data object schema for `customer.sms.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerSmsFailed": {
        "title": "Event Customer SMS Failed",
        "description": "Event data object schema for `customer.sms.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerEmailSent": {
        "title": "Event Customer Email Sent",
        "description": "Event data object schema for `customer.email.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerEmailRecovered": {
        "title": "Event Customer Email Recovered",
        "description": "Event data object schema for `customer.email.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerEmailFailed": {
        "title": "Event Customer Email Failed",
        "description": "Event data object schema for `customer.email.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerActiveCampaignSent": {
        "title": "Event Customer ActiveCampaign Sent",
        "description": "Event data object schema for `customer.activecampaign.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerActiveCampaignRecovered": {
        "title": "Event Customer ActiveCampaign Recovered",
        "description": "Event data object schema for `customer.activecampaign.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerActiveCampaignFailed": {
        "title": "Event Customer ActiveCampaign Failed",
        "description": "Event data object schema for `customer.activecampaign.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerBrazeSent": {
        "title": "Event Customer Braze Sent",
        "description": "Event data object schema for `customer.braze.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerBrazeRecovered": {
        "title": "Event Customer Braze Recovered",
        "description": "Event data object schema for `customer.braze.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerBrazeFailed": {
        "title": "Event Customer Braze Failed",
        "description": "Event data object schema for `customer.braze.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerMailchimpSent": {
        "title": "Event Customer Mailchimp Sent",
        "description": "Event data object schema for `customer.mailchimp.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerMailchimpRecovered": {
        "title": "Event Customer Mailchimp Recovered",
        "description": "Event data object schema for `customer.mailchimp.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerMailchimpFailed": {
        "title": "Event Customer Mailchimp Failed",
        "description": "Event data object schema for `customer.mailchimp.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerIntercomSent": {
        "title": "Event Customer Intercom Sent",
        "description": "Event data object schema for `customer.intercom.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerIntercomRecovered": {
        "title": "Event Customer Intercom Recovered",
        "description": "Event data object schema for `customer.intercom.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerIntercomFailed": {
        "title": "Event Customer Intercom Failed",
        "description": "Event data object schema for `customer.intercom.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerShopifySent": {
        "title": "Event Customer Shopify Sent",
        "description": "Event data object schema for `customer.shopify.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerShopifyRecovered": {
        "title": "Event Customer Shopify Recovered",
        "description": "Event data object schema for `customer.shopify.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerShopifyFailed": {
        "title": "Event Customer Shopify Failed",
        "description": "Event data object schema for `customer.shopify.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerKlaviyoSent": {
        "title": "Event Customer Klaviyo Sent",
        "description": "Event data object schema for `customer.klaviyo.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerKlaviyoRecovered": {
        "title": "Event Customer Klaviyo Recovered",
        "description": "Event data object schema for `customer.klaviyo.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerKlaviyoFailed": {
        "title": "Event Customer Klaviyo Failed",
        "description": "Event data object schema for `customer.klaviyo.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerBatchSent": {
        "title": "Event Customer Batch Sent",
        "description": "Event data object schema for `customer.batch.sent`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerSent"
          }
        ]
      },
      "EventCustomerBatchRecovered": {
        "title": "Event Customer Batch Recovered",
        "description": "Event data object schema for `customer.batch.recovered`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRecovered"
          }
        ]
      },
      "EventCustomerBatchFailed": {
        "title": "Event Customer Batch Failed",
        "description": "Event data object schema for `customer.batch.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerFailed"
          }
        ]
      },
      "EventCustomerRewarded": {
        "title": "Event Customer Rewarded",
        "description": "Event data object schema for `customer.rewarded`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "holder": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "redemption": {
            "$ref": "#/components/schemas/RedemptionInternal"
          },
          "reward": {
            "$ref": "#/components/schemas/SimpleRedemptionRewardResult"
          },
          "referral_tier": {
            "$ref": "#/components/schemas/SimpleReferralTier"
          },
          "balance": {
            "nullable": true,
            "type": "object",
            "description": "Balance changed by the event. The `amount` property details a change in a gift card. The `points` property details a change in a loyalty card.",
            "properties": {
              "amount": {
                "type": "integer"
              },
              "points": {
                "type": "integer"
              }
            }
          },
          "custom_event": {
            "$ref": "#/components/schemas/CustomEvent"
          },
          "customer_event": {
            "nullable": true,
            "type": "object",
            "properties": {
              "segment": {
                "$ref": "#/components/schemas/SimpleSegment"
              },
              "event_type": {
                "type": "string",
                "description": "Type of activity that triggered the event."
              }
            }
          }
        }
      },
      "EventCustomerRewardedLoyaltyPoints": {
        "title": "Event Customer Rewarded Loyalty Points",
        "description": "Event data object schema for `customer.rewarded.loyalty_points`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "holder": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "loyalty_tier": {
            "$ref": "#/components/schemas/LoyaltyTier"
          },
          "earning_rule": {
            "$ref": "#/components/schemas/EarningRule"
          },
          "balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderCalculated"
              },
              {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "description": "Array of items applied to the order. It can include up to 500 items.",
                    "items": {
                      "$ref": "#/components/schemas/OrderCalculatedItem"
                    }
                  }
                }
              }
            ]
          },
          "event": {
            "$ref": "#/components/schemas/SimpleEvent"
          }
        }
      },
      "EventCustomerGiftVoucherBalanceAdded": {
        "title": "Event Customer Gift Voucher Balance Added",
        "description": "Event data object schema for `customer.voucher.gift.balance_added`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "transaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VoucherTransactionBase"
              },
              {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "object",
                    "description": "Contains the detailed information about the transaction.",
                    "properties": {
                      "balance": {
                        "$ref": "#/components/schemas/VoucherBalance"
                      },
                      "order": {
                        "type": "object",
                        "description": "Contains information about the original order.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique order ID."
                          },
                          "source_id": {
                            "type": "string",
                            "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                          }
                        },
                        "required": [
                          "id",
                          "source_id"
                        ]
                      },
                      "event": {
                        "type": "object",
                        "description": "Contains information about the event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "earning_rule": {
                        "type": "object",
                        "description": "Contains information about the earning rule.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of an earning rule, assigned by Voucherify."
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "banner"
                            ],
                            "description": "Contains the custom earning rule name.",
                            "properties": {
                              "banner": {
                                "type": "string",
                                "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "source"
                        ]
                      },
                      "segment": {
                        "type": "object",
                        "description": "Contains information about the segment.",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "loyalty_tier": {
                        "type": "object",
                        "description": "Contains information about the loyalty tier.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "redemption": {
                        "type": "object",
                        "description": "Contains information about the original redemption.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "rollback": {
                        "type": "object",
                        "description": "Contains information about the redemption rollback.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption rollback ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "custom_event": {
                        "type": "object",
                        "description": "Contains information about the custom event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "event_schema": {
                        "type": "object",
                        "description": "Contains information about the custom event metadata schema.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique metadata schema ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "reward": {
                        "type": "object",
                        "description": "Contains information about the pay with points reward.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique reward ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Reward name."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "source_voucher": {
                        "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      },
                      "destination_voucher": {
                        "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      }
                    }
                  },
                  "type": {
                    "type": "string",
                    "description": "Transaction type concerning gift card credits.",
                    "enum": [
                      "CREDITS_ADDITION"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "EventCustomerLoyaltyCardPendingPointsActivated": {
        "title": "Event Customer Loyalty Card Pending Points Activated",
        "description": "Event data object schema for `customer.voucher.loyalty_card.pending_points.activated`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "transaction": {
            "$ref": "#/components/schemas/VoucherTransaction"
          },
          "pending_points": {
            "$ref": "#/components/schemas/LoyaltyPendingPoints"
          }
        },
        "required": [
          "customer",
          "campaign",
          "voucher",
          "balance",
          "order",
          "transaction",
          "pending_points"
        ]
      },
      "EventCustomerLoyaltyCardPendingPointsAdded": {
        "title": "Event Customer Loyalty Card Pending Points Added",
        "description": "Event data object schema for `customer.voucher.loyalty_card.pending_points.added`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "voucher_pending_points_balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "pending_points": {
            "$ref": "#/components/schemas/LoyaltyPendingPoints"
          }
        },
        "required": [
          "customer",
          "campaign",
          "voucher",
          "voucher_pending_points_balance",
          "order",
          "pending_points"
        ]
      },
      "EventCustomerLoyaltyCardPendingPointsCanceled": {
        "title": "Event Customer Loyalty Card Pending Points Canceled",
        "description": "Event data object schema for `customer.voucher.loyalty_card.pending_points.canceled`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "voucher_pending_points_balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "pending_points": {
            "$ref": "#/components/schemas/LoyaltyPendingPoints"
          }
        },
        "required": [
          "customer",
          "campaign",
          "voucher",
          "voucher_pending_points_balance",
          "order",
          "pending_points"
        ]
      },
      "EventCustomerLoyaltyCardPendingPointsUpdated": {
        "title": "Event Customer Loyalty Card Pending Points Updated",
        "description": "Event data object schema for `customer.voucher.loyalty_card.pending_points.updated`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "voucher_pending_points_balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "pending_points": {
            "$ref": "#/components/schemas/LoyaltyPendingPoints"
          }
        },
        "required": [
          "customer",
          "campaign",
          "voucher",
          "voucher_pending_points_balance",
          "order",
          "pending_points"
        ]
      },
      "EventCustomerLoyaltyCardPointsAdded": {
        "title": "Event Customer Loyalty Card Points Added",
        "description": "Event data object schema for `customer.voucher.loyalty_card.points_added`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "transaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VoucherTransactionBase"
              },
              {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "object",
                    "description": "Contains the detailed information about the transaction.",
                    "properties": {
                      "balance": {
                        "$ref": "#/components/schemas/VoucherBalance"
                      },
                      "order": {
                        "type": "object",
                        "description": "Contains information about the original order.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique order ID."
                          },
                          "source_id": {
                            "type": "string",
                            "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                          }
                        },
                        "required": [
                          "id",
                          "source_id"
                        ]
                      },
                      "event": {
                        "type": "object",
                        "description": "Contains information about the event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "earning_rule": {
                        "type": "object",
                        "description": "Contains information about the earning rule.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of an earning rule, assigned by Voucherify."
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "banner"
                            ],
                            "description": "Contains the custom earning rule name.",
                            "properties": {
                              "banner": {
                                "type": "string",
                                "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "source"
                        ]
                      },
                      "segment": {
                        "type": "object",
                        "description": "Contains information about the segment.",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "loyalty_tier": {
                        "type": "object",
                        "description": "Contains information about the loyalty tier.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "redemption": {
                        "type": "object",
                        "description": "Contains information about the original redemption.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "rollback": {
                        "type": "object",
                        "description": "Contains information about the redemption rollback.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption rollback ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "custom_event": {
                        "type": "object",
                        "description": "Contains information about the custom event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "holder_loyalty_tier": {
                        "type": "object",
                        "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "event_schema": {
                        "type": "object",
                        "description": "Contains information about the custom event metadata schema.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique metadata schema ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "reward": {
                        "type": "object",
                        "description": "Contains information about the pay with points reward.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique reward ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Reward name."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "source_voucher": {
                        "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      },
                      "destination_voucher": {
                        "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      }
                    }
                  },
                  "type": {
                    "type": "string",
                    "description": "Transaction type concerning loyalty card points.",
                    "enum": [
                      "POINTS_ACCRUAL"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "EventCustomerLoyaltyCardPointsTransferred": {
        "title": "Event Customer Loyalty Card Points Transferred",
        "description": "Event data object schema for `customer.voucher.loyalty_card.points_transferred`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "source_voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "destination_voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "balance": {
            "$ref": "#/components/schemas/VoucherBalance"
          },
          "transaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VoucherTransactionBase"
              },
              {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "object",
                    "description": "Contains the detailed information about the transaction.",
                    "properties": {
                      "balance": {
                        "$ref": "#/components/schemas/VoucherBalance"
                      },
                      "order": {
                        "type": "object",
                        "description": "Contains information about the original order.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique order ID."
                          },
                          "source_id": {
                            "type": "string",
                            "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                          }
                        },
                        "required": [
                          "id",
                          "source_id"
                        ]
                      },
                      "event": {
                        "type": "object",
                        "description": "Contains information about the event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "earning_rule": {
                        "type": "object",
                        "description": "Contains information about the earning rule.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of an earning rule, assigned by Voucherify."
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "banner"
                            ],
                            "description": "Contains the custom earning rule name.",
                            "properties": {
                              "banner": {
                                "type": "string",
                                "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "source"
                        ]
                      },
                      "segment": {
                        "type": "object",
                        "description": "Contains information about the segment.",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "loyalty_tier": {
                        "type": "object",
                        "description": "Contains information about the loyalty tier.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "redemption": {
                        "type": "object",
                        "description": "Contains information about the original redemption.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "rollback": {
                        "type": "object",
                        "description": "Contains information about the redemption rollback.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption rollback ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "custom_event": {
                        "type": "object",
                        "description": "Contains information about the custom event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "event_schema": {
                        "type": "object",
                        "description": "Contains information about the custom event metadata schema.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique metadata schema ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "holder_loyalty_tier": {
                        "type": "object",
                        "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "reward": {
                        "type": "object",
                        "description": "Contains information about the pay with points reward.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique reward ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Reward name."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "source_voucher": {
                        "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      },
                      "destination_voucher": {
                        "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      }
                    }
                  },
                  "type": {
                    "type": "string",
                    "description": "Transaction type concerning loyalty card points.",
                    "enum": [
                      "POINTS_TRANSFER_IN",
                      "POINTS_TRANSFER_OUT"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "EventCustomerVouchersLoyaltyPointsExpired": {
        "title": "Event Customer Loyalty Card Points Expired",
        "description": "Event data object schema for `customer.voucher.loyalty_card.points_expired`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "points": {
            "type": "integer",
            "description": "The number of expired points."
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoyaltyPointsBucket"
            }
          },
          "transaction": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VoucherTransactionBase"
              },
              {
                "type": "object",
                "properties": {
                  "details": {
                    "type": "object",
                    "description": "Contains the detailed information about the transaction.",
                    "properties": {
                      "balance": {
                        "$ref": "#/components/schemas/VoucherBalance"
                      },
                      "order": {
                        "type": "object",
                        "description": "Contains information about the original order.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique order ID."
                          },
                          "source_id": {
                            "type": "string",
                            "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                          }
                        },
                        "required": [
                          "id",
                          "source_id"
                        ]
                      },
                      "event": {
                        "type": "object",
                        "description": "Contains information about the event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "earning_rule": {
                        "type": "object",
                        "description": "Contains information about the earning rule.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of an earning rule, assigned by Voucherify."
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "banner"
                            ],
                            "description": "Contains the custom earning rule name.",
                            "properties": {
                              "banner": {
                                "type": "string",
                                "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "source"
                        ]
                      },
                      "segment": {
                        "type": "object",
                        "description": "Contains information about the segment.",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "loyalty_tier": {
                        "type": "object",
                        "description": "Contains information about the loyalty tier.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "redemption": {
                        "type": "object",
                        "description": "Contains information about the original redemption.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "rollback": {
                        "type": "object",
                        "description": "Contains information about the redemption rollback.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique redemption rollback ID."
                          }
                        },
                        "required": [
                          "id"
                        ]
                      },
                      "custom_event": {
                        "type": "object",
                        "description": "Contains information about the custom event that triggers the point accrual.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique event ID."
                          },
                          "type": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "type"
                        ]
                      },
                      "event_schema": {
                        "type": "object",
                        "description": "Contains information about the custom event metadata schema.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique metadata schema ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Type of custom event."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "holder_loyalty_tier": {
                        "type": "object",
                        "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                          },
                          "name": {
                            "type": "string",
                            "description": "User-defined name of the loyalty tier."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "reward": {
                        "type": "object",
                        "description": "Contains information about the pay with points reward.",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Unique reward ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Reward name."
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      },
                      "source_voucher": {
                        "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      },
                      "destination_voucher": {
                        "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/SimpleVoucher"
                          }
                        ]
                      }
                    }
                  },
                  "type": {
                    "type": "string",
                    "description": "Transaction type concerning loyalty card points.",
                    "enum": [
                      "POINTS_EXPIRATION"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "EventCustomerVoucherDeleted": {
        "title": "Event Customer Voucher Deleted",
        "description": "Event data object schema for `customer.voucher.deleted`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          }
        }
      },
      "EventCustomerPublicationSucceeded": {
        "title": "Event Customer Publication Succeeded",
        "description": "Event data object schema for `customer.publication.succeeded`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "publication": {
            "$ref": "#/components/schemas/ListPublicationsItemValidSingleVoucher"
          }
        }
      },
      "EventCustomerPublicationFailed": {
        "title": "Event Customer Publication Failed",
        "description": "Event data object schema for `customer.publication.failed`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "publication": {
            "$ref": "#/components/schemas/ListPublicationsItemValidSingleVoucher"
          }
        }
      },
      "EventCustomerValidationSucceeded": {
        "title": "Event Customer Validation Succeeded",
        "description": "Event data object schema for `customer.validation.succeeded`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "validation": {
            "$ref": "#/components/schemas/ValidationEntity"
          }
        }
      },
      "EventCustomerValidationFailed": {
        "title": "Event Customer Validation Failed",
        "description": "Event data object schema for `customer.validation.failed`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "validation": {
            "$ref": "#/components/schemas/ValidationEntity"
          }
        }
      },
      "EventCustomerRedemptionSucceeded": {
        "title": "Event Customer Redemption Succeeded",
        "description": "Event data object schema for `customer.redemption.succeeded`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRedemption"
          }
        ]
      },
      "EventCustomerRedemptionFailed": {
        "title": "Event Customer Redemption Failed",
        "description": "Event data object schema for `customer.redemption.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRedemption"
          }
        ]
      },
      "EventCustomerRedemptionRollbackSucceeded": {
        "title": "Event Customer Redemption Rollback Succeeded",
        "description": "Event data object schema for `customer.redemption.rollback.succeeded`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRedemption"
          },
          {
            "type": "object",
            "properties": {
              "redemption_rollback": {
                "$ref": "#/components/schemas/SimpleRedemption"
              }
            }
          }
        ]
      },
      "EventCustomerRedemptionRollbackFailed": {
        "title": "Event Customer Redemption Rollback Failed",
        "description": "Event data object schema for `customer.redemption.rollback.failed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRedemption"
          },
          {
            "type": "object",
            "properties": {
              "redemption_rollback": {
                "$ref": "#/components/schemas/SimpleRedemption"
              }
            }
          }
        ]
      },
      "EventCustomerOrderCanceled": {
        "title": "Event Customer Order Canceled",
        "description": "Event data object schema for `customer.order.canceled`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerOrderCreated": {
        "title": "Event Customer Order Created",
        "description": "Event data object schema for `customer.order.created`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerOrderFulfilled": {
        "title": "Event Customer Order Fulfilled",
        "description": "Event data object schema for `customer.order.fulfilled`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerOrderPaid": {
        "title": "Event Customer Order Paid",
        "description": "Event data object schema for `customer.order.paid`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerOrderProcessing": {
        "title": "Event Customer Order Processing",
        "description": "Event data object schema for `customer.order.processing`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerOrderUpdated": {
        "title": "Event Customer Order Updated",
        "description": "Event data object schema for `customer.order.updated`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerOrder"
          }
        ]
      },
      "EventCustomerRewardRedemptionsCreated": {
        "title": "Event Customer Reward Redemptions Created",
        "description": "Event data object schema for `customer.reward_redemptions.created`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptions"
          }
        ]
      },
      "EventCustomerRewardRedemptionsPending": {
        "title": "Event Customer Reward Redemptions Pending",
        "description": "Event data object schema for `customer.reward_redemptions.pending`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptions"
          }
        ]
      },
      "EventCustomerRewardRedemptionsCompleted": {
        "title": "Event Customer Reward Redemptions Completed",
        "description": "Event data object schema for `customer.reward_redemptions.completed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptions"
          }
        ]
      },
      "EventCustomerRewardRedemptionsRolledBack": {
        "title": "Event Customer Reward Redemptions Rolled Back",
        "description": "Event data object schema for `customer.reward_redemptions.rolledback`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerRewardRedemptions"
          }
        ]
      },
      "EventCustomerLoyaltyUpdated": {
        "title": "Event Customer Loyalty Updated",
        "description": "Event data object schema for `customer.loyalty.updated`.",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "loyalty": {
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "example": "2022-02-25T13:32:08.734Z",
            "format": "date-time"
          }
        },
        "required": [
          "created_at"
        ]
      },
      "EventCustomerLoyaltyTierUpgraded": {
        "title": "Event Customer Loyalty Tier Upgraded",
        "description": "Event data object schema for `customer.loyalty.tier.upgraded`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Upgraded",
            "type": "object",
            "properties": {
              "loyalty_tier_from": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "loyalty_tier_to": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier_to"
            ]
          }
        ]
      },
      "EventCustomerLoyaltyTierDowngraded": {
        "title": "Event Customer Loyalty Tier Downgraded",
        "description": "Event data object schema for `customer.loyalty.tier.downgraded`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Downgraded",
            "type": "object",
            "properties": {
              "loyalty_tier_from": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "loyalty_tier_to": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier_from"
            ]
          }
        ]
      },
      "EventCustomerLoyaltyTierProlonged": {
        "title": "Event Customer Loyalty Tier Prolonged",
        "description": "Event data object schema for `customer.loyalty.tier.prolonged`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Prolonged",
            "type": "object",
            "properties": {
              "loyalty_tier": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier"
            ]
          }
        ]
      },
      "EventCustomerLoyaltyTierExpirationChanged": {
        "title": "Event Customer Loyalty Tier Expiration Changed",
        "description": "Event data object schema for `customer.loyalty.tier.expiration.changed`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Expiration Changed",
            "type": "object",
            "properties": {
              "loyalty_tier": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              },
              "expiration_date": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier",
              "expiration_date"
            ]
          }
        ]
      },
      "EventCustomerLoyaltyTierJoined": {
        "title": "Event Customer Loyalty Tier Joined",
        "description": "Event data object schema for `customer.loyalty.tier.joined`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Joined",
            "type": "object",
            "properties": {
              "loyalty_tier": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier"
            ]
          }
        ]
      },
      "EventCustomerLoyaltyTierLeft": {
        "title": "Event Customer Loyalty Tier Left",
        "description": "Event data object schema for `customer.loyalty.tier.left`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/EventCustomerLoyaltyTierBase"
          },
          {
            "title": "Loyalty Tier Left",
            "type": "object",
            "properties": {
              "loyalty_tier": {
                "$ref": "#/components/schemas/LoyaltyTier"
              },
              "created_at": {
                "type": "string",
                "example": "2022-02-25T13:32:08.734Z",
                "format": "date-time"
              }
            },
            "required": [
              "created_at",
              "loyalty_tier"
            ]
          }
        ]
      },
      "EventCustomerHolderAssignmentCreated": {
        "title": "Event Customer Holder Assignment Created",
        "description": "Event data object schema for `customer.holder.assignment.created`.",
        "properties": {
          "holder": {
            "$ref": "#/components/schemas/SimpleRedeemableHolder"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          }
        },
        "required": [
          "holder",
          "voucher",
          "campaign",
          "customer"
        ]
      },
      "EventCustomerHolderAssignmentDeleted": {
        "title": "Event Customer Holder Assignment Deleted",
        "description": "Event data object schema for `customer.holder.assignment.deleted`.",
        "properties": {
          "holder": {
            "$ref": "#/components/schemas/SimpleRedeemableHolder"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          }
        },
        "required": [
          "holder",
          "voucher",
          "campaign",
          "customer"
        ]
      },
      "RedeemableVoucher": {
        "title": "Voucher",
        "type": "object",
        "description": "This is an object representing a voucher.",
        "properties": {
          "id": {
            "type": "string",
            "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
            "description": "Assigned by the Voucherify API, identifies the voucher."
          },
          "code": {
            "type": "string",
            "example": "WVPblOYX",
            "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters."
          },
          "campaign": {
            "type": "string",
            "example": "Gift Card Campaign",
            "description": "A unique campaign name, identifies the voucher's parent campaign."
          },
          "campaign_id": {
            "type": "string",
            "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
            "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign."
          },
          "category": {
            "type": "string",
            "nullable": true,
            "description": "The value is null."
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID assigned by Voucherify.",
            "example": "cat_0bb343dee3cdb5ec0c"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Contains an empty array."
          },
          "type": {
            "type": "string",
            "enum": [
              "GIFT_VOUCHER",
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD"
            ],
            "description": "Defines the type of the voucher. "
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "gift": {
            "type": "object",
            "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`.",
            "properties": {
              "amount": {
                "type": "integer",
                "example": 10000,
                "description": "Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "subtracted_amount": {
                "type": "integer",
                "description": "Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "balance": {
                "type": "integer",
                "example": 500,
                "description": "Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`. `balance` = `amount` - `subtracted_amount` - `redemption.redeemed_amount`."
              },
              "effect": {
                "type": "string",
                "enum": [
                  "APPLY_TO_ORDER",
                  "APPLY_TO_ITEMS"
                ],
                "description": "Defines how the credits are applied to the customer's order."
              }
            }
          },
          "loyalty_card": {
            "type": "object",
            "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`.",
            "properties": {
              "points": {
                "type": "integer",
                "example": 7000,
                "description": "Total number of points added to the loyalty card over its lifespan."
              },
              "balance": {
                "type": "integer",
                "example": 6970,
                "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
              },
              "next_expiration_date": {
                "type": "string",
                "format": "date",
                "example": "2023-05-30",
                "description": "The next closest date when the next set of points are due to expire."
              },
              "next_expiration_points": {
                "type": "integer",
                "description": "The amount of points that are set to expire next."
              },
              "pending_points": {
                "type": "integer",
                "description": "Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually."
              },
              "expired_points": {
                "type": "integer",
                "description": "Shows the total number of expired points over the lifetime of the loyalty card."
              },
              "subtracted_points": {
                "type": "integer",
                "description": "Shows the total number of subtracted points over the lifetime of the loyalty card."
              }
            }
          },
          "start_date": {
            "type": "string",
            "example": "2021-12-01T00:00:00.000Z",
            "format": "date-time",
            "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. "
          },
          "expiration_date": {
            "type": "string",
            "example": "2021-12-31T00:00:00.000Z",
            "format": "date-time",
            "description": "Expiration timestamp defines when the code expires in ISO 8601 format.  Voucher is *inactive after* this date."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "active": {
            "type": "boolean",
            "nullable": true,
            "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher"
          },
          "additional_info": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the code such as a code description and details."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format."
          },
          "assets": {
            "$ref": "#/components/schemas/VoucherAssets"
          },
          "is_referral_code": {
            "type": "boolean",
            "nullable": true,
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2021-12-22T10:14:45.316Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format."
          },
          "referrer_id": {
            "type": "string",
            "description": "Unique identifier of the referring person.",
            "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
          },
          "holder_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. Default is `voucher`.",
            "default": "voucher"
          },
          "publish": {
            "type": "object",
            "description": "This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event.  A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or \n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` |  `type`:`DISCOUNT_VOUCHER`   | \n| `is_referral_code`:`true`      |    `type`:`GIFT_VOUCHER`   |\n",
            "properties": {
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the `url` attribute."
              },
              "count": {
                "type": "integer",
                "example": 0,
                "description": "Publication events counter."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10",
                "description": "The endpoint where this list of publications can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/publications`"
              }
            }
          },
          "redemption": {
            "type": "object",
            "description": "Stores a summary of redemptions that have been applied to the voucher.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              },
              "redeemed_points": {
                "type": "integer",
                "example": 100000,
                "description": "Total loyalty points redeemed."
              },
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the url attribute."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10",
                "description": "The endpoint where this list of redemptions can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/redemptions`"
              }
            }
          }
        }
      },
      "SimpleCustomer": {
        "title": "Simple Customer",
        "type": "object",
        "description": "Simplified customer data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of an existing customer. It is assigned by Voucherify."
          },
          "name": {
            "type": "string",
            "description": "Customer's first and last name."
          },
          "email": {
            "type": "string",
            "description": "Customer's email address."
          },
          "source_id": {
            "type": "string",
            "description": "A unique identifier of the customer. It can be a customer ID or email from a CRM system, database, or a third-party service."
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that are attached to the customer. It stores all custom attributes assigned to the customer."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "enum": [
              "customer"
            ]
          }
        }
      },
      "SimpleCampaign": {
        "title": "Simple Campaign",
        "type": "object",
        "description": "Simplified campaign data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Campaign ID."
          },
          "name": {
            "type": "string",
            "description": "Campaign name."
          },
          "campaign_type": {
            "type": "string",
            "description": "Type of campaign."
          },
          "type": {
            "type": "string",
            "description": "Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.\n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria\n-  `STATIC`: vouchers need to be manually published\n- `STANDALONE`: campaign for single vouchers",
            "enum": [
              "AUTO_UPDATE",
              "STATIC",
              "STANDALONE"
            ]
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleCampaignVoucher"
          },
          "referral_program": {
            "$ref": "#/components/schemas/ReferralProgram"
          },
          "auto_join": {
            "type": "boolean",
            "description": "Indicates whether customers will be able to auto-join the campaign if any earning rule is fulfilled."
          },
          "join_once": {
            "type": "boolean",
            "description": "If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always `true` for loyalty campaigns and it cannot be changed in them."
          },
          "active": {
            "type": "boolean",
            "description": "Indicates whether the campaign is active."
          },
          "category_id": {
            "nullable": true,
            "type": "string",
            "description": "The unique category ID that this campaign belongs to."
          },
          "category": {
            "type": "string",
            "description": "Unique category name."
          },
          "categories": {
            "type": "array",
            "description": "Contains details about the category.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a campaign. The metadata object stores all custom attributes assigned to the campaign."
          },
          "start_date": {
            "type": "string",
            "format": "date-time",
            "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive *before* this date. ",
            "example": "2022-09-20T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "format": "date-time",
            "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is inactive *after* this date.",
            "example": "2022-09-30T00:00:00.000Z"
          },
          "description": {
            "type": "string",
            "description": "An optional field to keep extra textual information about the campaign such as a campaign description and details."
          },
          "created_at": {
            "type": "string",
            "example": "2024-01-01T11:11:11.111Z",
            "description": "Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2024-01-01T11:11:11.111Z",
            "description": "Timestamp representing the date and time when the campaign was updated in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "campaign",
            "enum": [
              "campaign"
            ],
            "description": "The type of the object represented by JSON. This object stores information about the campaign."
          }
        }
      },
      "SimpleVoucher": {
        "type": "object",
        "title": "Simple Voucher",
        "description": "Simplified voucher data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "A unique identifier that represents the voucher assigned by Voucherify."
          },
          "code": {
            "type": "string",
            "description": "Voucher code."
          },
          "gift": {
            "description": "Gift object response.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Gift"
              }
            ]
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "loyalty_card": {
            "description": "Defines the loyalty card details.",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleLoyaltyCard"
              }
            ]
          },
          "type": {
            "type": "string",
            "description": "Type of the voucher.",
            "enum": [
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD",
              "GIFT_VOUCHER"
            ]
          },
          "campaign": {
            "type": "string",
            "description": "Campaign name."
          },
          "campaign_id": {
            "type": "string",
            "description": "Campaign unique ID."
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "holder_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify."
          },
          "referrer_id": {
            "type": "string",
            "description": "Unique identifier of the referrer assigned by Voucherify.",
            "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
          },
          "category_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique identifier of the category that this voucher belongs to.",
            "example": "cat_0b6152ce12414820dc"
          },
          "categories": {
            "type": "array",
            "description": "Contains details about the category.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "active": {
            "type": "boolean",
            "description": "Shows whether the voucher is on or off. `true` indicates an *active* voucher and `false` indicates an *inactive* voucher."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the order was created in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2024-01-01T11:11:11.111Z",
            "description": "Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              },
              "redeemed_points": {
                "type": "integer",
                "description": "Total loyalty points redeemed."
              }
            },
            "required": [
              "quantity",
              "redeemed_quantity"
            ]
          },
          "start_date": {
            "type": "string",
            "example": "2021-12-01T00:00:00.000Z",
            "format": "date-time",
            "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date."
          },
          "expiration_date": {
            "type": "string",
            "example": "2021-12-31T00:00:00.000Z",
            "format": "date-time",
            "description": "Expiration timestamp defines when the code expires in ISO 8601 format.  Voucher is *inactive after* this date."
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a voucher. The metadata object stores all custom attributes assigned to the voucher."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "voucher",
            "enum": [
              "voucher"
            ]
          }
        },
        "required": [
          "type",
          "code",
          "created_at",
          "object"
        ]
      },
      "CustomEvent": {
        "title": "Custom Event",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique custom event ID."
          },
          "object": {
            "type": "string",
            "default": "event",
            "description": "The object represented is an `event`.",
            "enum": [
              "event"
            ]
          },
          "type": {
            "type": "string",
            "description": "The event name."
          },
          "customer": {
            "description": "A simple customer object",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleCustomerRequiredObjectType"
              }
            ]
          },
          "referral": {
            "type": "object",
            "description": "Referral object.",
            "properties": {
              "referrer_id": {
                "type": "string",
                "description": "Unique referrer ID.",
                "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
              },
              "code": {
                "type": "string",
                "description": "Voucher code."
              },
              "id": {
                "type": "string",
                "description": "Unique voucher ID."
              }
            }
          },
          "loyalty": {
            "type": "object",
            "description": "Loyalty object.",
            "properties": {
              "code": {
                "type": "string",
                "description": "Loyalty card code."
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer object."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the custom event was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "object",
          "type",
          "customer",
          "referral",
          "loyalty"
        ]
      },
      "RedemptionInternal": {
        "title": "Redemption Internal",
        "description": "Model Used for internal communication",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "r_0bc92f81a6801f9bca",
            "description": "Unique redemption ID."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON. This object stores information about the `redemption`.",
            "default": "redemption"
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "tracking_id": {
            "type": "string",
            "description": "Hashed customer source ID."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the redemption."
          },
          "channel_type": {
            "type": "string",
            "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.",
            "enum": [
              "USER",
              "API"
            ]
          },
          "channel_id": {
            "type": "string",
            "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH",
            "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API."
          },
          "failure_code": {
            "type": "string",
            "example": "customer_rules_violated",
            "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed."
          },
          "failure_message": {
            "type": "string",
            "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed."
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderCalculated"
              },
              {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "description": "Array of items applied to the order. It can include up to 500 items.",
                    "items": {
                      "$ref": "#/components/schemas/OrderCalculatedItem"
                    }
                  }
                }
              }
            ]
          },
          "previous_order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderCalculated"
              },
              {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "description": "Array of items applied to the order. It can include up to 500 items.",
                    "items": {
                      "$ref": "#/components/schemas/OrderCalculatedItem"
                    }
                  }
                }
              }
            ]
          },
          "reward": {
            "$ref": "#/components/schemas/RedemptionRewardResult"
          },
          "amount": {
            "type": "integer",
            "description": "For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits.\nFor loyalty cards, this is the number of loyalty points used in the transaction.",
            "example": 10000
          },
          "reason": {
            "type": "string",
            "description": "System generated cause for the redemption being invalid in the context of the provided parameters."
          },
          "result": {
            "type": "string",
            "enum": [
              "SUCCESS",
              "FAILURE"
            ],
            "description": "Redemption result."
          },
          "status": {
            "type": "string",
            "enum": [
              "SUCCEEDED",
              "FAILED"
            ],
            "description": "Redemption status."
          },
          "related_redemptions": {
            "type": "object",
            "properties": {
              "rollbacks": {
                "type": "array",
                "items": {
                  "title": "Redemption Internal Related Redemptions Rollbacks Item",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "rr_0bc92f81a6801f9bca",
                      "description": "Unique rollback redemption ID."
                    },
                    "date": {
                      "type": "string",
                      "example": "2021-12-22T10:13:06.487Z",
                      "description": "Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.",
                      "format": "date-time"
                    }
                  }
                }
              },
              "redemptions": {
                "type": "array",
                "items": {
                  "title": "Redemption Internal Related Redemptions Item",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "r_0bc92f81a6801f9bca",
                      "description": "Unique redemption ID."
                    },
                    "date": {
                      "type": "string",
                      "example": "2021-12-22T10:13:06.487Z",
                      "description": "Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "parent_redemption_id": {
            "type": "string",
            "description": "Unique redemption ID of the parent redemption.",
            "example": "r_0c656311b5878a2031"
          },
          "redemption": {
            "type": "string",
            "description": "Unique redemption ID of the parent redemption.",
            "example": "r_0c656311b5878a2031"
          },
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "customer_id": {
            "type": "string",
            "nullable": true,
            "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64",
            "description": "Unique customer ID of the redeeming customer."
          },
          "related_object_type": {
            "type": "string",
            "description": "Defines the related object.",
            "enum": [
              "voucher",
              "promotion_tier"
            ]
          },
          "related_object_id": {
            "type": "string",
            "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher."
          },
          "related_object_parent_id": {
            "type": "string",
            "description": "Unique related parent object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher."
          },
          "campaign_name": {
            "type": "string",
            "description": "Campaign name"
          },
          "voucher": {
            "description": "Defines the details of the voucher being redeemed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Voucher"
              },
              {
                "$ref": "#/components/schemas/VoucherHolder"
              }
            ]
          },
          "promotion_tier": {
            "description": "Contains details of the promotion tier and the parent campaign.",
            "allOf": [
              {
                "$ref": "#/components/schemas/PromotionTier"
              }
            ]
          }
        }
      },
      "SimpleCustomEvent": {
        "title": "Simple Custom Event",
        "type": "object",
        "description": "Simplified custom event data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the custom event."
          },
          "name": {
            "type": "string",
            "description": "Name of the custom event."
          }
        }
      },
      "EventCustomerSent": {
        "title": "Event Customer Sent",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "distribution": {
            "type": "object"
          },
          "sent_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the distribution was sent in ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "sent_at"
        ]
      },
      "EventCustomerRecovered": {
        "title": "Event Customer Recovered",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "distribution": {
            "type": "object"
          },
          "recovered_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the distribution was recovered in ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "recovered_at"
        ]
      },
      "EventCustomerFailed": {
        "title": "Event Customer Failed",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "distribution": {
            "type": "object"
          },
          "failed_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the distribution failed in ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "failed_at"
        ]
      },
      "SimpleRedemptionRewardResult": {
        "title": "Simple Redemption Reward Result",
        "type": "object",
        "description": "Simplified redemption reward result data",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "assignment_id": {
            "type": "string",
            "description": "Unique reward assignment ID assigned by Voucherify."
          },
          "voucher": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleVoucher"
              }
            ]
          },
          "product": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProduct"
              }
            ]
          },
          "sku": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleSku"
              }
            ]
          },
          "loyalty_tier_id": {
            "type": "string",
            "description": "Unique loyalty tier ID assigned by Voucherify."
          },
          "id": {
            "type": "string",
            "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j",
            "description": "Unique reward ID, assigned by Voucherify."
          },
          "object": {
            "type": "string",
            "default": "reward",
            "enum": [
              "reward"
            ],
            "description": "The type of the object represented by the JSON. This object stores information about the reward."
          },
          "name": {
            "type": "string",
            "description": "Reward name."
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the reward was created. The value is shown in the ISO 8601 format.",
            "example": "2024-01-01T11:11:11.111Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "Timestamp representing the date and time when the reward was updated. The value is shown in the ISO 8601 format.",
            "example": "2024-01-01T11:11:11.111Z",
            "format": "date-time"
          },
          "parameters": {
            "description": "Defines how the reward is generated.",
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/RewardType"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward."
          },
          "type": {
            "type": "string",
            "enum": [
              "CAMPAIGN",
              "COIN",
              "MATERIAL"
            ],
            "description": "Reward type."
          }
        }
      },
      "SimpleReferralTier": {
        "title": "Simple Referral Tier",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique referral tier ID.",
            "example": "seg_DNAOhUtJffvX0f57ajLMFBYR"
          },
          "campaign_id": {
            "type": "string",
            "description": "Campaign Id."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "parameters": {
            "type": "object",
            "description": "Referral tier parameters"
          }
        }
      },
      "LoyaltyTier": {
        "title": "Loyalty Tier",
        "allOf": [
          {
            "$ref": "#/components/schemas/LoyaltyTierBase"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique loyalty tier ID."
              },
              "campaign_id": {
                "type": "string",
                "description": "Unique parent campaign ID."
              },
              "metadata": {
                "type": "object",
                "nullable": true,
                "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format."
              },
              "created_at": {
                "type": "string",
                "format": "date-time",
                "description": "Timestamp representing the date and time when the loyalty tier was created. The value is shown in the ISO 8601 format."
              },
              "updated_at": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format."
              },
              "config": {
                "type": "object",
                "description": "Defines loyalty tier range in points.",
                "required": [
                  "points"
                ],
                "properties": {
                  "points": {
                    "type": "object",
                    "description": "Defines range of loyalty tier in points.",
                    "properties": {
                      "from": {
                        "type": "integer",
                        "description": "Bottom points threshold value."
                      },
                      "to": {
                        "type": "integer",
                        "description": "Top points threshold value."
                      }
                    }
                  }
                }
              },
              "expiration": {
                "$ref": "#/components/schemas/LoyaltyTierExpiration"
              },
              "object": {
                "type": "string",
                "default": "loyalty_tier",
                "enum": [
                  "loyalty_tier"
                ],
                "description": "The type of the object represented by JSON. This object stores information about the loyalty."
              }
            },
            "required": [
              "id",
              "campaign_id",
              "metadata",
              "created_at",
              "config",
              "object"
            ]
          }
        ]
      },
      "EarningRule": {
        "title": "Earning Rule",
        "allOf": [
          {
            "$ref": "#/components/schemas/EarningRuleBase"
          },
          {
            "type": "object",
            "properties": {
              "validation_rule_id": {
                "type": "string",
                "nullable": true,
                "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance."
              },
              "updated_at": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format."
              },
              "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"
              }
            },
            "required": [
              "validation_rule_id",
              "updated_at",
              "active"
            ]
          }
        ]
      },
      "VoucherBalance": {
        "type": "object",
        "title": "Voucher Balance",
        "description": "Contains information on how the balance was affected by the transaction.",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of voucher whose balance is being adjusted due to the transaction.",
            "enum": [
              "loyalty_card",
              "gift_voucher"
            ]
          },
          "total": {
            "type": "integer",
            "description": "The number of all points or credits accumulated on the card as affected by add or subtract operations."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON.",
            "enum": [
              "balance"
            ]
          },
          "amount": {
            "type": "integer",
            "description": "Credits added or subtracted on a gift card."
          },
          "points": {
            "type": "integer",
            "description": "Points added or subtracted in the transaction of a loyalty card."
          },
          "balance": {
            "type": "integer",
            "description": "The available points or credits on the card after the transaction as affected by redemption or rollback."
          },
          "operation_type": {
            "type": "string",
            "description": "The type of the operation being performed. The operation type is `AUTOMATIC` if it is an automatic redemption.",
            "enum": [
              "MANUAL",
              "AUTOMATIC"
            ]
          },
          "related_object": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "description": "Defines the resource that is being modified with the values that are returned in the balance object.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Identifies the voucher that is being modified. The ID is assigned by the Voucherify API."
              },
              "type": {
                "type": "string",
                "description": "The object being modified, i.e. voucher.",
                "enum": [
                  "voucher"
                ]
              }
            }
          }
        },
        "required": [
          "total",
          "object",
          "balance",
          "related_object"
        ]
      },
      "OrderCalculated": {
        "title": "Order Calculated No Customer Data",
        "type": "object",
        "description": "Order information.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique source ID of an existing order that will be linked to the redemption of this request."
          },
          "status": {
            "type": "string",
            "description": "The order status.",
            "enum": [
              "CREATED",
              "PAID",
              "CANCELED",
              "FULFILLED"
            ]
          },
          "amount": {
            "type": "integer",
            "description": "This is the sum of the order items' amounts. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "initial_amount": {
            "type": "integer",
            "description": "This is the sum of the order items' amounts before any discount or other effect (e.g. add missing units) is applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items_discount_amount": {
            "type": "integer",
            "description": "Sum of all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "total_discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "total_amount": {
            "type": "integer",
            "description": "Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "applied_discount_amount": {
            "type": "integer",
            "description": "This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items_applied_discount_amount": {
            "type": "integer",
            "description": "Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).  \n`sum(items, i => i.applied_discount_amount)`"
          },
          "total_applied_discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).  \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`"
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "order",
            "enum": [
              "order"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the order was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "example": "2021-12-22T10:14:45.316Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the order was last updated in ISO 8601 format."
          },
          "customer_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.",
            "example": "cust_7iUa6ICKyU6gH40dBU25kQU1"
          },
          "referrer_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique referrer ID.",
            "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
          },
          "customer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerId"
              }
            ]
          },
          "referrer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReferrerId"
              }
            ]
          },
          "redemptions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/OrderRedemptionsEntry"
            }
          }
        }
      },
      "OrderCalculatedItem": {
        "type": "object",
        "title": "Order Item Calculated",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the order line item."
          },
          "sku_id": {
            "type": "string",
            "description": "Unique identifier of the SKU. It is assigned by Voucherify."
          },
          "product_id": {
            "type": "string",
            "description": "Unique identifier of the product. It is assigned by Voucherify."
          },
          "related_object": {
            "type": "string",
            "enum": [
              "product",
              "sku"
            ],
            "description": "Used along with the source_id property, can be set to either sku or product."
          },
          "source_id": {
            "type": "string",
            "description": "The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service."
          },
          "quantity": {
            "type": "integer",
            "description": "The quantity of the particular item in the cart."
          },
          "discount_quantity": {
            "type": "integer",
            "description": "Number of dicounted items."
          },
          "initial_quantity": {
            "type": "integer",
            "description": "A positive integer in the smallest unit quantity representing the total amount of the order; this is the sum of the order items' quantity."
          },
          "amount": {
            "type": "integer",
            "description": "The total amount of the order item (price * quantity)."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-item-level discounts applied to the order."
          },
          "applied_discount_amount": {
            "type": "integer",
            "description": "This field shows the order-level discount applied."
          },
          "applied_discount_quantity": {
            "type": "integer",
            "description": "Number of the discounted items applied in the transaction."
          },
          "applied_quantity": {
            "type": "integer",
            "description": "Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced."
          },
          "applied_quantity_amount": {
            "type": "integer",
            "description": "Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced."
          },
          "initial_amount": {
            "type": "integer",
            "description": "A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts."
          },
          "price": {
            "type": "integer",
            "description": "Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "subtotal_amount": {
            "type": "integer",
            "description": "Final order item amount after the applied item-level discount.  If there are no item-level discounts applied, this item is equal to the `amount`.   \n`subtotal_amount`=`amount`-`applied_discount_amount`"
          },
          "product": {
            "type": "object",
            "description": "An object containing details of the related product.",
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier that represents the product and is assigned by Voucherify."
              },
              "source_id": {
                "type": "string",
                "description": "The merchant's product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service."
              },
              "override": {
                "type": "boolean",
                "description": "The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system."
              },
              "name": {
                "type": "string",
                "description": "Product name."
              },
              "metadata": {
                "type": "object",
                "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections."
              },
              "price": {
                "type": "number",
                "description": "Product price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00)."
              }
            }
          },
          "sku": {
            "type": "object",
            "description": "An object containing details of the related SKU.",
            "properties": {
              "id": {
                "type": "string",
                "description": "A unique identifier that represents the SKU and is assigned by Voucherify."
              },
              "source_id": {
                "type": "string",
                "description": "The merchant's SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service."
              },
              "override": {
                "type": "boolean",
                "description": "The override set to `true` is used to store the product information in the system. If the product does not exist, it will be created with a source_id; if it does exist, the provided values for the name, price, and metadata will replace those already stored in the system."
              },
              "sku": {
                "type": "string",
                "description": "The SKU name."
              },
              "price": {
                "type": "number",
                "description": "SKU price. A positive integer in the smallest currency unit (e.g. 100 cents for $1.00)."
              },
              "metadata": {
                "type": "object",
                "description": "A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections."
              }
            }
          },
          "object": {
            "type": "string",
            "default": "order_item",
            "enum": [
              "order_item"
            ],
            "description": "The type of the object represented by JSON."
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to an item object. It can be useful for storing additional information about the item in a structured format. It can be used to define business validation rules or discount formulas."
          }
        },
        "required": [
          "object"
        ]
      },
      "SimpleEvent": {
        "title": "Simple Event",
        "type": "object",
        "description": "Simplified event data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier assigned by Voucherify that will be linked to the this event.",
            "example": "evcus_0e3070fef399b70b00"
          },
          "type": {
            "type": "string",
            "description": "Type of the triggering event.",
            "example": "customer.order.paid"
          },
          "category": {
            "type": "string",
            "description": "Type of the event.",
            "enum": [
              "EFFECT",
              "ACTION"
            ]
          },
          "entity_id": {
            "type": "string",
            "description": "ID of the entity that initiated the event.",
            "example": "cust_ADqZIwGvWFvugWXVbrHwXRHO"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T11:11:11.111Z",
            "description": "Timestamp representing the date and time when the event was created in the ISO 8601 format."
          },
          "group_id": {
            "type": "string",
            "description": "Unique identifier of the request that triggered the event.",
            "example": "v-1f36113948e50fc4ge"
          }
        }
      },
      "VoucherTransactionBase": {
        "title": "Voucher Transaction Base",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique transaction ID."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "description": "The merchant's transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is null."
          },
          "voucher_id": {
            "type": "string",
            "description": "Unique voucher ID."
          },
          "campaign_id": {
            "type": "string",
            "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes."
          },
          "source": {
            "type": "string",
            "nullable": true,
            "description": "The channel through which the transaction took place, whether through the API or the Dashboard. In case of a redemption, this value is null."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Reason why the transaction occurred. In case of a redemption, this value is null."
          },
          "related_transaction_id": {
            "type": "string",
            "nullable": true,
            "description": "The related transaction ID on the receiving card."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the transaction was created. The value is shown in the ISO 8601 format."
          }
        },
        "required": [
          "id",
          "source_id",
          "voucher_id",
          "campaign_id",
          "source",
          "reason",
          "type",
          "details",
          "related_transaction_id",
          "created_at"
        ]
      },
      "SimpleOrder": {
        "title": "Simple Order",
        "type": "object",
        "description": "Order information.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of an existing order that will be linked to the redemption of this request."
          },
          "source_id": {
            "type": "string",
            "description": "Unique source identifier of an existing order that will be linked to the redemption of this request."
          },
          "status": {
            "type": "string",
            "description": "The order status.",
            "enum": [
              "CREATED",
              "PAID",
              "CANCELED",
              "FULFILLED"
            ]
          },
          "customer_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.",
            "example": "cust_7iUa6ICKyU6gH40dBU25kQU1"
          },
          "referrer_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique identifier of the referrer assigned by Voucherify.",
            "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix"
          },
          "amount": {
            "type": "integer",
            "description": "A positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the total amount of the order. This is the sum of the order items' amounts."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "applied_discount_amount": {
            "type": "integer",
            "description": "This field shows the order-level discount applied. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items_discount_amount": {
            "type": "integer",
            "description": "Sum of all product-specific discounts applied to the order.  It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items_applied_discount_amount": {
            "type": "integer",
            "description": "Sum of all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).  \n`sum(items, i => i.applied_discount_amount)`"
          },
          "total_discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level AND all product-specific discounts applied to the order. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "total_applied_discount_amount": {
            "type": "integer",
            "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00).\n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`"
          },
          "total_amount": {
            "type": "integer",
            "description": "Order amount after undoing all the discounts through the rollback redemption. It is expressed as an integer in the smallest currency unit (e.g. 100 cents for $1.00)."
          },
          "items": {
            "type": "array",
            "description": "Array of items applied to the order. It can include up to 500 items.",
            "items": {
              "$ref": "#/components/schemas/SimpleOrderItem"
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format. It can be used to define business validation rules or discount formulas."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "order",
            "enum": [
              "order"
            ]
          }
        },
        "required": [
          "object"
        ]
      },
      "VoucherTransaction": {
        "title": "Voucher Transaction",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherTransactionBase"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "type": "object",
                "description": "Contains the detailed information about the transaction.",
                "properties": {
                  "balance": {
                    "$ref": "#/components/schemas/VoucherBalance"
                  },
                  "order": {
                    "type": "object",
                    "description": "Contains information about the original order.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique order ID."
                      },
                      "source_id": {
                        "type": "string",
                        "description": "The merchant's order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service."
                      }
                    },
                    "required": [
                      "id",
                      "source_id"
                    ]
                  },
                  "event": {
                    "type": "object",
                    "description": "Contains information about the event that triggers the point accrual.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique event ID."
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of event."
                      }
                    },
                    "required": [
                      "id",
                      "type"
                    ]
                  },
                  "earning_rule": {
                    "type": "object",
                    "description": "Contains information about the earning rule.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of an earning rule, assigned by Voucherify."
                      },
                      "source": {
                        "type": "object",
                        "required": [
                          "banner"
                        ],
                        "description": "Contains the custom earning rule name.",
                        "properties": {
                          "banner": {
                            "type": "string",
                            "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                          }
                        }
                      }
                    },
                    "required": [
                      "id",
                      "source"
                    ]
                  },
                  "segment": {
                    "type": "object",
                    "description": "Contains information about the segment.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the segment."
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the segment."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "loyalty_tier": {
                    "type": "object",
                    "description": "Contains information about the loyalty tier that is mapped for the earning rule and used in the transaction.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                      },
                      "name": {
                        "type": "string",
                        "description": "User-defined name of the loyalty tier."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "redemption": {
                    "type": "object",
                    "description": "Contains information about the original redemption.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique redemption ID."
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "rollback": {
                    "type": "object",
                    "description": "Contains information about the redemption rollback.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the redemption rollback."
                      }
                    },
                    "required": [
                      "id"
                    ]
                  },
                  "custom_event": {
                    "type": "object",
                    "description": "Contains information about the custom event that triggers the point accrual.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the event."
                      },
                      "type": {
                        "type": "string",
                        "description": "Type of the custom event."
                      }
                    },
                    "required": [
                      "id",
                      "type"
                    ]
                  },
                  "event_schema": {
                    "type": "object",
                    "description": "Contains information about the custom event metadata schema.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the metadata schema."
                      },
                      "name": {
                        "type": "string",
                        "description": "Type of the custom event."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "holder_loyalty_tier": {
                    "type": "object",
                    "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was before the loyalty point balance changed.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
                      },
                      "name": {
                        "type": "string",
                        "description": "User-defined name of the loyalty tier."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "pending_points": {
                    "$ref": "#/components/schemas/LoyaltyPendingPoints"
                  },
                  "reward": {
                    "type": "object",
                    "description": "Contains information about the pay with points reward.",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique reward ID."
                      },
                      "name": {
                        "type": "string",
                        "description": "Reward name."
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "source_voucher": {
                    "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/SimpleVoucher"
                      }
                    ]
                  },
                  "destination_voucher": {
                    "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.",
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/SimpleVoucher"
                      }
                    ]
                  }
                }
              },
              "type": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/GiftVoucherTransactionsType"
                  },
                  {
                    "$ref": "#/components/schemas/LoyaltyCardTransactionsType"
                  }
                ]
              }
            }
          }
        ]
      },
      "LoyaltyPendingPoints": {
        "type": "object",
        "title": "Loyalty Pending Point Entry",
        "description": "Contains details about the pending point entry.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the pending point entry, assigned by Voucherify.",
            "example": "lopp_0ffd593d5ad207ba6b"
          },
          "voucher_id": {
            "type": "string",
            "description": "Unique identifier of the loyalty card, assigned by Voucherify.",
            "example": "v_abCdEfghI1JKLMNPqRS2Tu3vWXyza4bc"
          },
          "campaign_id": {
            "type": "string",
            "description": "Unique campaign identifier, assigned by Voucherify.",
            "example": "camp_weer1c3p5ZgktqfW56RfoNaG"
          },
          "customer_id": {
            "type": "string",
            "description": "Unique customer identifier, assigned by Voucherify.",
            "example": "cust_IdgAFZxYwwHctOk9ppZMu319"
          },
          "order_id": {
            "type": "string",
            "description": "Unique order identifier, assigned by Voucherify.",
            "example": "ord_0ffc0fa65f15d2df17"
          },
          "points": {
            "type": "integer",
            "description": "Number of points in the pending state."
          },
          "activates_at": {
            "type": "string",
            "description": "Date when the pending points are activated and added to the customer's loyalty card.",
            "format": "date"
          },
          "details": {
            "$ref": "#/components/schemas/LoyaltyPendingPointsDetails"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the pending point entry was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the pending point entry was modified. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "voucher_id",
          "campaign_id",
          "customer_id",
          "order_id",
          "points",
          "activates_at",
          "details",
          "created_at"
        ]
      },
      "LoyaltyPointsBucket": {
        "type": "object",
        "title": "Loyalty Point Bucket",
        "description": "Contains the details about expiring loyalty points.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the loyalty points bucket."
          },
          "voucher_id": {
            "type": "string",
            "description": "Unique identifier of the parent loyalty card."
          },
          "campaign_id": {
            "type": "string",
            "description": "Unique identifier of the parent campaign."
          },
          "bucket": {
            "type": "object",
            "required": [
              "total_points"
            ],
            "description": "Defines the number of points stored in this loyalty point bucket.",
            "properties": {
              "total_points": {
                "type": "integer",
                "description": "Total number of points in the loyalty point bucket."
              }
            }
          },
          "status": {
            "type": "string",
            "description": "Loyalty point bucket status."
          },
          "expires_at": {
            "type": "string",
            "format": "date",
            "description": "Date when the number of points defined in the bucket object are due to expire."
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the loyalty point bucket object was created in ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the loyalty point bucket object was updated in ISO 8601 format."
          },
          "object": {
            "type": "string",
            "enum": [
              "loyalty_points_bucket"
            ],
            "description": "The type of the object represented by JSON. This object stores information about the loyalty point bucket."
          }
        },
        "required": [
          "id",
          "voucher_id",
          "campaign_id",
          "bucket",
          "created_at",
          "status",
          "expires_at",
          "object"
        ]
      },
      "ListPublicationsItemValidSingleVoucher": {
        "title": "Valid Single Voucher",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/ListPublicationsItemBase"
          },
          {
            "type": "object",
            "properties": {
              "result": {
                "type": "string",
                "default": "SUCCESS",
                "enum": [
                  "SUCCESS"
                ],
                "description": "Status of the publication attempt."
              },
              "voucher": {
                "$ref": "#/components/schemas/ListPublicationsItemVoucher"
              }
            },
            "required": [
              "result",
              "voucher"
            ]
          }
        ]
      },
      "ValidationEntity": {
        "title": "Validation Entity",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique validation id."
          },
          "session_id": {
            "type": "string",
            "description": "Unique session id."
          },
          "status": {
            "type": "string",
            "description": "The validation status",
            "enum": [
              "VALID",
              "INVALID"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the validation was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string",
            "description": "Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.",
            "example": "cust_7iUa6ICKyU6gH40dBU25kQU1"
          },
          "redeemables": {
            "type": "array",
            "description": "Lists validation results of each redeemable.",
            "items": {
              "type": "object",
              "description": "Determines the redeemables",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the redeemable, assigned by Voucherify."
                },
                "type": {
                  "type": "string",
                  "description": "Type of the redeemable.",
                  "enum": [
                    "voucher",
                    "promotion_tier"
                  ]
                }
              }
            }
          },
          "skipped_redeemables": {
            "type": "array",
            "description": "Lists validation results of each redeemable.",
            "items": {
              "type": "object",
              "description": "Determines the redeemables",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the redeemable, assigned by Voucherify."
                },
                "type": {
                  "type": "string",
                  "description": "Type of the redeemable.",
                  "enum": [
                    "voucher",
                    "promotion_tier"
                  ]
                }
              }
            }
          },
          "inapplicable_redeemables": {
            "type": "array",
            "description": "Lists validation results of each redeemable.",
            "items": {
              "type": "object",
              "description": "Determines the redeemables",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Unique identifier of the redeemable, assigned by Voucherify."
                },
                "type": {
                  "type": "string",
                  "description": "Type of the redeemable.",
                  "enum": [
                    "voucher",
                    "promotion_tier"
                  ]
                }
              }
            }
          }
        }
      },
      "EventCustomerRedemption": {
        "title": "Event Customer Redemption",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "holder": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "promotion_tier": {
            "$ref": "#/components/schemas/SimplePromotionTier"
          },
          "promotion_stack": {
            "$ref": "#/components/schemas/SimplePromotionStack"
          },
          "redemption": {
            "$ref": "#/components/schemas/SimpleRedemption"
          }
        }
      },
      "SimpleRedemption": {
        "type": "object",
        "title": "Simple Redemption",
        "description": "Simplified redemption data.",
        "properties": {
          "id": {
            "type": "string",
            "example": "r_0bc92f81a6801f9bca",
            "description": "Unique redemption ID."
          },
          "customer_id": {
            "type": "string",
            "nullable": true,
            "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64",
            "description": "Unique customer ID of the redeeming customer."
          },
          "tracking_id": {
            "type": "string",
            "description": "Hashed customer source ID."
          },
          "date": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the redemption was created in the ISO 8601 format.",
            "format": "date-time"
          },
          "amount": {
            "type": "integer",
            "description": "For gift cards, this is a positive integer in the smallest currency unit (e.g. 100 cents for $1.00) representing the number of redeemed credits.\nFor loyalty cards, this is the number of loyalty points used in the transaction.\nIn the case of redemption rollback, the numbers are expressed as negative integers.",
            "example": 10000
          },
          "order": {
            "$ref": "#/components/schemas/SimpleOrder"
          },
          "reward": {
            "$ref": "#/components/schemas/SimpleRedemptionRewardResult"
          },
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "result": {
            "type": "string",
            "enum": [
              "SUCCESS",
              "FAILURE"
            ],
            "description": "Redemption result."
          },
          "status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "SUCCEEDED",
              "FAILED",
              "ROLLED BACK"
            ]
          },
          "voucher": {
            "description": "Defines the details of the voucher being redeemed.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleVoucher"
              }
            ]
          },
          "promotion_tier": {
            "$ref": "#/components/schemas/SimplePromotionTier"
          },
          "redemption": {
            "type": "string",
            "description": "Unique redemption ID of the parent redemption.",
            "example": "r_0c656311b5878a2031"
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption."
          },
          "failure_code": {
            "type": "string",
            "example": "customer_rules_violated",
            "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed."
          },
          "failure_message": {
            "type": "string",
            "description": "If the result is `FAILURE`, this parameter will provide an expanded reason as to why the redemption failed."
          },
          "reason": {
            "type": "string",
            "description": "The reason for the redemption rollback."
          },
          "channel": {
            "type": "object",
            "description": "Defines the details of the channel through which the redemption was issued.",
            "properties": {
              "channel_id": {
                "type": "string",
                "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard, an X-APP-Id of a user using the API, or the reward assignment ID for automatic reward redemption."
              },
              "channel_type": {
                "type": "string",
                "description": "The source of the channel for the redemption:\n`USER` - the redemption was made in the Voucherify Dashboard by a user,\n `API` - redemption was made through the API,\n`AUTO_REDEEM` - the redemption was made automatically for a reward.",
                "enum": [
                  "API",
                  "AUTO_REDEEM",
                  "USER"
                ]
              }
            }
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON. This object stores information about the `redemption`.",
            "default": "redemption"
          }
        },
        "required": [
          "id",
          "date",
          "metadata",
          "status",
          "object"
        ]
      },
      "EventCustomerOrder": {
        "title": "Event Customer Order",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "referrer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderCalculated"
              },
              {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "description": "Array of items applied to the order. It can include up to 500 items.",
                    "items": {
                      "$ref": "#/components/schemas/OrderCalculatedItem"
                    }
                  }
                }
              }
            ]
          },
          "redemption": {
            "$ref": "#/components/schemas/RedemptionInternal"
          }
        }
      },
      "EventCustomerRewardRedemptions": {
        "title": "Event Customer Reward Redemptions",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "holder": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "voucher": {
            "$ref": "#/components/schemas/SimpleVoucher"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          },
          "reward_redemption": {
            "type": "object"
          },
          "reward": {
            "$ref": "#/components/schemas/SimpleRedemptionRewardResult"
          },
          "reward_assignment": {
            "$ref": "#/components/schemas/RewardAssignment"
          },
          "source": {
            "type": "string"
          },
          "balance": {
            "type": "integer"
          }
        }
      },
      "EventCustomerLoyaltyTierBase": {
        "title": "Event Customer Loyalty Tier Base",
        "type": "object",
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/SimpleCustomer"
          },
          "campaign": {
            "$ref": "#/components/schemas/SimpleCampaign"
          }
        },
        "required": [
          "created_at",
          "loyalty_tier_to"
        ]
      },
      "SimpleRedeemableHolder": {
        "type": "object",
        "title": "Redeemable Holder",
        "description": "Details about the holder of the redeemable.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the redeemable holder.",
            "example": "rh_0e7b8db4700106a852"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the redeemable was assigned. The value is shown in the ISO 8601 format.",
            "example": "2024-03-22T17:48:25.910Z"
          },
          "redeemable_id": {
            "type": "string",
            "description": "Identifier of the redeemable item.",
            "example": "v_GXVguPhq2khgFxH7GrRXWA91gDr1LiA1"
          },
          "redeemable_object": {
            "type": "string",
            "description": "Type of the redeemable.",
            "example": "voucher",
            "enum": [
              "voucher"
            ]
          },
          "campaign_id": {
            "type": "string",
            "description": "Unique identifier of the campaign as assigned by Voucherify.",
            "example": "camp_weer1c3p5ZgktqfW56RfoNaG"
          },
          "campaign_type": {
            "type": "string",
            "description": "Defines the type of the campaign.",
            "enum": [
              "REFERRAL_PROGRAM"
            ],
            "example": "REFERRAL_PROGRAM"
          },
          "voucher_type": {
            "type": "string",
            "description": "Defines the type of the voucher.",
            "enum": [
              "GIFT_VOUCHER",
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD"
            ],
            "example": "DISCOUNT_VOUCHER"
          },
          "publication_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique identifier of the publication."
          },
          "customer_id": {
            "type": "string",
            "description": "Unique identifier of the customer.",
            "example": "cust_p1ufreYbVbwZ1x70nFkH9rF9"
          },
          "holder_role": {
            "type": "string",
            "description": "Role of the holder.",
            "enum": [
              "OWNER",
              "REFERRER",
              "REFEREE"
            ],
            "example": "REFERRER"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "enum": [
              "redeemable_holder"
            ]
          }
        },
        "required": [
          "id",
          "created_at",
          "redeemable_id",
          "redeemable_object",
          "campaign_id",
          "campaign_type",
          "voucher_type",
          "publication_id",
          "customer_id",
          "holder_role",
          "object"
        ]
      },
      "Discount": {
        "title": "Discount",
        "type": "object",
        "description": "Contains information about discount.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/DiscountAmount"
          },
          {
            "$ref": "#/components/schemas/DiscountUnit"
          },
          {
            "$ref": "#/components/schemas/DiscountUnitMultiple"
          },
          {
            "$ref": "#/components/schemas/DiscountPercent"
          },
          {
            "$ref": "#/components/schemas/DiscountFixed"
          }
        ]
      },
      "ValidityTimeframe": {
        "title": "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"
          }
        }
      },
      "ValidityDayOfWeek": {
        "title": "Validity Day Of Week",
        "type": "array",
        "description": "Integer array corresponding to the particular days of the week in which the voucher 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",
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ]
        }
      },
      "ValidityHours": {
        "title": "Validity Hours",
        "type": "object",
        "description": "Determines the hours of validity, e.g. to create a happy hours scenario.",
        "properties": {
          "daily": {
            "type": "array",
            "description": "Defines the recurring period(s) when the resource is active. The periods should not overlap.",
            "items": {
              "type": "object",
              "description": "Defines the recurring period(s) when the resource will be active.",
              "properties": {
                "start_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the starting hour of validity in the HH:mm format. The resource is *inactive before* this time.",
                  "example": "12:00"
                },
                "days_of_week": {
                  "type": "array",
                  "description": "Integer array corresponding to the particular days of the week in which the resource 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",
                    "enum": [
                      0,
                      1,
                      2,
                      3,
                      4,
                      5,
                      6
                    ]
                  }
                },
                "expiration_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the ending hour of validity in the HH:mm format. The resource is *inactive after* this time.",
                  "example": "14:00"
                }
              }
            }
          }
        }
      },
      "VoucherAssets": {
        "title": "Voucher Assets",
        "type": "object",
        "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.",
        "properties": {
          "qr": {
            "type": "object",
            "description": "Stores Quick Response (QR) representation of encrypted code.",
            "properties": {
              "id": {
                "type": "string",
                "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==",
                "description": "Encrypted voucher code ID."
              },
              "url": {
                "type": "string",
                "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D",
                "description": "URL to QR code  \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code.  \n\n- `size`: integer value from `1` to `100`  \n- `format`: string, either `png` (default) or `svg`"
              }
            }
          },
          "barcode": {
            "type": "object",
            "description": "Stores barcode representation of encrypted code.",
            "properties": {
              "id": {
                "type": "string",
                "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==",
                "description": "Encrypted voucher code ID."
              },
              "url": {
                "type": "string",
                "example": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D",
                "description": "URL to barcode  \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code.  \n\n- `size`: integer value from `1` to `100`  \n- `format`: string, either `png` (default) or `svg`"
              }
            }
          }
        }
      },
      "SimpleCampaignVoucher": {
        "type": "object",
        "description": "Simplified campaign voucher data.",
        "title": "Simple Campaign Voucher",
        "properties": {
          "type": {
            "type": "string",
            "description": "Type of the voucher.",
            "enum": [
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD",
              "GIFT_VOUCHER"
            ]
          },
          "discount": {
            "description": "Defines the voucher discount type and details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Discount"
              }
            ]
          },
          "gift": {
            "description": "Defines the voucher gift details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Gift"
              }
            ]
          },
          "loyalty_card": {
            "description": "Defines the voucher loyalty card details.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CampaignLoyaltyCard"
              }
            ]
          },
          "redemption": {
            "type": "object",
            "description": "Defines the redemption limits on vouchers.",
            "properties": {
              "quantity": {
                "type": "integer",
                "nullable": true,
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              }
            },
            "required": [
              "quantity",
              "redeemed_quantity"
            ]
          },
          "code_config": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CodeConfig"
              }
            ],
            "required": [
              "length",
              "charset",
              "pattern"
            ]
          }
        },
        "required": [
          "type",
          "redemption",
          "code_config"
        ]
      },
      "ReferralProgram": {
        "title": "Referral Program",
        "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.",
        "type": "object",
        "properties": {
          "conversion_event_type": {
            "type": "string",
            "enum": [
              "redemption",
              "custom_event"
            ],
            "description": "Define how a referral is triggered."
          },
          "custom_event": {
            "type": "object",
            "description": "Contains details about the custom event.",
            "properties": {
              "id": {
                "type": "string",
                "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM",
                "description": "Unique custom event ID."
              },
              "name": {
                "type": "string",
                "description": "Custom event name."
              }
            }
          },
          "referee_reward": {
            "type": "object",
            "description": "Defines the referee reward.",
            "properties": {
              "related_object_parent": {
                "type": "object",
                "description": "Details of the resource from which the reward originates.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe",
                    "description": "Unique ID of the reward source."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the reward source."
                  },
                  "object": {
                    "type": "string",
                    "default": "CAMPAIGN",
                    "enum": [
                      "CAMPAIGN"
                    ],
                    "description": "Type of resource represented by the source of the reward."
                  }
                }
              },
              "type": {
                "type": "string",
                "enum": [
                  "LOYALTY_CARD",
                  "GIFT_VOUCHER"
                ],
                "description": "Type of reward."
              },
              "amount": {
                "type": "integer",
                "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
              }
            }
          }
        }
      },
      "Category": {
        "title": "Category",
        "description": "This is an object representing a category.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique category ID assigned by Voucherify."
          },
          "name": {
            "type": "string",
            "description": "Category name."
          },
          "hierarchy": {
            "type": "integer",
            "description": "Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.",
            "minimum": 0
          },
          "object": {
            "type": "string",
            "default": "category",
            "enum": [
              "category"
            ],
            "description": "The type of the object represented by the JSON. This object stores information about the category."
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.",
            "example": "2022-07-14T10:45:13.156Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2022-08-16T10:52:08.094Z",
            "description": "Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "hierarchy",
          "created_at",
          "object"
        ]
      },
      "Gift": {
        "title": "Gift",
        "type": "object",
        "description": "Contains current gift card balance information.",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "subtracted_amount": {
            "type": "integer",
            "description": "Total amount of subtracted credits over the gift card lifetime."
          },
          "balance": {
            "type": "number",
            "description": "Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`. `balance` = `amount` - `subtracted_amount` - `redemption.redeemed_amount`."
          },
          "effect": {
            "type": "string",
            "description": "Defines how the credits are applied to the customer's order.",
            "enum": [
              "APPLY_TO_ORDER",
              "APPLY_TO_ITEMS"
            ]
          }
        },
        "required": [
          "amount",
          "balance"
        ]
      },
      "SimpleLoyaltyCard": {
        "title": "Simple Loyalty Card",
        "type": "object",
        "description": "Simplified loyalty card data.",
        "required": [
          "points"
        ],
        "properties": {
          "points": {
            "type": "integer",
            "description": "Total number of points added to the loyalty card over its lifespan."
          },
          "balance": {
            "type": "integer",
            "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
          },
          "next_expiration_date": {
            "type": "string",
            "description": "The next closest date when the next set of points are due to expire."
          },
          "next_expiration_points": {
            "type": "integer",
            "description": "The amount of points that are set to expire next."
          },
          "pending_points": {
            "type": "integer",
            "description": "Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually."
          },
          "expired_points": {
            "type": "integer",
            "description": "Shows the total number of expired points over the lifetime of the loyalty card."
          },
          "subtracted_points": {
            "type": "integer",
            "description": "Shows the total number of subtracted points over the lifetime of the loyalty card."
          }
        }
      },
      "SimpleCustomerRequiredObjectType": {
        "type": "object",
        "description": "This is an object representing a customer with limited properties used in Event Tracking endpoints.",
        "title": "Customer Object Required Object Type",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique ID of a customer that is assigned by Voucherify.",
            "example": "cust_CSnYd37MXmrbS19XCrghjBsv"
          },
          "source_id": {
            "type": "string",
            "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service."
          },
          "name": {
            "type": "string",
            "description": "Customer's first and last name."
          },
          "email": {
            "type": "string",
            "description": "Customer's email address."
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. "
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON. This object stores information about the customer.",
            "default": "customer"
          }
        },
        "required": [
          "object"
        ]
      },
      "RedemptionRewardResult": {
        "title": "Redemption Reward Result",
        "type": "object",
        "properties": {
          "customer": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleCustomer"
              }
            ]
          },
          "assignment_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique reward assignment ID assigned by Voucherify."
          },
          "voucher": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Voucher"
              }
            ]
          },
          "product": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Product"
              }
            ]
          },
          "sku": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Sku"
              }
            ]
          },
          "loyalty_tier_id": {
            "type": "string",
            "nullable": true,
            "description": "Unique loyalty tier ID assigned by Voucherify."
          },
          "id": {
            "type": "string",
            "example": "rew_0bc92f81a6801f9bca",
            "description": "Unique reward ID."
          },
          "name": {
            "type": "string",
            "example": "Reward Name",
            "description": "Name of the reward."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON",
            "default": "reward",
            "enum": [
              "reward"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2022-10-03T12:24:58.008Z",
            "description": "Timestamp in ISO 8601 format indicating when the reward was updated."
          },
          "parameters": {
            "type": "object",
            "description": "These are parameters representing a material reward.",
            "properties": {
              "campaign": {
                "type": "object",
                "description": "Defines the product redeemed as a reward.",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Campaign unique ID.",
                    "example": "camp_13BbZ0kQsNinhqsX3wUts2UP"
                  },
                  "balance": {
                    "type": "integer",
                    "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
                  },
                  "type": {
                    "type": "string",
                    "description": "Defines the type of the campaign."
                  }
                }
              },
              "product": {
                "type": "object",
                "description": "Defines the product redeemed as a reward.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "prod_0b7d7dfb05cbe5c616",
                    "description": "Unique product ID, assigned by Voucherify. "
                  },
                  "sku_id": {
                    "type": "string",
                    "description": "Unique identifier of the SKU. It is assigned by Voucherify.",
                    "example": "sku_0a41e31c7b41c28358"
                  }
                }
              },
              "coin": {
                "type": "object",
                "description": "Defines the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.",
                "properties": {
                  "exchange_ratio": {
                    "type": "integer",
                    "description": "The cash equivalent of the points defined in the `points_ratio` property."
                  },
                  "points_ratio": {
                    "type": "integer",
                    "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property."
                  }
                }
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a reward. The metadata object stores all custom attributes assigned to the reward."
          },
          "type": {
            "type": "string",
            "enum": [
              "CAMPAIGN",
              "COIN",
              "MATERIAL"
            ],
            "description": "Reward type."
          }
        },
        "required": [
          "reward",
          "customer",
          "assignment_id",
          "voucher",
          "product",
          "sku",
          "loyalty_tier_id"
        ]
      },
      "Voucher": {
        "title": "Voucher",
        "description": "This is an object representing a voucher with categories and validation rules assignments.",
        "allOf": [
          {
            "$ref": "#/components/schemas/VoucherBase"
          },
          {
            "type": "object",
            "properties": {
              "categories": {
                "type": "array",
                "description": "Contains details about the category.",
                "items": {
                  "$ref": "#/components/schemas/Category"
                }
              },
              "validation_rules_assignments": {
                "$ref": "#/components/schemas/ValidationRulesAssignmentsList"
              }
            }
          }
        ]
      },
      "VoucherHolder": {
        "title": "Voucher Holder",
        "type": "object",
        "description": "This is an object representing a voucher holder.",
        "properties": {
          "holder": {
            "$ref": "#/components/schemas/SimpleCustomer"
          }
        }
      },
      "PromotionTier": {
        "type": "object",
        "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "title": "Promotion Tier",
        "properties": {
          "id": {
            "type": "string",
            "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
            "description": "Unique promotion tier ID."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-15T11:34:01.333Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was created. The value is shown in the ISO 8601 format."
          },
          "updated_at": {
            "type": "string",
            "example": "2022-02-09T09:20:05.603Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was updated. The value is shown in the ISO 8601 format."
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "action": {
            "type": "object",
            "description": "Contains details about the discount applied by the promotion tier.",
            "properties": {
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "promotion_id": {
            "type": "string",
            "description": "Promotion unique ID."
          },
          "campaign": {
            "type": "object",
            "description": "Contains details about promotion tier's parent campaign.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique campaign ID."
              },
              "start_date": {
                "type": "string",
                "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
                "format": "date-time",
                "example": "2022-09-22T00:00:00.000Z"
              },
              "expiration_date": {
                "type": "string",
                "format": "date-time",
                "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
                "example": "2022-09-30T00:00:00.000Z"
              },
              "validity_timeframe": {
                "$ref": "#/components/schemas/ValidityTimeframe"
              },
              "validity_day_of_week": {
                "$ref": "#/components/schemas/ValidityDayOfWeek"
              },
              "validity_hours": {
                "$ref": "#/components/schemas/ValidityHours"
              },
              "active": {
                "type": "boolean",
                "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](/api-reference/disable-campaign) endpoint.  \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign"
              },
              "category_id": {
                "type": "string",
                "example": "cat_0b688929a2476386a6",
                "description": "Unique category ID that this campaign belongs to."
              },
              "object": {
                "type": "string",
                "description": "The type of the object represented by the campaign object. This object stores information about the campaign.",
                "default": "campaign"
              }
            }
          },
          "campaign_id": {
            "type": "string",
            "description": "Promotion tier's parent campaign's unique ID."
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier"
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "summary": {
            "type": "object",
            "description": "Contains statistics about promotion tier redemptions and orders.",
            "properties": {
              "redemptions": {
                "type": "object",
                "description": "Contains statistics about promotion tier redemptions.",
                "properties": {
                  "total_redeemed": {
                    "type": "integer",
                    "description": "Number of times the promotion tier was redeemed."
                  }
                }
              },
              "orders": {
                "type": "object",
                "description": "Contains statistics about orders related to the promotion tier.",
                "properties": {
                  "total_amount": {
                    "type": "integer",
                    "description": "Sum of order totals."
                  },
                  "total_discount_amount": {
                    "type": "integer",
                    "description": "Sum of total discount applied using the promotion tier."
                  }
                }
              }
            }
          },
          "object": {
            "type": "string",
            "default": "promotion_tier",
            "description": "The type of the object represented by JSON. This object stores information about the promotion tier."
          },
          "validation_rule_assignments": {
            "$ref": "#/components/schemas/ValidationRuleAssignmentsList"
          },
          "category_id": {
            "type": "string",
            "description": "Promotion tier category ID.",
            "example": "cat_0c9da30e7116ba6bba"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "SimpleProduct": {
        "title": "Simple Product",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID."
          },
          "source_id": {
            "type": "string",
            "description": "Product source id."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          }
        }
      },
      "SimpleSku": {
        "title": "Simple Sku",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique sku ID."
          },
          "source_id": {
            "type": "string",
            "description": "Sku source id."
          },
          "sku": {
            "type": "string",
            "description": "Sku name."
          }
        }
      },
      "RewardType": {
        "title": "Reward type",
        "oneOf": [
          {
            "$ref": "#/components/schemas/RewardTypeCampaign"
          },
          {
            "$ref": "#/components/schemas/RewardTypeCoin"
          },
          {
            "$ref": "#/components/schemas/RewardTypeMaterial"
          }
        ]
      },
      "LoyaltyTierBase": {
        "title": "Loyalty Tier Base",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Loyalty Tier name."
          },
          "earning_rules": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MappingPoints"
            },
            "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule."
          },
          "rewards": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MappingPoints"
            },
            "description": "Contains a list of reward IDs and their points mapping for the given reward."
          },
          "points": {
            "type": "object",
            "description": "Defines range of loyalty tier in points.",
            "properties": {
              "from": {
                "type": "integer",
                "description": "Bottom points threshold value."
              },
              "to": {
                "type": "integer",
                "description": "Top points threshold value."
              }
            }
          }
        },
        "required": [
          "name",
          "points"
        ]
      },
      "LoyaltyTierExpiration": {
        "title": "Loyalty Tier Expiration",
        "description": "Defines loyalty tier expiration date.",
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "description": "Unique customer identifier of the customer making the purchase. The ID is assigned by Voucherify.",
            "example": "cust_7iUa6ICKyU6gH40dBU25kQU1"
          },
          "campaign_id": {
            "type": "string",
            "description": "Unique campaign ID, assigned by Voucherify.",
            "example": "camp_rRsfatlwN7unSeUIJDCYedal"
          },
          "tier_id": {
            "type": "string",
            "description": "Unique tier ID, assigned by Voucherify."
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the loyalty tier starts to be active in ISO 8601 format. Loyalty tier is inactive before this date."
          },
          "expiration_date": {
            "type": "string",
            "description": "Expiration timestamp defines when the loyalty tier expires in ISO 8601 format. Loyalty tier is inactive after this date."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the loyalty tier was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          }
        },
        "required": [
          "customer_id",
          "campaign_id",
          "tier_id",
          "created_at"
        ]
      },
      "EarningRuleBase": {
        "title": "EarningRuleBase",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Assigned by the Voucherify API, identifies the earning rule object."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the earning rule was created. The value is shown in the ISO 8601 format."
          },
          "loyalty": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EarningRuleFixed"
              },
              {
                "$ref": "#/components/schemas/EarningRuleProportional"
              }
            ]
          },
          "event": {
            "description": "Defines the event which triggers the earning rule to add points to a loyalty card.",
            "allOf": [
              {
                "$ref": "#/components/schemas/EarningRuleEvent"
              }
            ]
          },
          "custom_event": {
            "description": "Contains details about the custom event.",
            "type": "object",
            "properties": {
              "schema_id": {
                "description": "Unique identifier of the custom event schema",
                "type": "string"
              }
            },
            "required": [
              "schema_id"
            ]
          },
          "segment": {
            "type": "object",
            "description": "Contains the ID of a customer segment. Required for the `customer.segment.entered` option in the event.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API."
              }
            },
            "required": [
              "id"
            ]
          },
          "loyalty_tier": {
            "type": "object",
            "description": "Defines the tier associated with the earning rule definition.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique loyalty tier ID associated with the earning rule.    \n\n- `__ANY__`: any loyalty tier within the campaign",
                "example": "ltr_pudTGWasuIqxdiDM0go31OV1"
              }
            }
          },
          "pending_points": {
            "type": "object",
            "description": "Defines the configuration for pending points. Pending points can be used only with the `order.paid` event.",
            "properties": {
              "period_type": {
                "type": "string",
                "description": "Defines the type of the period during which the points are in the pending state. Currently, only `DAY` value is accepted.",
                "enum": [
                  "DAY"
                ]
              },
              "period_value": {
                "type": "integer",
                "description": "Defines for how long the points are in the pending state. The minimum value is 1, maximum is 90.",
                "minimum": 1,
                "maximum": 90
              }
            }
          },
          "source": {
            "type": "object",
            "required": [
              "object_id",
              "object_type"
            ],
            "description": "Contains the custom earning rule name and parent campaign.",
            "properties": {
              "banner": {
                "type": "string",
                "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
              },
              "object_id": {
                "type": "string",
                "description": "A unique campaign identifier assigned by the Voucherify API."
              },
              "object_type": {
                "type": "string",
                "description": "Defines the object associated with the earning rule. Defaults to `campaign`.",
                "default": "campaign",
                "enum": [
                  "campaign"
                ]
              }
            }
          },
          "object": {
            "type": "string",
            "default": "earning_rule",
            "enum": [
              "earning_rule"
            ],
            "description": "The type of the object represented by JSON. Default is earning_rule."
          },
          "automation_id": {
            "type": "string",
            "description": "For internal use by Voucherify."
          },
          "start_date": {
            "type": "string",
            "description": "Start date defines when the earning rule starts to be active. Activation timestamp is presented in the ISO 8601 format. The earning rule is inactive before this date. If you do not define the start date for an earning rule, it will inherit the campaign start date by default."
          },
          "expiration_date": {
            "type": "string",
            "description": "Expiration date defines when the earning rule expires. Expiration timestamp is presented in the ISO 8601 format. The earning rule is inactive after this date. If you do not define the expiration date for an earning rule, it will inherit the campaign expiration date by default."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "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."
          },
          "expiration_rules": {
            "$ref": "#/components/schemas/EarningRuleExpirationRules"
          }
        },
        "required": [
          "id",
          "created_at",
          "loyalty",
          "source",
          "object",
          "automation_id",
          "metadata"
        ]
      },
      "CustomerId": {
        "title": "Customer Id",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A unique identifier of an existing customer."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "customer",
            "enum": [
              "customer"
            ]
          }
        },
        "required": [
          "id",
          "object"
        ]
      },
      "ReferrerId": {
        "title": "Referrer Id",
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerId"
          }
        ]
      },
      "OrderRedemptionsEntry": {
        "title": "Order Redemptions",
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Timestamp representing the date and time when the redemption was created. The value is shown in the ISO 8601 format.",
            "example": "2022-09-02T17:06:56.649Z",
            "format": "date-time"
          },
          "rollback_id": {
            "type": "string",
            "description": "Unique ID of the redemption rollback.",
            "example": "rr_0c63c84eb78ee0a6c0"
          },
          "rollback_date": {
            "type": "string",
            "description": "Timestamp representing the date and time when the redemption rollback was created. The value is shown in the ISO 8601 format.",
            "example": "2023-01-31T14:18:37.150Z",
            "format": "date-time"
          },
          "related_object_type": {
            "type": "string",
            "description": "The source of the incentive.",
            "default": "redemption"
          },
          "related_object_id": {
            "type": "string",
            "description": "Unique ID of the parent redemption.",
            "example": "r_0ba186c4824e4881e1"
          },
          "related_object_parent_id": {
            "type": "string",
            "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign."
          },
          "stacked": {
            "type": "array",
            "description": "Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.",
            "items": {
              "type": "string"
            }
          },
          "rollback_stacked": {
            "type": "array",
            "description": "Lists the rollback redemption IDs of the particular child redemptions.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SimpleOrderItem": {
        "type": "object",
        "title": "Simple Order Item",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the order line item."
          },
          "object": {
            "type": "string",
            "default": "order_item",
            "enum": [
              "order_item"
            ],
            "description": "The type of the object represented by JSON. This object stores information about the `order_item`."
          },
          "source_id": {
            "type": "string",
            "description": "The merchant's product/SKU ID (if it is different from the Voucherify product/SKU ID). It is useful in the integration between multiple systems. It can be an ID from an eCommerce site, a database, or a third-party service."
          },
          "related_object": {
            "type": "string",
            "enum": [
              "product",
              "sku"
            ],
            "description": "Used along with the `source_id` property, can be set to either SKU or product."
          },
          "product_id": {
            "type": "string",
            "description": "Unique identifier of the product. It is assigned by Voucherify."
          },
          "sku_id": {
            "type": "string",
            "description": "Unique identifier of the SKU. It is assigned by Voucherify."
          },
          "quantity": {
            "type": "integer",
            "description": "Quantity of the particular item in the cart."
          },
          "applied_quantity": {
            "type": "integer",
            "description": "Quantity of items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced."
          },
          "applied_quantity_amount": {
            "type": "integer",
            "description": "Amount for the items changed by the application of a new quantity items. It can be positive when an item is added or negative if an item is replaced."
          },
          "discount_quantity": {
            "type": "integer",
            "description": "Number of discounted items."
          },
          "applied_discount_quantity": {
            "type": "integer",
            "description": "Number of the discounted items applied in the transaction."
          },
          "amount": {
            "type": "integer",
            "description": "Total amount of the order item (price * quantity)."
          },
          "discount_amount": {
            "type": "integer",
            "description": "Sum of all order-item-level discounts applied to the order."
          },
          "applied_discount_amount": {
            "type": "integer",
            "description": "Order-level discount amount applied in the transaction."
          },
          "price": {
            "type": "integer",
            "description": "Unit price of an item. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
          },
          "subtotal_amount": {
            "type": "integer",
            "description": "Final order item amount after the applied item-level discount.  If there are no item-level discounts applied, this item is equal to the `amount`.   \n`subtotal_amount`=`amount`-`discount_amount`"
          }
        }
      },
      "GiftVoucherTransactionsType": {
        "title": "Gift Card Transactions Type",
        "type": "string",
        "description": "Transaction types concerning gift card credits.",
        "enum": [
          "CREDITS_REDEMPTION",
          "CREDITS_REFUND",
          "CREDITS_ADDITION",
          "CREDITS_REMOVAL"
        ]
      },
      "LoyaltyCardTransactionsType": {
        "title": "Loyalty Card Transactions Type",
        "type": "string",
        "description": "Transaction types concerning loyalty points.",
        "enum": [
          "PENDING_POINTS_ACTIVATION",
          "POINTS_ACCRUAL",
          "POINTS_REDEMPTION",
          "POINTS_REFUND",
          "POINTS_ADDITION",
          "POINTS_REMOVAL",
          "POINTS_EXPIRATION",
          "POINTS_TRANSFER_IN",
          "POINTS_TRANSFER_OUT"
        ]
      },
      "LoyaltyPendingPointsDetails": {
        "title": "Pending Point Details",
        "type": "object",
        "description": "Details about how the pending points were earned.",
        "properties": {
          "loyalty_tier": {
            "type": "object",
            "description": "The loyalty tier that is mapped for the earning rule and used in the pending point transaction.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
              },
              "name": {
                "type": "string",
                "description": "User-defined name of the loyalty tier."
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "holder_loyalty_tier": {
            "type": "object",
            "description": "Loyalty tier of the loyalty card holder at the moment when the transaction occurred. The loyalty tier is the tier in which the holder was at the moment pending points were created.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the loyalty tier, assigned by Voucherify."
              },
              "name": {
                "type": "string",
                "description": "User-defined name of the loyalty tier."
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "event": {
            "type": "object",
            "description": "Details about the event that created pending points.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique event identifier, assigned by Voucherify."
              },
              "type": {
                "type": "string",
                "description": "Type of the event that triggered the creation of pending points.",
                "enum": [
                  "customer.order.paid"
                ]
              },
              "group_id": {
                "type": "string",
                "description": "Unique identifier of the request that triggered the event, assigned by Voucherify."
              },
              "entity_id": {
                "type": "string",
                "description": "Unique identifier of the entity that triggered the event, assigned by Voucherify. For pending points, it is the `customer_id` of the customer who paid for the order."
              },
              "created_at": {
                "type": "string",
                "description": "Timestamp representing the date and time when the event occurred. The value is shown in the ISO 8601 format.",
                "format": "date-time"
              },
              "category": {
                "type": "string",
                "description": "Type of the event.",
                "enum": [
                  "ACTION",
                  "EFFECT"
                ]
              },
              "event_source": {
                "$ref": "#/components/schemas/EventSource"
              }
            }
          },
          "earning_rule": {
            "type": "object",
            "description": "Contains information about the earning rule.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of an earning rule, assigned by Voucherify."
              },
              "source": {
                "type": "object",
                "required": [
                  "banner"
                ],
                "description": "Contains the custom earning rule name.",
                "properties": {
                  "banner": {
                    "type": "string",
                    "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard."
                  }
                }
              }
            },
            "required": [
              "id",
              "source"
            ]
          },
          "order": {
            "type": "object",
            "description": "Details about the order that caused adding pending points.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique order identifier, assigned by Voucherify."
              },
              "source_id": {
                "nullable": true,
                "type": "string",
                "description": "User-defined order identifier."
              }
            },
            "required": [
              "id",
              "source_id"
            ]
          }
        },
        "required": [
          "event",
          "earning_rule",
          "order"
        ]
      },
      "ListPublicationsItemBase": {
        "title": "List Publications Item Base",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp",
            "description": "Unique publication ID, assigned by Voucherify."
          },
          "object": {
            "type": "string",
            "default": "publication",
            "enum": [
              "publication"
            ],
            "description": "The type of the object represented by the JSON. This object stores information about the `publication`."
          },
          "created_at": {
            "type": "string",
            "example": "2022-09-23T09:57:00.434Z",
            "description": "Timestamp representing the date and time when the publication was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "customer_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer ID of the customer receiving the publication."
          },
          "tracking_id": {
            "type": "string",
            "description": "Customer's `source_id`."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.",
            "properties": {
              "source_type": {
                "type": "string",
                "description": "Defines the type of the distribution source."
              },
              "source_id": {
                "type": "string",
                "description": "Unique identifier of the distribution source."
              },
              "distribution_id": {
                "type": "string",
                "description": "Unique identifier of the distribution."
              }
            }
          },
          "channel": {
            "type": "string",
            "description": "How the publication was originated. It can be your own custom channel or an example value provided here."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "description": "The merchant's publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. "
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerWithSummaryLoyaltyReferrals"
          },
          "vouchers": {
            "type": "array",
            "description": "Contains the voucher IDs that was assigned by Voucherify.",
            "items": {
              "type": "string",
              "example": "ZFMKNAEK"
            }
          },
          "vouchers_id": {
            "type": "array",
            "description": "Contains the unique internal voucher IDs that was assigned by Voucherify.",
            "items": {
              "type": "string",
              "example": "v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA"
            }
          }
        },
        "required": [
          "id",
          "object",
          "created_at",
          "customer_id",
          "metadata",
          "channel",
          "source_id",
          "customer",
          "vouchers_id"
        ]
      },
      "ListPublicationsItemVoucher": {
        "type": "object",
        "title": "List Publications Item Voucher",
        "properties": {
          "code": {
            "type": "string",
            "description": "Voucher code."
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "voucher",
            "enum": [
              "voucher"
            ]
          },
          "campaign": {
            "description": "Campaign name",
            "type": "string"
          },
          "gift": {
            "description": "Gift object response",
            "allOf": [
              {
                "$ref": "#/components/schemas/Gift"
              }
            ]
          },
          "loyalty_card": {
            "description": "Defines the loyalty card details.",
            "type": "object"
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "is_referral_code": {
            "type": "boolean",
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          }
        },
        "required": [
          "code",
          "object",
          "campaign"
        ]
      },
      "SimplePromotionTier": {
        "title": "Simple Promotion Tier",
        "type": "object",
        "description": "This is an object representing a simple promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "properties": {
          "id": {
            "type": "string",
            "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
            "description": "Unique promotion tier ID."
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "campaign": {
            "type": "object",
            "description": "Contains details about promotion tier's parent campaign.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique campaign ID."
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "A set of custom key/value pairs that you can attach to a promotion tier. The metadata object stores all custom attributes assigned to the promotion tier."
          }
        }
      },
      "SimplePromotionStack": {
        "title": "Simple Promotion Stack",
        "type": "object",
        "description": "Represents simplified promotion stack data.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the promotion stack."
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion stack."
          },
          "category_id": {
            "type": "string",
            "description": "Unique identifier of the category of the promotion stack."
          },
          "campaign": {
            "type": "object",
            "description": "Represents simplified promotion stack campaign data.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique identifier of the campaign."
              }
            }
          },
          "tiers": {
            "type": "object",
            "required": [
              "ids"
            ],
            "description": "Contains the tier configuration. A promotion stack can include up to 30 tiers.",
            "properties": {
              "ids": {
                "type": "array",
                "minItems": 1,
                "description": "Contains the list of tiers in a pre-defined sequence.",
                "items": {
                  "type": "string"
                }
              },
              "hierarchy_mode": {
                "type": "string",
                "default": "MANUAL",
                "enum": [
                  "MANUAL"
                ]
              }
            }
          }
        }
      },
      "RewardAssignment": {
        "title": "Reward Assignment",
        "allOf": [
          {
            "$ref": "#/components/schemas/RewardAssignmentBase"
          },
          {
            "$ref": "#/components/schemas/RewardAssignmentParameters"
          }
        ],
        "type": "object"
      },
      "DiscountAmount": {
        "type": "object",
        "title": "Amount",
        "properties": {
          "type": {
            "type": "string",
            "default": "AMOUNT",
            "enum": [
              "AMOUNT"
            ],
            "description": "Defines the type of the voucher."
          },
          "amount_off": {
            "type": "number",
            "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000."
          },
          "amount_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountAmountVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "amount_off"
        ]
      },
      "DiscountUnit": {
        "type": "object",
        "title": "Unit",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "unit_off": {
            "type": "integer",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "description": "Defines how the unit is added to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountUnitVouchersEffectTypes"
              }
            ]
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "unit_type"
        ]
      },
      "DiscountUnitMultiple": {
        "type": "object",
        "title": "Unit Multiple",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "effect": {
            "type": "string",
            "default": "ADD_MANY_ITEMS",
            "enum": [
              "ADD_MANY_ITEMS"
            ],
            "description": "Defines how the discount is applied to the customer's order."
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscountUnitMultipleOneUnit"
            }
          }
        },
        "required": [
          "type",
          "units"
        ]
      },
      "DiscountPercent": {
        "type": "object",
        "title": "Percent",
        "properties": {
          "type": {
            "type": "string",
            "default": "PERCENT",
            "enum": [
              "PERCENT"
            ],
            "description": "Defines the type of the voucher."
          },
          "percent_off": {
            "type": "number",
            "description": "The percent discount that the customer will receive."
          },
          "percent_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "amount_limit": {
            "type": "number",
            "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountPercentVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "percent_off"
        ]
      },
      "DiscountFixed": {
        "title": "Fixed",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "FIXED",
            "enum": [
              "FIXED"
            ],
            "description": "Defines the type of the voucher."
          },
          "fixed_amount": {
            "type": "number",
            "description": "Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value."
          },
          "fixed_amount_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountFixedVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "fixed_amount"
        ]
      },
      "CampaignLoyaltyCard": {
        "type": "object",
        "description": "Schema model for a campaign loyalty card.",
        "title": "Campaign Loyalty Card",
        "properties": {
          "points": {
            "type": "integer",
            "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card."
          },
          "expiration_rules": {
            "type": "object",
            "description": "Defines the loyalty point expiration rule. This expiration rule applies when there are no `expiration_rules` defined for an earning rule.",
            "properties": {
              "period_type": {
                "type": "string",
                "description": "Type of period. Can be set for `MONTH` or `FIXED_DAY_OF_YEAR`. `MONTH` requires the `period_value` field. `FIXED_DAY_OF_YEAR` requires the `fixed_month` and `fixed_day` fields.",
                "enum": [
                  "FIXED_DAY_OF_YEAR",
                  "MONTH"
                ]
              },
              "period_value": {
                "type": "integer",
                "description": "Value of the period. Required for the `period_type: MONTH`."
              },
              "rounding_type": {
                "type": "string",
                "description": "Type of rounding of the expiration period. Optional for the `period_type: MONTH`.",
                "enum": [
                  "END_OF_MONTH",
                  "END_OF_QUARTER",
                  "END_OF_HALF_YEAR",
                  "END_OF_YEAR",
                  "PARTICULAR_MONTH"
                ]
              },
              "rounding_value": {
                "type": "integer",
                "description": "Value of rounding of the expiration period. Required for the `rounding_type`."
              },
              "fixed_month": {
                "type": "integer",
                "description": "Determines the month when the points expire; `1` is January, `2` is February, and so on. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
                "minimum": 1,
                "maximum": 12
              },
              "fixed_day": {
                "type": "integer",
                "description": "Determines the day of the month when the points expire. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
                "minimum": 1,
                "maximum": 31
              }
            },
            "required": [
              "period_type"
            ]
          }
        },
        "required": [
          "points"
        ]
      },
      "CodeConfig": {
        "title": "Code Config",
        "type": "object",
        "description": "Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).",
        "properties": {
          "length": {
            "type": "number",
            "description": "Number of characters in a generated code (excluding prefix and postfix)."
          },
          "charset": {
            "type": "string",
            "description": "Characters that can appear in the code.  \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789`  \n- Custom: a custom character set"
          },
          "prefix": {
            "type": "string",
            "description": "A text appended before the code."
          },
          "postfix": {
            "type": "string",
            "description": "A text appended after the code."
          },
          "pattern": {
            "type": "string",
            "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`."
          },
          "initial_count": {
            "type": "integer",
            "description": "Internal value, does not change anything if provided."
          }
        }
      },
      "Product": {
        "type": "object",
        "description": "This is an object representing a product.  \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.",
        "title": "Product",
        "allOf": [
          {
            "$ref": "#/components/schemas/ProductWithoutSkus"
          },
          {
            "type": "object",
            "properties": {
              "skus": {
                "$ref": "#/components/schemas/SkusListForProduct"
              }
            }
          }
        ]
      },
      "Sku": {
        "title": "SKU Object",
        "type": "object",
        "description": "This is an object representing a product SKU.",
        "properties": {
          "id": {
            "type": "string",
            "example": "sku_0b1621b319d248b79f",
            "description": "A unique identifier that represents the SKU and is assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "example": "sku_source_id_4",
            "description": "A unique SKU identifier from your inventory system."
          },
          "product_id": {
            "type": "string",
            "example": "prod_0b15f6b9f650c16990",
            "description": "The parent product's unique ID."
          },
          "sku": {
            "type": "string",
            "nullable": true,
            "example": "Large Pink Shirt",
            "description": "Unique user-defined SKU name."
          },
          "price": {
            "type": "integer",
            "nullable": true,
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "SKU price currency.",
            "example": "USD"
          },
          "attributes": {
            "type": "object",
            "description": "The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family."
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format. It can be used to create product collections."
          },
          "created_at": {
            "type": "string",
            "example": "2022-05-17T10:36:30.187Z",
            "description": "Timestamp representing the date and time when the SKU was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "example": "2022-05-17T10:55:09.137Z",
            "description": "Timestamp representing the date and time when the SKU was updated. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "sku",
            "description": "The type of the object represented by JSON. This object stores information about the `SKU`.",
            "enum": [
              "sku"
            ]
          }
        },
        "required": [
          "id",
          "source_id",
          "product_id",
          "sku",
          "price",
          "attributes",
          "metadata",
          "image_url",
          "created_at",
          "updated_at",
          "object"
        ]
      },
      "VoucherBase": {
        "title": "Voucher Base",
        "description": "This is an object representing a voucher.",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV",
            "description": "Assigned by the Voucherify API, identifies the voucher."
          },
          "code": {
            "type": "string",
            "example": "WVPblOYX",
            "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters."
          },
          "campaign": {
            "type": "string",
            "example": "Gift Card Campaign",
            "description": "A unique campaign name, identifies the voucher's parent campaign."
          },
          "campaign_id": {
            "type": "string",
            "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV",
            "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign."
          },
          "category": {
            "type": "string",
            "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint."
          },
          "category_id": {
            "type": "string",
            "description": "Unique category ID assigned by Voucherify.",
            "example": "cat_0bb343dee3cdb5ec0c"
          },
          "type": {
            "type": "string",
            "enum": [
              "GIFT_VOUCHER",
              "DISCOUNT_VOUCHER",
              "LOYALTY_CARD"
            ],
            "description": "Defines the type of the voucher. "
          },
          "discount": {
            "$ref": "#/components/schemas/Discount"
          },
          "gift": {
            "type": "object",
            "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`.",
            "properties": {
              "amount": {
                "type": "integer",
                "example": 10000,
                "description": "Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "subtracted_amount": {
                "type": "integer",
                "description": "Total amount of subtracted credits over the gift card lifetime. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "balance": {
                "type": "integer",
                "example": 500,
                "description": "Available funds. The value is multiplied by 100 to represent 2 decimal places. For example `10000 cents` for `$100.00`."
              },
              "effect": {
                "type": "string",
                "enum": [
                  "APPLY_TO_ORDER",
                  "APPLY_TO_ITEMS"
                ],
                "description": "Defines how the credits are applied to the customer's order."
              }
            }
          },
          "loyalty_card": {
            "type": "object",
            "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`. Defaults to `null`.",
            "properties": {
              "points": {
                "type": "integer",
                "example": 7000,
                "description": "Total number of points added to the loyalty card over its lifespan."
              },
              "balance": {
                "type": "integer",
                "example": 6970,
                "description": "Points available for reward redemption. This is calculated as follows: `balance` = `points` - `expired_points` - `subtracted_points` - `redemption.redeemed_points`."
              },
              "next_expiration_date": {
                "type": "string",
                "format": "date",
                "example": "2023-05-30",
                "description": "The next closest date when the next set of points are due to expire."
              },
              "next_expiration_points": {
                "type": "integer",
                "description": "The amount of points that are set to expire next."
              },
              "pending_points": {
                "type": "integer",
                "description": "Shows the number of pending points that will be added to the loyalty card when they are activated automatically or manually."
              },
              "expired_points": {
                "type": "integer",
                "description": "Shows the total number of expired points over the lifetime of the loyalty card."
              },
              "subtracted_points": {
                "type": "integer",
                "description": "Shows the total number of subtracted points over the lifetime of the loyalty card."
              }
            }
          },
          "start_date": {
            "type": "string",
            "example": "2021-12-01T00:00:00.000Z",
            "format": "date-time",
            "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. "
          },
          "expiration_date": {
            "type": "string",
            "example": "2021-12-31T00:00:00.000Z",
            "format": "date-time",
            "description": "Expiration timestamp defines when the code expires in ISO 8601 format.  Voucher is *inactive after* this date."
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "active": {
            "type": "boolean",
            "nullable": true,
            "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher"
          },
          "additional_info": {
            "type": "string",
            "description": "An optional field to keep any extra textual information about the code such as a code description and details."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the code. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format."
          },
          "assets": {
            "$ref": "#/components/schemas/VoucherAssets"
          },
          "is_referral_code": {
            "type": "boolean",
            "nullable": true,
            "description": "Flag indicating whether this voucher is a referral code; `true` for campaign type `REFERRAL_PROGRAM`."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-22T10:13:06.487Z",
            "description": "Timestamp representing the date and time when the voucher was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "example": "2021-12-22T10:14:45.316Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format."
          },
          "holder_id": {
            "type": "string",
            "example": "cust_eWgXlBBiY6THFRJwX45Iakv4",
            "description": "Unique customer identifier of the redeemable holder. It equals to the customer ID assigned by Voucherify."
          },
          "referrer_id": {
            "type": "string",
            "description": "Unique identifier of the referring person.",
            "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. Default is `voucher`.",
            "default": "voucher"
          },
          "publish": {
            "type": "object",
            "description": "Stores a summary of publication events: an event counter and endpoint to return details of each event. Publication is an assignment of a code to a customer, e.g. through a distribution.",
            "properties": {
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the `url` attribute."
              },
              "count": {
                "type": "integer",
                "example": 0,
                "description": "Publication events counter."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10",
                "description": "The endpoint where this list of publications can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/publications`"
              }
            }
          },
          "redemption": {
            "type": "object",
            "description": "Stores a summary of redemptions that have been applied to the voucher.",
            "properties": {
              "quantity": {
                "type": "integer",
                "description": "How many times a voucher can be redeemed. A `null` value means unlimited."
              },
              "redeemed_quantity": {
                "type": "integer",
                "example": 1,
                "description": "How many times a voucher has already been redeemed."
              },
              "redeemed_points": {
                "type": "integer",
                "example": 100000,
                "description": "Total loyalty points redeemed."
              },
              "object": {
                "type": "string",
                "default": "list",
                "description": "The type of the object represented is by default `list`. To get this list, you need to make a call to the endpoint returned in the url attribute."
              },
              "url": {
                "type": "string",
                "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10",
                "description": "The endpoint where this list of redemptions can be accessed using a **GET** method. `/v1/vouchers/{voucher_code}/redemptions`"
              }
            }
          }
        }
      },
      "ValidationRulesAssignmentsList": {
        "title": "Validation Rules Assignments List",
        "description": "List of Validation Rules Assignments",
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "enum": [
              "list"
            ],
            "description": "The type of the object represented by JSON. This object stores information about validation rules assignments."
          },
          "data_ref": {
            "type": "string",
            "default": "data",
            "enum": [
              "data"
            ],
            "description": "Identifies the name of the attribute that contains the array of validation rules assignments."
          },
          "data": {
            "type": "array",
            "description": "Contains array of validation rules assignments.",
            "items": {
              "$ref": "#/components/schemas/BusValRuleAssignment"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "Total number of validation rules assignments."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "ValidationRuleAssignmentsList": {
        "type": "object",
        "description": "Validation Rule Assignments List",
        "title": "Validation Rule Assignments List",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about validation rule assignments.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of validation rule assignments.",
            "items": {
              "$ref": "#/components/schemas/ValidationRuleAssignment"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of validation rule assignments."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "RewardTypeCampaign": {
        "title": "Digital",
        "type": "object",
        "properties": {
          "campaign": {
            "type": "object",
            "required": [
              "id",
              "type"
            ],
            "description": "Objects stores information about the campaign related to the reward.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique campaign ID, assigned by Voucherify."
              },
              "balance": {
                "type": "integer",
                "description": "The number of points to be added to a loyalty card or the amount to be added to the current balance on the gift card.\n\nFor gift cards, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000."
              },
              "type": {
                "type": "string",
                "enum": [
                  "DISCOUNT_COUPONS",
                  "GIFT_VOUCHERS",
                  "LOYALTY_PROGRAM"
                ],
                "description": "Campaign type."
              }
            }
          }
        },
        "required": [
          "campaign"
        ]
      },
      "RewardTypeCoin": {
        "title": "Pay with Points",
        "type": "object",
        "properties": {
          "coin": {
            "type": "object",
            "required": [
              "exchange_ratio"
            ],
            "description": "Defines the ratio by mapping the number of loyalty points in points_ratio to a predefined cash amount in exchange_ratio.",
            "properties": {
              "exchange_ratio": {
                "type": "number",
                "description": "The cash equivalent of the points defined in the points_ratio property."
              },
              "points_ratio": {
                "type": "integer",
                "description": "The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property."
              }
            }
          }
        },
        "required": [
          "coin"
        ]
      },
      "RewardTypeMaterial": {
        "title": "Material",
        "type": "object",
        "properties": {
          "product": {
            "type": "object",
            "required": [
              "id"
            ],
            "description": "Contains information about the product given as a reward.",
            "properties": {
              "id": {
                "type": "string",
                "example": "prod_0b7d7dfb05cbe5c616",
                "description": "Unique product ID, assigned by Voucherify."
              },
              "sku_id": {
                "type": "string",
                "nullable": true,
                "example": "sku_0b7d7dfb090be5c619",
                "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward."
              }
            }
          }
        },
        "required": [
          "product"
        ]
      },
      "MappingPoints": {
        "title": "MappingPoints",
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/MappingMultiply"
          },
          {
            "$ref": "#/components/schemas/MappingFixed"
          }
        ]
      },
      "EarningRuleFixed": {
        "title": "Define fixed amount of points",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "FIXED",
            "enum": [
              "FIXED"
            ],
            "description": "The number of points to be added to the loyalty card."
          },
          "points": {
            "type": "integer",
            "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points."
          },
          "points_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the rewarded points."
          }
        },
        "required": [
          "type",
          "points"
        ]
      },
      "EarningRuleProportional": {
        "title": "Calculate points proportionally",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrder"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderItems"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent"
          }
        ]
      },
      "EarningRuleEvent": {
        "title": "Earning Rule Event",
        "example": "`order.paid`, `customer.segment.entered`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged`, `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`",
        "type": "string"
      },
      "EarningRuleExpirationRules": {
        "title": "Earning Rule Expiration Rules",
        "type": "object",
        "description": "Defines the loyalty point expiration rule. This expiration rule applies only to this earning rule and supersedes `expiration_rules` defined in the `voucher.loyalty_card` object.",
        "properties": {
          "period_type": {
            "type": "string",
            "description": "Type of period. Can be set for `MONTH` or `FIXED_DAY_OF_YEAR`. `MONTH` requires the `period_value` field. `FIXED_DAY_OF_YEAR` requires the `fixed_month` and `fixed_day` fields.",
            "enum": [
              "FIXED_DAY_OF_YEAR",
              "MONTH"
            ]
          },
          "period_value": {
            "type": "integer",
            "description": "Value of the period. Required for the `period_type: MONTH`."
          },
          "rounding_type": {
            "type": "string",
            "description": "Type of rounding of the expiration period. Optional for the `period_type: MONTH`.",
            "enum": [
              "END_OF_MONTH",
              "END_OF_QUARTER",
              "END_OF_HALF_YEAR",
              "END_OF_YEAR",
              "PARTICULAR_MONTH"
            ]
          },
          "rounding_value": {
            "type": "integer",
            "description": "Value of rounding of the expiration period. Required for the `rounding_type`."
          },
          "fixed_month": {
            "type": "integer",
            "description": "Determines the month when the points expire; `1` is January, `2` is February, and so on. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
            "minimum": 1,
            "maximum": 12
          },
          "fixed_day": {
            "type": "integer",
            "description": "Determines the day of the month when the points expire. Required for the `period_type: FIXED_DAY_OF_YEAR`.",
            "minimum": 1,
            "maximum": 31
          }
        },
        "required": [
          "period_type"
        ]
      },
      "RewardAssignmentBase": {
        "title": "Reward Assignment Base",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "rewa_PbIRoMXpwe5QhobW4JKu0VjH",
            "description": "Unique reward assignment ID, assigned by Voucherify."
          },
          "reward_id": {
            "type": "string",
            "description": "Associated reward ID.",
            "example": "rew_C7wS9eHFDN4CIbXI5PpLSkGY"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the reward assignment was created. The value is shown in the ISO 8601 format.",
            "example": "2022-08-11T14:49:22.586Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "Timestamp representing the date and time when the reward assignment was updated. The value is shown in the ISO 8601 format.",
            "example": "2022-08-11T16:01:34.885Z",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by the JSON. This object stores information about the reward assignment.",
            "default": "reward_assignment",
            "enum": [
              "reward_assignment"
            ]
          },
          "related_object_id": {
            "type": "string",
            "description": "Related object ID to which the reward was assigned.",
            "example": "camp_wciTvaOfYmAa3EmIIW3QpXXZ"
          },
          "related_object_type": {
            "type": "string",
            "description": "Related object type to which the reward was assigned.",
            "default": "campaign",
            "enum": [
              "campaign"
            ]
          }
        },
        "required": [
          "related_object_id",
          "related_object_type",
          "id",
          "reward_id",
          "created_at",
          "updated_at",
          "object"
        ]
      },
      "RewardAssignmentParameters": {
        "title": "Digital or Material Reward - Parameters",
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Defines the cost of the reward.",
            "type": "object",
            "properties": {
              "loyalty": {
                "type": "object",
                "description": "Defines the equivalent points value of the reward.",
                "properties": {
                  "points": {
                    "type": "integer",
                    "description": "The number of points required to redeem the reward."
                  },
                  "auto_redeem": {
                    "type": "boolean",
                    "nullable": true,
                    "description": "Determines if the reward is redeemed automatically when the customer reaches the sufficient number of points to redeem it. Value `true` means that the automatic reward redemption is active. Only one reward can be set to be redeemed automatically in a loyalty campaign, i.e. only one can have the value `true`."
                  }
                }
              }
            },
            "required": [
              "loyalty"
            ]
          }
        }
      },
      "DiscountAmountVouchersEffectTypes": {
        "title": "Discount Amount Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS",
          "APPLY_TO_ITEMS_PROPORTIONALLY",
          "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY",
          "APPLY_TO_ITEMS_BY_QUANTITY"
        ],
        "type": "string"
      },
      "DiscountUnitVouchersEffectTypes": {
        "title": "Discount Unit Vouchers Effect Types",
        "enum": [
          "ADD_MISSING_ITEMS",
          "ADD_NEW_ITEMS",
          "ADD_MANY_ITEMS",
          "ADD_SAME_ITEMS"
        ],
        "type": "string"
      },
      "SimpleProductDiscountUnit": {
        "type": "object",
        "title": "Simple Product Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product's source ID."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "SimpleSkuDiscountUnit": {
        "type": "object",
        "title": "Simple Sku Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique SKU ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product variant's source ID."
          },
          "name": {
            "type": "string",
            "description": "Sku name"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "DiscountUnitMultipleOneUnit": {
        "type": "object",
        "title": "One Unit",
        "properties": {
          "unit_off": {
            "type": "number",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "type": "string",
            "enum": [
              "ADD_NEW_ITEMS",
              "ADD_MISSING_ITEMS"
            ],
            "description": "Defines how the unit is added to the customer's order.\n\n"
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "description": "Contains information about the sku.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
              }
            ]
          }
        },
        "required": [
          "effect",
          "unit_type"
        ]
      },
      "DiscountPercentVouchersEffectTypes": {
        "title": "Discount Percent Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      },
      "DiscountFixedVouchersEffectTypes": {
        "title": "Discount Fixed Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      },
      "ProductWithoutSkus": {
        "title": "Product without Skus Object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID assigned by Voucherify.",
            "example": "prod_0b1da8105693710357"
          },
          "source_id": {
            "type": "string",
            "nullable": true,
            "example": "productSourceID16",
            "description": "Unique product source ID."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Unique user-defined product name.",
            "example": "T-shirt"
          },
          "price": {
            "type": "integer",
            "nullable": true,
            "description": "Unit price. It is represented by a value multiplied by 100 to accurately reflect 2 decimal places, such as `$100.00` being expressed as `10000`."
          },
          "attributes": {
            "type": "array",
            "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections."
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.",
            "example": "https://images.com/original.jpg"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the product was created. The value is shown in the ISO 8601 format.",
            "example": "2022-05-23T06:52:55.008Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "nullable": true,
            "description": "Timestamp representing the date and time when the product was updated. The value is shown in the ISO 8601 format.",
            "example": "2022-05-23T09:24:07.405Z",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about the product.",
            "default": "product",
            "enum": [
              "product"
            ]
          }
        },
        "required": [
          "id",
          "source_id",
          "name",
          "attributes",
          "metadata",
          "object",
          "price"
        ]
      },
      "SkusListForProduct": {
        "type": "object",
        "description": "Contains information about child SKUs.",
        "title": "Skus List For Product",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about SKUs.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of SKUs.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of SKUs.",
            "items": {
              "$ref": "#/components/schemas/Sku"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of SKUs in the product."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "BusValRuleAssignment": {
        "title": "Business Validation Rule Assignment",
        "description": "Assignments of business validation rule",
        "example": {
          "id": "asgm_LnY1g7UNFA9KyDrD",
          "rule_id": "val_3gPNA6SnH4ae",
          "related_object_id": "camp_CZOnEGiZfwIKWmSjhIoIT7Ol",
          "related_object_type": "campaign",
          "object": "validation_rules_assignment",
          "validation_status": "PARTIALLY_VALID",
          "validation_omitted_rules": [
            "1"
          ]
        },
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for a assignment"
          },
          "rule_id": {
            "type": "string",
            "description": "The unique identifier for a rule"
          },
          "related_object_id": {
            "type": "string",
            "description": "The unique identifier for a related object"
          },
          "related_object_type": {
            "type": "string",
            "description": "The type of related object"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.",
            "example": "2022-03-09T11:19:04.819Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "Timestamp representing the date and time when the object was last updated in ISO 8601 format.",
            "example": "2022-03-09T11:19:04.819Z",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON.",
            "default": "validation_rules_assignment",
            "enum": [
              "validation_rules_assignment"
            ]
          },
          "validation_status": {
            "type": "string",
            "description": "The validation status of the assignment",
            "enum": [
              "VALID",
              "PARTIALLY_VALID",
              "INVALID"
            ]
          },
          "validation_omitted_rules": {
            "type": "array",
            "description": "The list of omitted rules",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "rule_id",
          "related_object_id",
          "related_object_type",
          "object"
        ]
      },
      "ValidationRuleAssignment": {
        "title": "Validation Rule Assignment",
        "type": "object",
        "description": "This is an object representing a validation rule assignment.",
        "properties": {
          "id": {
            "type": "string",
            "example": "asgm_74F7QZoYbUoljwQO",
            "description": "Validation rule assignment ID."
          },
          "rule_id": {
            "type": "string",
            "example": "val_4j7DCRm2IS59",
            "description": "Validation rule ID."
          },
          "related_object_id": {
            "type": "string",
            "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT",
            "description": "The resource ID to which the validation rule was assigned."
          },
          "related_object_type": {
            "type": "string",
            "description": "The type of resource to which the validation rule was assigned.",
            "enum": [
              "voucher",
              "campaign",
              "earning_rule",
              "reward_assignment",
              "promotion_tier",
              "distribution"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2022-02-17T08:18:15.085Z",
            "description": "Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "validation_rules_assignment",
            "description": "The type of the object represented by the ID.",
            "enum": [
              "validation_rules_assignment"
            ]
          }
        },
        "required": [
          "id",
          "rule_id",
          "related_object_id",
          "related_object_type",
          "created_at",
          "object"
        ]
      },
      "MappingMultiply": {
        "title": "MappingMultiply",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "MULTIPLY",
            "enum": [
              "MULTIPLY"
            ],
            "description": "Type of calculation."
          },
          "multiplier": {
            "type": "number",
            "description": "Multiplication factor used to multiply the points to obtain the mapped points."
          }
        }
      },
      "MappingFixed": {
        "title": "MappingFixed",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "CUSTOM",
            "enum": [
              "CUSTOM"
            ],
            "description": "Type of calculation."
          },
          "points": {
            "type": "integer",
            "description": "Fixed number of points to be applied."
          }
        }
      },
      "EarningRuleProportionalOrder": {
        "title": "Define amount of points proportional to the order",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata"
          }
        ]
      },
      "EarningRuleProportionalOrderItems": {
        "title": "Define amount of points proportional to order items",
        "oneOf": [
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount"
          },
          {
            "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount"
          }
        ]
      },
      "EarningRuleProportionalCustomerMetadata": {
        "title": "Define amount of points proportional to customer metadata",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "CUSTOMER_METADATA",
            "enum": [
              "CUSTOMER_METADATA"
            ],
            "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)"
          },
          "customer": {
            "type": "object",
            "required": [
              "metadata"
            ],
            "properties": {
              "metadata": {
                "type": "object",
                "required": [
                  "every",
                  "points",
                  "property"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "For how many increments of the customer metadata property to grant points for."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "property": {
                    "type": "string",
                    "description": "Customer metadata property."
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "customer"
        ]
      },
      "EarningRuleProportionalCustomEvent": {
        "title": "Earning Rule Proportional Custom Event",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "CUSTOM_EVENT_METADATA",
            "enum": [
              "CUSTOM_EVENT_METADATA"
            ],
            "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)."
          },
          "custom_event": {
            "type": "object",
            "required": [
              "metadata"
            ],
            "properties": {
              "metadata": {
                "type": "object",
                "required": [
                  "every",
                  "points",
                  "property"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "For how many increments of the customer metadata property to grant points for."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "property": {
                    "type": "string",
                    "description": "\nCustom event metadata property."
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "custom_event"
        ]
      },
      "EarningRuleProportionalOrderAmount": {
        "title": "Order Amount",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_AMOUNT",
            "enum": [
              "ORDER_AMOUNT"
            ],
            "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)"
          },
          "order": {
            "type": "object",
            "required": [
              "amount"
            ],
            "properties": {
              "amount": {
                "type": "object",
                "required": [
                  "every",
                  "points"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order"
        ]
      },
      "EarningRuleProportionalOrderTotalAmount": {
        "title": "Order Total Amount",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_TOTAL_AMOUNT",
            "enum": [
              "ORDER_TOTAL_AMOUNT"
            ],
            "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)"
          },
          "order": {
            "type": "object",
            "required": [
              "total_amount"
            ],
            "properties": {
              "total_amount": {
                "type": "object",
                "required": [
                  "every",
                  "points"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order"
        ]
      },
      "EarningRuleProportionalOrderMetadata": {
        "title": "Order Metadata",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_METADATA",
            "enum": [
              "ORDER_METADATA"
            ],
            "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)"
          },
          "order": {
            "type": "object",
            "required": [
              "metadata"
            ],
            "description": "Defines the formula for calculating points proportionally.",
            "properties": {
              "metadata": {
                "type": "object",
                "required": [
                  "every",
                  "points",
                  "property"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "For how many increments of the order metadata property to grant points for."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "property": {
                    "type": "string",
                    "description": "Order metadata property."
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order"
        ]
      },
      "EarningRuleProportionalOrderItemsQuantity": {
        "title": "Order Items Quantity",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_ITEMS_QUANTITY",
            "enum": [
              "ORDER_ITEMS_QUANTITY"
            ],
            "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in the `order_items.quantity.applicable_to` array or `order_items.quantity.object` & `.id` (X points for every Y items excluding free items)."
          },
          "order_items": {
            "type": "object",
            "required": [
              "quantity"
            ],
            "properties": {
              "quantity": {
                "type": "object",
                "required": [
                  "every",
                  "points"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "object": {
                    "type": "string",
                    "description": "Type of object which will be covered by the earning rule. This is required together with `id`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used.",
                    "enum": [
                      "products_collection",
                      "product",
                      "sku"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "description": "Unique ID of the resource assigned by Voucherify. This is required together with `object`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                  },
                  "applicable_to": {
                    "type": "array",
                    "description": "Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by `object` and `id` to define only one object.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "description": "Type of object which will be covered by the earning rule.",
                          "enum": [
                            "products_collection",
                            "product",
                            "sku"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "description": "Unique ID of the resource assigned by Voucherify. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order_items"
        ]
      },
      "EarningRuleProportionalOrderItemsAmount": {
        "title": "Order Items Amount",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_ITEMS_AMOUNT",
            "enum": [
              "ORDER_ITEMS_AMOUNT"
            ],
            "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the `order_items.quantity.applicable_to` array or `order_items.quantity.object` & `.id` (X points for every Y spent on items excluding discounts)"
          },
          "order_items": {
            "type": "object",
            "required": [
              "amount"
            ],
            "properties": {
              "amount": {
                "type": "object",
                "required": [
                  "every",
                  "points"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "object": {
                    "type": "string",
                    "description": "Type of object which will be covered by the earning rule. This is required together with `id`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used.",
                    "enum": [
                      "products_collection",
                      "product",
                      "sku"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "description": "Unique ID of the resource assigned by Voucherify. This is required together with `object`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                  },
                  "applicable_to": {
                    "type": "array",
                    "description": "Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by `object` and `id` to define only one object.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "description": "Type of object which will be covered by the earning rule.",
                          "enum": [
                            "products_collection",
                            "product",
                            "sku"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "description": "Unique ID of the resource assigned by Voucherify. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order_items"
        ]
      },
      "EarningRuleProportionalOrderItemsSubtotalAmount": {
        "title": "Order Items Subtotal Amount",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "PROPORTIONAL",
            "enum": [
              "PROPORTIONAL"
            ],
            "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio."
          },
          "calculation_type": {
            "type": "string",
            "default": "ORDER_ITEMS_SUBTOTAL_AMOUNT",
            "enum": [
              "ORDER_ITEMS_SUBTOTAL_AMOUNT"
            ],
            "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)"
          },
          "order_items": {
            "type": "object",
            "required": [
              "subtotal_amount"
            ],
            "properties": {
              "subtotal_amount": {
                "type": "object",
                "required": [
                  "every",
                  "points"
                ],
                "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.",
                "properties": {
                  "every": {
                    "type": "integer",
                    "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000."
                  },
                  "points": {
                    "type": "integer",
                    "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card."
                  },
                  "points_formula": {
                    "type": "string",
                    "description": "Formula used to dynamically calculate the rewarded points."
                  },
                  "object": {
                    "type": "string",
                    "description": "Type of object which will be covered by the earning rule. This is required together with `id`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used.",
                    "enum": [
                      "products_collection",
                      "product",
                      "sku"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "description": "Unique ID of the resource assigned by Voucherify. This is required together with `object`. Can be replaced by the `applicable_to` array. In response, the value of the first object is returned even if `applicable_to` array was used. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                  },
                  "applicable_to": {
                    "type": "array",
                    "description": "Defines products, SKUs, or product collections covered by the earning rule. Can be replaced by `object` and `id` to define only one object.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "object": {
                          "type": "string",
                          "description": "Type of object which will be covered by the earning rule.",
                          "enum": [
                            "products_collection",
                            "product",
                            "sku"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "description": "Unique ID of the resource assigned by Voucherify. Values are, for example, `pc_75U0dHlr7u75BJodrW1AE3t6` for product collection, `prod_0bae32322150fd0546` for a product, or `sku_0b7d7dfb090be5c619` for a SKU."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "type",
          "calculation_type",
          "order_items"
        ]
      }
    },
    "securitySchemes": {
      "X-App-Id": {
        "type": "apiKey",
        "name": "X-App-Id",
        "in": "header"
      },
      "X-App-Token": {
        "type": "apiKey",
        "name": "X-App-Token",
        "in": "header"
      },
      "X-Voucherify-OAuth": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://api.voucherify.io/v1/oauth/token",
            "scopes": {
              "api": "Gives access to whole server-side API.",
              "vouchers": "Gives access to all endpoints and methods starting with `v1/vouchers`.",
              "client_api": "Gives access to whole client-side API.",
              "client_vouchers": "Gives access to all endpoints and methods starting with `/client/v1/vouchers`.",
              "promotions": "Gives access to all endpoints and methods starting with `/v1/promotions`.",
              "client_promotions": "Gives access to all endpoints and methods starting with `/client/v1/promotions`",
              "campaigns": "Gives access to all endpoints and methods starting with `v1/campaigns`.",
              "client_publish": "Gives access to all endpoints and methods starting with `/client/v1/publish`.",
              "exports": "Gives access to all endpoints and methods starting with `/v1/exports`.",
              "publications": "Gives access to all endpoints and methods starting with `/v1/publications`.",
              "client_validate": "Gives access to all endpoints and methods starting with `/client/v1/validate`.",
              "validations": "Gives access to all endpoints and methods starting with `/v1/validations`.",
              "client_validations": "Gives access to all endpoints and methods starting with `/client/v1/validations`.",
              "qualifications": "Gives access to all endpoints and methods starting with `/v1/qualifications`.",
              "client_qualifications": "Gives access to all endpoints and methods starting with `/client/v1/qualifications`.",
              "client_redeem": "Gives access to all endpoints and methods starting with `/client/v1/redeem",
              "redemptions": "Gives access to all endpoints and methods starting with `/v1/redemptions`.",
              "client_redemptions": "Gives access to all endpoints and methods starting with `/client/v1/redemptions`",
              "customers": "Gives access to all endpoints and methods starting with `/v1/customers`.",
              "client_customers": "Gives access to all endpoints and methods starting with `/client/v1/customers`.",
              "orders": "Gives access to all endpoints and methods starting with `/v1/orders`.",
              "products": "Gives access to all endpoints and methods starting with `/v1/products`.",
              "skus": "Gives access to all endpoints and methods starting with `/v1/SKUs`.",
              "validation-rules": "Gives access to all endpoints and methods starting with `/v1/validation-rules`.",
              "validation-rules-assignments": "Gives access to all endpoints and methods starting with `/v1/validation-rules-assignments",
              "segments": "Gives access to all endpoints and methods starting with `/v1/segments`.",
              "events": "Gives access to all endpoints and methods starting with `/v1/events`.",
              "client_events": "Gives access to all endpoints and methods starting with `client/v1/events`.",
              "rewards": "Gives access to all endpoints and methods starting with `/v1/rewards`.",
              "assets": "Gives access to all endpoints and methods starting with `/v1/assets`.",
              "task-results": "Gives access to all endpoints and methods starting with `/v1/task-results`.",
              "loyalties": "Gives access to all endpoints and methods starting with `/v1/loyalties`.",
              "client_consents": "Gives access to all endpoints and methods starting with `client/v1/consents`.",
              "consents": "Gives access to all endpoints and methods starting with `/v1/consents`.",
              "async-actions": "Gives access to all endpoints and methods starting with `/v1/async-actions`.",
              "product-collections": "Gives access to all endpoints and methods starting with `/v1/product-collections`.",
              "categories": "Gives access to all endpoints and methods starting with `/v1/categories`.",
              "metadata-schemas": "Gives access to all endpoints and methods starting with `/v1/metadata-schemas`.",
              "locations": "Gives access to all endpoints and methods starting with `/v1/locations`.",
              "referrals": "Gives access to all endpoints and methods starting with `/v1/referrals`.",
              "trash-bin": "Gives access to all endpoints and methods starting with `/v1/trash-bin`.",
              "templates": "Gives access to all endpoints and methods starting with `/v1/templates`."
            }
          }
        }
      }
    }
  }
}