curl --request POST \
--url https://test.paysight.io/api/mitigation/subscriptions \
--header 'Authorization: <api-key>' \
--header 'ClientId: <clientid>' \
--header 'Content-Type: application/json' \
--header 'UserEmail: <useremail>' \
--data '
{
"pageNumber": 123,
"limit": 123,
"emails": [
"<string>"
],
"orderIds": [
123
],
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
}
'import requests
url = "https://test.paysight.io/api/mitigation/subscriptions"
payload = {
"pageNumber": 123,
"limit": 123,
"emails": ["<string>"],
"orderIds": [123],
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
}
headers = {
"ClientId": "<clientid>",
"UserEmail": "<useremail>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
ClientId: '<clientid>',
UserEmail: '<useremail>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pageNumber: 123,
limit: 123,
emails: ['<string>'],
orderIds: [123],
dateFrom: '2023-12-25',
dateTo: '2023-12-25'
})
};
fetch('https://test.paysight.io/api/mitigation/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.paysight.io/api/mitigation/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageNumber' => 123,
'limit' => 123,
'emails' => [
'<string>'
],
'orderIds' => [
123
],
'dateFrom' => '2023-12-25',
'dateTo' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"ClientId: <clientid>",
"Content-Type: application/json",
"UserEmail: <useremail>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.paysight.io/api/mitigation/subscriptions"
payload := strings.NewReader("{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ClientId", "<clientid>")
req.Header.Add("UserEmail", "<useremail>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test.paysight.io/api/mitigation/subscriptions")
.header("ClientId", "<clientid>")
.header("UserEmail", "<useremail>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.paysight.io/api/mitigation/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ClientId"] = '<clientid>'
request["UserEmail"] = '<useremail>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"count": 123,
"pageNumber": 123,
"moreResults": true,
"subscriptions": [
{
"parentCompanyId": 123,
"companyId": 123,
"mid": "<string>",
"descriptor": "<string>",
"id": 123,
"customerId": 123,
"subDate": "2023-11-07T05:31:56Z",
"unsubDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"active": true,
"unsubscribeOrderId": 123,
"email": "<string>",
"subId": 123,
"frozen": true
}
]
}User Subscription Search with Pagination
Retrieves subscriptions (active and inactive) for filtered date period. New subscribers and updated (unsubscribed) subscribers are returned based on date range. For broad range searches (for pulling large dataset) where only the date range is provided, a maximum of 1 day is allowed, i.e dateFrom must equal dateTo. Please also note that transactions are not updated when refunded / voided. Instead, they have a corresponding refund transaction which can be linked to the original transaction via the originalTransactionId field.
curl --request POST \
--url https://test.paysight.io/api/mitigation/subscriptions \
--header 'Authorization: <api-key>' \
--header 'ClientId: <clientid>' \
--header 'Content-Type: application/json' \
--header 'UserEmail: <useremail>' \
--data '
{
"pageNumber": 123,
"limit": 123,
"emails": [
"<string>"
],
"orderIds": [
123
],
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
}
'import requests
url = "https://test.paysight.io/api/mitigation/subscriptions"
payload = {
"pageNumber": 123,
"limit": 123,
"emails": ["<string>"],
"orderIds": [123],
"dateFrom": "2023-12-25",
"dateTo": "2023-12-25"
}
headers = {
"ClientId": "<clientid>",
"UserEmail": "<useremail>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
ClientId: '<clientid>',
UserEmail: '<useremail>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pageNumber: 123,
limit: 123,
emails: ['<string>'],
orderIds: [123],
dateFrom: '2023-12-25',
dateTo: '2023-12-25'
})
};
fetch('https://test.paysight.io/api/mitigation/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.paysight.io/api/mitigation/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pageNumber' => 123,
'limit' => 123,
'emails' => [
'<string>'
],
'orderIds' => [
123
],
'dateFrom' => '2023-12-25',
'dateTo' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"ClientId: <clientid>",
"Content-Type: application/json",
"UserEmail: <useremail>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.paysight.io/api/mitigation/subscriptions"
payload := strings.NewReader("{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("ClientId", "<clientid>")
req.Header.Add("UserEmail", "<useremail>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test.paysight.io/api/mitigation/subscriptions")
.header("ClientId", "<clientid>")
.header("UserEmail", "<useremail>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.paysight.io/api/mitigation/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["ClientId"] = '<clientid>'
request["UserEmail"] = '<useremail>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pageNumber\": 123,\n \"limit\": 123,\n \"emails\": [\n \"<string>\"\n ],\n \"orderIds\": [\n 123\n ],\n \"dateFrom\": \"2023-12-25\",\n \"dateTo\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"count": 123,
"pageNumber": 123,
"moreResults": true,
"subscriptions": [
{
"parentCompanyId": 123,
"companyId": 123,
"mid": "<string>",
"descriptor": "<string>",
"id": 123,
"customerId": 123,
"subDate": "2023-11-07T05:31:56Z",
"unsubDate": "2023-11-07T05:31:56Z",
"orderId": 123,
"active": true,
"unsubscribeOrderId": 123,
"email": "<string>",
"subId": 123,
"frozen": true
}
]
}Headers
Your Paysight Tenant/Client Id. This is the id of the parent company listed in https://app.paysight.io/management/companies. Alternatively, this will be provided by Paysight
Body
Request to fetch subscriptions with filters like email and date range