# 1. Sale

<mark style="color:green;">`POST`</mark> `{{Base Address}}/api/payment/sync/sale`

It will be sufficient to send a request to the address provided above. You can use the 'Base Address' as desired for both the Test and Production environments.

{% hint style="info" %}
Important: To use the **Sync Sale** service, you need to send the '**apikeyprivate**' and '**apiclientprivate**' parameters in the 'Header' section.

\
[<mark style="color:green;">**PhysicalAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

**The header information required to be sent to the service is as follows:**

<table><thead><tr><th width="243">Parameter</th><th width="106.33333333333331">Type</th><th width="153">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td>The Private Key obtained from your merchant panel.</td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>The Private Client obtained from your merchant panel.</td></tr></tbody></table>

**The body information that needs to be sent to the service is as follows:**

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

```json
{
    "TerminalId": "38e895c3-1a9a-4b73-8816-8557d1d031d6",
    // "TerminalTagCode": "",
    "MerchantUniqueCode": "{{$guid}}",
    "DisplayCode": "Kişisel Bakım",
    "Amount": 22,
    "CurrencyId": 1,
    "Methods": [
        {
            "PaymentMethodId": 1
        },
        {
            "PaymentMethodId": 2
        }
    ],
    "CallbackAddress": "https://webhook.site/276d912e-090e-461a-aad5-5f137ab03cf4",
    "SplitPaymentSupport": false,
    "Customer": {
        "Type": 1,
        "FirstName": "eda",
        "MiddleName": "seda",
        "LastName": "meda",
        "CompanyName": "",
        "TaxOfficeCode": "",
        "TaxNumber": "",
        "Phone": "",
        "Email": "",
        "Identity": "11111111110",
        "Country": "Türkiye",
        "City": "İstanbul",
        "District": "Mesela",
        "Neighborhood": "Öyle",
        "Address": "Tam sokağın ortası"
    },
    "Products": [
        {
            "Name": "Saç Tıraşı",
            "TaxGroupId": 10,
            "UnitCodeId": 1,
            "Amount": 22,
            "Quantity": 1,
            "PaymentMethodId": 2
        }
    ],
    "SkipPrintCustomer": false,
    "SkipPrintMerchant": false
    "SkipPaymentOptionScreen": false,
    "ReceiptOptions": { // Opsiyonal
        "TopSupport": true,
        "Top": {
            "Text": "Üst başlık",
            "FontSize": 10
        },
        "BottomSupport": true,
        "Bottom": {
            "Text": "Alt başlık",
            "FontSize": 50
        }
    }
}
```

{% endtab %}
{% endtabs %}

<table><thead><tr><th width="268">Parameter</th><th width="98.33333333333331">Type</th><th width="152">Compulsory</th><th width="97">Length</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>TerminalId
</code></pre></td><td>string</td><td>Yes/No</td><td>Guid</td><td>Your terminal's identity (ID) information</td></tr><tr><td><pre><code>TerminalTagCode
</code></pre></td><td>string</td><td>Yes</td><td>25</td><td>Label code.</td></tr><tr><td><pre><code>MerchantUniqueCode
</code></pre></td><td>Guid</td><td>Yes</td><td>-</td><td>The tracking number created by you for the payment.</td></tr><tr><td><pre><code>Amount
</code></pre></td><td>decimal</td><td>Yes</td><td>-</td><td>Sales amount.</td></tr><tr><td><pre><code>DisplayCode
</code></pre></td><td>string</td><td>No</td><td>25</td><td>The payment code that will be displayed on the terminal at the time the payment is shown.</td></tr><tr><td><pre><code>CurrencyId
</code></pre></td><td>string</td><td>Yes</td><td>-</td><td>Bkz: <a href="broken-reference">Currency</a></td></tr><tr><td><pre><code>CallbackAddress
</code></pre></td><td>string</td><td>No</td><td>150</td><td>The feedback address where we report the payment status.<br><br>Bkz: <a href="broken-reference">Exampl</a>e </td></tr><tr><td><pre><code>Methods
</code></pre></td><td>Array&#x3C;<mark style="color:orange;">Method</mark>></td><td>No</td><td>-</td><td>You can specify which payment methods you want to be supported using these parameters</td></tr><tr><td><pre><code>Customer
</code></pre></td><td><mark style="color:orange;">Customer</mark></td><td>No</td><td>-</td><td>The information of the customer for whom the payment is made</td></tr><tr><td><pre><code>Products
</code></pre></td><td>Array&#x3C;<mark style="color:orange;">Product</mark>></td><td>Yes</td><td>-</td><td>Product information</td></tr><tr><td><pre><code>SkipPrintCustomer
</code></pre></td><td>bool</td><td>No</td><td>-</td><td>Customer receipty print out skipping with this param</td></tr><tr><td><pre><code>SkipPrintMerchant
</code></pre></td><td>bool</td><td>No</td><td>-</td><td>Merchant receipty print out skipping with this param</td></tr><tr><td><pre><code>SkipPaymentOptionScreen
</code></pre></td><td>bool</td><td>No</td><td>-</td><td>The card transaction details screen (e.g., installments) is not displayed during the payment process.</td></tr><tr><td><pre><code>ReceiptOptions
</code></pre></td><td><mark style="color:orange;">ReceiptOptions</mark></td><td>Hayır</td><td>-</td><td>Ödeme sonrasında çıkacak fiş için özel ayarlamalar</td></tr></tbody></table>

<mark style="color:orange;">**Method Object\<Method>**</mark>

<table><thead><tr><th width="214">Parameter</th><th width="85.33333333333331">Type</th><th width="147">Compulsory</th><th width="141">Length</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentMethodId
</code></pre></td><td>int</td><td>Yes</td><td>-</td><td><a href="broken-reference">Payment Methods</a></td></tr></tbody></table>

<mark style="color:orange;">**Method Object \<ReceiptOptions>**</mark>

<table><thead><tr><th width="237">Parameter</th><th width="103.33333333333331">Type</th><th width="147">Compulsory</th><th width="123">Length</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>TopSupport
</code></pre></td><td>bool</td><td>Yes</td><td>-</td><td>Will text be positioned at the top of the receipt?</td></tr><tr><td><pre><code>Top > Text
</code></pre></td><td>string</td><td>Yes</td><td>150</td><td>Information to be written at the top of the receipt.</td></tr><tr><td><pre><code>Top > FontSize
</code></pre></td><td>int</td><td>Yes</td><td>2</td><td>The size of the information to be written at the top of the receipt.</td></tr><tr><td><pre><code>BottomSupport
</code></pre></td><td>bool</td><td>Yes</td><td>-</td><td>Will text be positioned at the bottom of the receipt?</td></tr><tr><td><pre><code>Bottom > Text
</code></pre></td><td>string</td><td>Yes</td><td>150</td><td>Information to be written at the bottom of the receipt.</td></tr><tr><td><pre><code>Bottom > FontSize
</code></pre></td><td>int</td><td>Yes</td><td>2</td><td>The size of the information to be written at the bottom of the receipt.</td></tr></tbody></table>

<mark style="color:orange;">**Customer Object\<Customer>**</mark>

<table><thead><tr><th width="188">Parameter</th><th width="104.33333333333331">Type</th><th width="148">Compulsory</th><th width="129">Length</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>Type
</code></pre></td><td>int</td><td>Yes</td><td>-</td><td>Customer Types</td></tr><tr><td><pre><code>FirstName
</code></pre></td><td>string</td><td>Yes/No</td><td>50</td><td>Customer first name</td></tr><tr><td><pre><code>MiddleName
</code></pre></td><td>string</td><td>No</td><td>50</td><td>Customer middle name</td></tr><tr><td><pre><code>LastName
</code></pre></td><td>string</td><td>Yes/No</td><td>50</td><td>Customer last name</td></tr><tr><td><pre><code>CompanyName
</code></pre></td><td>string</td><td>Yes/No</td><td>175</td><td>Company name</td></tr><tr><td><pre><code>TaxOfficeCode
</code></pre></td><td>string</td><td>Yes/No</td><td>50</td><td>Company tax office code</td></tr><tr><td><pre><code>TaxNumber
</code></pre></td><td>string</td><td>Yes/No</td><td>25</td><td>Company tax number</td></tr><tr><td><pre><code>Phone
</code></pre></td><td>string</td><td>No</td><td>20</td><td>Phone</td></tr><tr><td><pre><code>Email
</code></pre></td><td>string</td><td>No</td><td>100</td><td>Email address</td></tr><tr><td><pre><code>Identity
</code></pre></td><td>string</td><td>Yes/No</td><td>20</td><td>Identity number</td></tr><tr><td><pre><code>Country
</code></pre></td><td>string</td><td>No</td><td>50</td><td>Country</td></tr><tr><td><pre><code>City
</code></pre></td><td>string</td><td>No</td><td>100</td><td>City</td></tr><tr><td><pre><code>District
</code></pre></td><td>string</td><td>No</td><td>100</td><td>District/Neighborhood</td></tr><tr><td><pre><code>Neighborhood
</code></pre></td><td>string</td><td>No</td><td>100</td><td>Street</td></tr><tr><td><pre><code>Address
</code></pre></td><td>string</td><td>No</td><td>255</td><td>Street address</td></tr></tbody></table>

<mark style="color:orange;">**Product Object\<Product>**</mark>

<table><thead><tr><th width="188">Parameter</th><th width="116.33333333333331">Type</th><th width="129">Compulsory</th><th width="136">Length</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>Name
</code></pre></td><td>string</td><td>Yes</td><td>75</td><td>Product Name</td></tr><tr><td><pre><code>TaxGroupId
</code></pre></td><td>int</td><td>Yes</td><td>-</td><td><p>The VAT rate of the product</p><p><br>Bkz: <a href="broken-reference">Tax Group</a></p></td></tr><tr><td><pre><code>UnitCodeId
</code></pre></td><td>int</td><td>Yes</td><td>-</td><td><p>Product unit information</p><p><br>Bkz: <a href="broken-reference">Unit Codes</a></p></td></tr><tr><td><pre><code>CurrencyId
</code></pre></td><td>string</td><td>Yes</td><td>-</td><td>Bkz: <a href="broken-reference">Currency</a></td></tr><tr><td><pre><code>Amount
</code></pre></td><td>decimal</td><td>Yes</td><td>150</td><td><p>Product amount</p><p><br><strong>Note:</strong> The total of the product amounts must equal the sales amount.</p></td></tr><tr><td><pre><code>Quantity
</code></pre></td><td>int</td><td>Yes</td><td>-</td><td>Product quantity</td></tr></tbody></table>

**The response returned by the service:**

<table><thead><tr><th width="182">Parameter</th><th width="107.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Result</td><td>object</td><td>The service returns the details in the response.</td></tr><tr><td>ErrorCode</td><td>int</td><td>Error code. If the transaction is successful, it returns a value of '0'.</td></tr><tr><td>Succeeded</td><td>bool</td><td>It returns a true or false value. If the transaction is <mark style="color:green;">successful</mark>, it returns a value of 'true'.</td></tr><tr><td>Failed</td><td>bool</td><td>It returns a true or false value. If the transaction is <mark style="color:red;">unsuccessful</mark>, it returns a value of 'true'.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction is erroneous, it returns the error message specified, offering language support according to the locale parameter.</td></tr><tr><td>ClientMessage</td><td>string</td><td>It returns the fixed values of Paywall error codes. You can map them.</td></tr></tbody></table>

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

```json5
{
    "Result": {
        "PaymentRequestId": "1eb856a8-1d41-49ab-8994-ecee2880d62c",
        "PaymentRequestActivityId": "2015c508-4029-4f6b-b7e2-4bf34a213c41",
        "PaymentRequestActivityTypeId": 1,
        "PaymentStatus": 4
    },
    "Failed": false,
    "Message": null,
    "ClientMessage": null,
    "Succeeded": true
}
```

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

<table><thead><tr><th width="263">Parameter</th><th width="139.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>PaymentRequestId
</code></pre></td><td>Guid</td><td>The identity information of the Async payment in Paywall. It <strong>should be stored.</strong></td></tr><tr><td><pre><code>PaymentRequestActivityId
</code></pre></td><td>Guid</td><td>It is the identity information of the last transaction of the Async payment.</td></tr><tr><td><pre><code>PaymentRequestActivityTypeId
</code></pre></td><td>int</td><td>It is the transaction type of the last Async payment.<br><br>Bkz: <a href="broken-reference">Payment Type</a></td></tr><tr><td><pre><code>PaymentStatus
</code></pre></td><td>int</td><td>The last status of the asynchronous payment.<br><br>Bkz: <a href="broken-reference">Payment Status</a></td></tr></tbody></table>
