{
  "components": {
    "schemas": {
      "Authz_TokenResponse": {
        "properties": {
          "access_token": {
            "description": "Signed ES256 JWT.",
            "type": "string"
          },
          "expires_in": {
            "description": "Lifetime of the token in seconds.",
            "format": "int64",
            "type": "integer"
          },
          "token_type": {
            "description": "Always `Bearer`.",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "type": "object"
      },
      "ErrorResponse": {
        "additionalProperties": false,
        "description": "An error response object (PayLead profile).\n\nExtension members (e.g. ``errors`` for validation) are allowed and serialised as\ntop-level keys.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "errors": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Errors"
          },
          "instance": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Instance"
          },
          "status": {
            "title": "Status",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "code",
          "title",
          "status"
        ],
        "title": "ErrorResponse",
        "type": "object"
      },
      "Perks_ConsumerToCreateSchema": {
        "properties": {
          "extra_consents": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Perks_PrivacyPolicyLevel"
            },
            "title": "Extra Consents",
            "type": "array"
          },
          "id": {
            "maxLength": 100,
            "minLength": 2,
            "pattern": "^[a-zA-Z0-9_.-]*$",
            "title": "Id",
            "type": "string"
          },
          "removed_consents": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/Perks_PrivacyPolicyLevel"
            },
            "title": "Removed Consents",
            "type": "array"
          }
        },
        "required": [
          "id"
        ],
        "title": "ConsumerToCreateSchema",
        "type": "object"
      },
      "Perks_CreatedConsumerSchema": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "CreatedConsumerSchema",
        "type": "object"
      },
      "Perks_KycSchema": {
        "properties": {
          "birthday": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Birthday"
          },
          "country_of_residence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Of Residence"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "first_name": {
            "title": "First Name",
            "type": "string"
          },
          "last_name": {
            "title": "Last Name",
            "type": "string"
          },
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          },
          "natural_user_id": {
            "title": "Natural User Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "natural_user_id",
          "status",
          "email",
          "first_name",
          "last_name",
          "nationality",
          "country_of_residence",
          "birthday"
        ],
        "title": "KycSchema",
        "type": "object"
      },
      "Perks_KycToUpsertSchema": {
        "properties": {
          "birthday": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Birthday"
          },
          "country_of_residence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country Of Residence"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "first_name": {
            "minLength": 1,
            "title": "First Name",
            "type": "string"
          },
          "last_name": {
            "minLength": 1,
            "title": "Last Name",
            "type": "string"
          },
          "nationality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nationality"
          }
        },
        "required": [
          "email",
          "first_name",
          "last_name"
        ],
        "title": "KycToUpsertSchema",
        "type": "object"
      },
      "Perks_PageLinks": {
        "properties": {
          "first": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First"
          },
          "last": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last"
          },
          "next": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next"
          },
          "prev": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev"
          },
          "self": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Self"
          }
        },
        "title": "PageLinks",
        "type": "object"
      },
      "Perks_PageMeta": {
        "properties": {
          "links": {
            "$ref": "#/components/schemas/Perks_PageLinks"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "per_page": {
            "title": "Per Page",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "page",
          "per_page",
          "total",
          "links"
        ],
        "title": "PageMeta",
        "type": "object"
      },
      "Perks_Page_RewardSchema_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Perks_RewardSchema"
            },
            "title": "Items",
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/Perks_PageMeta"
          }
        },
        "required": [
          "items",
          "meta"
        ],
        "title": "Page[RewardSchema]",
        "type": "object"
      },
      "Perks_Page_SegmentAssignationSchema_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Perks_SegmentAssignationSchema"
            },
            "title": "Items",
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/Perks_PageMeta"
          }
        },
        "required": [
          "items",
          "meta"
        ],
        "title": "Page[SegmentAssignationSchema]",
        "type": "object"
      },
      "Perks_Page_VoucherOrderSchema_": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Perks_VoucherOrderSchema"
            },
            "title": "Items",
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/Perks_PageMeta"
          }
        },
        "required": [
          "items",
          "meta"
        ],
        "title": "Page[VoucherOrderSchema]",
        "type": "object"
      },
      "Perks_PaymentAccountSchema": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payout_account": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout Account"
          },
          "psp_status": {
            "title": "Psp Status",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "boolean"
          },
          "target_account": {
            "title": "Target Account",
            "type": "string"
          }
        },
        "required": [
          "id",
          "target_account",
          "payout_account",
          "status",
          "psp_status"
        ],
        "title": "PaymentAccountSchema",
        "type": "object"
      },
      "Perks_PaymentAccountToCreateSchema": {
        "properties": {
          "target_account": {
            "title": "Target Account",
            "type": "string"
          }
        },
        "required": [
          "target_account"
        ],
        "title": "PaymentAccountToCreateSchema",
        "type": "object"
      },
      "Perks_PayoutAcceptedSchema": {
        "properties": {
          "amount": {
            "description": "Total amount paid out (sum of the settled rewards).",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Amount",
            "type": "string"
          },
          "payout_id": {
            "description": "Identifier of the payout created on PayLead's side.",
            "format": "uuid",
            "title": "Payout Id",
            "type": "string"
          },
          "psp_payout_id": {
            "description": "Identifier of the bank wire payout created on the PSP (Mangopay) side.",
            "title": "Psp Payout Id",
            "type": "string"
          },
          "reward_count": {
            "description": "Number of rewards settled by this payout.",
            "title": "Reward Count",
            "type": "integer"
          },
          "status": {
            "default": "PENDING",
            "description": "Settlement status. The payout is initiated synchronously but the bank wire is settled asynchronously by the PSP, so it starts as `PENDING`.",
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "payout_id",
          "psp_payout_id",
          "amount",
          "reward_count"
        ],
        "title": "PayoutAcceptedSchema",
        "type": "object"
      },
      "Perks_PrivacyPolicyLevel": {
        "enum": [
          "BASIC",
          "TRANSACTION_TRIGGERS",
          "TARGETING",
          "STATISTICS",
          "SMART_RANKING",
          "WEB_ANALYTICS"
        ],
        "title": "PrivacyPolicyLevel",
        "type": "string"
      },
      "Perks_RewardBrandSchema": {
        "properties": {
          "logo": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Absolute CDN URL of the reward's brand logo; null if the brand has no logo.",
            "title": "Logo"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the reward's brand.",
            "title": "Name"
          }
        },
        "required": [
          "name"
        ],
        "title": "RewardBrandSchema",
        "type": "object"
      },
      "Perks_RewardSchema": {
        "properties": {
          "amount": {
            "description": "Amount of the reward.",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Amount",
            "type": "string"
          },
          "brand": {
            "$ref": "#/components/schemas/Perks_RewardBrandSchema",
            "description": "Brand display information for the reward."
          },
          "created_at": {
            "description": "When the reward was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "Identifier of the reward.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "transaction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Perks_RewardTransactionSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Originating transaction; null for rewards without one (e.g. gifts)."
          },
          "type": {
            "description": "Type of the reward (e.g. CASHBACK, GIFT).",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "amount",
          "created_at",
          "type",
          "transaction",
          "brand"
        ],
        "title": "RewardSchema",
        "type": "object"
      },
      "Perks_RewardTransactionSchema": {
        "properties": {
          "executed_at": {
            "description": "When the originating transaction was executed (purchase date).",
            "format": "date-time",
            "title": "Executed At",
            "type": "string"
          },
          "external_id": {
            "description": "External identifier of the originating transaction.",
            "title": "External Id",
            "type": "string"
          }
        },
        "required": [
          "external_id",
          "executed_at"
        ],
        "title": "RewardTransactionSchema",
        "type": "object"
      },
      "Perks_RewardType": {
        "enum": [
          "CASHBACK",
          "GIFT",
          "CASHBACK_AFFILIATION",
          "LBS_CASHBACK"
        ],
        "title": "RewardType",
        "type": "string"
      },
      "Perks_SegmentAssignationSchema": {
        "properties": {
          "associated_at": {
            "description": "When the consumer was assigned to the segment.",
            "format": "date-time",
            "title": "Associated At",
            "type": "string"
          },
          "reference": {
            "description": "Public reference (slug) of the segment the consumer is assigned to.",
            "title": "Reference",
            "type": "string"
          }
        },
        "required": [
          "reference",
          "associated_at"
        ],
        "title": "SegmentAssignationSchema",
        "type": "object"
      },
      "Perks_VoucherOrderBrandSchema": {
        "properties": {
          "logo": {
            "anyOf": [
              {
                "format": "uri",
                "maxLength": 2083,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Absolute CDN URL of the brand logo; null if the brand has no logo or the CDN is unset.",
            "title": "Logo"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the voucher order's brand.",
            "title": "Name"
          }
        },
        "required": [
          "name"
        ],
        "title": "VoucherOrderBrandSchema",
        "type": "object"
      },
      "Perks_VoucherOrderSchema": {
        "properties": {
          "amount": {
            "description": "Total amount of the voucher order (`voucher_order.total_amount`).",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Amount",
            "type": "string"
          },
          "brand": {
            "$ref": "#/components/schemas/Perks_VoucherOrderBrandSchema",
            "description": "Brand display information for the voucher order."
          },
          "created_at": {
            "description": "When the voucher order was created.",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "description": "Identifier of the voucher order.",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "voucher_count": {
            "description": "Number of vouchers in the order.",
            "title": "Voucher Count",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "amount",
          "voucher_count",
          "created_at",
          "brand"
        ],
        "title": "VoucherOrderSchema",
        "type": "object"
      },
      "Thub_BankConnectionStatus": {
        "description": "Bank Connection Status enum",
        "enum": [
          "UNKNOWN",
          "DISABLED",
          "ERROR",
          "CHALLENGE_REQUIRED",
          "SCRAPPING",
          "SUCCESS",
          "SCA_REQUIRED",
          "WEBAUTH_REQUIRED",
          "WRONG_PASS",
          "ACTION_NEEDED",
          "WAITING_FOR_VALIDATION"
        ],
        "title": "BankConnectionStatus",
        "type": "string"
      },
      "Thub_BrandSchema": {
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Street address of the brand.",
            "examples": [
              "1 Rue de la Paix"
            ],
            "title": "Address"
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Category label of the brand's activity.",
            "examples": [
              "CLOTHING"
            ],
            "title": "Category Code"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "City of the brand address.",
            "examples": [
              "Paris"
            ],
            "title": "City"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 3166-1 alpha-2 country code of the brand.",
            "examples": [
              "FR"
            ],
            "title": "Country"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Identifier of the brand on your system.",
            "examples": [
              "brand_nike"
            ],
            "title": "Id"
          },
          "mcc": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 18245 Merchant Category Code associated with the brand.",
            "examples": [
              "5941"
            ],
            "title": "Mcc"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the brand.",
            "examples": [
              "Nike"
            ],
            "title": "Name"
          },
          "post_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Postal code of the brand address.",
            "examples": [
              "75001"
            ],
            "title": "Post Code"
          },
          "public_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Legal company registration number of the brand (e.g. RCS/SIREN).",
            "examples": [
              "FR0123456789"
            ],
            "title": "Public Reference"
          }
        },
        "title": "BrandSchema",
        "type": "object"
      },
      "Thub_BucketAccountSchema": {
        "properties": {
          "iban": {
            "anyOf": [
              {
                "maxLength": 34,
                "title": "IBAN",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "IBAN of the bank account, validated against the IBAN format.",
            "examples": [
              "FR7630006000011234567890189"
            ],
            "title": "Iban"
          },
          "id": {
            "description": "Unique identifier for the resource on your system",
            "examples": [
              "acc_9876543210"
            ],
            "title": "Id",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the bank account.",
            "examples": [
              "exemple_account"
            ],
            "title": "Name"
          },
          "transactions": {
            "description": "Transactions carried by this account in the bucket.",
            "items": {
              "$ref": "#/components/schemas/Thub_BucketTransactionSchema"
            },
            "title": "Transactions",
            "type": "array"
          }
        },
        "required": [
          "id"
        ],
        "title": "BucketAccountSchema",
        "type": "object"
      },
      "Thub_BucketBankSchema": {
        "properties": {
          "accounts": {
            "description": "Bank accounts attached to this bank connection.",
            "items": {
              "$ref": "#/components/schemas/Thub_BucketAccountSchema"
            },
            "title": "Accounts",
            "type": "array"
          },
          "bank_id": {
            "description": "Identifier of the bank, as agreed in the bank mapping defined with the Ops team.",
            "examples": [
              "bank_id"
            ],
            "title": "Bank Id",
            "type": "string"
          },
          "id": {
            "anyOf": [
              {
                "description": "Unique identifier for the resource on your system",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Identifier of the bank connection on your system.",
            "examples": [
              "1"
            ],
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_BankConnectionStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status of the bank connection. Mainly used for programs with AISP.",
            "examples": [
              "SUCCESS"
            ]
          }
        },
        "required": [
          "bank_id",
          "accounts"
        ],
        "title": "BucketBankSchema",
        "type": "object"
      },
      "Thub_BucketCreateSchema": {
        "properties": {
          "banks": {
            "description": "List of bank connections and their associated accounts in the bucket.",
            "items": {
              "$ref": "#/components/schemas/Thub_BucketBankSchema"
            },
            "title": "Banks",
            "type": "array"
          }
        },
        "required": [
          "banks"
        ],
        "title": "BucketCreateSchema",
        "type": "object"
      },
      "Thub_BucketTransactionSchema": {
        "properties": {
          "account_id": {
            "anyOf": [
              {
                "description": "Unique identifier for the resource on your system",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Identifier of the account this transaction belongs to.",
            "examples": [
              "acc_9876543210"
            ],
            "title": "Account Id"
          },
          "acquirer_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) acquirer reference number, unique identifier assigned to a card transaction by the acquirer, max 23 characters",
                "examples": [
                  "74999912345678901234567"
                ],
                "maxLength": 23,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,23}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acquirer Reference Number"
          },
          "amount": {
            "description": "Signed transaction amount in the transaction currency; negative for debits, positive for credits.",
            "examples": [
              -85.5
            ],
            "title": "Amount",
            "type": "number"
          },
          "authorization_id_response": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) reference number assigned by the issuer in response to a transaction authorization request, max 6 characters",
                "examples": [
                  "1A2B3C"
                ],
                "maxLength": 6,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Id Response"
          },
          "brand": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_BrandSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Brand metadata resolved for the transaction."
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Category of the transaction as classified by the bank.",
            "examples": [
              "shopping"
            ],
            "title": "Category"
          },
          "channel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionChannel"
              },
              {
                "type": "null"
              }
            ],
            "description": "Channel through which the transaction was made."
          },
          "currency": {
            "description": "ISO 4217 currency code (alpha-3 or numeric)",
            "enum": [
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BHD",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BOV",
              "BRL",
              "BSD",
              "BTN",
              "BWP",
              "BYN",
              "BZD",
              "CAD",
              "CDF",
              "CHE",
              "CHF",
              "CHW",
              "CLF",
              "CLP",
              "CNY",
              "COP",
              "COU",
              "CRC",
              "CUP",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ERN",
              "ETB",
              "EUR",
              "FJD",
              "FKP",
              "GBP",
              "GEL",
              "GHS",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "IQD",
              "IRR",
              "ISK",
              "JMD",
              "JOD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KPW",
              "KRW",
              "KWD",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "LYD",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRU",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MXV",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "OMR",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SDG",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "SSP",
              "STN",
              "SVC",
              "SYP",
              "SZL",
              "THB",
              "TJS",
              "TMT",
              "TND",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "USD",
              "USN",
              "UYI",
              "UYU",
              "UYW",
              "UZS",
              "VED",
              "VES",
              "VND",
              "VUV",
              "WST",
              "XAD",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "XSU",
              "XUA",
              "YER",
              "ZAR",
              "ZMW",
              "ZWG"
            ],
            "examples": [
              "EUR",
              "978"
            ],
            "maxLength": 3,
            "minLength": 3,
            "title": "Currency",
            "type": "string"
          },
          "deleted": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 8601 timestamp at which the transaction was deleted, when applicable.",
            "title": "Deleted"
          },
          "executed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              }
            ],
            "description": "ISO 8601 date/datetime at which the transaction was executed.",
            "examples": [
              "2023-07-15T14:32:45"
            ],
            "title": "Executed At"
          },
          "id": {
            "description": "Unique identifier for the resource on your system",
            "examples": [
              "tx_12345678abcdef"
            ],
            "title": "Id",
            "type": "string"
          },
          "is_realtime": {
            "default": false,
            "description": "Whether the transaction was pushed in real time (e.g. at authorization).",
            "title": "Is Realtime",
            "type": "boolean"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cleaned, human-readable descriptor of the transaction.",
            "examples": [
              "PURCHASE NIKE STORE"
            ],
            "title": "Label"
          },
          "raw_label": {
            "description": "Raw descriptor as received from the bank, before any cleaning.",
            "examples": [
              "PURCHASE NIKE STORE PARIS"
            ],
            "title": "Raw Label",
            "type": "string"
          },
          "retrieval_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) retrieval reference number, unique identifier assigned to a card transaction during the authorization, max 12 characters",
                "examples": [
                  "1A2B3C4D5E6F"
                ],
                "maxLength": 12,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,12}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retrieval Reference Number"
          },
          "scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The network used for the transaction",
            "examples": [
              "visa",
              "mastercard"
            ],
            "title": "Scheme"
          },
          "scheme_id": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) scheme identifier assigned to a card transaction by the card network",
                "examples": [
                  "019876543210987"
                ],
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheme Id"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Settlement state of the transaction."
          },
          "store": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_StoreSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Store metadata resolved for the transaction."
          },
          "truncated_dpan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the device token, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "maxLength": 4,
                "minLength": 4,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Dpan"
          },
          "truncated_pan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the card number, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "maxLength": 4,
                "minLength": 4,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Pan"
          },
          "type": {
            "$ref": "#/components/schemas/Thub_TransactionType",
            "description": "Nature of the transaction as reported by the bank."
          }
        },
        "required": [
          "id",
          "amount",
          "raw_label",
          "executed_at",
          "type",
          "currency"
        ],
        "title": "BucketTransactionSchema",
        "type": "object"
      },
      "Thub_ConsumerCreateSchema": {
        "properties": {
          "banks": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Thub_BucketBankSchema"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional bank connections to attach to the consumer at onboarding time. When omitted, the consumer is created without any bank connection.",
            "title": "Banks"
          },
          "id": {
            "description": "Unique identifier for a consumer on your system, alphanumeric string with optional dashes or underscores",
            "maxLength": 100,
            "minLength": 2,
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ConsumerCreateSchema",
        "type": "object"
      },
      "Thub_ConsumerOutSchema": {
        "properties": {
          "id": {
            "description": "Unique identifier for a consumer on your system, alphanumeric string with optional dashes or underscores",
            "pattern": "^[a-zA-Z0-9_-]+$",
            "title": "Id",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "title": "ConsumerOutSchema",
        "type": "object"
      },
      "Thub_EmptySchema": {
        "properties": {},
        "title": "EmptySchema",
        "type": "object"
      },
      "Thub_PerksRewardInfoOut": {
        "properties": {
          "can_trigger_pooled": {
            "description": "Whether the consumer is eligible to trigger a payout of their pooled rewards.",
            "title": "Can Trigger Pooled",
            "type": "boolean"
          },
          "paid": {
            "$ref": "#/components/schemas/Thub_RewardStatusAggregateOut",
            "description": "Rewards already paid to the consumer."
          },
          "pooled": {
            "$ref": "#/components/schemas/Thub_RewardStatusAggregateOut",
            "description": "Validated rewards pooled for the consumer."
          },
          "validation": {
            "$ref": "#/components/schemas/Thub_RewardStatusAggregateOut",
            "description": "Rewards awaiting validation."
          },
          "voucher": {
            "$ref": "#/components/schemas/Thub_VoucherAggregateOut",
            "description": "Aggregated data about vouchers purchased by the consumer."
          }
        },
        "required": [
          "validation",
          "pooled",
          "paid",
          "voucher",
          "can_trigger_pooled"
        ],
        "title": "PerksRewardInfoOut",
        "type": "object"
      },
      "Thub_RewardStatusAggregateOut": {
        "description": "Aggregated reward amount and count for a given reward status.",
        "properties": {
          "amount": {
            "description": "Total reward amount in this status, as a decimal string.",
            "examples": [
              "42.50"
            ],
            "title": "Amount",
            "type": "string"
          },
          "count": {
            "description": "Number of rewards in this status.",
            "examples": [
              12
            ],
            "title": "Count",
            "type": "integer"
          }
        },
        "required": [
          "count",
          "amount"
        ],
        "title": "RewardStatusAggregateOut",
        "type": "object"
      },
      "Thub_RewardsInfoResponse": {
        "description": "Aggregated reward information for a consumer.\n\nEach field maps to a distinct backend and is only present when that backend\nresponded. Backends are queried concurrently; a backend that fails, times out\nor has no data for the consumer is simply omitted from the payload.",
        "properties": {
          "perks": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_PerksRewardInfoOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "RewardsInfoResponse",
        "type": "object"
      },
      "Thub_StoreSchema": {
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Street address of the store.",
            "examples": [
              "1 Rue de la Paix"
            ],
            "title": "Address"
          },
          "category_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Category label of the store's activity.",
            "examples": [
              "Clothing"
            ],
            "title": "Category Code"
          },
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "City of the store address.",
            "examples": [
              "Paris"
            ],
            "title": "City"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 3166-1 alpha-2 country code of the store.",
            "examples": [
              "FR"
            ],
            "title": "Country"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Identifier of the physical store on your system.",
            "examples": [
              "store_123456"
            ],
            "title": "Id"
          },
          "merchant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Acquirer merchant identifier (card acceptor ID).",
            "examples": [
              "merchant_nike_fr"
            ],
            "title": "Merchant Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Display name of the store.",
            "examples": [
              "Nike Store"
            ],
            "title": "Name"
          },
          "post_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Postal code of the store address.",
            "examples": [
              "75001"
            ],
            "title": "Post Code"
          },
          "public_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Legal company registration number of the store (e.g. RCS/SIREN).",
            "examples": [
              "RCS987654321"
            ],
            "title": "Public Reference"
          },
          "terminal_id": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) terminal identifier, max 8 characters",
                "examples": [
                  "TERM1234"
                ],
                "maxLength": 8,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,8}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terminal Id"
          }
        },
        "title": "StoreSchema",
        "type": "object"
      },
      "Thub_TransactionChannel": {
        "description": "Channel through which the transaction was made: in a physical ``store`` or ``online``.",
        "enum": [
          "store",
          "online"
        ],
        "title": "TransactionChannel",
        "type": "string"
      },
      "Thub_TransactionOutSchema": {
        "properties": {
          "acquirer_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) acquirer reference number, unique identifier assigned to a card transaction by the acquirer, max 23 characters",
                "examples": [
                  "74999912345678901234567"
                ],
                "maxLength": 23,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,23}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acquirer Reference Number"
          },
          "amount": {
            "description": "Signed transaction amount in the transaction currency; negative for debits, positive for credits.",
            "examples": [
              -85.5
            ],
            "title": "Amount",
            "type": "number"
          },
          "authorization_id_response": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) reference number assigned by the issuer in response to a transaction authorization request, max 6 characters",
                "examples": [
                  "1A2B3C"
                ],
                "pattern": "^[a-zA-Z0-9 _-]{1,6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Id Response"
          },
          "brand": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_BrandSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Brand metadata resolved for the transaction."
          },
          "channel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionChannel"
              },
              {
                "type": "null"
              }
            ],
            "description": "Channel through which the transaction was made."
          },
          "country_code": {
            "anyOf": [
              {
                "pattern": "^\\w{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 3166-1 alpha-2 country code where the transaction took place.",
            "examples": [
              "FR"
            ],
            "title": "Country Code"
          },
          "currency": {
            "description": "ISO 4217 currency code (alpha-3 or numeric)",
            "enum": [
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BHD",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BOV",
              "BRL",
              "BSD",
              "BTN",
              "BWP",
              "BYN",
              "BZD",
              "CAD",
              "CDF",
              "CHE",
              "CHF",
              "CHW",
              "CLF",
              "CLP",
              "CNY",
              "COP",
              "COU",
              "CRC",
              "CUP",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ERN",
              "ETB",
              "EUR",
              "FJD",
              "FKP",
              "GBP",
              "GEL",
              "GHS",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "IQD",
              "IRR",
              "ISK",
              "JMD",
              "JOD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KPW",
              "KRW",
              "KWD",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "LYD",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRU",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MXV",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "OMR",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SDG",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "SSP",
              "STN",
              "SVC",
              "SYP",
              "SZL",
              "THB",
              "TJS",
              "TMT",
              "TND",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "USD",
              "USN",
              "UYI",
              "UYU",
              "UYW",
              "UZS",
              "VED",
              "VES",
              "VND",
              "VUV",
              "WST",
              "XAD",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "XSU",
              "XUA",
              "YER",
              "ZAR",
              "ZMW",
              "ZWG"
            ],
            "examples": [
              "EUR",
              "978"
            ],
            "maxLength": 3,
            "minLength": 3,
            "title": "Currency",
            "type": "string"
          },
          "executed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              }
            ],
            "description": "ISO 8601 date/datetime at which the transaction was executed.",
            "examples": [
              "2023-07-15T14:32:45"
            ],
            "title": "Executed At"
          },
          "id": {
            "description": "Unique identifier for the resource on your system",
            "examples": [
              "tx_12345678abcdef"
            ],
            "title": "Id",
            "type": "string"
          },
          "is_realtime": {
            "default": false,
            "description": "Whether the transaction was pushed in real time (e.g. at authorization).",
            "title": "Is Realtime",
            "type": "boolean"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cleaned, human-readable descriptor of the transaction.",
            "examples": [
              "PURCHASE NIKE STORE"
            ],
            "title": "Label"
          },
          "raw_label": {
            "description": "Raw descriptor as received from the bank, before any cleaning.",
            "examples": [
              "PURCHASE NIKE STORE PARIS"
            ],
            "title": "Raw Label",
            "type": "string"
          },
          "retrieval_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) retrieval reference number, unique identifier assigned to a card transaction during the authorization, max 12 characters",
                "examples": [
                  "1A2B3C4D5E6F"
                ],
                "maxLength": 12,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,12}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retrieval Reference Number"
          },
          "scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The network used for the transaction",
            "examples": [
              "visa",
              "mastercard"
            ],
            "title": "Scheme"
          },
          "scheme_id": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) scheme identifier assigned to a card transaction by the card network",
                "examples": [
                  "019876543210987"
                ],
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheme Id"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Settlement state of the transaction."
          },
          "store": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_StoreSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Store metadata resolved for the transaction."
          },
          "truncated_dpan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the device token, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "pattern": "^[A-Za-z0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Dpan"
          },
          "truncated_pan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the card number, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "pattern": "^[A-Za-z0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Pan"
          },
          "type": {
            "$ref": "#/components/schemas/Thub_TransactionType",
            "description": "Nature of the transaction as reported by the bank."
          }
        },
        "required": [
          "id",
          "amount",
          "currency",
          "raw_label",
          "executed_at",
          "type"
        ],
        "title": "TransactionOutSchema",
        "type": "object"
      },
      "Thub_TransactionState": {
        "description": "Settlement state of the transaction: ``authorization`` (pending) or ``cleared`` (settled).",
        "enum": [
          "cleared",
          "authorization"
        ],
        "title": "TransactionState",
        "type": "string"
      },
      "Thub_TransactionType": {
        "description": "Nature of the transaction as reported by the bank (payment instrument or operation type).",
        "enum": [
          "bank",
          "card",
          "check",
          "deferred_card",
          "deposit",
          "loan_payment",
          "order",
          "payback",
          "summary_card",
          "transfer",
          "unknown",
          "withdrawal"
        ],
        "title": "TransactionType",
        "type": "string"
      },
      "Thub_TransactionUpdateSchema": {
        "properties": {
          "acquirer_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) acquirer reference number, unique identifier assigned to a card transaction by the acquirer, max 23 characters",
                "examples": [
                  "74999912345678901234567"
                ],
                "maxLength": 23,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,23}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acquirer Reference Number"
          },
          "amount": {
            "description": "Signed transaction amount in the transaction currency; negative for debits, positive for credits.",
            "examples": [
              -85.5
            ],
            "title": "Amount",
            "type": "number"
          },
          "authorization_id_response": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) reference number assigned by the issuer in response to a transaction authorization request, max 6 characters",
                "examples": [
                  "1A2B3C"
                ],
                "maxLength": 6,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Id Response"
          },
          "brand": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_BrandSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Brand metadata resolved for the transaction."
          },
          "channel": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionChannel"
              },
              {
                "type": "null"
              }
            ],
            "description": "Channel through which the transaction was made."
          },
          "country_code": {
            "anyOf": [
              {
                "pattern": "^\\w{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ISO 3166-1 alpha-2 country code where the transaction took place.",
            "examples": [
              "FR"
            ],
            "title": "Country Code"
          },
          "currency": {
            "description": "ISO 4217 currency code (alpha-3 or numeric)",
            "enum": [
              "AED",
              "AFN",
              "ALL",
              "AMD",
              "AOA",
              "ARS",
              "AUD",
              "AWG",
              "AZN",
              "BAM",
              "BBD",
              "BDT",
              "BHD",
              "BIF",
              "BMD",
              "BND",
              "BOB",
              "BOV",
              "BRL",
              "BSD",
              "BTN",
              "BWP",
              "BYN",
              "BZD",
              "CAD",
              "CDF",
              "CHE",
              "CHF",
              "CHW",
              "CLF",
              "CLP",
              "CNY",
              "COP",
              "COU",
              "CRC",
              "CUP",
              "CVE",
              "CZK",
              "DJF",
              "DKK",
              "DOP",
              "DZD",
              "EGP",
              "ERN",
              "ETB",
              "EUR",
              "FJD",
              "FKP",
              "GBP",
              "GEL",
              "GHS",
              "GIP",
              "GMD",
              "GNF",
              "GTQ",
              "GYD",
              "HKD",
              "HNL",
              "HTG",
              "HUF",
              "IDR",
              "ILS",
              "INR",
              "IQD",
              "IRR",
              "ISK",
              "JMD",
              "JOD",
              "JPY",
              "KES",
              "KGS",
              "KHR",
              "KMF",
              "KPW",
              "KRW",
              "KWD",
              "KYD",
              "KZT",
              "LAK",
              "LBP",
              "LKR",
              "LRD",
              "LSL",
              "LYD",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MMK",
              "MNT",
              "MOP",
              "MRU",
              "MUR",
              "MVR",
              "MWK",
              "MXN",
              "MXV",
              "MYR",
              "MZN",
              "NAD",
              "NGN",
              "NIO",
              "NOK",
              "NPR",
              "NZD",
              "OMR",
              "PAB",
              "PEN",
              "PGK",
              "PHP",
              "PKR",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "RWF",
              "SAR",
              "SBD",
              "SCR",
              "SDG",
              "SEK",
              "SGD",
              "SHP",
              "SLE",
              "SOS",
              "SRD",
              "SSP",
              "STN",
              "SVC",
              "SYP",
              "SZL",
              "THB",
              "TJS",
              "TMT",
              "TND",
              "TOP",
              "TRY",
              "TTD",
              "TWD",
              "TZS",
              "UAH",
              "UGX",
              "USD",
              "USN",
              "UYI",
              "UYU",
              "UYW",
              "UZS",
              "VED",
              "VES",
              "VND",
              "VUV",
              "WST",
              "XAD",
              "XAF",
              "XCD",
              "XCG",
              "XOF",
              "XPF",
              "XSU",
              "XUA",
              "YER",
              "ZAR",
              "ZMW",
              "ZWG"
            ],
            "examples": [
              "EUR",
              "978"
            ],
            "maxLength": 3,
            "minLength": 3,
            "title": "Currency",
            "type": "string"
          },
          "executed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              }
            ],
            "description": "ISO 8601 date/datetime at which the transaction was executed.",
            "examples": [
              "2023-07-15T14:32:45"
            ],
            "title": "Executed At"
          },
          "id": {
            "description": "Unique identifier for the resource on your system",
            "examples": [
              "tx_12345678abcdef"
            ],
            "title": "Id",
            "type": "string"
          },
          "is_realtime": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the transaction was pushed in real time (e.g. at authorization).",
            "title": "Is Realtime"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cleaned, human-readable descriptor of the transaction.",
            "examples": [
              "PURCHASE NIKE STORE"
            ],
            "title": "Label"
          },
          "raw_label": {
            "description": "Raw descriptor as received from the bank, before any cleaning.",
            "examples": [
              "PURCHASE NIKE STORE PARIS"
            ],
            "title": "Raw Label",
            "type": "string"
          },
          "retrieval_reference_number": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) retrieval reference number, unique identifier assigned to a card transaction during the authorization, max 12 characters",
                "examples": [
                  "1A2B3C4D5E6F"
                ],
                "maxLength": 12,
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]{1,12}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retrieval Reference Number"
          },
          "scheme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The network used for the transaction",
            "examples": [
              "visa",
              "mastercard"
            ],
            "title": "Scheme"
          },
          "scheme_id": {
            "anyOf": [
              {
                "description": "Alphanumeric (accepts spaces, _ and -) scheme identifier assigned to a card transaction by the card network",
                "examples": [
                  "019876543210987"
                ],
                "minLength": 1,
                "pattern": "^[a-zA-Z0-9 _-]+$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheme Id"
          },
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_TransactionState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Settlement state of the transaction."
          },
          "store": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Thub_StoreSchema"
              },
              {
                "type": "null"
              }
            ],
            "description": "Store metadata resolved for the transaction."
          },
          "truncated_dpan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the device token, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "maxLength": 4,
                "minLength": 4,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Dpan"
          },
          "truncated_pan": {
            "anyOf": [
              {
                "description": "Last 4 digits of the card number, must be a string without null bytes, and match 4 digits",
                "examples": [
                  "1A2B"
                ],
                "maxLength": 4,
                "minLength": 4,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncated Pan"
          },
          "type": {
            "$ref": "#/components/schemas/Thub_TransactionType",
            "description": "Nature of the transaction as reported by the bank."
          }
        },
        "required": [
          "id",
          "amount",
          "currency",
          "executed_at",
          "type",
          "raw_label"
        ],
        "title": "TransactionUpdateSchema",
        "type": "object"
      },
      "Thub_VoucherAggregateOut": {
        "description": "Aggregated voucher count and discount for the consumer.",
        "properties": {
          "count": {
            "description": "Number of vouchers issued to the consumer.",
            "examples": [
              3
            ],
            "title": "Count",
            "type": "integer"
          },
          "total_discount": {
            "description": "Cumulated voucher discount amount, as a decimal string.",
            "examples": [
              "15.00"
            ],
            "title": "Total Discount",
            "type": "string"
          }
        },
        "required": [
          "count",
          "total_discount"
        ],
        "title": "VoucherAggregateOut",
        "type": "object"
      }
    },
    "securitySchemes": {
      "basic_auth": {
        "scheme": "basic",
        "type": "http"
      },
      "oauth2": {
        "flows": {
          "clientCredentials": {
            "scopes": {
              "ALL": "Full access to all resources (wildcard).",
              "LOYALTIES": "Access to loyalties features.",
              "PERKS": "Access to perks features.",
              "TX_INJECTION": "Access to transaction sharing."
            },
            "tokenUrl": "/tokens"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Paylead Program API.\nYou can find complete documentation in https://docs.paylead.com/\n",
    "license": {
      "name": "Proprietary",
      "url": "https://docs.paylead.com/"
    },
    "title": "Paylead Program API",
    "version": "2.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/consumers": {
      "post": {
        "description": "Create a consumer by providing it's `consumer_id`",
        "operationId": "consumers__post",
        "parameters": [
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Thub_ConsumerCreateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_ConsumerOutSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Onboard a consumer on Paylead platform",
        "tags": [
          "Consumers"
        ],
        "x-slug": "thub"
      }
    },
    "/consumers/{consumer_id}": {
      "delete": {
        "description": "Delete a consumer by providing it's `consumer_id`",
        "operationId": "consumers__consumer_id__delete",
        "parameters": [
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Offboard a consumer from Paylead platform",
        "tags": [
          "Consumers"
        ],
        "x-slug": "thub"
      }
    },
    "/consumers/{consumer_id}/rewards/info": {
      "get": {
        "description": "Aggregates reward information for consumer `consumer_id` by querying the different backends concurrently. Each backend contributes its own field (e.g. `perks`) and is only included when it responds: a backend that fails, times out or has no data for the consumer is omitted from the payload.",
        "operationId": "consumers__consumer_id__rewards__info__get",
        "parameters": [
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_RewardsInfoResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get a consumer's aggregated reward information",
        "tags": [
          "Rewards"
        ],
        "x-slug": "thub"
      }
    },
    "/consumers/{consumer_id}/transactions": {
      "post": {
        "description": "Inserts multiple transactions to consumer `consumer_id` using a bulk.",
        "operationId": "consumers__consumer_id__transactions__post",
        "parameters": [
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Thub_BucketCreateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_EmptySchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a bulk of transactions",
        "tags": [
          "Bulk Transaction"
        ],
        "x-slug": "thub"
      }
    },
    "/consumers/{consumer_id}/transactions/history": {
      "post": {
        "description": "Inserts multiple historical transactions to consumer `consumer_id` using a bulk. Historical transactions will not be cashbacked.",
        "operationId": "consumers__consumer_id__transactions__history__post",
        "parameters": [
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Thub_BucketCreateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_EmptySchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Create a bulk of historical transactions",
        "tags": [
          "Bulk Transaction"
        ],
        "x-slug": "thub"
      }
    },
    "/consumers/{consumer_id}/transactions/{transaction_id}": {
      "delete": {
        "description": "Delete the transaction `transaction_id` on account `account_id` linked to bank connection `bank_connection_id` for consumer `consumer_id`.",
        "operationId": "consumers__consumer_id__transactions__transaction_id__delete",
        "parameters": [
          {
            "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
            "in": "path",
            "name": "transaction_id",
            "required": true,
            "schema": {
              "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
              "title": "Transaction Id",
              "type": "string"
            }
          },
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Delete transaction",
        "tags": [
          "Transaction"
        ],
        "x-slug": "thub"
      },
      "get": {
        "description": "Returns all the information about transaction `transaction_id` on account `account_id` linked to bank connection `bank_connection_id` for consumer `consumer_id`.",
        "operationId": "consumers__consumer_id__transactions__transaction_id__get",
        "parameters": [
          {
            "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
            "in": "path",
            "name": "transaction_id",
            "required": true,
            "schema": {
              "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
              "title": "Transaction Id",
              "type": "string"
            }
          },
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_TransactionOutSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Get the transaction details",
        "tags": [
          "Transaction"
        ],
        "x-slug": "thub"
      },
      "put": {
        "description": "Update the `transaction_id` transaction on `account_id` linked to `bank_connection_id` bank connection for consumer `consumer_id`.",
        "operationId": "consumers__consumer_id__transactions__transaction_id__put",
        "parameters": [
          {
            "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
            "in": "path",
            "name": "transaction_id",
            "required": true,
            "schema": {
              "description": "UUID of the transaction or Unique ID of the transaction that you have registered when the transaction was created.",
              "title": "Transaction Id",
              "type": "string"
            }
          },
          {
            "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "description": "Unique ID of the consumer that you have registered when the user was onboarded.",
              "maxLength": 100,
              "minLength": 2,
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Thub_TransactionUpdateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thub_TransactionOutSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "summary": "Update transaction",
        "tags": [
          "Transaction"
        ],
        "x-slug": "thub"
      }
    },
    "/perks/consumers": {
      "post": {
        "operationId": "perks__consumers__post",
        "parameters": [
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Perks_ConsumerToCreateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_CreatedConsumerSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "409": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-409-09": {
                    "summary": "Consumer Not Enrolled On Platform",
                    "value": {
                      "code": "PL-409-09",
                      "status": 409,
                      "title": "Consumer Not Enrolled On Platform"
                    }
                  },
                  "PL-409-10": {
                    "summary": "Consumer Already Enrolled",
                    "value": {
                      "code": "PL-409-10",
                      "status": 409,
                      "title": "Consumer Already Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Enroll a consumer into the perks program (accept CGU).",
        "tags": [
          "Consumers"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/accounts/payment": {
      "delete": {
        "operationId": "perks__consumers__consumer_id__accounts__payment__delete",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-400-05": {
                    "summary": "Payment Account Recipient Rejected",
                    "value": {
                      "code": "PL-400-05",
                      "status": 400,
                      "title": "Payment Account Recipient Rejected"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-502-03": {
                    "summary": "PSP Service Unavailable",
                    "value": {
                      "code": "PL-502-03",
                      "status": 502,
                      "title": "PSP Service Unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "summary": "Revoke the consumer's currently designated payment account.",
        "tags": [
          "UPM"
        ],
        "x-slug": "perks"
      },
      "get": {
        "operationId": "perks__consumers__consumer_id__accounts__payment__get",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_PaymentAccountSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  },
                  "PL-404-05": {
                    "summary": "Payment Account Not Found",
                    "value": {
                      "code": "PL-404-05",
                      "status": 404,
                      "title": "Payment Account Not Found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Read the payment account currently designated for a consumer.",
        "tags": [
          "UPM"
        ],
        "x-slug": "perks"
      },
      "post": {
        "operationId": "perks__consumers__consumer_id__accounts__payment__post",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Perks_PaymentAccountToCreateSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_PaymentAccountSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-400-05": {
                    "summary": "Payment Account Recipient Rejected",
                    "value": {
                      "code": "PL-400-05",
                      "status": 400,
                      "title": "Payment Account Recipient Rejected"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-403-01": {
                    "summary": "Consumer Pool Not Enabled",
                    "value": {
                      "code": "PL-403-01",
                      "status": 403,
                      "title": "Consumer Pool Not Enabled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-409-04": {
                    "summary": "Payment Account Already Exists",
                    "value": {
                      "code": "PL-409-04",
                      "status": 409,
                      "title": "Payment Account Already Exists"
                    }
                  },
                  "PL-409-05": {
                    "summary": "Consumer KYC Not Ready",
                    "value": {
                      "code": "PL-409-05",
                      "status": 409,
                      "title": "Consumer KYC Not Ready"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-502-03": {
                    "summary": "PSP Service Unavailable",
                    "value": {
                      "code": "PL-502-03",
                      "status": 502,
                      "title": "PSP Service Unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "summary": "Designate the bank account where a consumer wants to be paid out.",
        "tags": [
          "UPM"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/kyc": {
      "put": {
        "operationId": "perks__consumers__consumer_id__kyc__put",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Perks_KycToUpsertSchema"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_KycSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-400-06": {
                    "summary": "KYC Rejected",
                    "value": {
                      "code": "PL-400-06",
                      "status": 400,
                      "title": "KYC Rejected"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-403-01": {
                    "summary": "Consumer Pool Not Enabled",
                    "value": {
                      "code": "PL-403-01",
                      "status": 403,
                      "title": "Consumer Pool Not Enabled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-502-03": {
                    "summary": "PSP Service Unavailable",
                    "value": {
                      "code": "PL-502-03",
                      "status": 502,
                      "title": "PSP Service Unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "summary": "Create or update a consumer's KYC (Mangopay natural user).",
        "tags": [
          "KYC"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/pools/me/payouts": {
      "post": {
        "description": "Pays out the consumer's `PAID_IN` rewards: reserves the funds in the ledger, moves the money on the PSP (working capital to the program's UPM wallet, then a bank wire to the consumer's recipient), and marks the rewards `PAID_OUT`. Returns `202 Accepted`: the payout is initiated synchronously but the bank wire is settled asynchronously by the PSP.",
        "operationId": "perks__consumers__consumer_id__pools__me__payouts__post",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_PayoutAcceptedSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-400-07": {
                    "summary": "Payout Rejected",
                    "value": {
                      "code": "PL-400-07",
                      "status": 400,
                      "title": "Payout Rejected"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-403-01": {
                    "summary": "Consumer Pool Not Enabled",
                    "value": {
                      "code": "PL-403-01",
                      "status": 403,
                      "title": "Consumer Pool Not Enabled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-409-05": {
                    "summary": "Consumer KYC Not Ready",
                    "value": {
                      "code": "PL-409-05",
                      "status": 409,
                      "title": "Consumer KYC Not Ready"
                    }
                  },
                  "PL-409-06": {
                    "summary": "Consumer Outflow Blocked",
                    "value": {
                      "code": "PL-409-06",
                      "status": 409,
                      "title": "Consumer Outflow Blocked"
                    }
                  },
                  "PL-409-07": {
                    "summary": "Pool Below Threshold",
                    "value": {
                      "code": "PL-409-07",
                      "status": 409,
                      "title": "Pool Below Threshold"
                    }
                  },
                  "PL-409-08": {
                    "summary": "Payment Account Missing",
                    "value": {
                      "code": "PL-409-08",
                      "status": 409,
                      "title": "Payment Account Missing"
                    }
                  },
                  "PL-409-999": {
                    "summary": "Contact Admin User",
                    "value": {
                      "code": "PL-409-999",
                      "status": 409,
                      "title": "Contact Admin User"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "502": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-502-03": {
                    "summary": "PSP Service Unavailable",
                    "value": {
                      "code": "PL-502-03",
                      "status": 502,
                      "title": "PSP Service Unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "summary": "Trigger a payout of the consumer's pool.",
        "tags": [
          "UPM"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/rewards": {
      "get": {
        "operationId": "perks__consumers__consumer_id__rewards__get",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "description": "Filter on one or several reward types.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/Perks_RewardType"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter on one or several reward types.",
              "title": "Type"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 1000,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "-created_at",
              "enum": [
                "created_at",
                "-created_at",
                "executed_at",
                "-executed_at"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_at__gte",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created At  Gte"
            }
          },
          {
            "in": "query",
            "name": "created_at__lte",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Created At  Lte"
            }
          },
          {
            "in": "query",
            "name": "executed_at__gte",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Executed At  Gte"
            }
          },
          {
            "in": "query",
            "name": "executed_at__lte",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Executed At  Lte"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_Page_RewardSchema_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "List the rewards a consumer has received.",
        "tags": [
          "Rewards"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/segments": {
      "get": {
        "operationId": "perks__consumers__consumer_id__segments__get",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 1000,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_Page_SegmentAssignationSchema_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "List the segments a consumer is currently assigned to.",
        "tags": [
          "Segments"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/segments/{segment_reference}": {
      "delete": {
        "operationId": "perks__consumers__consumer_id__segments__segment_reference__delete",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "segment_reference",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Segment Reference",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  },
                  "PL-404-04": {
                    "summary": "Segment Assignation Not Found",
                    "value": {
                      "code": "PL-404-04",
                      "status": 404,
                      "title": "Segment Assignation Not Found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "Unassign a consumer from a segment.",
        "tags": [
          "Segments"
        ],
        "x-slug": "perks"
      },
      "post": {
        "operationId": "perks__consumers__consumer_id__segments__segment_reference__post",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "segment_reference",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Segment Reference",
              "type": "string"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_SegmentAssignationSchema"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  },
                  "PL-404-03": {
                    "summary": "Segment Not Found",
                    "value": {
                      "code": "PL-404-03",
                      "status": 404,
                      "title": "Segment Not Found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-409-03": {
                    "summary": "Segment Already Assigned To Consumer",
                    "value": {
                      "code": "PL-409-03",
                      "status": 409,
                      "title": "Segment Already Assigned To Consumer"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Assign a consumer to a segment.",
        "tags": [
          "Segments"
        ],
        "x-slug": "perks"
      }
    },
    "/perks/consumers/{consumer_id}/voucher-orders": {
      "get": {
        "operationId": "perks__consumers__consumer_id__voucher-orders__get",
        "parameters": [
          {
            "in": "path",
            "name": "consumer_id",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 2,
              "pattern": "^[a-zA-Z0-9_.-]*$",
              "title": "Consumer Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 1000,
              "minimum": 1,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "-created_at",
              "enum": [
                "created_at",
                "-created_at"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "brand__name",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Brand  Name"
            }
          },
          {
            "examples": {
              "default": {
                "value": "2.0.0"
              }
            },
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "default": "2.0.0",
              "title": "X-Api-Version",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "Authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Perks_Page_VoucherOrderSchema_"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": "PL-400-00",
                  "errors": [
                    {
                      "loc": [
                        "body",
                        "field"
                      ],
                      "msg": "Field required",
                      "type": "missing"
                    }
                  ],
                  "instance": "/path/of/the/request",
                  "status": 400,
                  "title": "Bad Request"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-401-00": {
                    "summary": "Unauthorized",
                    "value": {
                      "code": "PL-401-00",
                      "status": 401,
                      "title": "Unauthorized"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "404": {
            "content": {
              "application/json": {
                "examples": {
                  "PL-404-02": {
                    "summary": "Consumer Not Enrolled",
                    "value": {
                      "code": "PL-404-02",
                      "status": 404,
                      "title": "Consumer Not Enrolled"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "List the READY voucher orders a consumer has placed.",
        "tags": [
          "Voucher Orders"
        ],
        "x-slug": "perks"
      }
    },
    "/tokens": {
      "post": {
        "description": "Exchange API key credentials for a short-lived ES256 JWT access token. Authenticate with HTTP Basic: the username is the API key's `client_id` (a UUID) and the password is its `client_secret`. Send the returned `access_token` as `Authorization: Bearer <token>` on every subsequent Platform API call.",
        "operationId": "issue",
        "parameters": [
          {
            "description": "Selects the partner API version to use, in semver form `x.y.z` (e.g. `2.0.0`). Optional; the service default version is used when omitted.",
            "example": "2.0.0",
            "in": "header",
            "name": "x-api-version",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authz_TokenResponse"
                }
              }
            },
            "description": "Access token issued."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Missing or invalid Basic credentials."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Client not found or secret mismatch."
          }
        },
        "security": [
          {
            "basic_auth": []
          }
        ],
        "summary": "Issue an access token",
        "tags": [
          "Tokens"
        ],
        "x-slug": "authz"
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "servers": [
    {
      "description": "Sandbox",
      "url": "https://api-{programRef}.sandbox.paylead.tech",
      "variables": {
        "programRef": {
          "default": "changeme",
          "description": "Program reference provided by Paylead"
        }
      }
    }
  ],
  "tags": [
    {
      "description": "Issue ES256 JWTs for API keys",
      "name": "Tokens",
      "x-displayName": "Tokens"
    },
    {
      "description": "Routes used to query consumers resources",
      "name": "Consumers",
      "x-displayName": "Consumers"
    },
    {
      "name": "UPM",
      "x-displayName": "UPM"
    },
    {
      "name": "KYC",
      "x-displayName": "KYC"
    },
    {
      "name": "Rewards",
      "x-displayName": "Rewards"
    },
    {
      "name": "Segments",
      "x-displayName": "Segments"
    },
    {
      "name": "Voucher Orders",
      "x-displayName": "Voucher Orders"
    },
    {
      "description": "Routes used to create transactions with a bulk insert",
      "name": "Bulk Transaction",
      "x-displayName": "Bulk Transaction"
    },
    {
      "description": "Routes used to query transactions resources based on the transaction id or unique id that you defined",
      "name": "Transaction",
      "x-displayName": "Transaction"
    }
  ]
}
