With this request, you should check the callback source and make sure it comes from FCF Pay.
cURL JavaScript Node.js PHP Python
Copy curl --location --request POST 'https://merchant.fcfpay.com/api/v1/check-source' \
--header 'Authorization: Bearer YOUR_LIVE_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
}'
Copy var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_LIVE_API_KEY");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://merchant.fcfpay.com/api/v1/check-source", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Copy var request = require('request');
var options = {
'method': 'POST',
'url': 'https://merchant.fcfpay.com/api/v1/check-source',
'headers': {
'Authorization': 'Bearer ',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Copy <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://merchant.fcfpay.com/api/v1/check-source',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer ',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Copy import requests
import json
url = "https://merchant.fcfpay.com/api/v1/check-source"
payload = json.dumps({
"unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
})
headers = {
'Authorization': 'Bearer YOUR_LIVE_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200: OK Transaction exists 200: OK Merchant Authentication problem! 401: Unauthorized The given data was invalid! 401: Unauthorized Transaction does not exist!
Copy {
"success" : true ,
"data" : {
"unique_id" : "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
} ,
"message" : "Transaction exists."
}
Copy {
"success" : false ,
"data" : [] ,
"message" : "Merchant Authentication problem!"
}
Copy {
"success" : false ,
"data" : {
"test" : "test"
} ,
"message" : "The given data was invalid!" ,
"errors" : {
"unique_id" : [
"The unique id field is required."
]
}
}
Copy {
"success" : false ,
"data" : {
"unique_id" : "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
} ,
"message" : "Transaction does not exist!"
}