> ## Documentation Index
> Fetch the complete documentation index at: https://developers.bonifiq.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Change the tier of a customer in BonifiQ

> This endpoint allows you to manually change the tier of a customer. The tier affects how the customer accrues points and which rewards are available to them.

## Some important remarks
- The `TierId` field is **required** and must match an existing tier configured in BonifiQ. If the tier does not exist, the API returns an error with the `Tier_NotFound` error code.
- If the customer already belongs to a tier, they will be **removed from the old tier** and assigned to the new one.
- If the customer does not exist, the API returns an error with the `Customer_NotFound` error code.
- This endpoint does **not** calculate tiers automatically based on points or history. It is a manual override.

## The GracePeriodInDays field
This optional field allows you to define a grace period (in days) for the tier change. 
This can be useful when promoting a customer temporarily or when a business rule requires the customer to stay in the tier for a limited time.

## The GracePeriodComments field
This optional field allows you to add a comment explaining the reason for the grace period. This information is internal-use only and will not be visible to the customer.

## Response
On success, the response contains the `CustomerId`, the new `TierId`, the `CurrentTierName`, and the `OldTierName` (if the customer was previously in a tier).



## OpenAPI

````yaml https://api.bonifiq.com.br/swagger/Private%20APIs/swagger.json post /v1/pvt/Customer/{originalId}/changetier
openapi: 3.0.0
info:
  title: BonifiQ Private APIs
  description: >-
    # Introduction 

    This is the BonifiQ Private APIs documentation. With these endpoints you can
    interact with BonifiQ systems and enhance your program points.


    # Limitations

    These endpoints are intended to be used in backend communication so they are
    not CORS-compatible and cannot be used by in-browser frontend libraries
    (such as React, Angular, Vue, jQuery, etc)


    If are required to call BonifiQ API from a browser, please refer to our
    [Public APIs](https://api.bonifiq.com.br/apidocs/public)


    # Authentication

    These Private APis use the [Basic
    Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)
    scheme. You need both an API Token (Username) and API Key (Password) to use
    with it


    You can generate this key pair in BonifiQ admin panel, at the "API Keys"
    menu.


    # How to use this page

    ## Making calls

    You can simulate, test and make calls to API from this Swagger page. To do
    that:

    - Click on the **Authorize** button

    - Inform the Username (API Token) and Passwoird (API Key) and click on
    **Authorize**

    - From the list bellow, choose an API call and click on **Try it out**

    - Inform the required parameters (if any) and click on **Execute**


    ## Verifying requests and responses bodies

    In every API Call there is an explanation of what each field means, theirs
    types and accepted values for all Requests and Responses.


    To view this information, just go to any API Call bellow and in the
    Responses section, click on the Schema.
  version: 1.0.0
servers:
  - url: https://api.bonifiq.com.br
security: []
tags:
  - name: POS
    description: >-
      Flow methods to integrate BonifiQ with a POS system. Check the Flow
      Documentation link on the right
    externalDocs:
      description: Flow Documentation
      url: >-
        https://suporte.bonifiq.com.br/support/solutions/articles/159000319538-integrar-com-pdv
  - name: Checkout
    description: Operations related to checkout cashback redeem, refresh and removal
  - name: Customization
    description: Retrieve customizations for the loyalty program
  - name: Rewards
    description: Interact with rewards already redeemed
paths:
  /v1/pvt/Customer/{originalId}/changetier:
    post:
      tags:
        - Customer
      summary: Change the tier of a customer in BonifiQ
      description: >-
        This endpoint allows you to manually change the tier of a customer. The
        tier affects how the customer accrues points and which rewards are
        available to them.


        ## Some important remarks

        - The `TierId` field is **required** and must match an existing tier
        configured in BonifiQ. If the tier does not exist, the API returns an
        error with the `Tier_NotFound` error code.

        - If the customer already belongs to a tier, they will be **removed from
        the old tier** and assigned to the new one.

        - If the customer does not exist, the API returns an error with the
        `Customer_NotFound` error code.

        - This endpoint does **not** calculate tiers automatically based on
        points or history. It is a manual override.


        ## The GracePeriodInDays field

        This optional field allows you to define a grace period (in days) for
        the tier change. 

        This can be useful when promoting a customer temporarily or when a
        business rule requires the customer to stay in the tier for a limited
        time.


        ## The GracePeriodComments field

        This optional field allows you to add a comment explaining the reason
        for the grace period. This information is internal-use only and will not
        be visible to the customer.


        ## Response

        On success, the response contains the `CustomerId`, the new `TierId`,
        the `CurrentTierName`, and the `OldTierName` (if the customer was
        previously in a tier).
      operationId: Customer_ChangeTier
      parameters:
        - name: originalId
          in: path
          required: true
          description: Id from the client's store, usually email address or document
          schema:
            type: string
          x-position: 1
      requestBody:
        x-name: request
        description: >-
          Tier change data containing the target `TierId` (required), an
          optional `GracePeriodInDays`, and an optional `GracePeriodComments`
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeTierCustomerRequest'
        required: true
        x-position: 2
      responses:
        '200':
          description: >-
            The updated tier information including old and new tier names, or an
            error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseExternalApiResponseOfBoolean'
      security:
        - Basic Authentication: []
components:
  schemas:
    ChangeTierCustomerRequest:
      type: object
      additionalProperties: false
      properties:
        GracePeriodInDays:
          type: integer
          format: int32
          nullable: true
        TierId:
          type: integer
          format: int32
        GracePeriodComments:
          type: string
          nullable: true
    BaseExternalApiResponseOfBoolean:
      type: object
      description: Standard response envelope used by the External API.
      additionalProperties: false
      properties:
        ErrorMessage:
          type: string
          description: >-
            Error message returned when the request fails validation or
            processing.

            For warnings and successful responses, consumers should usually
            inspect `Result`, `Code` and `Severity` first.
          nullable: true
        ErrorCode:
          type: integer
          description: >-
            Legacy numeric error code derived from internal API errors when
            available.

            This field is relevant only for error flows that use
            `ApiResponseErrorDescription`.
          format: int32
          nullable: true
        Result:
          type: boolean
          description: Business payload returned by the endpoint.
        Code:
          type: string
          description: >-
            Endpoint-specific business code formatted as a two-digit string,
            such as `03` or `07`.

            This field is available for success, warning and error outcomes.
          nullable: true
        CodeName:
          type: string
          description: >-
            Symbolic enum name associated with `Code`, such as
            `CheckoutNotFound`.
          nullable: true
        Severity:
          description: >-
            Final severity of the response.

            `Success` means the action completed as expected, `Warning` means
            the request was valid but the business outcome is informational or
            non-ideal, and `Error` means the request should be treated as a
            failure.
          oneOf:
            - $ref: '#/components/schemas/ExternalApiResponseSeverity'
        HasWarning:
          type: boolean
          description: >-
            Convenience flag that is `true` when `Severity` is `Warning`.

            Warnings are valid `200 OK` business outcomes and should not be
            handled as transport or validation errors.
        HasError:
          type: boolean
          description: >-
            Indicates whether the request failed and should be handled as an
            error response.

            This flag is reserved for real API errors; warnings must keep this
            property as `false`.
    ExternalApiResponseSeverity:
      type: integer
      description: |-
        0 = Success
        1 = Warning
        2 = Error
      x-enumNames:
        - Success
        - Warning
        - Error
      enum:
        - 0
        - 1
        - 2
  securitySchemes:
    Basic Authentication:
      type: http
      description: Use API Basic Auth Keys
      name: Basic Authentication
      in: header
      scheme: basic

````