{
  "openapi": "3.1.0",
  "info": {
    "title": "RE-ZIP API",
    "version": "2.0"
  },
  "paths": {
    "/me": {
      "delete": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Delete current user"
      },
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "mfa_required_by_account": {
                      "type": "boolean"
                    },
                    "mfa_enabled": {
                      "type": "boolean"
                    },
                    "mfa_required": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "name",
                    "email",
                    "created_at",
                    "updated_at",
                    "mfa_required_by_account",
                    "mfa_enabled",
                    "mfa_required"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "summary": "Get current authenticated user"
      },
      "patch": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "email",
                    "created_at",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Update the authenticated user's profile"
      },
      "post": {
        "parameters": [],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "locale": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "da_DK",
                          "de_AT",
                          "de_DE",
                          "en_GB",
                          "fr_BE",
                          "fr_FR",
                          "hu_HU",
                          "nl_BE",
                          "nl_NL",
                          "sq_AL"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "email",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Register a new user (send email verification)"
      }
    },
    "/me/access-token": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials>"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "normal",
                        "mfa"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "auth_state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "success",
                            "mfa_required",
                            "mfa_setup"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "auth_state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "summary": "Create an access token"
      }
    },
    "/me/activate": {
      "post": {
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "otp": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 8
                      }
                    ]
                  }
                },
                "required": [
                  "email",
                  "otp",
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Activate account or email-change"
      }
    },
    "/me/agreements": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "accepted": {
                        "type": "boolean"
                      },
                      "owner": {
                        "type": "boolean"
                      },
                      "mfa_required": {
                        "type": "boolean"
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string"
                      },
                      "expires_at": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "account": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      "acl_permissions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "resource": {
                              "type": "string"
                            },
                            "get": {
                              "type": "boolean"
                            },
                            "put": {
                              "type": "boolean"
                            },
                            "post": {
                              "type": "boolean"
                            },
                            "patch": {
                              "type": "boolean"
                            },
                            "delete": {
                              "type": "boolean"
                            },
                            "query": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "resource",
                            "get",
                            "put",
                            "post",
                            "patch",
                            "delete",
                            "query"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "acl_permission_groups": {
                        "anyOf": [
                          {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "account_id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "managed",
                                    "custom"
                                  ]
                                },
                                "created_at": {
                                  "type": "string"
                                },
                                "updated_at": {
                                  "type": "string"
                                },
                                "acl_permissions": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "resource": {
                                        "type": "string"
                                      },
                                      "get": {
                                        "type": "boolean"
                                      },
                                      "put": {
                                        "type": "boolean"
                                      },
                                      "post": {
                                        "type": "boolean"
                                      },
                                      "patch": {
                                        "type": "boolean"
                                      },
                                      "delete": {
                                        "type": "boolean"
                                      },
                                      "query": {
                                        "type": "boolean"
                                      }
                                    },
                                    "required": [
                                      "resource",
                                      "get",
                                      "put",
                                      "post",
                                      "patch",
                                      "delete",
                                      "query"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "account_id",
                                "name",
                                "type",
                                "created_at",
                                "updated_at",
                                "acl_permissions"
                              ],
                              "additionalProperties": false
                            }
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "acl_permission_group_ids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "accepted",
                      "owner",
                      "mfa_required",
                      "created_at",
                      "updated_at",
                      "expires_at",
                      "account",
                      "acl_permissions",
                      "acl_permission_groups",
                      "acl_permission_group_ids"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        },
        "summary": "List current user's agreements"
      }
    },
    "/me/agreements/{id}": {
      "delete": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "404": {
            "description": ""
          }
        },
        "summary": "Delete me agreement"
      }
    },
    "/me/agreements/{id}/accept": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "summary": "Accept user agreement"
      }
    },
    "/me/email": {
      "put": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Update email (initiate verification)"
      }
    },
    "/me/email/verify": {
      "post": {
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "email",
                    "created_at",
                    "updated_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "otp": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "otp"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Verify email address with OTP"
      }
    },
    "/me/mfa": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "auth_state": {
                      "type": "string",
                      "enum": [
                        "mfa_setup",
                        "mfa_required",
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "auth_state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "summary": "Get MFA auth state"
      },
      "patch": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mfa_required": {
                      "type": "boolean"
                    },
                    "mfa_required_by_account": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "mfa_required",
                    "mfa_required_by_account"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mfa_required": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "mfa_required"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Toggle MFA requirement for the authenticated user"
      },
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": ""
          }
        },
        "summary": "Generate MFA TOTP provisioning QR code"
      }
    },
    "/me/mfa/delete": {
      "patch": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "auth_state": {
                      "type": "string",
                      "enum": [
                        "mfa_setup",
                        "mfa_required",
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "auth_state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "disable": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "code",
                  "email",
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Delete MFA secret"
      }
    },
    "/me/mfa/otp": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "summary": "Send MFA OTP"
      }
    },
    "/me/mfa/reset": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "summary": "Request MFA reset OTP"
      }
    },
    "/me/mfa/verify": {
      "patch": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "auth_state": {
                      "type": "string",
                      "enum": [
                        "mfa_setup",
                        "mfa_required",
                        "success"
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "auth_state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "code"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Verify MFA passcode"
      }
    },
    "/me/packaging/lookup/{barcode}": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "barcode",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "packaging": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "barcode": {
                          "type": "string"
                        },
                        "condition": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "NaN"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "-Infinity"
                              ]
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "barcode",
                        "condition",
                        "created_at",
                        "updated_at"
                      ],
                      "additionalProperties": false
                    },
                    "scan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "user_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "shop_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "circulations": {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "NaN"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "Infinity"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "-Infinity"
                              ]
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "user_id",
                        "shop_id",
                        "circulations",
                        "created_at"
                      ],
                      "additionalProperties": false
                    },
                    "shop": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "website": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "logo_url": {
                              "type": "string"
                            },
                            "return_policy_url": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "description",
                            "website",
                            "logo_url",
                            "return_policy_url"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "product": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "group": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "description": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "description"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "sku",
                        "name",
                        "group"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "packaging",
                    "scan",
                    "shop",
                    "product"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": ""
          }
        },
        "summary": "Look up packaging by barcode"
      }
    },
    "/me/packaging/scan": {
      "post": {
        "parameters": [],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {},
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "deleted_at": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "data",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hardware_id": {
                    "type": "string"
                  },
                  "barcode": {
                    "type": "string"
                  },
                  "drop_point_location_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "hardware_id",
                  "barcode",
                  "drop_point_location_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Scan packaging for reward"
      }
    },
    "/me/password": {
      "put": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "old_password": {
                    "type": "string"
                  },
                  "new_password": {
                    "type": "string",
                    "allOf": [
                      {
                        "minLength": 8
                      }
                    ]
                  }
                },
                "required": [
                  "old_password",
                  "new_password"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Update password"
      }
    },
    "/me/password/reset": {
      "post": {
        "parameters": [],
        "responses": {
          "202": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Request a password reset"
      }
    },
    "/me/rewards": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "data": {},
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string"
                      },
                      "deleted_at": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "data",
                      "created_at",
                      "updated_at",
                      "deleted_at"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        },
        "summary": "List rewards for the authenticated user"
      }
    },
    "/me/rewards/{id}": {
      "delete": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "404": {
            "description": ""
          }
        },
        "summary": "Delete me reward"
      },
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {},
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "deleted_at": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "data",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": ""
          }
        },
        "summary": "Get reward for user"
      }
    },
    "/me/rewards/{id}/email": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "locale": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Send reward voucher by email"
      }
    },
    "/me/rewards/{id}/exchange": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "data": {},
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "deleted_at": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "data",
                    "created_at",
                    "updated_at",
                    "deleted_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": ""
          },
          "409": {
            "description": ""
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "Voucher",
                      "Ticket"
                    ]
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "summary": "Exchange ticket reward for voucher"
      }
    },
    "/me/rewards/{id}/options": {
      "get": {
        "parameters": [
          {
            "in": "header",
            "name": "Authorization",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Basic <credentials> || Bearer <token>"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "shop_id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "conditions": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "type": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "value": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "NaN"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "Infinity"
                                    ]
                                  },
                                  {
                                    "type": "string",
                                    "enum": [
                                      "-Infinity"
                                    ]
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "unit": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "created_at": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updated_at": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "expires_at": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "deleted_at": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "cursor": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "shop": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "website": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "logo_url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "website",
                          "logo_url"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "id",
                      "shop_id",
                      "shop"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "404": {
            "description": ""
          }
        },
        "summary": "List ticket reward exchange options"
      }
    }
  }
}
