# 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 %}
