> For the complete documentation index, see [llms.txt](https://developer.paywall.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.paywall.one/payment-orchestration-integration-document/payment-service/14.-payment-confirmation/1.-paywall-calculator/2.-payment-based.md).

# 2. Payment-Based

## **Confirm Payment Based on Payment**

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/marketplace/approve/pw/payment`

{% hint style="info" %}
Önemli: **Ödeme** servisini kullanabilmeniz için 'Header' alanında '**apikeypublic**' ve '**apiclientpublic**' **Important:** To use the Payment service, you must include the **apikeypublic** and **apiclientpublic** parameters in the **Header** section.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

<table><thead><tr><th width="188">Parameter</th><th width="89.46875">Type</th><th width="152.796875">Compolsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>Public Client obtained from the merchant panel.</td></tr></tbody></table>

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

<table><thead><tr><th width="229.51953125">Parameter</th><th width="134">Type</th><th width="138.7890625">Compolsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>PaymentId</td><td>int</td><td>Yes</td><td>The payment's ID information on the Paywall side should be used.</td></tr><tr><td>Payout</td><td>PayoutModel</td><td>No</td><td><p>Settings that can be configured at the time of earnings distribution related to the payment are included under this parameter. For example, a special note can be added to the payment receipt at the time of the money transfer.</p><p></p><p>You can review the following JSON to see the values it accepts.</p></td></tr><tr><td>SameReflectionDateWithMember</td><td>bool</td><td>No</td><td><p>If you want your marketplace settlements to occur on the same day as the reflection date of your merchant, you must send this parameter as <strong>true</strong>.</p><p>The value date is always based on the merchant’s value date.<br>For example; if the merchant’s reflection date is <strong>01.01</strong> and yours is <strong>05.01</strong>, with this parameter both the merchant’s and the platform’s reflection date will be <strong>01.01</strong>.</p><p>This parameter is only valid for a single merchant. If there is more than one merchant included in the payment request, the parameter will be disabled.</p></td></tr></tbody></table>

**The example&#x20;**<mark style="color:green;">**JSON**</mark>**&#x20;and&#x20;**<mark style="color:green;">**sample codes**</mark>**&#x20;to be sent to the service are as follows:**

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

```json5
{
    "PaymentId": 1644501,
    "SameReflectionDateWithMember": false,
    "Payout": {
        "DescriptionApply": true,
        "Description": "Ödemeye özel para transferi açıklaması"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

```csharp
// Soon
```

{% endtab %}

{% tab title="GO" %}

```go
// Soon
```

{% endtab %}

{% tab title="Java" %}

```java
// Soon
```

{% endtab %}

{% tab title="PHP" %}

```php
// Soon
```

{% endtab %}

{% tab title="Python" %}

```python
// Soon
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
// Soon
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
// Soon
```

{% endtab %}

{% tab title="Curl" %}

```sh
// Soon
```

{% endtab %}
{% endtabs %}

**Response returned from the service:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a true or false value. Returns 'true' if the operation is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this is the message describing the error, and it supports localization based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>Detailed information about the transaction</td></tr></tbody></table>

{% hint style="success" %}
**Example response for a successful operation**
{% endhint %}

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

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Success": [
            {
                "ProductId": 1626132
            },
            {
                "ProductId": 1626133
            },
            {
                "ProductId": 1626134
            },
            {
                "ProductId": 1626135
            },
            {
                "ProductId": 1626136
            }
        ],
        "Fail": []
    }
}
```

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

{% hint style="danger" %}
**Example response for a failed operation**
{% endhint %}

{% tabs %}
{% tab title="JSON" %}

```json
{
    "ErrorCode": 1,
    "Result": false,
    "Message": "",
    "Body": {
        "Success": [],
        "Fail": [
            {
                "ProductId": 1626132,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626133,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626134,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626135,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626136,
                "Reason": "This product already approved"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}
