# Collecting Tips

Learn how to include tips when processing payments.

Sellers can easily collect tips with Finix while processing both:

- [Online Payments](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#tipping-online-payments)
- [In-Person Payments](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#tipping-in-person-payments)

## Tipping Online Payments

There are two ways to collect tips while processing Online Payments. Both methods rely on when and how the tip is requested from the cardholder.

- If the seller wants [to collect the tip while the buyer makes their payment,](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#time-of-payment) include the tip in `amount` when creating the `Authorization` or `Transfer`. This is the most common method of collecting tips when processing Online Payments.

- If the seller wants [to collect the tip after providing a service or good,](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#after-the-payment) first create an `Authorization` to verify funds are available. Then create a `Transfer` that includes the tip in `amount` along with the cost of the transaction.

### Time of Payment

Here's an example of a `Transfer` that processes a $20 transaction with a $2 tip. The `amount` represents the total amount (cost of the goods or services + tip) that's collected from the cardholder.

To track the tip within Finix, create a tag. Include the part of the `amount` that is a tip in the `tags` field like the example below.

- Example
- API Definition

post  
    /transfers

- Sandbox server  
  https://finix.sandbox-payments-api.com/transfers

cURL

```bash
curl -i -X POST \
  -u USfdccsr1Z5iVbXDyYt7hjZZ:313636f3-fac2-45a7-bff7-a334b93e7bda \
  https://finix.sandbox-payments-api.com/transfers \
  -H 'Content-Type: application/json' \
  -H 'Finix-Version: 2022-02-01' \
  -d '{\n    "amount": 5000,\n    "currency": "CAD",\n    "merchant": "string",\n    "source": "PIxxxxxxxxxxxxxxxxxx"\n  }'
```

### After the Payment

To collect the tip after a service or good is provided, first create an `Authorization` to confirm the `Payment Instrument` has enough funds.

Below is an example of a transaction that is $22 and will be collecting a tip of $8.

The first `Authorization` assumes a general tip of $5.

```bash
curl https://finix.sandbox-payments-api.com/authorizations \
  -H 'Content-Type: application/json' \
  -H 'Finix-Version: 2022-02-01' \
  -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \
  -X POST \
  -d '{\n    "amount": 2700,\n    "currency": "USD",\n    "merchant": "MUeDVrf2ahuKc9Eg5TeZugvs",\n    "source": "PIe2YvpcjvoVJ6PzoRPBK137"\n  }'
```

After the service or good is provided, if the total `amount` with the tip included is:

|  |  |
| --- | --- |
| Less than the initial `Authorization` | [Capture the initial `Authorization`](https://docs.finix.com/guides/online-payments/payment-features/auth-and-captures#capturing-an-authorization) for that smaller `amount`. |
| Greater than the initial `Authorization` | [Void the initial `Authorization`](https://docs.finix.com/guides/online-payments/payment-features/auth-and-captures#void-an-authorization), and create a `Transfer` for that greater `amount`. |

If the buyer tips $8, here's the `Transfer` you create after voiding the initial `Authorization`.
Include the tip the buyer provided in `amount` (cost of the goods or services + tip).

To track the tip within Finix, create a tag. Include the part of the `amount` that is a tip in the `tags` field like the example below.

- Example
- API Definition

post  
    /transfers

- Sandbox server  
  https://finix.sandbox-payments-api.com/transfers

cURL

## Tipping In-Person Payments

There are two ways to collect tips while processing In-Person Payments:

|  |  |
| --- | --- |
| [Tipping on the Receipt](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#tipping-on-the-receipt) | The tip is collected when the initial `Authorization` is captured. The buyer usually writes the tip on the receipt; this is one of the most widely used options to collect tips. |
| [Tipping on Point of Sale Software](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#tipping-on-point-of-sale-software) | The buyer enters the tip on your point-of-sale software or app. The buyer usually enters the tip on a tablet like an iPad or an Android device. |

### Tipping on the Receipt

To collect a tip on a receipt:

|  |  |
| --- | --- |
| 1\. [Create an `Authorization`](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#create-an-authorization) | Create an `Authorization` for the transaction `amount`. |
| 2\. [Collect the buyer's tip](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#collect-the-tip) | At a later point, collect the buyer's tip either digitally or from the receipt. |
| 3\. [Capture the `Authorization`](https://docs.finix.com/guides/online-payments/payment-features/collecting-tips#capture-the-authorization) | Capture the `Authorization` for the transaction `amount` including the tip. |

#### Create an Authorization

The following authorizes a `Payment Instrument` for a restaurant bill of $20. This `amount` doesn't include the buyer's tip.

```bash
curl https://finix.sandbox-payments-api.com/authorizations \
  -H 'Content-Type: application/json' \
  -H 'Finix-Version: 2022-02-01' \
  -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \
  -X POST \
  -d '{\n    "amount": 2000,\n    "currency": "USD",\n    "device": "DVf2H8sh4LZZC52GTUrwCPPf",\n    "operation_key": "CARD_PRESENT_AUTHORIZATION"\n  }'
```

A successful response returns a 200 and the newly created `Authorization` resource.

```json
{
    "id": "AUarp7Pz21Low4u2Urw5Ub4W",
    "created_at": "2019-04-29T20:44:00.13Z",
    "updated_at": "2022-10-10T05:59:17.59Z",
    "amount": 2000,
    "currency": "USD",
    "state": "SUCCEEDED",
    "tags": {
        "TicketNumber": "45878"
    },
    "_links": {
        "self": {
            "href": "https://finix.sandbox-payments-api.com/authorizations/AUbrumLihwhdLixtbU1mfMiF"
        }
    }
}
```

#### Collect the Tip

Collect the dollar amount of the tip from the _Tip_ written on the receipt, or from the tip the buyer entered into your app.

If you are using a `FINIX_V1` / `DUMMY` terminal with printing capabilities, you can enable/disable the tip field on the receipt with the below API call:

```bash
curl https://finix.sandbox-payments-api.com/devices/DVf2H8sh4LZZC52GTUrwCPPf \
  -H 'Content-Type: application/json' \
  -H 'Finix-Version: 2022-02-01' \
  -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \
  -X PUT \
  -d '{\n    "configuration": {\n      "display_tip_on_receipt": true\n    }\n  }'
```

#### Capture the Authorization

Capture the `Authorization` with the tip included in `capture_amount`. The `capture_amount` should include the total amount of funds you’d like to collect from the cardholder.

In this example, the cardholder tipped $2, so the `capture_amount` for a $20 bill will be $22. We also capture the tip amount in the `tags` to track and record.

```bash
curl https://finix.sandbox-payments-api.com/authorizations/AUarp7Pz21Low4u2Urw5Ub4W \
  -H 'Content-Type: application/json' \
  -H 'Finix-Version: 2022-02-01' \
  -u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e \
  -X PUT \
  -d '{\n    "capture_amount": 2200,\n    "tags": {\n      "tip": "200"\n    }\n  }'
```

A successful response returns a 200 and the `Authorization` resource.

```json
{
    "id": "AUarp7Pz21Low4u2Urw5Ub4W",
    "created_at": "2022-10-06T20:22:42.25Z",
    "updated_at": "2022-10-07T17:09:22.85Z",
    "amount": 2200,
    "currency": "USD",
    "tags": {
        "tip": "200"
    }
}
```
