curl --location --request POST 'https://merchant.fcfpay.com/api/v1/create-order' \
--header 'Authorization: Bearer YOUR_LIVE_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "yourdomain.com",
"order_id": "3",
"user_id": "1",
"amount": "10",
"currency_name": "USD",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"check_source_url": "https://yourdomain.com/api/v1/check-order"
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_LIVE_API_KEY");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"domain": "yourdomain.com",
"order_id": "3",
"user_id": "1",
"amount": "10",
"currency_name": "USD",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"check_source_url": "https://yourdomain.com/api/v1/check-order"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://merchant.fcfpay.com/api/v1/create-order", 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/create-order',
'headers': {
'Authorization': 'Bearer YOUR_LIVE_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"domain": "yourdomain.com",
"order_id": "3",
"user_id": "1",
"amount": "10",
"currency_name": "USD",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"check_source_url": "https://yourdomain.com/api/v1/check-order"
})
};
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/create-order',
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 =>'{
"domain": "yourdomain.com",
"order_id": "3",
"user_id": "1",
"amount": "10",
"currency_name": "USD",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"check_source_url": "https://yourdomain.com/api/v1/check-order"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_LIVE_API_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://merchant.fcfpay.com/api/v1/create-order"
payload = json.dumps({
"domain": "yourdomain.com",
"order_id": "3",
"user_id": "1",
"amount": "10",
"currency_name": "USD",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"check_source_url": "https://yourdomain.com/api/v1/check-order"
})
headers = {
'Authorization': 'Bearer YOUR_LIVE_API_KEY',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Creates a new order.
{
"success": true,
"data": {
"checkout_page_url": "https://checkout.fcfpay.com/JDJ5JDEwJFB2WjFLZldnbEd0R2JRbWNKOS5Lci5SU1FIVkdSY0ZLQktSZkl2Q0FjclRLdlJXYUZ3VWF5",
"payment_status": "waiting"
},
"message": "Order successfully created. Waiting for the payment."
}
After order creation, our system will send you a checkout page URL. You should redirect your customers to that URL.