# 1. Perform Reconciliation

Perform Reconciliation

<mark style="color:green;">`POST`</mark> `{{Base Address}}/api/paywall/private/vpos/reconciliation/reconcile`

{% hint style="info" %}
Important: To use the Perform Reconciliation service, you need to send 'apikeyprivate' and 'apiclientprivate' parameters in the 'Header' field.

&#x20;[<mark style="color:green;">**PaymentPrivateAPI Address**</mark>](https://developer.paywall.one/ortam)
{% endhint %}

| Parameter        | Type   | Compulsory | Description                                          |
| ---------------- | ------ | ---------- | ---------------------------------------------------- |
| apikeyprivate    | string | Yes        | The Private Key obtained from the merchant panel.    |
| apiclientprivate | string | Yes        | The Private Client obtained from the merchant panel. |

{% hint style="info" %}
The reconciliation for each day can be performed after 00:30 midnight of the following day.\
Example: The reconciliation for 06.06.2024 can be performed after 00:30 on 07.06.2024.
{% endhint %}

{% hint style="info" %}
Once a reconciliation request is submitted and successfully processed, another reconciliation request cannot be submitted for the same day. However, if the reconciliation fails, a new request with different values can be submitted for the same day.
{% endhint %}

**The parameters that need to be sent to the service are as follows:**

| Parameter           | Type    | Compulsory | Description                                                 |
| ------------------- | ------- | ---------- | ----------------------------------------------------------- |
| Date                | Date    | Yes        | The day of reconciliation in the format yyyy-MM-dd          |
| TotalCount          | int     | Yes        | Total number of transactions in your system                 |
| TotalAmount         | decimal | Yes        | Total transaction amount in your system                     |
| SuccessfulCount     | int     | Yes        | Total number of successful transactions in your system.     |
| SuccessfulAmount    | decimal | Yes        | Total amount of successful transactions in your system.     |
| UnsuccessfulCount   | int     | Yes        | Total number of failed transactions in your system.         |
| UnsuccessfulAmount  | decimal | Yes        | Total amount of failed transactions in your system.         |
| RefundCount         | int     | Yes        | Total number of refund transactions in your system.         |
| RefundAmount        | decimal | Yes        | Total amount of refund transactions in your system.         |
| PartialRefundCount  | int     | Yes        | Total number of partial refund transactions in your system. |
| PartialRefundAmount | decimal | Yes        | Total amount of partial refund transactions in your system. |
| CancelCount         | int     | Yes        | Total number of canceled transactions in your system.       |
| CancelAmount        | decimal | Yes        | Total amount of canceled transactions in your system.       |

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "Date": "2024-05-07",
    "TotalCount": 4,
    "TotalAmount": 46.00,
    "SuccessfulCount": 0,
    "SuccessfulAmount": 0.00,
    "UnsuccessfulCount": 1,
    "UnsuccessfulAmount": 13.00,
    "RefundCount": 0,
    "RefundAmount": 0.00,
    "PartialRefundCount": 0,
    "PartialRefundAmount": 0.00,
    "CancelCount": 0,
    "CancelAmount": 0.00
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

{% endtab %}

{% tab title="GO" %}

{% endtab %}

{% tab title="Java" %}

{% endtab %}

{% tab title="PHP" %}

{% endtab %}

{% tab title="Python" %}

{% endtab %}

{% tab title="Ruby" %}

{% endtab %}

{% tab title="TypeScript" %}

{% endtab %}

{% tab title="Curl" %}

{% endtab %}
{% endtabs %}

**The response returned from the service:**

| Parameter | Type   | Description                                                                                                                           |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| Body      | object | Details regarding the reconciliation transaction are returned. You can create your objects with the following information.            |
| ErrorCode | int    | Error code. If the operation is successful, it returns a value of '0'.                                                                |
| Result    | bool   | It returns either true or false. If the operation is successful, it returns 'true'.                                                   |
| Message   | string | If the operation fails, this is the error message specified for that error, providing language support based on the locale parameter. |

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "Reconciliation result is success",
    "Body": {
        "IsReconciled": true,
        "IsSaved": true,
        "ExistsReconciliation": false,
        "OperationDateTime": "2024-06-07T20:11:55.3150056+03:00",
        "ReconciliationDate": "2024-06-07T20:11:55.3160313+03:00",
        "Merchant": {
            "TotalCount": 4,
            "TotalAmount": 46.00,
            "SuccessfulCount": 0,
            "SuccessfulAmount": 0.00,
            "UnsuccessfulCount": 1,
            "UnsuccessfulAmount": 13.00,
            "RefundCount": 0,
            "RefundAmount": 0.00,
            "PartialRefundCount": 0,
            "PartialRefundAmount": 0.00,
            "CancelCount": 0,
            "CancelAmount": 0.00
        },
        "Paywall": {
            "EndOfDayId": 3417,
            "TotalCount": 4,
            "TotalAmount": 46.00,
            "SuccessfulCount": 0,
            "SuccessfulAmount": 0.00,
            "UnsuccessfulCount": 1,
            "UnsuccessfulAmount": 13.00,
            "RefundCount": 0,
            "RefundAmount": 0.00,
            "PartialRefundCount": 0,
            "PartialRefundAmount": 0.00,
            "CancelCount": 0,
            "CancelAmount": 0.00
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.paywall.one/payment-orchestration-integration-document/wallet-services/reconciliation-service/virtual-pos/1.-perform-reconciliation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
