# 2. Payment-Based

## **Confirm Payment Based on Payment**

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

{% hint style="info" %}
**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="79">Type</th><th width="107">Compulsory</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="255.3359375">Parameter</th><th width="140">Type</th><th width="144.71875">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>PaymentId</td><td>int</td><td>Yes</td><td>Ödemenin Paywall tarafındaki Id bilgisi kullanılmalıdır</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 %}


---

# 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/payment-service/14.-payment-confirmation/2.-platform-calculator/2.-payment-based.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.
