# 1. Generate

## Generate Common Page Payment

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/checkout/generate`

{% hint style="info" %}
**Important**: In order to use this service, you need to send the '**apikeypublic**' and '**apiclientpublic**' parameters in the 'Header' field.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

**Parameters that should be sent to the service are as follows:**

<details>

<summary><strong>Required header parameters</strong></summary>

<table><thead><tr><th width="160.65625">Parameter</th><th width="131.5546875">Type</th><th width="181.59375">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>The Public Key you have obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>Public Client that you have obtained from the merchant panel.</td></tr></tbody></table>

</details>

<details>

<summary><strong>Request body parameters</strong></summary>

<table><thead><tr><th width="259">Parameter</th><th width="152">Type</th><th width="138">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>UniqueCode</td><td>string</td><td>Yes</td><td>The tracking/order/cart code of the payment on your side</td></tr><tr><td>Amount</td><td>decimal</td><td>Yes</td><td>Product/Service Amount</td></tr><tr><td>LanguageId</td><td>int</td><td>No</td><td>You can change the language settings of the shared payment page according to your user segment.<br><br>See: <a href="/pages/zqqIsXsXP4dw7u3h7GLg">Launguage Options</a></td></tr><tr><td>CurrencyId</td><td>int</td><td>Yes</td><td>Currency<br><br><a href="https://paywall.gitbook.io/tr/sistem-verileri/para-birimleri">https://paywall.gitbook.io/tr/sistem-verileri/para-birimleri</a></td></tr><tr><td>CallbackSupport</td><td>bool</td><td>Yes</td><td>Successful payment results are sent to an address via POST as a callback</td></tr><tr><td>CallbackAddress</td><td>string</td><td>No</td><td>The address where successful payment results will be sent</td></tr><tr><td>InstallmentSupport</td><td>bool</td><td>Yes</td><td>Should installment options be displayed on the screen?</td></tr><tr><td>InstallmentDynamic</td><td>bool</td><td>No</td><td>Installment options can be listed using your active installments among active providers. This listing is based on the card family entered by the user</td></tr><tr><td>SuccessBackUrl</td><td>string</td><td>Yes</td><td>The page to redirect after a successful payment</td></tr><tr><td>FailBackUrl</td><td>string</td><td>Yes</td><td>The page to redirect after a failed payment</td></tr><tr><td>Force3D</td><td>bool</td><td>Yes</td><td>Should the user be forced to use “Secure Payment” on the shared payment page?</td></tr><tr><td>ShowProduct</td><td>bool</td><td>Yes</td><td>Should the products subject to payment be listed on the shared payment page?</td></tr><tr><td>ExpireDateTime</td><td>datetime</td><td>No</td><td>The lifetime of the shared payment page. It can be defined by you; if not specified, it defaults to 10 minutes</td></tr><tr><td>Products</td><td>List&#x3C;<mark style="color:blue;">Products</mark>></td><td>Yes</td><td>Product information subject to payment (displayed on the shared payment page if permitted)</td></tr><tr><td>Customer</td><td><h4><mark style="color:blue;">Customer</mark></h4></td><td>Yes</td><td>Customer information subject to payment (not displayed on the shared payment page; used in reporting)</td></tr><tr><td>CardWallSupport</td><td>bool</td><td>No</td><td>Can be used to enable saved card support on the shared payment page</td></tr><tr><td>CardWallRelationalId1</td><td>string</td><td>No</td><td>The first unique identifier to associate the card</td></tr><tr><td>CardWallRelationalId2</td><td>string</td><td>No</td><td>The second unique identifier to associate the card (all fields must be sent during listing)</td></tr><tr><td>CardWallRelationalId3</td><td>string</td><td>No</td><td>The third unique identifier to associate the card (all fields must be sent during listing)</td></tr><tr><td>PayWatchSupport</td><td>bool</td><td>No</td><td>Should payments be monitored with PayWatch? (Only those in “Started” status)</td></tr><tr><td>PayWatchMin</td><td>short</td><td>Yes (Conditional)</td><td>After how many minutes should PayWatch process the payment?<br><br><mark style="color:red;">Minimum: 5 | Maksimum: 20</mark></td></tr><tr><td>PayWatchCallbackAddress</td><td>string</td><td>No</td><td>If provided, a callback will be sent to the specified address after any change detected by PayWatch in the payment</td></tr><tr><td>MasterpassSupport</td><td>bool</td><td>No</td><td><p>To enable <strong>Masterpass</strong> support on the shared payment page, you must send the relevant parameter as <code>true</code></p><p><br></p><p><strong>Note:</strong> In addition to sending this parameter as <code>true</code>, you must also activate the <strong>Masterpass</strong> plugin on the Virtual POS providers page in the Paywall panel</p></td></tr><tr><td>UseMasterpassAlternative</td><td>bool</td><td>No</td><td>If you want to use Virtual POS providers connected in the Paywall panel (excluding Masterpass) for transactions that are not registered in Masterpass, entered manually, or not intended to be saved by the user in Masterpass, this parameter must be sent as <code>true</code></td></tr><tr><td>RouteGroupKey</td><td>string</td><td>Yes/No</td><td>If payments are to be received via <strong>RouteGroup</strong>, the RouteGroup key information must be provided with this parameter</td></tr><tr><td>SupportCampaign</td><td>bool</td><td>No</td><td><p>To list campaigns related to the card used on the shared payment page, the relevant parameter must be sent as <code>true</code></p><p><br></p><p><strong>Note:</strong> To perform campaign queries, at least one of the connected Virtual POS providers in the Paywall panel must be marked as a <strong>Campaign POS</strong></p></td></tr><tr><td>SupportReward<br><br><mark style="color:orange;"><strong><code>*Comming Soon</code></strong></mark></td><td>bool</td><td>No</td><td>To enable the use of reward points for the relevant card information on the shared payment page, the parameter must be sent as <code>true</code></td></tr><tr><td>ProviderBased</td><td>bool</td><td>Yes</td><td>“true” is returned when the payment must be processed through a specific virtual POS provider; in this case, the target provider is selected using the ProviderKey.</td></tr><tr><td>ProviderKey</td><td>string</td><td>Yes/No</td><td>Required when <code>ProviderBased = true</code> i: The key value of the provider defined in the panel. If<code>ProviderBased = false</code> , this is typically left blank.</td></tr><tr><td>ProviderCondition</td><td>object</td><td>No</td><td>Additional conditions for provider selection. For example, the <code>InstallmentReceiverAddressSupport</code> parameter can be used to define conditions for a specific number of installments; if not used, it can be set to <code>null</code>.</td></tr><tr><td>ReceiverAddressSupport</td><td>bool</td><td>Yes</td><td>Determines whether the recipient address fields are displayed on the shared payment page.</td></tr><tr><td>ReceiverInfoSupport</td><td>bool</td><td>Yes</td><td>Determines whether the fields for recipient information are displayed on the shared payment page.</td></tr><tr><td>RegionId</td><td>short</td><td>No</td><td>The region ID if region selection is to be used. If not provided, the default behavior is used.</td></tr><tr><td>InterestConfirmationPopup</td><td>bool</td><td>Yes</td><td>Determines whether to display a confirmation window regarding the commission/interest to the user.</td></tr><tr><td>SkipInterest</td><td>bool</td><td>Yes</td><td>If true, skip behavior is triggered in the interest/commission flow under certain conditions; the specific condition can be specified using the <code>SkipInterestCondition.</code></td></tr><tr><td>SkipInterestCondition</td><td>object</td><td>No</td><td>Used in conjunction with <code>SkipInterest</code> The Installment parameter (byte, nullable): Specifies which installment option the skip applies to; set to null if not used.</td></tr></tbody></table>

</details>

<details>

<summary><mark style="color:blue;"><strong>Products</strong></mark><strong> parameter above</strong></summary>

<table><thead><tr><th width="197">Parameter</th><th width="129">Type</th><th width="144">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>ProductId</td><td>string</td><td>Yes</td><td>ID of your product on your system</td></tr><tr><td>ProductImage</td><td>string</td><td>No</td><td>URL of your product image</td></tr><tr><td>ProductName</td><td>string</td><td>Yes</td><td>Your product name</td></tr><tr><td>ProductCategory</td><td>string</td><td>Yes</td><td>Category of your product</td></tr><tr><td>ProductDescription</td><td>string</td><td>Yes</td><td>Description of your product</td></tr><tr><td>ProductAmount</td><td>decimal</td><td>Yes</td><td>The amount of your product</td></tr><tr><td>MemberId</td><td>int</td><td>No</td><td>It is mandatory for the Marketplace model. It must be filled with the MemberId information of the sub-merchant in the Paywall system.</td></tr><tr><td>MemberEarningCalculated</td><td>bool</td><td>No</td><td>In the marketplace scope, if you have calculated the sub-merchant's entitlement, you should send this parameter as true.</td></tr><tr><td>MemberEarning</td><td>decimal</td><td>No</td><td>In the marketplace scope, if you have calculated the sub-merchant's entitlement, you should send this parameter with the entitlement value to Paywall.</td></tr><tr><td>MemberCustomCommission</td><td>bool</td><td>No</td><td>In the marketplace scope, this is the parameter used if you want to specify a commission for the sub-merchant for this particular sale.</td></tr><tr><td>MemberCommission</td><td>decimal</td><td>No</td><td>In the marketplace scope, this is the parameter where the commission value is sent if you want to specify a commission for the sub-merchant for this particular sale.</td></tr></tbody></table>

</details>

<details>

<summary><mark style="color:blue;"><strong>Customer</strong></mark><strong> parameter above</strong></summary>

<table><thead><tr><th width="187">Parameter</th><th width="129">Type</th><th width="150">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>FullName</td><td>string</td><td>Yes</td><td>Customer name/surname</td></tr><tr><td>Phone</td><td>string</td><td>Yes</td><td>Customer phone number</td></tr><tr><td>Email</td><td>string</td><td>Yes</td><td>Customer e-mail</td></tr><tr><td>Country</td><td>string</td><td>No</td><td>Country</td></tr><tr><td>City</td><td>string</td><td>No</td><td>City</td></tr><tr><td>Address</td><td>decimal</td><td>No</td><td>Full address</td></tr><tr><td>IdentityNumber</td><td>string</td><td>No</td><td>Individual Customer</td></tr><tr><td>TaxNumber</td><td>string</td><td>No</td><td>Corporate Customer</td></tr><tr><td>CustomerId</td><td>string</td><td>Yes/No</td><td><p>You must fill this field with the payer user's ID in your system.</p><p></p><p><strong>Note:</strong> Required for Masterpass</p></td></tr></tbody></table>

</details>

**An example JSON to be sent to the service is as follows:**

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

```json
{
    "UniqueCode": "{{$guid}}",
    "Amount": 10.0,
    "CurrencyId": 1,
    "LanguageId": 1,
    "CallbackSupport": true,
    "PayWatchSupport": true,
    "CallbackAddress": "https://yourwebservice.com/callback",
    "PayWatchMin": 5,
    "PayWatchCallbackAddress": "https://yourwebservice.com/callback/paywatch",
    "SuccessBackUrl": "https://yourwebservice.com/callback/success",
    "FailBackUrl": "https://yourwebservice.com/callback/unsuccessful",
    "Force3D": false,
    "InstallmentSupport": true,
    "InstallmentDynamic": true,
    "CardWallSupport": false,
    "CardWallRelationalId1": "user-id",
    "CardWallRelationalId2": null,
    "CardWallRelationalId3": null,
    "ShowProduct": true,
    "ReceiverInfoSupport": false,
    "ReceiverAddressSupport": false,
    "RegionId": null,
    "ProviderBased": false,
    "ProviderKey": "",
    "ProviderCondition": {
      "Installment": null
    },
    "InterestConfirmationPopup": true,
    "SkipInterest": false,
    "SkipInterestCondition": null,
    "Customer": {
        "FullName":"{{$randomFirstName}}",
        "Phone":"905123456789", // Must for Masterpass
        "Email":"{{$randomEmail}}",
        "Country":"{{$randomCountry}}",
        "City":"{{$randomCity}}",
        "Address":"{{$randomStreetAddress}}",
        "IdentityNumber":"2523123412",
        "TaxNumber":"456345456",
        "CustomerId": "72845" // Must for Masterpass (Payer's userid in your system)
    },
    "Products": [
      {
       "MemberId": 12345,
       "MemberEarningCalculated": true,
       "MemberEarning": 96.39,
       "MemberCustomCommission": true,
       "MemberCommission": 2.61,
       "ProductId": "1",
       "ProductImage": "https://yourwebsite.com/photoimage",
       "ProductName": "1",
       "ProductCategory": "1",
       "ProductDescription": null,
       "ProductAmount": 10
      }
    ],
    "ExpireDateTime": null,
    "RouteGroupKey": "route-999",
    "MasterpassSupport": true, // If payment page will support Masterpass
    "UseMasterpassAlternative": true, // If payment page will support altervative providers than Masterpass
    "SupportCampaign": true,
    "SupportReward": false // Soon
  }
```

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

**The parameters returned from the service are as follows:**

<details>

<summary>Parameter Descriptions</summary>

| Parameter | Type   | Description                                                                                                                    |
| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| ErrorCode | int    | Error code. If the operation is successful, it returns '0'.                                                                    |
| Result    | bool   | Returns True or False. Transaction successful request returns 'true'                                                           |
| Message   | string | If the operation is wrong, this is the message about the error, it provides language support according to the local parameter. |
| Body      | string | Returns the payment link under the link parameter                                                                              |

</details>

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

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "Id": 13284456,
        "Guid": "a2319b22-b442-4b9d-bc87-b800be680761",
        "UniqueCode": "OAEASG54455565256792",
        "Amount": 25.0,
        "Link": "https://dev-checkout.itspaywall.com/checkout/?CheckoutId=a2319b22-b442-4b9d-bc87-b800be680761"
    }
}
```

{% 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/checkout-page-service/1.-generate.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.
