LogoLogo
  • Intro
  • Quick Start
  • Reference
    • API Requests - V2
      • Create Order
      • Create Invoice
      • Deposit Callback
      • Check Order
      • Check Orders
    • API Requests - V1 - deprecated!
      • Create Order
      • Deposit Callback
      • Check Source
      • Check Order
      • Check Orders
Powered by GitBook
On this page
  • Check the Source
  • Check the source.
  1. Reference
  2. API Requests - V1 - deprecated!

Check Source

Check the source

PreviousDeposit CallbackNextCheck Order

Last updated 2 years ago

Check the Source

With this request, you should check the callback source and make sure it comes from FCF Pay.

You will receive theunique_id in the .

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"
}'
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));
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);
});
<?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;
Field
Description

unique_id

The unique id you mus get from deposit callback

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)

Check the source.

POST https://merchant.fcfpay.com/api/v1/check-source

Headers

Name
Type
Description

Authorization*

String

Bearer {{API_KEY}}

Request Body

Name
Type
Description

unique_id

string

Got from deposit callback request

{
  "success": true,
  "data": {
    "unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
  },
  "message": "Transaction exists."
}
{
  "success": false,
  "data": [],
  "message": "Merchant Authentication problem!"
}
{
  "success": false,
  "data": {
    "test": "test"
  },
  "message": "The given data was invalid!",
  "errors": {
    "unique_id": [
      "The unique id field is required."
    ]
  }
}
{
  "success": false,
  "data": {
    "unique_id": "0x9cf24f76778e517511f6178f114a1d3e95e3c7fdbfcbe52a961b6d748e860849_0"
  },
  "message": "Transaction does not exist!"
}
deposit callback