> ## 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.

# Estimates the points, cashback and availability dates for a sale without saving an order.

> Send the same body as POST /v1/pvt/POS/orders. The estimate in Result uses the submitted sale,
even if an order with the same OriginalId exists. The estimate applies the store's customer enrollment rules.



## OpenAPI

````yaml https://api.bonifiq.com.br/swagger/Private%20APIs/swagger.json post /v1/pvt/POS/orders/estimate
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
    description: Production
  - url: https://backend--homolog.previewqa.bonifique.com.br
    description: Sandbox
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/POS/orders/estimate:
    post:
      tags:
        - POS
      summary: >-
        Estimates the points, cashback and availability dates for a sale without
        saving an order.
      description: >-
        Send the same body as POST /v1/pvt/POS/orders. The estimate in Result
        uses the submitted sale,

        even if an order with the same OriginalId exists. The estimate applies
        the store's customer enrollment rules.
      operationId: POS_EstimateOrderBonus
      requestBody:
        x-name: orderData
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrderRequest'
        required: true
        x-position: 1
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BaseExternalApiResponseOfOrderEstimatedBonusResponse
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BaseExternalApiResponseOfOrderEstimatedBonusResponse
      security:
        - Basic Authentication: []
components:
  schemas:
    CreateOrderRequest:
      type: object
      description: Purchase Order Model
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: 'This is the Id in the client store. '
        OrderPlacementDate:
          type: string
          description: 'Date of the customer''s purchase. '
          format: date-time
        OrderCompletedDate:
          type: string
          description: >-
            Date the order reached the completed state (usually it's invoiced or
            delivered).
          format: date-time
          nullable: true
        OrderCancelledDate:
          type: string
          description: if the order is cancelled, contains the date.
          format: date-time
          nullable: true
        OrderStatus:
          type: string
          description: Status at the client's order system.
        IsCancelledOrReturned:
          type: boolean
          description: if true the order was cancelled or returned.
        IsCompleted:
          type: boolean
          description: >-
            If true it means the order has reached its final status and points
            can be awarded to the consumer.
        OrderTotal:
          type: number
          description: >-
            Can be used at Loyalty Programs. Important: these values should not
            include Shipping costs.
          format: decimal
        Customer:
          description: Buyer registration.
          oneOf:
            - $ref: '#/components/schemas/ExternalCreateCustomerRequest'
        Products:
          type: array
          description: Products listed on the order.
          nullable: true
          xml:
            wrapped: true
          items:
            xml:
              name: CreateProductRequest
            oneOf:
              - $ref: '#/components/schemas/CreateProductRequest'
        UpdatedDate:
          type: string
          description: the date from the last update on this order.
          format: date-time
        Coupon:
          type: string
          description: Coupon code used on this order.
          nullable: true
        Metadatas:
          type: array
          description: >-
            This is a key-value list of extra information regarding the order.

            It could be informative only or being part of an business rule to be
            used later.
          nullable: true
          xml:
            wrapped: true
          items:
            xml:
              name: CreateOrderRequestMetadata
            oneOf:
              - $ref: '#/components/schemas/CreateOrderRequestMetadata'
        PaymentMethod:
          description: >-
            Obsolete: use PaymentMethods instead. This legacy field is still
            supported for backward compatibility.

            The Payment Method used in this purchase. Should be the more
            specific as possible (ie: instead of using "Credit Card" use "Visa
            Credit Card" and so on).

            This field can be used later on to create extra points purchase
            rules.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateOrderPaymentMethod'
        PaymentMethods:
          type: array
          description: >-
            Preferred field for the payment methods used in this purchase. Each
            item should be as specific as possible

            (ie: instead of using "Credit Card" use "Visa Credit Card" and so
            on).
          nullable: true
          xml:
            wrapped: true
          items:
            xml:
              name: CreateOrderPaymentMethod
            oneOf:
              - $ref: '#/components/schemas/CreateOrderPaymentMethod'
        Branch:
          description: >-
            A Branch is physical location or outlet of a store (loja, filial,
            etc). This is used to receive information of which store the
            purchase was made. It can be later used to create rules for points
            or filtering reports.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateOrderBranch'
        SalesPerson:
          description: >-
            A sales person is the person responsible for the sale. It can be
            used for filtering reports.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateOrderSalesPerson'
        TradePolicy:
          description: >-
            Optional trade policy (política comercial) of the sale, such as a
            full price store or an outlet store.

            It can be used to create extra points rules by trade policy.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateOrderTradePolicy'
        ExternalCoupon:
          type: string
          nullable: true
    BaseExternalApiResponseOfOrderEstimatedBonusResponse:
      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:
          description: Business payload returned by the endpoint.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/OrderEstimatedBonusResponse'
        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`.
    ProblemDetails:
      type: object
      additionalProperties:
        nullable: true
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
    ExternalCreateCustomerRequest:
      type: object
      description: Creater Customer body Request
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: 'This is the Id in the client store. '
        Name:
          type: string
          description: Customer name.
        Email:
          type: string
          description: Customer email.
          nullable: true
        Phone:
          type: string
          description: Customer Contact Phone.
          nullable: true
        BirthdayDate:
          type: string
          description: Customer Birthdate.
          format: date-time
          nullable: true
        SignupDate:
          type: string
          description: Date when the customer made the register on client store.
          format: date-time
          nullable: true
        Document:
          type: string
          description: Some document number from the customer, accepts any string.
          nullable: true
        IsEnrolled:
          type: boolean
          description: >-
            If true the customer is participating on the points plan from the
            store.
        EnrolledDate:
          type: string
          description: >-
            Date when the customer made entered into the program. Use the
            OrderPlacementDate if not informed.
          format: date-time
          nullable: true
    CreateProductRequest:
      type: object
      description: Product model.
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: Id from the client store.
        Title:
          type: string
          description: Product Name
        Url:
          type: string
          description: Direct url to the product on the client store.
          nullable: true
        ImageUrl:
          type: string
          description: Product img url.
          nullable: true
        IsActive:
          type: boolean
          description: if true the product is active on the store.
        ProductPrice:
          type: number
          description: >-
            How much the customer paid for this product. If it is not null and
            not zero it can be used with extra points for products rule
          format: decimal
          nullable: true
        ProductBrand:
          description: Product Brand
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateProductBrandRequest'
        ProductCategory:
          description: >-
            Product Category. Supports hierarchical categories with parent
            references.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateProductCategoryRequest'
    CreateOrderRequestMetadata:
      type: object
      additionalProperties: false
      properties:
        Name:
          type: string
        Value:
          type: string
    CreateOrderPaymentMethod:
      type: object
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: >-
            The If of the Payment method. Can be any string unique to this
            Payment Method. If no Id is available you can used the Payment
            Method Name as Id
        Name:
          type: string
          description: >-
            Name of the payment method used. It could be shown to the customer
            so it should be meaningful.
        PaidAmount:
          type: number
          description: Optional amount paid using this payment method.
          format: decimal
          nullable: true
    CreateOrderBranch:
      type: object
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: >-
            This is the Id of the branch (filial, loja, etc) in the client
            store. Can be any string.
        Name:
          type: string
          description: This is the name of the branch. Can be any string possible
    CreateOrderSalesPerson:
      type: object
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: This is the Id of the Sales Person. Can be any string or number.
        Name:
          type: string
          description: This is the name of the sales person. Can be any string.
    CreateOrderTradePolicy:
      type: object
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: >-
            Id of the trade policy in the client system. Can be any string, such
            as `FULLPRICE` or `OUTLET`.

            Trade policies received from the ecommerce platform share the same
            ids, so use a distinct id unless the rule should be shared.
          example: OUTLET
        Name:
          type: string
          description: >-
            Name of the trade policy shown in the BonifiQ panel. When empty,
            `OriginalId` is used as the name.
          nullable: true
          example: Loja Outlet
    OrderEstimatedBonusResponse:
      type: object
      description: >-
        Estimate of the bonus (points and cashback) the customer will earn for
        this order.

        It is a simulation made when the order is saved: the bonus actually
        granted may differ

        (eg: rules changed, order cancelled, bonus still pending its release
        date).
      additionalProperties: false
      properties:
        GenerateBonus:
          type: boolean
          description: >-
            `true` when this order is expected to generate a bonus for the
            customer.

            `false` when it is not expected to generate one (eg: customer not
            enrolled, order not eligible, no points)

            or when the estimate could not be calculated. In both cases the
            order itself was saved successfully.
        EstimatedPoints:
          type: integer
          description: >-
            Estimated points the customer will earn. `0` when `GenerateBonus` is
            `false`.
          format: int32
        EstimatedCashback:
          type: number
          description: >-
            Estimated points converted to cashback using the store's active
            cashback reward,

            rounded down like the customer's cashback balance (eg: 45 points at
            R$ 0,10 each = R$ 4,00).

            `0` when the store has no active cashback reward or `GenerateBonus`
            is `false`.
          format: decimal
        EstimatedCashbackFormatted:
          type: string
          description: >-
            `EstimatedCashback` formatted in the store's currency and culture
            (eg: "R$ 4,00"). Use it only for display.
        DaysToAvailable:
          type: integer
          description: >-
            Days after the order is completed until the points are granted and
            available to use

            (the store's grant delay for this sales channel, or an advanced
            rule's). `0` means right after the order is completed.
          format: int32
        EstimatedAvailableDate:
          type: string
          description: >-
            Estimated date (UTC) from which the points are available to use:
            `OrderCompletedDate` + `DaysToAvailable`.

            `null` when the order is not completed yet or `GenerateBonus` is
            `false`.
          format: date-time
          nullable: true
        ExpirationDays:
          type: integer
          description: >-
            How many days the points are valid after being granted. `null` when
            the store's points do not expire or `GenerateBonus` is `false`.
          format: int32
          nullable: true
        EstimatedExpirationDate:
          type: string
          description: >-
            Estimated date (UTC) when the points expire, counted from
            `EstimatedAvailableDate`.

            `null` when the points do not expire, the order is not completed yet
            or `GenerateBonus` is `false`.
          format: date-time
          nullable: true
    ExternalApiResponseSeverity:
      type: integer
      description: |-
        0 = Success
        1 = Warning
        2 = Error
      x-enumNames:
        - Success
        - Warning
        - Error
      enum:
        - 0
        - 1
        - 2
    CreateProductBrandRequest:
      type: object
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: Id from the client store
        Name:
          type: string
          description: Brand Name
    CreateProductCategoryRequest:
      type: object
      description: Product Category model with support for hierarchical categories.
      additionalProperties: false
      properties:
        OriginalId:
          type: string
          description: Id from the client store
        Name:
          type: string
          description: Category Name
        Description:
          type: string
          description: Category Description
          nullable: true
        ParentCategory:
          description: |-
            Parent Category. Use this to create a category tree.
            For example, if you have Electronics > Smartphones > Android,
            the Android category would have Smartphones as its ParentCategory,
            and Smartphones would have Electronics as its ParentCategory.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CreateProductCategoryRequest'
  securitySchemes:
    Basic Authentication:
      type: http
      description: Use API Basic Auth Keys
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.