curl --request POST \
--url https://test.paysight.io/customerapi/refund \
--header 'Authorization: <api-key>' \
--header 'ClientId: <clientid>' \
--header 'Content-Type: application/json' \
--header 'UserEmail: <useremail>' \
--data '
{
"parentCompanyId": 1,
"userEmail": "care@yourdomain.com",
"messageId": "fd6562a1-e0e7-4b8b-b0d4-f20359482dd1",
"sendUserCommunication": false,
"amount": 12.99,
"refundItems": []
}
'import requests
url = "https://test.paysight.io/customerapi/refund"
payload = {
"parentCompanyId": 1,
"userEmail": "care@yourdomain.com",
"messageId": "fd6562a1-e0e7-4b8b-b0d4-f20359482dd1",
"sendUserCommunication": False,
"amount": 12.99,
"refundItems": []
}
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({
parentCompanyId: 1,
userEmail: 'care@yourdomain.com',
messageId: 'fd6562a1-e0e7-4b8b-b0d4-f20359482dd1',
sendUserCommunication: false,
amount: 12.99,
refundItems: []
})
};
fetch('https://test.paysight.io/customerapi/refund', 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/customerapi/refund",
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([
'parentCompanyId' => 1,
'userEmail' => 'care@yourdomain.com',
'messageId' => 'fd6562a1-e0e7-4b8b-b0d4-f20359482dd1',
'sendUserCommunication' => false,
'amount' => 12.99,
'refundItems' => [
]
]),
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/customerapi/refund"
payload := strings.NewReader("{\n \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\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/customerapi/refund")
.header("ClientId", "<clientid>")
.header("UserEmail", "<useremail>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.paysight.io/customerapi/refund")
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 \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "",
"refundId": "da6562a1-e0e7-4b8b-c0d4-g20359482dd1"
}Refund
Refund a customer
curl --request POST \
--url https://test.paysight.io/customerapi/refund \
--header 'Authorization: <api-key>' \
--header 'ClientId: <clientid>' \
--header 'Content-Type: application/json' \
--header 'UserEmail: <useremail>' \
--data '
{
"parentCompanyId": 1,
"userEmail": "care@yourdomain.com",
"messageId": "fd6562a1-e0e7-4b8b-b0d4-f20359482dd1",
"sendUserCommunication": false,
"amount": 12.99,
"refundItems": []
}
'import requests
url = "https://test.paysight.io/customerapi/refund"
payload = {
"parentCompanyId": 1,
"userEmail": "care@yourdomain.com",
"messageId": "fd6562a1-e0e7-4b8b-b0d4-f20359482dd1",
"sendUserCommunication": False,
"amount": 12.99,
"refundItems": []
}
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({
parentCompanyId: 1,
userEmail: 'care@yourdomain.com',
messageId: 'fd6562a1-e0e7-4b8b-b0d4-f20359482dd1',
sendUserCommunication: false,
amount: 12.99,
refundItems: []
})
};
fetch('https://test.paysight.io/customerapi/refund', 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/customerapi/refund",
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([
'parentCompanyId' => 1,
'userEmail' => 'care@yourdomain.com',
'messageId' => 'fd6562a1-e0e7-4b8b-b0d4-f20359482dd1',
'sendUserCommunication' => false,
'amount' => 12.99,
'refundItems' => [
]
]),
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/customerapi/refund"
payload := strings.NewReader("{\n \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\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/customerapi/refund")
.header("ClientId", "<clientid>")
.header("UserEmail", "<useremail>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.paysight.io/customerapi/refund")
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 \"parentCompanyId\": 1,\n \"userEmail\": \"care@yourdomain.com\",\n \"messageId\": \"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1\",\n \"sendUserCommunication\": false,\n \"amount\": 12.99,\n \"refundItems\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "",
"refundId": "da6562a1-e0e7-4b8b-c0d4-g20359482dd1"
}Authorizations
Your Paysight API key. You can find it in your Paysight account at https://app.paysight.io/settings/account
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
The email address of the party or group making the request
Body
Payload
Your Paysight tenant id. This will be provided by Paysight.
1
An email associated with the party/agent making the request
"care@yourdomain.com"
The unique Paysight transaction id
"fd6562a1-e0e7-4b8b-b0d4-f20359482dd1"
If true, then Paysight will send a confirmation to the user's email address (if mail settings are set up)
false
The amount to refund in the original transaction currency. 0 will result in a full refund. Any amount greater than the transaction amount will be rejected. Any partial refund amount for an eCom order must be accompanied by a complete list of refundItems.
12.99
To be defined (applicable only to ecom transactions)
[]
Response
Valid Request. More detailed info will be in the JSON body