curl --request GET \
--url https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote \
--header 'x-api-key: <api-key>'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote', 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://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"enabled": true,
"refundAmount": 100,
"saleTake": null,
"fee": 3,
"iva": 0.48,
"feeTotal": 3.48,
"pendingSettlement": null,
"pendingAfter": null,
"balance": null,
"allowance": null,
"allowanceAvailable": null,
"allowed": true,
"missing": 0,
"kind": "SAME_DAY",
"deducted": 3.48,
"chargedFrom": "PENDING_SETTLEMENT",
"balanceAfter": null
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Refund quote
Read only. Tells you what refunding the sale now would cost the business (the fee Compago keeps, with IVA), where that fee would come from, and whether the refund would be accepted, without refunding anything.
curl --request GET \
--url https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote \
--header 'x-api-key: <api-key>'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote', 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://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/one-time-payment/{id}/refund-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"enabled": true,
"refundAmount": 100,
"saleTake": null,
"fee": 3,
"iva": 0.48,
"feeTotal": 3.48,
"pendingSettlement": null,
"pendingAfter": null,
"balance": null,
"allowance": null,
"allowanceAvailable": null,
"allowed": true,
"missing": 0,
"kind": "SAME_DAY",
"deducted": 3.48,
"chargedFrom": "PENDING_SETTLEMENT",
"balanceAfter": null
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Respuesta
The refund quote
What refunding this sale now would cost the business, and whether it would be accepted. Read only: nothing is reserved, so the answer can change if other sales settle or are refunded before you call the refund endpoint.
SAME_DAY: the sale was not settled yet, so only the fee is deducted from the business's pending settlement. LATE: the sale was already deposited, so the whole refund is deducted from its next settlements. Through an API key a refund is always same-day, so the quote answers SAME_DAY for any sale the API can still refund.
SAME_DAY, LATE "SAME_DAY"