# 4. 3D Payment

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

{% hint style="info" %}
Important: To use the **3D payment** service, you must include the 'apikeypublic' and 'apiclientpublic' parameters in the 'Header' section.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

**Example&#x20;**<mark style="color:green;">**JSON**</mark>**&#x20;payload and&#x20;**<mark style="color:green;">**sample code**</mark>**&#x20;to be sent to the service are as follows.**

<table><thead><tr><th width="162">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>The Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The Public Client obtained from the merchant panel.</td></tr></tbody></table>

<mark style="color:blue;">Paywall Request Payload</mark>

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

```json5
{
    "PaymentDetail": {
        "Amount": 1.00,
        "MerchantUniqueCode": "22123222256226225",
        "TrackingCode": "TrackingCode1",
        "Half3D": false,
        "MerchantSuccessBackUrl": "https://domain.com/callback",
        "MerchantFailBackUrl": "https://domain.com/callback",
        "ClientIP": "0.0.0.0",
        "CurrencyId": 1,
        "Installment": 1,
        "ChannelId": 0,
        "TagId": 0,
        "PayWatch": null,
        "PayWatchMultipleSupport": false,
        "PayWatchMultiple": null,
        "EndOfTheDay": 1,
        "RegionId": 1,
        "ProviderBased": false,
        "ProviderKey": "providerkey",
        "MarketPlace": {
            "BasketAmount": 1.00
        }
    },
    "Card":{
        "OwnerName":"Iyzico Kartı",
        "Number":"5528790000000008",
        "ExpireMonth":"12",
        "ExpireYear":"2030",
        "Cvv":"123",
        "UniqueCode":"",
        "TempCardToken": "",
        "Partner": { // Nullable
            "PartnerBased": false,
            "PartnerIdentity": ""
        },
        "CardSave": {
            "Nickname": "Kredi kartım",
            "RelationalId1": "userid19283746",
            "RelationalId2": "",
            "RelationalId3": "",
            "Save": true
        }
    },
    "Customer":{
        "FullName":"FullName",
        "Phone":"5336662211",
        "Email":"enes@xcompany.com",
        "Country":"Country",
        "City":"City",
        "Address":"Address",
        "IdentityNumber":"IdentityNumber",
        "TaxNumber":"TaxNumber"
    },
    "Products":[{
        "ProductId": "ProductId",
        "ProductName": "ProductName",
        "ProductCategory": "ProductCategory",
        "ProductDescription": "ProductDescription",
        "ProductAmount": 1.0,
        "MemberId": 0,
        "MemberCustomCommission": false,
        "MemberCommission": 0,
        "MemberEarningCalculated": false,
        "MemberEarning": 0
    }]
}
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class Program
{
    static readonly HttpClient client = new HttpClient();

    public class PaymentDetail
    {
        public double Amount { get; set; }
        public string MerchantUniqueCode { get; set; }
        public int CurrencyId { get; set; }
        public string MerchantSuccessBackUrl { get; set; }
        public string MerchantFailBackUrl { get; set; }
        public int Installment { get; set; }
        public int ChannelId { get; set; }
        public int TagId { get; set; }
        public bool Half3D { get; set; }
    }

    public class Card
    {
        public string OwnerName { get; set; }
        public string Number { get; set; }
        public string ExpireMonth { get; set; }
        public string ExpireYear { get; set; }
        public string Cvv { get; set; }
        public string UniqueCode { get; set; }
    }

    public class Customer
    {
        public string FullName { get; set; }
        public string Phone { get; set; }
        public string Email { get; set; }
        public string Country { get; set; }
        public string City { get; set; }
        public string Address { get; set; }
        public string IdentityNumber { get; set; }
        public string TaxNumber { get; set; }
    }

    public class Product
    {
        public string ProductId { get; set; }
        public string ProductName { get; set; }
        public string ProductCategory { get; set; }
        public string ProductDescription { get; set; }
        public double ProductAmount { get; set; }
    }

    public class Root
    {
        public PaymentDetail PaymentDetail { get; set; }
        public Card Card { get; set; }
        public Customer Customer { get; set; }
        public Product[] Products { get; set; }
    }

    public static async Task Main()
    {
        Root root = new Root
        {
            PaymentDetail = new PaymentDetail
            {
                Amount = 9.85,
                MerchantUniqueCode = "AJSHFSAKFHASKHFA",
                CurrencyId = 1,
                MerchantSuccessBackUrl = "https://merchantsite.site.com/success",
                MerchantFailBackUrl = "https://merchantsite.site.com/fail",
                Installement = 1,
                ChannelId = 0,
                TagId = 0,
                Half3D = false
            },
            Card = new Card
            {
                OwnerName = "John Doe",
                Number = "5528790000000008",
                ExpireMonth = "12",
                ExpireYear = "2030",
                Cvv = "123",
                UniqueCode = ""
            },
            Customer = new Customer
            {
                FullName = "FullName",
                Phone = "5336662211",
                Email = "enes@xcompany.com",
                Country = "Country",
                City = "City",
                Address = "Address",
                IdentityNumber = "IdentityNumber",
                TaxNumber = "TaxNumber"
            },
            Products = new Product[] {
                new Product {
                    ProductId = "ProductId",
                    ProductName = "ProductName",
                    ProductCategory = "ProductCategory",
                    ProductDescription = "ProductDescription",
                    ProductAmount = 9.85
                }
            }
        };

        string json = JsonConvert.SerializeObject(root, Formatting.Indented);
        var data = new StringContent(json, Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("apikeypublic", "%%");
        client.DefaultRequestHeaders.Add("apiclientpublic", "%%");

        var url = "{{Base Adres}}/api/paywall/payment/startdirect";
        var response = await client.PostAsync(url, data);

        string result = response.Content.ReadAsStringAsync().Result;
        Console.WriteLine(result);
    }
}
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

type PaymentDetail struct {
	Amount                 float64 `json:"Amount"`
	MerchantUniqueCode     string  `json:"MerchantUniqueCode"`
	CurrencyId             int     `json:"CurrencyId"`
	MerchantSuccessBackUrl string  `json:"MerchantSuccessBackUrl"`
	MerchantFailBackUrl    string  `json:"MerchantFailBackUrl"`
	Installment           int     `json:"Installment"`
	ChannelId              int     `json:"ChannelId"`
	TagId                  int     `json:"TagId"`
	Half3D                 bool    `json:"Half3D"`
}

type Card struct {
	OwnerName   string `json:"OwnerName"`
	Number      string `json:"Number"`
	ExpireMonth string `json:"ExpireMonth"`
	ExpireYear  string `json:"ExpireYear"`
	Cvv         string `json:"Cvv"`
	UniqueCode  string `json:"UniqueCode"`
}

type Customer struct {
	FullName      string `json:"FullName"`
	Phone         string `json:"Phone"`
	Email         string `json:"Email"`
	Country       string `json:"Country"`
	City          string `json:"City"`
	Address       string `json:"Address"`
	IdentityNumber string `json:"IdentityNumber"`
	TaxNumber      string `json:"TaxNumber"`
}

type Product struct {
	ProductId          string  `json:"ProductId"`
	ProductName        string  `json:"ProductName"`
	ProductCategory    string  `json:"ProductCategory"`
	ProductDescription string  `json:"ProductDescription"`
	ProductAmount      float64 `json:"ProductAmount"`
}

type Data struct {
	PaymentDetail PaymentDetail `json:"PaymentDetail"`
	Card          Card          `json:"Card"`
	Customer      Customer      `json:"Customer"`
	Products      []Product     `json:"Products"`
}

type ResponseData struct {
	ErrorCode int
	Result    bool
	Message   string
	Body      string
}

func main() {
	data := Data{
		PaymentDetail: PaymentDetail{
			Amount:                 9.85,
			MerchantUniqueCode:     "AJSHFSAKFHASKHFA",
			CurrencyId:             1,
			MerchantSuccessBackUrl: "https://merchantsite.site.com/success",
			MerchantFailBackUrl:    "https://merchantsite.site.com/fail",
			Installement:           1,
			ChannelId:              0,
			TagId:                  0,
			Half3D:                 false,
		},
		Card: Card{
			OwnerName:   "John Doe",
			Number:      "5528790000000008",
			ExpireMonth: "12",
			ExpireYear:  "2030",
			Cvv:         "123",
			UniqueCode:  "",
		},
		Customer: Customer{
			FullName:       "FullName",
			Phone:          "5336662211",
			Email:          "enes@xcompany.com",
			Country:        "Country",
			City:           "City",
			Address:        "Address",
			IdentityNumber: "IdentityNumber",
			TaxNumber:      "TaxNumber",
		},
		Products: []Product{
			{
				ProductId:          "ProductId",
				ProductName:        "ProductName",
				ProductCategory:    "ProductCategory",
				ProductDescription: "ProductDescription",
				ProductAmount:      9.85,
			},
		},
	}

	payloadBuf := new(bytes.Buffer)
	json.NewEncoder(payloadBuf).Encode(data)

	req, _ := http.NewRequest("POST", "{{Base Adres}}/api/paywall/payment/startdirect", payloadBuf)

	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("apikeypublic", "%%")
	req.Header.Set("apiclientpublic", "%%")

	client := &http.Client{}
	res, e := client.Do(req)
	if e != nil {
		panic(e)
	}

	defer res.Body.Close()

	body, _ := ioutil.ReadAll(res.Body)

	var responseData ResponseData
	json.Unmarshal(body, &responseData)

	fmt.Println("ErrorCode: ", responseData.ErrorCode)
	fmt.Println("Result: ", responseData.Result)
	fmt.Println("Message: ", responseData.Message)
	fmt.Println("Body: ", responseData.Body)
}
```

{% endtab %}

{% tab title="Java" %}

```xml
<dependencies>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.12.5</version>
    </dependency>
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>4.9.0</version>
    </dependency>
</dependencies>
```

```java
import okhttp3.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;

public class Main {

    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();
        ObjectMapper mapper = new ObjectMapper();

        // Create JSON in a readable way
        ObjectNode rootNode = mapper.createObjectNode();
        rootNode.put("Amount", 9.85);
        rootNode.put("MerchantUniqueCode", "AJSHFSAKFHASKHFA");
        rootNode.put("CurrencyId", 1);
        rootNode.put("MerchantSuccessBackUrl", "https://merchantsite.site.com/success");
        rootNode.put("MerchantFailBackUrl", "https://merchantsite.site.com/fail");
        rootNode.put("Installment", 1);
        rootNode.put("ChannelId", 0);
        rootNode.put("TagId", 0);
        rootNode.put("Half3D", false);
        // and so on for all fields

        String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(rootNode);

        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, json);
        Request request = new Request.Builder()
            .url("{{Base Adres}}/api/paywall/payment/startdirect")
            .post(body)
            .addHeader("Content-Type", "application/json")
            .addHeader("apikeypublic", "%%")
            .addHeader("apiclientpublic", "%%")
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = '{{Base Adres}}/api/paywall/payment/startdirect';
$data = array(
    "PaymentDetail" => array(
        "Amount" => 9.85,
        "MerchantUniqueCode" => "AJSHFSAKFHASKHFA",
        "CurrencyId" => 1,
        "MerchantSuccessBackUrl" => "https://merchantsite.site.com/success",
        "MerchantFailBackUrl" => "https://merchantsite.site.com/fail",
        "Installment" => 1,
        "ChannelId" => 0,
        "TagId" => 0,
        "Half3D" => false
    ),
    "Card" => array(
        "OwnerName" => "John Doe",
        "Number" => "5528790000000008",
        "ExpireMonth" => "12",
        "ExpireYear" => "2030",
        "Cvv" => "123",
        "UniqueCode" => ""
    ),
    "Customer" => array(
        "FullName" => "FullName",
        "Phone" => "5336662211",
        "Email" => "enes@xcompany.com",
        "Country" => "Country",
        "City" => "City",
        "Address" => "Address",
        "IdentityNumber" => "IdentityNumber",
        "TaxNumber" => "TaxNumber"
    ),
    "Products" => array(
        array(
            "ProductId" => "ProductId",
            "ProductName" => "ProductName",
            "ProductCategory" => "ProductCategory",
            "ProductDescription" => "ProductDescription",
            "ProductAmount" => 9.85
        )
    )
);
$options = array(
    'http' => array(
        'header'  => "Content-type: application/json\r\n" .
                     "apikeypublic: %PUBLICKEY%\r\n" . 
                     "apiclientpublic: %PUBLICCLIENT%\r\n",
        'method'  => 'POST',
        'content' => json_encode($data),
    ),
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }

// Decode
$response = json_decode($result);

// ErrorCode-Result-Message
echo "ErrorCode: " . $response->ErrorCode . "\n";
echo "Result: " . ($response->Result ? "true" : "false") . "\n";
echo "Message: " . $response->Message . "\n";

// Decode Body
$body = json_decode($response->Body);
var_dump($result);
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json

url = '{{Base Adres}}/api/paywall/payment/startdirect'

headers = {
    'Content-Type': 'application/json',
    'apikeypublic': '%%',
    'apiclientpublic': '%%'
}

data = {
    "PaymentDetail": {
        "Amount": 9.85,
        "MerchantUniqueCode": "AJSHFSAKFHASKHFA",
        "CurrencyId": 1,
        "MerchantSuccessBackUrl": "https://merchantsite.site.com/success",
        "MerchantFailBackUrl": "https://merchantsite.site.com/fail",
        "Installment": 1,
        "ChannelId": 0,
        "TagId": 0,
        "Half3D": False
    },
    "Card": {
        "OwnerName": "John Doe",
        "Number": "5528790000000008",
        "ExpireMonth": "12",
        "ExpireYear": "2030",
        "Cvv": "123",
        "UniqueCode": ""
    },
    "Customer": {
        "FullName": "FullName",
        "Phone": "5336662211",
        "Email": "enes@xcompany.com",
        "Country": "Country",
        "City": "City",
        "Address": "Address",
        "IdentityNumber": "IdentityNumber",
        "TaxNumber": "TaxNumber"
    },
    "Products": [{
        "ProductId": "ProductId",
        "ProductName": "ProductName",
        "ProductCategory": "ProductCategory",
        "ProductDescription": "ProductDescription",
        "ProductAmount": 9.85
    }]
}

response = requests.post(url, headers=headers, data=json.dumps(data))

if response.status_code == 200:
    response_data = response.json()

    print("ErrorCode: ", response_data.get('ErrorCode'))
    print("Result: ", response_data.get('Result'))
    print("Message: ", response_data.get('Message'))

    body = json.loads(response_data.get('Body'))
    print(body)
else:
    print(f'Request failed with status code {response.status_code}')
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("{{Base Adres}}/api/paywall/payment/startdirect")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.path, {
  'Content-Type' => 'application/json',
  'apikeypublic' => '%%',
  'apiclientpublic' => '%%'
})

request.body = JSON.generate({
  "PaymentDetail" => {
    "Amount" => 9.85,
    "MerchantUniqueCode" => "AJSHFSAKFHASKHFA",
    "CurrencyId" => 1,
    "MerchantSuccessBackUrl" => "https://merchantsite.site.com/success",
    "MerchantFailBackUrl" => "https://merchantsite.site.com/fail",
    "Installment" => 1,
    "ChannelId" => 0,
    "TagId" => 0,
    "Half3D" => false
  },
  "Card" => {
    "OwnerName" => "John Doe",
    "Number" => "5528790000000008",
    "ExpireMonth" => "12",
    "ExpireYear" => "2030",
    "Cvv" => "123",
    "UniqueCode" => ""
  },
  "Customer" => {
    "FullName" => "FullName",
    "Phone" => "5336662211",
    "Email" => "enes@xcompany.com",
    "Country" => "Country",
    "City" => "City",
    "Address" => "Address",
    "IdentityNumber" => "IdentityNumber",
    "TaxNumber" => "TaxNumber"
  },
  "Products" => [
    {
      "ProductId" => "ProductId",
      "ProductName" => "ProductName",
      "ProductCategory" => "ProductCategory",
      "ProductDescription" => "ProductDescription",
      "ProductAmount" => 9.85
    }
  ]
})

response = http.request(request)
puts response.body
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
import axios, { AxiosResponse } from 'axios';

interface ResponseData {
  ErrorCode: number;
  Result: boolean;
  Message: string;
  Body: string;
}

let data = {
  PaymentDetail: {
    Amount: 9.85,
    MerchantUniqueCode: "AJSHFSAKFHASKHFA",
    CurrencyId: 1,
    MerchantSuccessBackUrl: "https://merchantsite.site.com/success",
    MerchantFailBackUrl: "https://merchantsite.site.com/fail",
    Installment: 1,
    ChannelId: 0,
    TagId: 0,
    Half3D: false
  },
  Card: {
    OwnerName: "John Doe",
    Number: "5528790000000008",
    ExpireMonth: "12",
    ExpireYear: "2030",
    Cvv: "123",
    UniqueCode: ""
  },
  Customer: {
    FullName: "FullName",
    Phone: "5336662211",
    Email: "enes@xcompany.com",
    Country: "Country",
    City: "City",
    Address: "Address",
    IdentityNumber: "IdentityNumber",
    TaxNumber: "TaxNumber"
  },
  Products: [{
    ProductId: "ProductId",
    ProductName: "ProductName",
    ProductCategory: "ProductCategory",
    ProductDescription: "ProductDescription",
    ProductAmount: 9.85
  }]
};

let config = {
  method: 'post',
  url: '{{Base Adres}}/api/paywall/payment/startdirect',
  headers: { 
    'Content-Type': 'application/json', 
    'apikeypublic': '%%', 
    'apiclientpublic': '%%'
  },
  data : data
};

axios(config)
.then(function (response: AxiosResponse<ResponseData>) {
  console.log(response.data);
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Curl" %}

```sh
curl --location --request POST '{{Base Adres}}/api/paywall/payment/startdirect' \
--header 'Content-Type: application/json' \
--header 'apikeypublic: %%PUBLICKEY%%' \
--header 'apiclientpublic: %%PUBLICCLIENT%%' \
--data-raw '{
    "PaymentDetail": {
        "Amount": 9.85,
        "MerchantUniqueCode": "FASLSZDPOT3535BFNGI",
        "CurrencyId": 1,
        "MerchantSuccessBackUrl": "https://merchantsite.site.com/success",
        "MerchantFailBackUrl": "https://merchantsite.site.com/fail",
        "Installment": 1,
        "ChannelId": 0,
        "TagId": 0,
        "Half3D": false
    },
    "Card": {
        "OwnerName": "John Doe",
        "Number": "5528790000000008",
        "ExpireMonth": "12",
        "ExpireYear": "2030",
        "Cvv": "123",
        "UniqueCode": ""
    },
    "Customer": {
        "FullName": "FullName",
        "Phone": "5336662211",
        "Email": "enes@xcompany.com",
        "Country": "Country",
        "City": "City",
        "Address": "Address",
        "IdentityNumber": "IdentityNumber",
        "TaxNumber": "TaxNumber"
    },
    "Products": [{
        "ProductId": "ProductId",
        "ProductName": "ProductName",
        "ProductCategory": "ProductCategory",
        "ProductDescription": "ProductDescription",
        "ProductAmount": 9.85
    }]
}'
```

{% endtab %}
{% endtabs %}

<mark style="color:blue;">**Root Directory:**</mark> <mark style="color:orange;">**PaymentDetail**</mark>

<table><thead><tr><th width="243">Parameter</th><th width="109">Type</th><th width="161">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>Amount</td><td>decimal</td><td>Yes</td><td>Total amount of the payment basket.</td></tr><tr><td>MerchantUniqueCode</td><td>string</td><td>Yes</td><td><p>Must be the same value as the MerchantUniqueCode sent in the payment initiation request. This code is a unique identifier assigned by you for the transaction. It is used to uniquely identify and track a payment in Cancel/Refund/Payment Inquiry operations.</p><p></p><p><mark style="color:red;">Length: 250 characters</mark></p></td></tr><tr><td>TrackingCode</td><td>string</td><td>No</td><td><p>Can be used as a secondary tracking number on your side for the payment. You can use this parameter to send additional information that needs to be associated with the MerchantUniqueCode.</p><p></p><p><mark style="color:blue;">Important note:</mark> This is not unique and can be repeated. If uniqueness is required, it must be managed on your side.</p></td></tr><tr><td>MerchantSuccessBackUrl</td><td>string</td><td>Yes</td><td>The address to which the 3D screen will be redirected via FormPost for a <mark style="color:blue;">successful</mark> transaction.<br><br><mark style="color:red;">Length: 250 characters</mark><br><br>See: <a href="broken-reference">Review</a></td></tr><tr><td>MerchantFailBackUrl</td><td>string</td><td>Yes</td><td>The address to which the 3D screen will be redirected via FormPost for a <mark style="color:red;">failed</mark> transaction.<br><br><mark style="color:red;">Length: 250 characters</mark><br><br>See: <a href="broken-reference">Review</a></td></tr><tr><td>CurrencyId</td><td>int</td><td>Yes</td><td>Currency<br><br>See: <a href="../system-data/currency">Review</a></td></tr><tr><td>Installment</td><td>int</td><td>Yes</td><td>Installment information; 1 must be sent for a single payment.</td></tr><tr><td>Half3D</td><td>bool</td><td>No</td><td>This parameter enables you to finalize payments with a custom call. If you send the Half3D parameter as true, the payment will remain in <mark style="color:yellow;">pre-authorization</mark> at the bank until you make the completion call.</td></tr><tr><td>ClientIP</td><td>string</td><td>Yes</td><td>IP address of the party performing the transaction. This could be the customer, user, member, etc.<br><br><mark style="color:red;">Length: 15 characters</mark></td></tr><tr><td>TagId</td><td>int?</td><td>No</td><td>Used when you want to apply tagging to your payments.</td></tr><tr><td>ChannelId</td><td>int?</td><td>No</td><td>Used when you want to differentiate the channels through which your payments are transmitted to Paywall.</td></tr><tr><td>EndOfTheDay</td><td>int?</td><td>No</td><td><p>This is an end-of-day value. If you want your payment to be processed only through providers that support "Next Day" settlements among the connected providers, you must send this parameter with a value.</p><p><br>See: <a href="broken-reference">Review</a></p></td></tr><tr><td>RegionId</td><td>short?</td><td>No</td><td>This parameter allows you to specify the country under which the payment should be processed by the providers. If not specified, your payment will be treated as 'Global'.</td></tr><tr><td>ProviderBased</td><td>bool</td><td>No</td><td>Used when you decide on your side which provider the payment should be routed through.</td></tr><tr><td>ProviderKey</td><td>string</td><td>Yes/No</td><td>The provider key through which you want your payment to be processed.</td></tr><tr><td>MarketPlace <mark style="color:red;">></mark> BasketAmount</td><td>decimal</td><td>No</td><td>Used within the scope of a marketplace.</td></tr><tr><td>PayWatch <mark style="color:red;">></mark><br>Watch</td><td>bool?</td><td>No</td><td>Should the payment be monitored with PayWatch?</td></tr><tr><td>PayWatch <mark style="color:red;">></mark><br>PaymentStatus[]</td><td>List&#x3C;int></td><td>Yes/No</td><td>Under which conditions should the payment be monitored?</td></tr><tr><td>PayWatch <mark style="color:red;">></mark><br>ActionId</td><td>short</td><td>Yes/No</td><td>Action to be taken as a result of the monitoring.<br><br>See: <a href="broken-reference">Review</a></td></tr><tr><td>PayWatch <mark style="color:red;">></mark><br>WebhookAddress</td><td>string</td><td>Yes/No</td><td>When the monitoring action is set as a Webhook, the address to which the notification will be sent.</td></tr><tr><td>PayWatch <mark style="color:red;">></mark><br>WatchMin</td><td>short</td><td>Yes/No</td><td><p>How many minutes after the payment should monitoring start?</p><p></p><p>Min: 5<br>Max: 20</p></td></tr><tr><td>PayWatchMultipleSupport</td><td>bool</td><td>No</td><td>Should the payment be monitored with multi-rule PayWatch?</td></tr><tr><td>PayWatchMultiple <mark style="color:red;">></mark><br>Watch</td><td>bool</td><td>Yes/No</td><td>Should the payment be monitored with PayWatch Multi?</td></tr><tr><td>PayWatchMultiple <mark style="color:red;">></mark><br>Jobs[] <mark style="color:red;">></mark><br>PaymentStatus[]</td><td>List&#x3C;int></td><td>Yes/No</td><td>Under which conditions should the payment be monitored?</td></tr><tr><td>PayWatchMultiple <mark style="color:red;">></mark><br>Jobs[] <mark style="color:red;">></mark><br>ActionId</td><td>short</td><td>Yes/No</td><td>Action to be taken as a result of the monitoring<br><br>See: <a href="broken-reference">Review</a></td></tr><tr><td>PayWatchMultiple <mark style="color:red;">></mark><br>Jobs[] <mark style="color:red;">></mark><br>WebhookAddress</td><td>string</td><td>Yes/No</td><td>When the monitoring action is set to Webhook, the address where the notification will be sent.</td></tr><tr><td>PayWatchMultiple <mark style="color:red;">></mark><br>Jobs[] <mark style="color:red;">></mark><br>WatchMin</td><td>short</td><td>Yes/No</td><td><p>How many minutes after the payment should monitoring start?</p><p></p><p>Min: 2<br>Max: 20</p></td></tr></tbody></table>

<mark style="color:blue;">Root Directory:</mark> <mark style="color:orange;">Card</mark>

<table><thead><tr><th width="177">Parameter</th><th width="84">Type</th><th width="128">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>OwnerName</td><td>string</td><td>Yes/No</td><td><p>Full name of the cardholder from whom the payment will be collected.<br></p><p><mark style="color:red;">Length: 60 characters</mark></p></td></tr><tr><td>Number</td><td>string</td><td>Yes/No</td><td>Card number from which the payment will be collected.<br><br><mark style="color:red;">Length: 20 characters</mark></td></tr><tr><td>ExpireMonth</td><td>string</td><td>Yes/No</td><td>Expiration month of the card from which the payment will be collected.</td></tr><tr><td>ExpireYear</td><td>string</td><td>Yes/No</td><td>Expiration year of the card from which the payment will be collected.</td></tr><tr><td>Cvv</td><td>string</td><td>Yes/No</td><td>Security code of the card from which the payment will be collected.</td></tr><tr><td>UniqueCode</td><td>string</td><td>Yes/No</td><td>Identifier of the saved card. Returned by Paywall during card saving and listing operations.</td></tr><tr><td>TempCardToken</td><td>string</td><td>Yes/No</td><td>This parameter should be used when you want to process a payment with a temporary saved card (Client-Side Tokenization).</td></tr><tr><td>Partner<mark style="color:red;">? ></mark><br>PartnerBased</td><td>bool?</td><td>Yes/No</td><td>This parameter is used when cards are structured based on a partner model.</td></tr><tr><td>Partner<mark style="color:red;">? ></mark><br>PartnerIdentity</td><td>string</td><td>Yes/No</td><td>When cards are structured based on a partner model, this is your company's partnership identifier in Paywall. You can obtain this information from the Paywall panel.</td></tr><tr><td>CardSave<mark style="color:red;">? ></mark><br>Save</td><td>bool</td><td>Yes/No</td><td>If you want the card to be saved upon a successful payment, this should be sent as <strong>True</strong> during the transaction. When <strong>True</strong> is sent, the other parameters under the <strong>CardSave</strong> object will be taken into account.</td></tr><tr><td>CardSave<mark style="color:red;">? ></mark><br>Nickname</td><td>string</td><td>Yes/No</td><td>Alias of the card.</td></tr><tr><td>CardSave<mark style="color:red;">? ></mark><br>RelationalId1</td><td>string</td><td>Yes/No</td><td>The association value of the card.</td></tr><tr><td>CardSave<mark style="color:red;">? ></mark><br>RelationalId2</td><td>string</td><td>Yes/No</td><td>The second (hierarchical/tree structure) association value of the card.</td></tr><tr><td>CardSave<mark style="color:red;">? ></mark><br>RelationalId3</td><td>string</td><td>Yes/No</td><td>The third (hierarchical/tree structure) association value of the card.</td></tr></tbody></table>

<mark style="color:blue;">Root Directory:</mark> <mark style="color:orange;">Customer</mark>

<table><thead><tr><th width="174">Parameter</th><th width="110">Type</th><th width="133.50390625">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>FullName</td><td>string</td><td>Yes</td><td>First name of the buyer on the merchant side.</td></tr><tr><td>Phone</td><td>string</td><td>Yes</td><td>Mobile phone number of the buyer on the merchant side.</td></tr><tr><td>Email</td><td>string</td><td>Yes</td><td>Email address of the buyer on the merchant side.</td></tr><tr><td>Country</td><td>string</td><td>Yes</td><td>Country information of the buyer on the merchant side.</td></tr><tr><td>City</td><td>string</td><td>Yes</td><td>City information of the buyer on the merchant side.</td></tr><tr><td>Address</td><td>string</td><td>Yes</td><td>Registered address of the buyer on the merchant side.</td></tr><tr><td>IdentityNumber</td><td>string</td><td>No</td><td>Identification number (TCKN) of the buyer on the merchant side.</td></tr><tr><td>TaxNumber</td><td>string</td><td>No</td><td>Tax identification number of the buyer on the merchant side.</td></tr></tbody></table>

<mark style="color:blue;">Root Directory:</mark><mark style="color:orange;">`Product<Array>`</mark>

<table><thead><tr><th width="272">Parameter</th><th width="109">Type</th><th width="122">Compulsory</th><th>Description</th></tr></thead><tbody><tr><td>ProductId</td><td>string</td><td>Yes</td><td>Product ID</td></tr><tr><td>ProductName</td><td>string</td><td>Yes</td><td>Product name</td></tr><tr><td>ProductCategory</td><td>string</td><td>Yes</td><td>Product category.</td></tr><tr><td>ProductDescription</td><td>string</td><td>Yes</td><td>Product description.</td></tr><tr><td>ProductAmount</td><td>decimal</td><td>Yes</td><td>Product price information.</td></tr><tr><td>MemberId</td><td>int?</td><td>Yes/No</td><td>Required for the Marketplace model. Must be filled with the MemberId of the sub-merchant in the Paywall system</td></tr><tr><td>MemberEarningCalculated</td><td>bool?</td><td>Yes/No</td><td>Within the scope of the marketplace, if you have calculated the sub-merchant's payout yourself, you must send this parameter as true</td></tr><tr><td>MemberEarning</td><td>decimal?</td><td>Yes/No</td><td>Within the scope of the marketplace, if you have calculated the sub-merchant’s payout yourself, you must report the payout amount to Paywall using this parameter</td></tr><tr><td>MemberCustomCommission</td><td>bool</td><td>Yes/No</td><td>Within the scope of the marketplace, this parameter is used if you want to specify a commission for the sub-merchant specific to this sale.</td></tr><tr><td>MemberCommission</td><td>decimal?</td><td>Yes/No</td><td>Within the scope of the marketplace, this is the parameter used to send the commission value when you want to specify a commission for the sub-merchant specific to this sale.</td></tr></tbody></table>

<mark style="color:blue;">Paywall Response</mark>

<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 a value of '0' if the transaction is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a value of true or false. Returns true if the transaction is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the transaction fails, this is the message describing the error. It provides language support based on the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>If the transaction fails, this is the code corresponding to the error.</td></tr></tbody></table>

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

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "Success",
    "Body": {
        "Message": null,
        "RedirectUrl": "https://dev-payment-agent.itspaywall.com/paywall/callback?UniqueNumber=xxxxxx-xxxxxxx-xxxxxxx-xxxxxx",
        "Payment": {
            "PaymentId": 1918272,
            "ActivityId": 3820721,
            "UniqueCode": "87e30149-817b-42cf-a8a8-81af2af5722b",
            "MerchantUniqueKey": "96aaa33633aaaa3aaaaa3aa2aa2322a2aaaa4a21331a234aas33aaaa3aasa"
        }
    }
}
```

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