Create Chargeback Response
POST https://api-sandbox.coinflow.cash/api/merchant/chargebacks/{paymentId}/respond Content-Type: application/json
Respond to a chargeback. This will send the response to the card network.
Reference: /api-reference/api-reference/merchant/respond
Authentication
Authorizationheader (required) — The API key of the merchant - see /api-reference/api-reference/authentication/get-session-keyAuthorizationheader (required)
Request
Path parameters
paymentId(string, required)
Body (application/json)
object or object- object
response(string, required)
- object
fileKey(string, required)
- object
Examples
Request
{
"response": "We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance."
}
Response
{}
SDK Code
import requests
url = "https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond"
payload = { "response": "We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance." }
headers = {
"Authorization": "<apiKey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond';
const options = {
method: 'POST',
headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
body: '{"response":"We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance."}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond"
payload := strings.NewReader("{\n \"response\": \"We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<apiKey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"response\": \"We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance.\"\n}"
response = http.request(request)
puts response.read_body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond")
.header("Authorization", "<apiKey>")
.header("Content-Type", "application/json")
.body("{\n \"response\": \"We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance.\"\n}")
.asString();
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond', [
'body' => '{
"response": "We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance."
}',
'headers' => [
'Authorization' => '<apiKey>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
using RestSharp;
var client = new RestClient("https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"response\": \"We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Authorization": "<apiKey>",
"Content-Type": "application/json"
]
let parameters = ["response": "We have reviewed the transaction and found it to be valid. Attached are the supporting documents proving the delivery and customer acceptance."] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/merchant/chargebacks/paymentId/respond")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()