# Rebate estimate

**JS library only.**

A rebate estimate, sometimes called a quote, lets providers and patients retrieve an estimate of
the gap amount for a HealthPoint claim. It works much like a [claim](/docs/in-person-payments/pay-in-person/features/private-health-fund/getting-started), but with
no financial settlement.

The process is similar to a claim:

1. Enter and review the health service details in the PMS.
2. Swipe or tap the patient's health fund membership card.
3. Enter the patient number if the PMS hasn't already sent it.
4. Process the rebate estimate and receive a real-time response from the health fund.
5. Print the claim assessment receipt and display the result in the PMS.


The patient doesn't need to accept or decline a rebate estimate, and a rebate estimate can't be
voided or cancelled.

A rebate estimate is a point-in-time assessment. There's no guarantee the health fund will honour it
beyond the day it was processed. During periods of high transaction volume at a health fund, a
rebate estimate can queue for longer than a claim, so you may not be able to submit a rebate
estimate and then immediately submit a claim. The claim may be declined, so you may need to wait.

## Request

`initiateHealthPointRebateEstimate(requestParams, transactionCallbacks)` tells the terminal to start
a HealthPoint rebate estimate.

The request parameters are the same as for `initiateHealthPointClaim`. See
[Getting started](/docs/in-person-payments/pay-in-person/features/private-health-fund/getting-started) for the parameters and the claim items fields.


```javascript
iclientWithUI.initiateHealthPointRebateEstimate({
  providerId: "2147661H",
  serviceType: "D",
  claimItemsCount: "2",
  totalClaimAmount: "25000",
  claimItems: [
    {
      "claimAmount": "10000",
      "serviceCode": "00001",
      "description": "SKULL XRAY",
      "serviceReference": "01",
      "patientId": "02",
      "serviceDate": "20191209"
    }, {
      "claimAmount": "15000",
      "serviceCode": "00001",
      "description": "SKULL XRAY",
      "serviceReference": "01",
      "patientId": "02",
      "serviceDate": "20191209"
    }
  ]},
  {transactionCompleteCallback: yourPosCode.handleComplete,
   statusMessageCallback: yourPosCode.handleComplete,
   questionCallback: yourPosCode.questionAsked });
```

## Callbacks

The callbacks are the same as for `initiateHealthPointClaim`, except there's no question for the
patient to accept or decline, as there is in a claim.

## Response

The response is the same as for a claim. A `healthpointSettlementDateTime` may be shown, but a rebate
estimate doesn't trigger a financial settlement to the provider.


```json
{
    "result": "APPROVED",
    "transactionId": "55083fb77c7e6d455b68ec9bc9e3732dfcaa",
    "healthpointRefTag": "2257825",
    "healthpointTotalBenefitAmount": "25000",
    "healthpointSettlementDateTime": "20191209064416",
    "healthpointTerminalDateTime": "20191209064416",
    "healthpointMemberNumber": "0000000000",
    "healthpointProviderId": "2147661H",
    "healthpointServiceType": "D",
    "healthpointClaimItems": [
        {
            "claimAmount": "10000",
            "serviceCode": "00001",
            "description": "SKULL XRAY",
            "serviceReference": "01",
            "patientId": "02",
            "serviceDate": "20191209"
        },
        {
            "claimAmount": "15000",
            "serviceCode": "00001",
            "description": "SKULL XRAY",
            "serviceReference": "01",
            "patientId": "02",
            "serviceDate": "20191209"
        }
    ],
    "healthpointGapAmount": "0",
    "healthpointPhfResponseCode": "00",
    "healthpointPhfResponseCodeDescription": "APPROVED",
    "healthpointHealthFundName": "ISOFT FUND",
    "healthpointHealthFundIdentifyingDigits": "0099"
}
```

## Demo

[Demo - JS Fiddle](https://jsfiddle.net/IntegrationSupport/jyr6tmfs/6/)

Don't click **Save** if you make changes in the JS Fiddle sample app. Click **Run** instead.
Clicking Save may break the fiddle's functionality.