Ödeme Listesi

Zotlo üzerinden kullanıcıların yaptıkları ödeme listesinin çekilebileceği servistir.

GET https://api.zotlo.com/v1/subscription/transaction?subscriberId=SUBSCRIBERID&paymentType=&startDate=&endDate=&packageId=

Profil servisi için gönderilmesi gereken parametreler şunlardır :

Alan
Açıklama
Zorunlu
subscriberId
Satın alma listesinin getirileceği kullanıcı
Evet
paymentType
Satın alma listesini satın alma türüne göre filtrelemek için kullanılır. Alabileceği değerler consumable ve subscription'dir. "consumable" ile tek seferlik ürün satın almaları, "subscription" ile ise abonelikle ilgili ödeme listesi dönülür. Bış gönderilirse tüm kayıtlar dönülür.
Hayır
startDate
İstenilen tarihten sonraki ödemeleri getirmek için kullanılır. Varsayılan değer "null"dır.
Hayır
endDate
İstenilen tarihten önceki ödemeleri getirmek için kullanılır. Varsayılan değer "null"dır.
Hayır
packageId
Sadece istenilen paketlere ait ödemeleri listelemek için kullanılır. Varsayılan değer "null"dır.
Hayır

Örnek İstek

Curl
Php
Swift
Java
Python
C#
1
curl --location --request GET 'https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId=' \
2
--header 'AccessKey: ***' \
3
--header 'AccessSecret: ***' \
4
--header 'ApplicationId: 2' \
5
--header 'Language: tr'
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => "https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId=",
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => "",
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => "GET",
12
CURLOPT_HTTPHEADER => array(
13
"AccessKey: ***",
14
"AccessSecret: ***",
15
"ApplicationId: 2",
16
"Language: tr"
17
),
18
));
19
20
$response = curl_exec($curl);
21
22
curl_close($curl);
23
echo $response;
Copied!
1
import Foundation
2
3
var semaphore = DispatchSemaphore (value: 0)
4
5
var request = URLRequest(url: URL(string: "https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId=")!,timeoutInterval: Double.infinity)
6
request.addValue("***", forHTTPHeaderField: "AccessKey")
7
request.addValue("***", forHTTPHeaderField: "AccessSecret")
8
request.addValue("2", forHTTPHeaderField: "ApplicationId")
9
request.addValue("tr", forHTTPHeaderField: "Language")
10
11
request.httpMethod = "GET"
12
13
let task = URLSession.shared.dataTask(with: request) { data, response, error in
14
guard let data = data else {
15
print(String(describing: error))
16
return
17
}
18
print(String(data: data, encoding: .utf8)!)
19
semaphore.signal()
20
}
21
22
task.resume()
23
semaphore.wait()
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
Request request = new Request.Builder()
4
.url("https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId=")
5
.method("GET", null)
6
.addHeader("AccessKey", "***")
7
.addHeader("AccessSecret", "***")
8
.addHeader("ApplicationId", "2")
9
.addHeader("Language", "tr")
10
.build();
11
Response response = client.newCall(request).execute();
Copied!
1
import requests
2
3
url = "https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId="
4
5
payload = {}
6
headers = {
7
'AccessKey': '***',
8
'AccessSecret': '***',
9
'ApplicationId': '2',
10
'Language': 'tr'
11
}
12
13
response = requests.request("GET", url, headers=headers, data = payload)
14
15
print(response.text.encode('utf8'))
Copied!
1
var client = new RestClient("https://api.zotlo.com/v1/subscription/transaction?subscriberId=***&paymentType=&startDate=&endDate=&packageId=");
2
client.Timeout = -1;
3
var request = new RestRequest(Method.GET);
4
request.AddHeader("AccessKey", "***");
5
request.AddHeader("AccessSecret", "***");
6
request.AddHeader("ApplicationId", "2");
7
request.AddHeader("Language", "tr");
8
IRestResponse response = client.Execute(request);
9
Console.WriteLine(response.Content);
Copied!

Servis Cevapları

Satınalma Geçmişi Varsa :

1
{
2
"meta": {
3
"requestId": "6d2989e84793-REQ-5f32a9da35fe1",
4
"httpStatus": 200
5
},
6
"result": {
7
"transactions": [
8
{
9
"id": 1645,
10
"payment_type": "subscription",
11
"original_transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
12
"transaction_id": "84f065b9-a714-45fd-8af1-84cd488755c9",
13
"provider_transaction_id": "9d67477c-ed74-4159-9cda-a318bd0490bd",
14
"package_id": "zotlo-premium",
15
"status": "renewal",
16
"purchase_date": "2020-08-10 13:57:09",
17
"expire_date": "2021-02-06 13:25:31",
18
"original_purchase_date": "2020-08-10 13:25:31",
19
"price": "3.99",
20
"currency": "USD",
21
"country": "TR",
22
"provider_name": "Zotlopay",
23
"refund": null
24
},
25
{
26
"id": 1644,
27
"payment_type": "subscription",
28
"original_transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
29
"transaction_id": "c87ef3a3-5025-498d-98c7-c2254f958510",
30
"provider_transaction_id": "f21f4f44-a25b-44e5-9e63-cc373d878d1f",
31
"package_id": "zotlo-premium",
32
"status": "renewal",
33
"purchase_date": "2020-08-10 13:55:08",
34
"expire_date": "2021-01-07 13:25:31",
35
"original_purchase_date": "2020-08-10 13:25:31",
36
"price": "3.99",
37
"currency": "USD",
38
"country": "TR",
39
"provider_name": "Zotlopay",
40
"refund": null
41
},
42
{
43
"id": 1643,
44
"payment_type": "subscription",
45
"original_transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
46
"transaction_id": "b21ab103-0204-447f-8a21-b740f6069147",
47
"provider_transaction_id": "9128fe0c-d244-4516-959d-5b47fd2c0209",
48
"package_id": "zotlo-premium",
49
"status": "renewal",
50
"purchase_date": "2020-08-10 13:53:47",
51
"expire_date": "2020-12-08 13:25:31",
52
"original_purchase_date": "2020-08-10 13:25:31",
53
"price": "3.99",
54
"currency": "USD",
55
"country": "TR",
56
"provider_name": "Zotlopay",
57
"refund": null
58
},
59
{
60
"id": 1642,
61
"payment_type": "subscription",
62
"original_transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
63
"transaction_id": "a898f2aa-5e7d-4d77-8a3e-c2ef4fba139f",
64
"provider_transaction_id": "1024d29e-e09e-48d7-8a12-09d208211b15",
65
"package_id": "zotlo-premium",
66
"status": "renewal",
67
"purchase_date": "2020-08-10 13:51:03",
68
"expire_date": "2020-11-08 13:25:31",
69
"original_purchase_date": "2020-08-10 13:25:31",
70
"price": "3.99",
71
"currency": "USD",
72
"country": "TR",
73
"provider_name": "Zotlopay",
74
"refund": null
75
},
76
{
77
"id": 1641,
78
"payment_type": "subscription",
79
"original_transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
80
"transaction_id": "5751ee7e-93a4-4e9e-a207-4213e2470dd7",
81
"provider_transaction_id": "4739b3c2-94fc-4031-9d3d-6873a0142e30",
82
"package_id": "zotlo-premium",
83
"status": "start_paid",
84
"purchase_date": "2020-08-10 13:25:31",
85
"expire_date": "2020-09-09 13:25:31",
86
"original_purchase_date": "2020-08-10 13:25:31",
87
"price": "3.99",
88
"currency": "USD",
89
"country": "TR",
90
"provider_name": "Zotlopay",
91
"refund": null
92
}
93
]
94
}
95
}
Copied!

Hata Durumları

Ödeme servislerinden HTTP status code olarak başarılı durumlarda 200 dönmektedir. Başarısız durumlarda ise 400 ya da 500 Http StatusCode dönmektedir. Örnek hata cevabı aşağıdaki şekildedir.
1
{
2
"meta": {
3
"requestId": "app2.localdomain-REQ-5e7db66e67542",
4
"httpStatus": 400,
5
"errorMessage": "Kullanıcı abonelik profili bulunamadı.",
6
"errorCode": 400009
7
},
8
"result": []
9
}
Copied!
Cevap
Açıklama
requestId
Her istek için sistem tarafından atanan id değeridir. Sistemsel hatalarda log'lardan hata yakalamak için kullanılır.
httpStatus
Hatanın HTTP durum kodu değeri
errorMessage
Hata mesajı. Tüm hata kodlarına "Hata Kodları" menüsünden ulaşabilirsiniz.
errorCode
İlgili hata için Zotlo tarafından verilen hata kodu.
Last modified 2mo ago