{
    "openapi":  "3.1.0",
    "info":  {
                 "title":  "Customer Loyalty API",
                 "description":  "Loyalty wallet, redemption, and history endpoints from customer service.",
                 "version":  "1.0.0"
             },
    "servers":  [
                    {
                        "url":  "https://api.bitbybit.studio",
                        "description":  "Production"
                    }
                ],
    "security":  [
                     {
                         "ApiKeyAuth":  [

                                        ]
                     }
                 ],
    "paths":  {
                  "/customer/api/open/v1/loyalty/reward-options":  {
                                                                       "get":  {
                                                                                   "operationId":  "getCustomerLoyaltyRewardOptions",
                                                                                   "summary":  "Get reward options for customer loyalty",
                                                                                   "description":  "Returns reward options available for redemption in customer service format.",
                                                                                   "tags":  [
                                                                                                "Loyalty - Customer"
                                                                                            ],
                                                                                   "parameters":  [

                                                                                                  ],
                                                                                   "responses":  {
                                                                                                     "200":  {
                                                                                                                 "description":  "Success",
                                                                                                                 "content":  {
                                                                                                                                 "application/json":  {
                                                                                                                                                          "schema":  {
                                                                                                                                                                         "type":  "object",
                                                                                                                                                                         "properties":  {
                                                                                                                                                                                            "data":  {
                                                                                                                                                                                                         "type":  "array",
                                                                                                                                                                                                         "items":  {
                                                                                                                                                                                                                       "$ref":  "#/components/schemas/RewardOptionView"
                                                                                                                                                                                                                   }
                                                                                                                                                                                                     }
                                                                                                                                                                                        }
                                                                                                                                                                     }
                                                                                                                                                      }
                                                                                                                             }
                                                                                                             }
                                                                                                 }
                                                                               }
                                                                   },
                  "/customer/api/open/v1/loyalty/rewards/redemptions/summary":  {
                                                                                    "get":  {
                                                                                                "operationId":  "getRewardRedemptionSummaryList",
                                                                                                "summary":  "Get total redemptions by reward option",
                                                                                                "description":  "Get aggregate redeemed count and points by reward option.",
                                                                                                "tags":  [
                                                                                                             "Loyalty - Customer"
                                                                                                         ],
                                                                                                "parameters":  [

                                                                                                               ],
                                                                                                "responses":  {
                                                                                                                  "200":  {
                                                                                                                              "description":  "Success",
                                                                                                                              "content":  {
                                                                                                                                              "application/json":  {
                                                                                                                                                                       "schema":  {
                                                                                                                                                                                      "type":  "object",
                                                                                                                                                                                      "properties":  {
                                                                                                                                                                                                         "data":  {
                                                                                                                                                                                                                      "type":  "array",
                                                                                                                                                                                                                      "items":  {
                                                                                                                                                                                                                                    "$ref":  "#/components/schemas/RewardSummary"
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                  }
                                                                                                                                                                                                     }
                                                                                                                                                                                  }
                                                                                                                                                                   }
                                                                                                                                          }
                                                                                                                          }
                                                                                                              }
                                                                                            }
                                                                                },
                  "/customer/api/open/v1/loyalty/rewards/{rewardOptionId}/redemptions/summary":  {
                                                                                                     "get":  {
                                                                                                                 "operationId":  "getRewardRedemptionSummary",
                                                                                                                 "summary":  "Get one reward option redemption summary",
                                                                                                                 "description":  "Get redeemed totals and used-at-checkout totals for one reward option.",
                                                                                                                 "tags":  [
                                                                                                                              "Loyalty - Customer"
                                                                                                                          ],
                                                                                                                 "parameters":  [
                                                                                                                                    {
                                                                                                                                        "name":  "rewardOptionId",
                                                                                                                                        "in":  "path",
                                                                                                                                        "required":  true,
                                                                                                                                        "schema":  {
                                                                                                                                                       "type":  "string"
                                                                                                                                                   }
                                                                                                                                    }
                                                                                                                                ],
                                                                                                                 "responses":  {
                                                                                                                                   "200":  {
                                                                                                                                               "description":  "Success",
                                                                                                                                               "content":  {
                                                                                                                                                               "application/json":  {
                                                                                                                                                                                        "schema":  {
                                                                                                                                                                                                       "type":  "object",
                                                                                                                                                                                                       "properties":  {
                                                                                                                                                                                                                          "data":  {
                                                                                                                                                                                                                                       "$ref":  "#/components/schemas/RewardSummaryDetail"
                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                      }
                                                                                                                                                                                                   }
                                                                                                                                                                                    }
                                                                                                                                                           }
                                                                                                                                           }
                                                                                                                               }
                                                                                                             }
                                                                                                 },
                  "/customer/api/open/v1/loyalty/rewards/{rewardOptionId}/redeemers":  {
                                                                                           "get":  {
                                                                                                       "operationId":  "getRewardRedeemers",
                                                                                                       "summary":  "Get redeemers for one reward option",
                                                                                                       "description":  "List customers who redeemed a specific reward option.",
                                                                                                       "tags":  [
                                                                                                                    "Loyalty - Customer"
                                                                                                                ],
                                                                                                       "parameters":  [
                                                                                                                          {
                                                                                                                              "name":  "rewardOptionId",
                                                                                                                              "in":  "path",
                                                                                                                              "required":  true,
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string"
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "limit",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "integer",
                                                                                                                                             "default":  20,
                                                                                                                                             "minimum":  1,
                                                                                                                                             "maximum":  100
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "before",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string",
                                                                                                                                             "format":  "date-time"
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "status",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string",
                                                                                                                                             "enum":  [
                                                                                                                                                          "reserved",
                                                                                                                                                          "committed",
                                                                                                                                                          "released",
                                                                                                                                                          "expired",
                                                                                                                                                          "failed"
                                                                                                                                                      ]
                                                                                                                                         }
                                                                                                                          }
                                                                                                                      ],
                                                                                                       "responses":  {
                                                                                                                         "200":  {
                                                                                                                                     "description":  "Success",
                                                                                                                                     "content":  {
                                                                                                                                                     "application/json":  {
                                                                                                                                                                              "schema":  {
                                                                                                                                                                                             "type":  "object",
                                                                                                                                                                                             "properties":  {
                                                                                                                                                                                                                "data":  {
                                                                                                                                                                                                                             "type":  "array",
                                                                                                                                                                                                                             "items":  {
                                                                                                                                                                                                                                           "$ref":  "#/components/schemas/RedeemerItem"
                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                         },
                                                                                                                                                                                                                "pagination":  {
                                                                                                                                                                                                                                   "$ref":  "#/components/schemas/CursorPagination"
                                                                                                                                                                                                                               }
                                                                                                                                                                                                            }
                                                                                                                                                                                         }
                                                                                                                                                                          }
                                                                                                                                                 }
                                                                                                                                 }
                                                                                                                     }
                                                                                                   }
                                                                                       },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/wallet":  {
                                                                                      "get":  {
                                                                                                  "operationId":  "getLoyaltyWallet",
                                                                                                  "summary":  "Get customer loyalty wallet",
                                                                                                  "description":  "Get points balance and wallet lifetime counters.",
                                                                                                  "tags":  [
                                                                                                               "Loyalty - Customer"
                                                                                                           ],
                                                                                                  "parameters":  [
                                                                                                                     {
                                                                                                                         "name":  "customerId",
                                                                                                                         "in":  "path",
                                                                                                                         "required":  true,
                                                                                                                         "schema":  {
                                                                                                                                        "type":  "string"
                                                                                                                                    }
                                                                                                                     }
                                                                                                                 ],
                                                                                                  "responses":  {
                                                                                                                    "200":  {
                                                                                                                                "description":  "Success",
                                                                                                                                "content":  {
                                                                                                                                                "application/json":  {
                                                                                                                                                                         "schema":  {
                                                                                                                                                                                        "type":  "object",
                                                                                                                                                                                        "properties":  {
                                                                                                                                                                                                           "data":  {
                                                                                                                                                                                                                        "$ref":  "#/components/schemas/LoyaltyWallet"
                                                                                                                                                                                                                    }
                                                                                                                                                                                                       }
                                                                                                                                                                                    }
                                                                                                                                                                     }
                                                                                                                                            }
                                                                                                                            }
                                                                                                                }
                                                                                              }
                                                                                  },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/redemptions/summary":  {
                                                                                                   "get":  {
                                                                                                               "operationId":  "getCustomerRedeemedPointsSummary",
                                                                                                               "summary":  "Get total redeemed points by customer",
                                                                                                               "description":  "Get total redeemed points and total redemption count for one customer.",
                                                                                                               "tags":  [
                                                                                                                            "Loyalty - Customer"
                                                                                                                        ],
                                                                                                               "parameters":  [
                                                                                                                                  {
                                                                                                                                      "name":  "customerId",
                                                                                                                                      "in":  "path",
                                                                                                                                      "required":  true,
                                                                                                                                      "schema":  {
                                                                                                                                                     "type":  "string"
                                                                                                                                                 }
                                                                                                                                  }
                                                                                                                              ],
                                                                                                               "responses":  {
                                                                                                                                 "200":  {
                                                                                                                                             "description":  "Success",
                                                                                                                                             "content":  {
                                                                                                                                                             "application/json":  {
                                                                                                                                                                                      "schema":  {
                                                                                                                                                                                                     "type":  "object",
                                                                                                                                                                                                     "properties":  {
                                                                                                                                                                                                                        "data":  {
                                                                                                                                                                                                                                     "type":  "object",
                                                                                                                                                                                                                                     "properties":  {
                                                                                                                                                                                                                                                        "customerId":  {
                                                                                                                                                                                                                                                                           "type":  "string"
                                                                                                                                                                                                                                                                       },
                                                                                                                                                                                                                                                        "totalRedeemedPoints":  {
                                                                                                                                                                                                                                                                                    "type":  "string"
                                                                                                                                                                                                                                                                                },
                                                                                                                                                                                                                                                        "totalRedemptionCount":  {
                                                                                                                                                                                                                                                                                     "type":  "integer"
                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                    }
                                                                                                                                                                                                 }
                                                                                                                                                                                  }
                                                                                                                                                         }
                                                                                                                                         }
                                                                                                                             }
                                                                                                           }
                                                                                               },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/history":  {
                                                                                       "get":  {
                                                                                                   "operationId":  "getCustomerPointHistory",
                                                                                                   "summary":  "Get customer loyalty point history",
                                                                                                   "description":  "Get loyalty ledger entries for a customer.",
                                                                                                   "tags":  [
                                                                                                                "Loyalty - Customer"
                                                                                                            ],
                                                                                                   "parameters":  [
                                                                                                                      {
                                                                                                                          "name":  "customerId",
                                                                                                                          "in":  "path",
                                                                                                                          "required":  true,
                                                                                                                          "schema":  {
                                                                                                                                         "type":  "string"
                                                                                                                                     }
                                                                                                                      },
                                                                                                                      {
                                                                                                                          "name":  "filter",
                                                                                                                          "in":  "query",
                                                                                                                          "schema":  {
                                                                                                                                         "type":  "string",
                                                                                                                                         "enum":  [
                                                                                                                                                      "all",
                                                                                                                                                      "points_added",
                                                                                                                                                      "points_deducted"
                                                                                                                                                  ],
                                                                                                                                         "default":  "all"
                                                                                                                                     }
                                                                                                                      },
                                                                                                                      {
                                                                                                                          "name":  "limit",
                                                                                                                          "in":  "query",
                                                                                                                          "schema":  {
                                                                                                                                         "type":  "integer",
                                                                                                                                         "default":  20,
                                                                                                                                         "minimum":  1,
                                                                                                                                         "maximum":  100
                                                                                                                                     }
                                                                                                                      },
                                                                                                                      {
                                                                                                                          "name":  "before",
                                                                                                                          "in":  "query",
                                                                                                                          "schema":  {
                                                                                                                                         "type":  "string",
                                                                                                                                         "format":  "date-time"
                                                                                                                                     }
                                                                                                                      }
                                                                                                                  ],
                                                                                                   "responses":  {
                                                                                                                     "200":  {
                                                                                                                                 "description":  "Success",
                                                                                                                                 "content":  {
                                                                                                                                                 "application/json":  {
                                                                                                                                                                          "schema":  {
                                                                                                                                                                                         "type":  "object",
                                                                                                                                                                                         "properties":  {
                                                                                                                                                                                                            "data":  {
                                                                                                                                                                                                                         "type":  "array",
                                                                                                                                                                                                                         "items":  {
                                                                                                                                                                                                                                       "$ref":  "#/components/schemas/LedgerEntry"
                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                     },
                                                                                                                                                                                                            "pagination":  {
                                                                                                                                                                                                                               "$ref":  "#/components/schemas/CursorPagination"
                                                                                                                                                                                                                           }
                                                                                                                                                                                                        }
                                                                                                                                                                                     }
                                                                                                                                                                      }
                                                                                                                                             }
                                                                                                                             }
                                                                                                                 }
                                                                                               }
                                                                                   },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/redemptions":  {
                                                                                           "get":  {
                                                                                                       "operationId":  "getCustomerRedemptions",
                                                                                                       "summary":  "Get customer reward redemptions",
                                                                                                       "description":  "List reward redemptions for a customer.",
                                                                                                       "tags":  [
                                                                                                                    "Loyalty - Customer"
                                                                                                                ],
                                                                                                       "parameters":  [
                                                                                                                          {
                                                                                                                              "name":  "customerId",
                                                                                                                              "in":  "path",
                                                                                                                              "required":  true,
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string"
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "search",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string"
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "status",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string",
                                                                                                                                             "enum":  [
                                                                                                                                                          "reserved",
                                                                                                                                                          "committed",
                                                                                                                                                          "released",
                                                                                                                                                          "expired",
                                                                                                                                                          "failed"
                                                                                                                                                      ]
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "limit",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "integer",
                                                                                                                                             "default":  20,
                                                                                                                                             "minimum":  1,
                                                                                                                                             "maximum":  100
                                                                                                                                         }
                                                                                                                          },
                                                                                                                          {
                                                                                                                              "name":  "before",
                                                                                                                              "in":  "query",
                                                                                                                              "schema":  {
                                                                                                                                             "type":  "string",
                                                                                                                                             "format":  "date-time"
                                                                                                                                         }
                                                                                                                          }
                                                                                                                      ],
                                                                                                       "responses":  {
                                                                                                                         "200":  {
                                                                                                                                     "description":  "Success",
                                                                                                                                     "content":  {
                                                                                                                                                     "application/json":  {
                                                                                                                                                                              "schema":  {
                                                                                                                                                                                             "type":  "object",
                                                                                                                                                                                             "properties":  {
                                                                                                                                                                                                                "data":  {
                                                                                                                                                                                                                             "type":  "array",
                                                                                                                                                                                                                             "items":  {
                                                                                                                                                                                                                                           "$ref":  "#/components/schemas/RedemptionItem"
                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                         },
                                                                                                                                                                                                                "pagination":  {
                                                                                                                                                                                                                                   "$ref":  "#/components/schemas/CursorPagination"
                                                                                                                                                                                                                               }
                                                                                                                                                                                                            }
                                                                                                                                                                                         }
                                                                                                                                                                          }
                                                                                                                                                 }
                                                                                                                                 }
                                                                                                                     }
                                                                                                   }
                                                                                       },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/points/adjust":  {
                                                                                             "post":  {
                                                                                                          "operationId":  "adjustCustomerPoints",
                                                                                                          "summary":  "Add or deduct loyalty points",
                                                                                                          "description":  "Manually add or deduct points from customer wallet.",
                                                                                                          "tags":  [
                                                                                                                       "Loyalty - Customer"
                                                                                                                   ],
                                                                                                          "parameters":  [
                                                                                                                             {
                                                                                                                                 "name":  "customerId",
                                                                                                                                 "in":  "path",
                                                                                                                                 "required":  true,
                                                                                                                                 "schema":  {
                                                                                                                                                "type":  "string"
                                                                                                                                            }
                                                                                                                             }
                                                                                                                         ],
                                                                                                          "requestBody":  {
                                                                                                                              "required":  true,
                                                                                                                              "content":  {
                                                                                                                                              "application/json":  {
                                                                                                                                                                       "schema":  {
                                                                                                                                                                                      "type":  "object",
                                                                                                                                                                                      "required":  [
                                                                                                                                                                                                       "direction",
                                                                                                                                                                                                       "points",
                                                                                                                                                                                                       "reason"
                                                                                                                                                                                                   ],
                                                                                                                                                                                      "properties":  {
                                                                                                                                                                                                         "direction":  {
                                                                                                                                                                                                                           "type":  "string",
                                                                                                                                                                                                                           "enum":  [
                                                                                                                                                                                                                                        "add",
                                                                                                                                                                                                                                        "deduct"
                                                                                                                                                                                                                                    ]
                                                                                                                                                                                                                       },
                                                                                                                                                                                                         "points":  {
                                                                                                                                                                                                                        "type":  "integer",
                                                                                                                                                                                                                        "minimum":  1
                                                                                                                                                                                                                    },
                                                                                                                                                                                                         "reason":  {
                                                                                                                                                                                                                        "type":  "string"
                                                                                                                                                                                                                    },
                                                                                                                                                                                                         "idempotencyKey":  {
                                                                                                                                                                                                                                "type":  "string"
                                                                                                                                                                                                                            },
                                                                                                                                                                                                         "metadata":  {
                                                                                                                                                                                                                          "type":  "object",
                                                                                                                                                                                                                          "additionalProperties":  true
                                                                                                                                                                                                                      }
                                                                                                                                                                                                     }
                                                                                                                                                                                  }
                                                                                                                                                                   }
                                                                                                                                          }
                                                                                                                          },
                                                                                                          "responses":  {
                                                                                                                            "200":  {
                                                                                                                                        "description":  "Success",
                                                                                                                                        "content":  {
                                                                                                                                                        "application/json":  {
                                                                                                                                                                                 "schema":  {
                                                                                                                                                                                                "type":  "object",
                                                                                                                                                                                                "properties":  {
                                                                                                                                                                                                                   "data":  {
                                                                                                                                                                                                                                "$ref":  "#/components/schemas/AdjustPointsResponse"
                                                                                                                                                                                                                            }
                                                                                                                                                                                                               }
                                                                                                                                                                                            }
                                                                                                                                                                             }
                                                                                                                                                    }
                                                                                                                                    }
                                                                                                                        }
                                                                                                      }
                                                                                         },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/redeem":  {
                                                                                      "post":  {
                                                                                                   "operationId":  "redeemCustomerReward",
                                                                                                   "summary":  "Redeem reward and create voucher",
                                                                                                   "description":  "Redeem points for a reward option. This endpoint creates voucher data in redemption payload.",
                                                                                                   "tags":  [
                                                                                                                "Loyalty - Customer"
                                                                                                            ],
                                                                                                   "parameters":  [
                                                                                                                      {
                                                                                                                          "name":  "customerId",
                                                                                                                          "in":  "path",
                                                                                                                          "required":  true,
                                                                                                                          "schema":  {
                                                                                                                                         "type":  "string"
                                                                                                                                     }
                                                                                                                      }
                                                                                                                  ],
                                                                                                   "requestBody":  {
                                                                                                                       "required":  true,
                                                                                                                       "content":  {
                                                                                                                                       "application/json":  {
                                                                                                                                                                "schema":  {
                                                                                                                                                                               "type":  "object",
                                                                                                                                                                               "required":  [
                                                                                                                                                                                                "rewardOptionId",
                                                                                                                                                                                                "rewardName",
                                                                                                                                                                                                "pointsCost"
                                                                                                                                                                                            ],
                                                                                                                                                                               "properties":  {
                                                                                                                                                                                                  "rewardOptionId":  {
                                                                                                                                                                                                                         "type":  "string"
                                                                                                                                                                                                                     },
                                                                                                                                                                                                  "rewardName":  {
                                                                                                                                                                                                                     "type":  "string"
                                                                                                                                                                                                                 },
                                                                                                                                                                                                  "pointsCost":  {
                                                                                                                                                                                                                     "type":  "integer",
                                                                                                                                                                                                                     "minimum":  1
                                                                                                                                                                                                                 },
                                                                                                                                                                                                  "voucherCode":  {
                                                                                                                                                                                                                      "type":  "string"
                                                                                                                                                                                                                  },
                                                                                                                                                                                                  "voucherProvider":  {
                                                                                                                                                                                                                          "type":  "string"
                                                                                                                                                                                                                      },
                                                                                                                                                                                                  "voucherExternalId":  {
                                                                                                                                                                                                                            "type":  "string"
                                                                                                                                                                                                                        },
                                                                                                                                                                                                  "idempotencyKey":  {
                                                                                                                                                                                                                         "type":  "string"
                                                                                                                                                                                                                     },
                                                                                                                                                                                                  "metadata":  {
                                                                                                                                                                                                                   "type":  "object",
                                                                                                                                                                                                                   "additionalProperties":  true
                                                                                                                                                                                                               }
                                                                                                                                                                                              }
                                                                                                                                                                           }
                                                                                                                                                            }
                                                                                                                                   }
                                                                                                                   },
                                                                                                   "responses":  {
                                                                                                                     "200":  {
                                                                                                                                 "description":  "Success",
                                                                                                                                 "content":  {
                                                                                                                                                 "application/json":  {
                                                                                                                                                                          "schema":  {
                                                                                                                                                                                         "type":  "object",
                                                                                                                                                                                         "properties":  {
                                                                                                                                                                                                            "data":  {
                                                                                                                                                                                                                         "$ref":  "#/components/schemas/RedeemRewardResponse"
                                                                                                                                                                                                                     }
                                                                                                                                                                                                        }
                                                                                                                                                                                     }
                                                                                                                                                                      }
                                                                                                                                             }
                                                                                                                             }
                                                                                                                 }
                                                                                               }
                                                                                  },
                  "/customer/api/open/v1/loyalty/customers/{customerId}/timeline":  {
                                                                                        "get":  {
                                                                                                    "operationId":  "getCustomerTimeline",
                                                                                                    "summary":  "Get customer timeline (including loyalty events)",
                                                                                                    "description":  "Get customer timeline entries. Use category=loyalty to focus loyalty events.",
                                                                                                    "tags":  [
                                                                                                                 "Loyalty - Customer"
                                                                                                             ],
                                                                                                    "parameters":  [
                                                                                                                       {
                                                                                                                           "name":  "customerId",
                                                                                                                           "in":  "path",
                                                                                                                           "required":  true,
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "string"
                                                                                                                                      }
                                                                                                                       },
                                                                                                                       {
                                                                                                                           "name":  "months",
                                                                                                                           "in":  "query",
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "string"
                                                                                                                                      }
                                                                                                                       },
                                                                                                                       {
                                                                                                                           "name":  "category",
                                                                                                                           "in":  "query",
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "string",
                                                                                                                                          "enum":  [
                                                                                                                                                       "support",
                                                                                                                                                       "loyalty",
                                                                                                                                                       "system"
                                                                                                                                                   ]
                                                                                                                                      }
                                                                                                                       },
                                                                                                                       {
                                                                                                                           "name":  "limit",
                                                                                                                           "in":  "query",
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "integer"
                                                                                                                                      }
                                                                                                                       },
                                                                                                                       {
                                                                                                                           "name":  "after",
                                                                                                                           "in":  "query",
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "string"
                                                                                                                                      }
                                                                                                                       },
                                                                                                                       {
                                                                                                                           "name":  "before",
                                                                                                                           "in":  "query",
                                                                                                                           "schema":  {
                                                                                                                                          "type":  "string"
                                                                                                                                      }
                                                                                                                       }
                                                                                                                   ],
                                                                                                    "responses":  {
                                                                                                                      "200":  {
                                                                                                                                  "description":  "Success",
                                                                                                                                  "content":  {
                                                                                                                                                  "application/json":  {
                                                                                                                                                                           "schema":  {
                                                                                                                                                                                          "type":  "object",
                                                                                                                                                                                          "properties":  {
                                                                                                                                                                                                             "data":  {
                                                                                                                                                                                                                          "type":  "array",
                                                                                                                                                                                                                          "items":  {
                                                                                                                                                                                                                                        "$ref":  "#/components/schemas/TimelineEntry"
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                      },
                                                                                                                                                                                                             "meta":  {
                                                                                                                                                                                                                          "$ref":  "#/components/schemas/TimelineMeta"
                                                                                                                                                                                                                      }
                                                                                                                                                                                                         }
                                                                                                                                                                                      }
                                                                                                                                                                       }
                                                                                                                                              }
                                                                                                                              }
                                                                                                                  }
                                                                                                }
                                                                                    }
              },
    "components":  {
                       "securitySchemes":  {
                                               "ApiKeyAuth":  {
                                                                  "description":  "API key for authentication. Create one in Settings \u003e Developer.",
                                                                  "name":  "x-api-key",
                                                                  "in":  "header",
                                                                  "type":  "apiKey"
                                                              }
                                           },
                       "schemas":  {
                                       "CursorPagination":  {
                                                                "type":  "object",
                                                                "properties":  {
                                                                                   "limit":  {
                                                                                                 "type":  "integer"
                                                                                             },
                                                                                   "hasMore":  {
                                                                                                   "type":  "boolean"
                                                                                               },
                                                                                   "nextBefore":  {
                                                                                                      "type":  [
                                                                                                                   "string",
                                                                                                                   "null"
                                                                                                               ],
                                                                                                      "format":  "date-time"
                                                                                                  }
                                                                               }
                                                            },
                                       "RewardOptionView":  {
                                                                "type":  "object",
                                                                "properties":  {
                                                                                   "id":  {
                                                                                              "type":  "string"
                                                                                          },
                                                                                   "title":  {
                                                                                                 "type":  "string"
                                                                                             },
                                                                                   "pointsRequired":  {
                                                                                                          "type":  "integer"
                                                                                                      }
                                                                               }
                                                            },
                                       "RewardSummary":  {
                                                             "type":  "object",
                                                             "properties":  {
                                                                                "reward":  {
                                                                                               "type":  "object",
                                                                                               "properties":  {
                                                                                                                  "id":  {
                                                                                                                             "type":  "string"
                                                                                                                         },
                                                                                                                  "name":  {
                                                                                                                               "type":  "string"
                                                                                                                           }
                                                                                                              }
                                                                                           },
                                                                                "totalRedeemedCount":  {
                                                                                                           "type":  "integer"
                                                                                                       },
                                                                                "totalRedeemedPoints":  {
                                                                                                            "type":  "string"
                                                                                                        }
                                                                            }
                                                         },
                                       "RewardSummaryDetail":  {
                                                                   "type":  "object",
                                                                   "properties":  {
                                                                                      "reward":  {
                                                                                                     "type":  "object",
                                                                                                     "properties":  {
                                                                                                                        "id":  {
                                                                                                                                   "type":  "string"
                                                                                                                               },
                                                                                                                        "name":  {
                                                                                                                                     "type":  "string"
                                                                                                                                 }
                                                                                                                    }
                                                                                                 },
                                                                                      "totalRedeemedCount":  {
                                                                                                                 "type":  "integer"
                                                                                                             },
                                                                                      "totalRedeemedPoints":  {
                                                                                                                  "type":  "string"
                                                                                                              },
                                                                                      "totalUsedAtCheckoutCount":  {
                                                                                                                       "type":  "integer"
                                                                                                                   },
                                                                                      "totalUsedAtCheckoutPoints":  {
                                                                                                                        "type":  "string"
                                                                                                                    }
                                                                                  }
                                                               },
                                       "LoyaltyWallet":  {
                                                             "type":  "object",
                                                             "properties":  {
                                                                                "id":  {
                                                                                           "type":  "string"
                                                                                       },
                                                                                "companyId":  {
                                                                                                  "type":  "integer"
                                                                                              },
                                                                                "customerId":  {
                                                                                                   "type":  "string"
                                                                                               },
                                                                                "availablePoints":  {
                                                                                                        "type":  "string"
                                                                                                    },
                                                                                "reservedPoints":  {
                                                                                                       "type":  "string"
                                                                                                   },
                                                                                "lifetimeEarnedPoints":  {
                                                                                                             "type":  "string"
                                                                                                         },
                                                                                "lifetimeBurnedPoints":  {
                                                                                                             "type":  "string"
                                                                                                         },
                                                                                "version":  {
                                                                                                "type":  "string"
                                                                                            },
                                                                                "lastLedgerAt":  {
                                                                                                     "type":  [
                                                                                                                  "string",
                                                                                                                  "null"
                                                                                                              ],
                                                                                                     "format":  "date-time"
                                                                                                 },
                                                                                "createdAt":  {
                                                                                                  "type":  "string",
                                                                                                  "format":  "date-time"
                                                                                              },
                                                                                "updatedAt":  {
                                                                                                  "type":  "string",
                                                                                                  "format":  "date-time"
                                                                                              }
                                                                            }
                                                         },
                                       "LedgerEntry":  {
                                                           "type":  "object",
                                                           "properties":  {
                                                                              "id":  {
                                                                                         "type":  "string"
                                                                                     },
                                                                              "companyId":  {
                                                                                                "type":  "integer"
                                                                                            },
                                                                              "customerId":  {
                                                                                                 "type":  "string"
                                                                                             },
                                                                              "walletId":  {
                                                                                               "type":  "string"
                                                                                           },
                                                                              "entryType":  {
                                                                                                "type":  "string"
                                                                                            },
                                                                              "pointsDelta":  {
                                                                                                  "type":  "string"
                                                                                              },
                                                                              "availableAfter":  {
                                                                                                     "type":  "string"
                                                                                                 },
                                                                              "reservedAfter":  {
                                                                                                    "type":  "string"
                                                                                                },
                                                                              "referenceType":  {
                                                                                                    "type":  "string"
                                                                                                },
                                                                              "referenceId":  {
                                                                                                  "type":  "string"
                                                                                              },
                                                                              "idempotencyKey":  {
                                                                                                     "type":  "string"
                                                                                                 },
                                                                              "note":  {
                                                                                           "type":  [
                                                                                                        "string",
                                                                                                        "null"
                                                                                                    ]
                                                                                       },
                                                                              "metadata":  {
                                                                                               "type":  [
                                                                                                            "object",
                                                                                                            "null"
                                                                                                        ],
                                                                                               "additionalProperties":  true
                                                                                           },
                                                                              "occurredAt":  {
                                                                                                 "type":  "string",
                                                                                                 "format":  "date-time"
                                                                                             },
                                                                              "createdAt":  {
                                                                                                "type":  "string",
                                                                                                "format":  "date-time"
                                                                                            },
                                                                              "createdById":  {
                                                                                                  "type":  [
                                                                                                               "integer",
                                                                                                               "null"
                                                                                                           ]
                                                                                              }
                                                                          }
                                                       },
                                       "RedemptionItem":  {
                                                              "type":  "object",
                                                              "properties":  {
                                                                                 "id":  {
                                                                                            "type":  "string"
                                                                                        },
                                                                                 "companyId":  {
                                                                                                   "type":  "integer"
                                                                                               },
                                                                                 "customerId":  {
                                                                                                    "type":  "string"
                                                                                                },
                                                                                 "customer":  {
                                                                                                  "type":  "object",
                                                                                                  "properties":  {
                                                                                                                     "id":  {
                                                                                                                                "type":  [
                                                                                                                                             "string",
                                                                                                                                             "null"
                                                                                                                                         ]
                                                                                                                            },
                                                                                                                     "companyId":  {
                                                                                                                                       "type":  [
                                                                                                                                                    "integer",
                                                                                                                                                    "null"
                                                                                                                                                ]
                                                                                                                                   },
                                                                                                                     "name":  {
                                                                                                                                  "type":  [
                                                                                                                                               "string",
                                                                                                                                               "null"
                                                                                                                                           ]
                                                                                                                              },
                                                                                                                     "email":  {
                                                                                                                                   "type":  [
                                                                                                                                                "string",
                                                                                                                                                "null"
                                                                                                                                            ]
                                                                                                                               },
                                                                                                                     "phoneNumber":  {
                                                                                                                                         "type":  [
                                                                                                                                                      "string",
                                                                                                                                                      "null"
                                                                                                                                                  ]
                                                                                                                                     }
                                                                                                                 }
                                                                                              },
                                                                                 "walletId":  {
                                                                                                  "type":  "string"
                                                                                              },
                                                                                 "rewardOptionId":  {
                                                                                                        "type":  [
                                                                                                                     "string",
                                                                                                                     "null"
                                                                                                                 ]
                                                                                                    },
                                                                                 "rewardName":  {
                                                                                                    "type":  [
                                                                                                                 "string",
                                                                                                                 "null"
                                                                                                             ]
                                                                                                },
                                                                                 "status":  {
                                                                                                "type":  "string"
                                                                                            },
                                                                                 "pointsReserved":  {
                                                                                                        "type":  "string"
                                                                                                    },
                                                                                 "pointsCommitted":  {
                                                                                                         "type":  "string"
                                                                                                     },
                                                                                 "voucherCode":  {
                                                                                                     "type":  [
                                                                                                                  "string",
                                                                                                                  "null"
                                                                                                              ]
                                                                                                 },
                                                                                 "voucherProvider":  {
                                                                                                         "type":  [
                                                                                                                      "string",
                                                                                                                      "null"
                                                                                                                  ]
                                                                                                     },
                                                                                 "voucherExternalId":  {
                                                                                                           "type":  [
                                                                                                                        "string",
                                                                                                                        "null"
                                                                                                                    ]
                                                                                                       },
                                                                                 "reserveExpiresAt":  {
                                                                                                          "type":  [
                                                                                                                       "string",
                                                                                                                       "null"
                                                                                                                   ],
                                                                                                          "format":  "date-time"
                                                                                                      },
                                                                                 "commitAt":  {
                                                                                                  "type":  [
                                                                                                               "string",
                                                                                                               "null"
                                                                                                           ],
                                                                                                  "format":  "date-time"
                                                                                              },
                                                                                 "releasedAt":  {
                                                                                                    "type":  [
                                                                                                                 "string",
                                                                                                                 "null"
                                                                                                             ],
                                                                                                    "format":  "date-time"
                                                                                                },
                                                                                 "failureReason":  {
                                                                                                       "type":  [
                                                                                                                    "string",
                                                                                                                    "null"
                                                                                                                ]
                                                                                                   },
                                                                                 "idempotencyKey":  {
                                                                                                        "type":  "string"
                                                                                                    },
                                                                                 "metadata":  {
                                                                                                  "type":  [
                                                                                                               "object",
                                                                                                               "null"
                                                                                                           ],
                                                                                                  "additionalProperties":  true
                                                                                              },
                                                                                 "createdById":  {
                                                                                                     "type":  [
                                                                                                                  "integer",
                                                                                                                  "null"
                                                                                                              ]
                                                                                                 },
                                                                                 "createdAt":  {
                                                                                                   "type":  "string",
                                                                                                   "format":  "date-time"
                                                                                               },
                                                                                 "updatedAt":  {
                                                                                                   "type":  "string",
                                                                                                   "format":  "date-time"
                                                                                               }
                                                                             }
                                                          },
                                       "RedeemerItem":  {
                                                            "type":  "object",
                                                            "properties":  {
                                                                               "redemptionId":  {
                                                                                                    "type":  "string"
                                                                                                },
                                                                               "reward":  {
                                                                                              "type":  "object",
                                                                                              "properties":  {
                                                                                                                 "id":  {
                                                                                                                            "type":  [
                                                                                                                                         "string",
                                                                                                                                         "null"
                                                                                                                                     ]
                                                                                                                        },
                                                                                                                 "name":  {
                                                                                                                              "type":  "string"
                                                                                                                          }
                                                                                                             }
                                                                                          },
                                                                               "customer":  {
                                                                                                "type":  "object",
                                                                                                "properties":  {
                                                                                                                   "id":  {
                                                                                                                              "type":  [
                                                                                                                                           "string",
                                                                                                                                           "null"
                                                                                                                                       ]
                                                                                                                          },
                                                                                                                   "companyId":  {
                                                                                                                                     "type":  "integer"
                                                                                                                                 },
                                                                                                                   "name":  {
                                                                                                                                "type":  [
                                                                                                                                             "string",
                                                                                                                                             "null"
                                                                                                                                         ]
                                                                                                                            },
                                                                                                                   "email":  {
                                                                                                                                 "type":  [
                                                                                                                                              "string",
                                                                                                                                              "null"
                                                                                                                                          ]
                                                                                                                             },
                                                                                                                   "phoneNumber":  {
                                                                                                                                       "type":  [
                                                                                                                                                    "string",
                                                                                                                                                    "null"
                                                                                                                                                ]
                                                                                                                                   }
                                                                                                               }
                                                                                            },
                                                                               "pointsSpent":  {
                                                                                                   "type":  "string"
                                                                                               },
                                                                               "status":  {
                                                                                              "type":  [
                                                                                                           "string",
                                                                                                           "null"
                                                                                                       ]
                                                                                          },
                                                                               "source":  {
                                                                                              "type":  [
                                                                                                           "string",
                                                                                                           "null"
                                                                                                       ]
                                                                                          },
                                                                               "redeemedAt":  {
                                                                                                  "type":  [
                                                                                                               "string",
                                                                                                               "null"
                                                                                                           ],
                                                                                                  "format":  "date-time"
                                                                                              },
                                                                               "usedAtCheckoutAt":  {
                                                                                                        "type":  [
                                                                                                                     "string",
                                                                                                                     "null"
                                                                                                                 ],
                                                                                                        "format":  "date-time"
                                                                                                    },
                                                                               "createdAt":  {
                                                                                                 "type":  [
                                                                                                              "string",
                                                                                                              "null"
                                                                                                          ],
                                                                                                 "format":  "date-time"
                                                                                             }
                                                                           }
                                                        },
                                       "AdjustPointsResponse":  {
                                                                    "type":  "object",
                                                                    "properties":  {
                                                                                       "wallet":  {
                                                                                                      "$ref":  "#/components/schemas/LoyaltyWallet"
                                                                                                  },
                                                                                       "ledger":  {
                                                                                                      "$ref":  "#/components/schemas/LedgerEntry"
                                                                                                  },
                                                                                       "idempotencyKey":  {
                                                                                                              "type":  "string"
                                                                                                          }
                                                                                   }
                                                                },
                                       "RedeemRewardResponse":  {
                                                                    "type":  "object",
                                                                    "properties":  {
                                                                                       "wallet":  {
                                                                                                      "$ref":  "#/components/schemas/LoyaltyWallet"
                                                                                                  },
                                                                                       "redemption":  {
                                                                                                          "$ref":  "#/components/schemas/RedemptionItem"
                                                                                                      },
                                                                                       "ledger":  {
                                                                                                      "oneOf":  [
                                                                                                                    {
                                                                                                                        "$ref":  "#/components/schemas/LedgerEntry"
                                                                                                                    },
                                                                                                                    {
                                                                                                                        "type":  "null"
                                                                                                                    }
                                                                                                                ]
                                                                                                  },
                                                                                       "idempotencyKey":  {
                                                                                                              "type":  "string"
                                                                                                          }
                                                                                   }
                                                                },
                                       "TimelineEntry":  {
                                                             "type":  "object",
                                                             "properties":  {
                                                                                "id":  {
                                                                                           "type":  "string"
                                                                                       },
                                                                                "customerId":  {
                                                                                                   "type":  "string"
                                                                                               },
                                                                                "type":  {
                                                                                             "type":  "string"
                                                                                         },
                                                                                "source":  {
                                                                                               "type":  [
                                                                                                            "string",
                                                                                                            "null"
                                                                                                        ]
                                                                                           },
                                                                                "edit_log":  {
                                                                                                 "type":  [
                                                                                                              "string",
                                                                                                              "null"
                                                                                                          ]
                                                                                             },
                                                                                "notes":  {
                                                                                              "type":  [
                                                                                                           "string",
                                                                                                           "null"
                                                                                                       ]
                                                                                          },
                                                                                "createdAt":  {
                                                                                                  "type":  "string",
                                                                                                  "format":  "date-time"
                                                                                              },
                                                                                "updatedAt":  {
                                                                                                  "type":  "string",
                                                                                                  "format":  "date-time"
                                                                                              }
                                                                            }
                                                         },
                                       "TimelineMeta":  {
                                                            "type":  "object",
                                                            "properties":  {
                                                                               "startCursor":  {
                                                                                                   "type":  [
                                                                                                                "string",
                                                                                                                "boolean"
                                                                                                            ]
                                                                                               },
                                                                               "endCursor":  {
                                                                                                 "type":  "string"
                                                                                             },
                                                                               "hasNextPage":  {
                                                                                                   "type":  "boolean"
                                                                                               },
                                                                               "hasPreviousPage":  {
                                                                                                       "type":  "boolean"
                                                                                                   },
                                                                               "total":  {
                                                                                             "type":  "integer"
                                                                                         }
                                                                           }
                                                        }
                                   }
                   }
}
