> 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/1.-product-based.md).

# 1. Product-Based

## **Confirm Payment Based on Product**

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

{% 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="181.3671875">Parameter</th><th width="110.67578125">Type</th><th width="146.59765625">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="246.5546875">Parameter</th><th width="126.21875">Type</th><th width="148.57421875">Compulsory</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>ProductIds</td><td>List&#x3C;int></td><td>Yes</td><td><p>The ID information of the product(s) sent during the payment must be used in the Paywall system. This ID is returned in the response related to the product.</p><p></p><p>If you cannot store these ID details on your side, you can use the "Payment-Based" confirmation method.</p></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><p>SameReflectionDateWithMember</p><p></p></td><td>bool</td><td>No</td><td><p>If you want your marketplace earnings to be realized on the same day as your sub-merchant’s settlement date, you must send this parameter as <strong>true</strong>.</p><ul><li><p>The settlement day is always based on the sub-merchant’s settlement date.</p><ul><li>For example: if the sub-merchant’s settlement date is <strong>01.01</strong> and yours is <strong>05.01</strong>, with this parameter both the sub-merchant’s and the platform’s settlement date will be <strong>01.01</strong>.</li></ul></li><li>This parameter is valid only for a single sub-merchant. If there is more than one sub-merchant in the payment request, the parameter will be ignored.</li></ul></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": 1784197,
    "SameReflectionDateWithMember": false,
    "ProductIds": [
        1626127,
        1626128,
        1626129,
        1626130,
        1626131
    ],
    "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": 1626127
            },
            {
                "ProductId": 1626128
            },
            {
                "ProductId": 1626129
            },
            {
                "ProductId": 1626130
            },
            {
                "ProductId": 1626131
            }
        ],
        "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": 1626127,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626128,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626129,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626130,
                "Reason": "This product already approved"
            },
            {
                "ProductId": 1626131,
                "Reason": "This product already approved"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}
