# Reconcile Group Payments (/docs/guides/group-payment/group-payment-reconcilation) 

# 📊 Reconcile a Group Payment Session [#-reconcile-a-group-payment-session]

When multiple customers contribute to a group payment, each payment is tracked individually. To support reconciliation, Hands In provides a `referenceId` that can be used to identify and trace payments across systems.

By default, any `payment` made under a group payment session will have a `referenceId` formatted as:

```
{groupPaymentId}_{customerId}
```

Where:

* `groupPaymentId` is the unique ID of the group payment session.
* `customerId` associated with the participant in the group who the payment is for.

## 🧾 Using `referenceId` for Group Payments [#-using-referenceid-for-group-payments]

When creating a group payment session, you may pass a custom `referenceId`. This value will be prefixed to all payment `referenceId`s for a particular group order, allowing you to easily match incoming payments with your system records.

### Example Create Request with `referenceId` [#example-create-request-with-referenceid]

<Tabs items="[&#x22;curl&#x22;, &#x22;Node.js (fetch)&#x22;, &#x22;Python (requests)&#x22;]">
  <Tab value="curl">
    ```bash
    curl --request POST \
      --url https://api.sandbox.handsin.com/v1/group-payments \
      --header "Accept: application/json" \
      --header "Content-Type: application/json" \
      --header "x-api-key: <your-api-key>" \
      --data '{
        "idempotencyKey": "example_unique_idempotency_key",
        "referenceId": "YOUR_UNIQUE_MERCHANT_ORDER_REF",
        "amountMoney": {
          "amount": 2000,
          "currency": "GBP"
        },
        "customer": {
          "firstName": "Example",
          "email": "example@handsin.com"
        },
        "lineItemParams": [
          {
            "item": {
              "name": "Example LineItem",
              "amountMoney": {
                "amount": 1000,
                "currency": "GBP"
              }
            },
            "quantity": 2
          }
        ],
        "splitType": "BY_ITEM"
      }'
    ```
  </Tab>

  <Tab value="Node.js (fetch)">
    ```javascript
    const url = "https://api.sandbox.handsin.com/v1/group-payments";

    const payload = {
      idempotencyKey: "example_unique_idempotency_key",
      referenceId: "YOUR_UNIQUE_MERCHANT_ORDER_REF",
      amountMoney: {
        amount: 2000,
        currency: "GBP",
      },
      customer: {
        firstName: "Example",
        email: "example@handsin.com",
      },
      lineItemParams: [
        {
          item: {
            name: "Example LineItem",
            amountMoney: {
              amount: 1000,
              currency: "GBP",
            },
          },
          quantity: 2,
        },
      ],
      splitType: "BY_ITEM",
    };

    try {
      const response = await fetch(url, {
        method: "POST",
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
          "x-api-key": "<your-api-key>",
        },
        body: JSON.stringify(payload),
      });

      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error("Request failed:", error.message);
    }
    ```
  </Tab>

  <Tab value="Python (requests)">
    ```python
    import requests

    url = "https://api.sandbox.handsin.com/v1/group-payments"
    headers = {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "x-api-key": "<your-api-key>"
    }
    payload = {
        "idempotencyKey": "example_unique_idempotency_key",
        "referenceId": "YOUR_UNIQUE_MERCHANT_ORDER_REF",
        "amountMoney": {
            "amount": 2000,
            "currency": "GBP"
        },
        "customer": {
            "firstName": "Example",
            "email": "example@handsin.com"
        },
        "lineItemParams": [
            {
                "item": {
                    "name": "Example LineItem",
                    "amountMoney": {
                        "amount": 1000,
                        "currency": "GBP"
                    }
                },
                "quantity": 2
            }
        ],
        "splitType": "BY_ITEM"
    }

    response = requests.post(url, headers=headers, json=payload)
    print(response.json())
    ```
  </Tab>
</Tabs>

Now any `payments` made into this group payment session will have the following `referenceId` - `YOUR_UNIQUE_MERCHANT_ORDER_REF_{customerId}`

where `YOUR_UNIQUE_MERCHANT_ORDER_REF` is the value you passed in to the `referenceId` field when creating the group payment

## 🔍 Look Up Payments Via Your Merchant Dashboard [#-look-up-payments-via-your-merchant-dashboard]

<img src="/docs-assets/70a4d5610c47bd4cc2000dbdeec330a053551be9b72ceaa7221a10a80355b3d8-referenceId-payment-lookup.PNG" />

<br />

Using the table column 'reference Id' - You can search and filter your payments by your system's referenceId directly from your [Hands In Payments Dashboard](https://merchant.handsin.com/dashboard/payments)

In the example above, 3 payments out of many payments were found, with the following `referenceId`'s:

| Card # | Example Reference ID                           |
| ------ | ---------------------------------------------- |
| 1      | YOUR\_UNIQUE\_MERCHANT\_ORDER\_REF\_CUSTOMER-1 |
| 2      | YOUR\_UNIQUE\_MERCHANT\_ORDER\_REF\_CUSTOMER-2 |
| 3      | YOUR\_UNIQUE\_MERCHANT\_ORDER\_REF\_CUSTOMER-3 |

***

✅ That's it — you've learned how to use `referenceId` to help reconcile payments from a group payment session using your dashboard.

➡️ For real-time reconciliation and tracking of events, we recommend setting up [webhook notifications](/docs/guides/group-payment/group-payment-webhooks) to receive updates as they happen.\
Alternatively, API integrations can poll the group payment session and fetch each payment for that session using the values from the group payment's `memberPayments` field and in conjunction with the [retrieve payment endpoint](/docs/API/v1/getPayment)
