Create Order
Create an order
Creating a new order
curl --location -g --request POST '{{BASE_URL}}/v2/create-order' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "yourdomain.com",
"order_id": "Test123",
"user_id": "1",
"amount": "100",
"currency_name": "EUR",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"items": {
"1": {
"Item Name": "Test Item 1",
"Quantity":"1",
"Price": 10,
"Total":"12",
},
"2": {
"Item Name": "Test Item 2",
"Price": 20
}
}
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{API_KEY}}");
myHeaders.append("Content-Type", "application/json");
var raw = "{\r\n \"domain\": \"yourdomain.com\",\r\n \"order_id\": \"Test123\",\r\n \"user_id\": \"1\",\r\n \"amount\": \"100\",\r\n \"currency_name\": \"EUR\",\r\n \"order_date\": \"2022-04-26\",\r\n \"redirect_url\": \"https://yourdomain.com/thank-you/\",\r\n \"items\": {\r\n \"1\": {\r\n \"Item Name\": \"Test Item 1\",\r\n \"Quantity\":\"1\",\r\n \"Price\": 10,\r\n \"Total\":\"12\",\r\n },\r\n \"2\": {\r\n \"Item Name\": \"Test Item 2\",\r\n \"Price\": 20\r\n }\r\n }\r\n}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{BASE_URL}}/v2/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': '{{BASE_URL}}/v2/create-order',
'headers': {
'Authorization': 'Bearer {{API_KEY}}',
'Content-Type': 'application/json'
},
body: '{\r\n "domain": "yourdomain.com",\r\n "order_id": "Test123",\r\n "user_id": "1",\r\n "amount": "100",\r\n "currency_name": "EUR",\r\n "order_date": "2022-04-26",\r\n "redirect_url": "https://yourdomain.com/thank-you/",\r\n "items": {\r\n "1": {\r\n "Item Name": "Test Item 1",\r\n "Quantity":"1",\r\n "Price": 10,\r\n "Total":"12",\r\n },\r\n "2": {\r\n "Item Name": "Test Item 2",\r\n "Price": 20\r\n }\r\n }\r\n}'
};
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 => '%7B%7BBASE_URL%7D%7D/v2/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": "Test123",
"user_id": "1",
"amount": "100",
"currency_name": "EUR",
"order_date": "2022-04-26",
"redirect_url": "https://yourdomain.com/thank-you/",
"items": {
"1": {
"Item Name": "Test Item 1",
"Quantity":"1",
"Price": 10,
"Total":"12",
},
"2": {
"Item Name": "Test Item 2",
"Price": 20
}
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer {{API_KEY}}',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "{{BASE_URL}}/v2/create-order"
payload = "{\r\n\t\"domain\": \"yourdomain.com\",\r\n\t\"order_id\": \"Test123\",\r\n \"user_id\": \"1\",\r\n\t\"amount\": \"100\",\r\n\t\"currency_name\": \"EUR\",\r\n \"order_date\": \"2022-04-26\",\r\n\t\"redirect_url\": \"https://yourdomain.com/thank-you/\",\r\n \"items\": {\r\n\t\t\t\"1\": {\r\n\t\t\t\t\"Item Name\": \"Test Item 1\",\r\n \"Quantity\":\"1\",\r\n\t\t\t\t\"Price\": 10,\r\n \"Total\":\"12\",\r\n\t\t\t},\r\n\t\t\t\"2\": {\r\n\t\t\t\t\"Item Name\": \"Test Item 2\",\r\n\t\t\t\t\"Price\": 20\r\n\t\t\t}\r\n\t\t}\r\n}"
headers = {
'Authorization': 'Bearer {{API_KEY}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Create an order.
POST
https://merchant.fcfpay.com/api/v2/create-order
Creates a new order.
Request Body
{
"success": true,
"data": {
"checkout_page_url": "https://checkout-sandbox.fcfpay.com/pay/JDJ5JDEwJGNFWHNualp6NnFydDNNZzhkVUJwN2VILkJkTko1RmFTZ1ZVQVRCVWxqSVlxUy83YzRwTFou",
"payment_status": "waiting"
},
"message": "Order successfully created. Waiting for the payment."
}
{
"success": false,
"data": [],
"message": "Merchant Authentication problem!"
}
After order creation, our system will send you a checkout page URL. You should redirect your customers to that URL.
If you send information about items, this will be displayed on the checkout page:
Last updated