curl --request POST \
--url https://api.fernhq.com/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"quoteId": "c88ebfc2-3356-48b5-b2bb-6fca7b618c96",
"correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8"
}
'import requests
url = "https://api.fernhq.com/transactions"
payload = {
"quoteId": "c88ebfc2-3356-48b5-b2bb-6fca7b618c96",
"correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8"
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteId: 'c88ebfc2-3356-48b5-b2bb-6fca7b618c96',
correlationId: '03b7030f-6da1-4e76-3352-3debd82112c8'
})
};
fetch('https://api.fernhq.com/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fernhq.com/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => 'c88ebfc2-3356-48b5-b2bb-6fca7b618c96',
'correlationId' => '03b7030f-6da1-4e76-3352-3debd82112c8'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fernhq.com/transactions"
payload := strings.NewReader("{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fernhq.com/transactions")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}"
response = http.request(request)
puts response.read_bodyCreate transaction
Create a transactionCreates a transaction using a given quoteID. QuoteID must be valid and not expired.
curl --request POST \
--url https://api.fernhq.com/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"quoteId": "c88ebfc2-3356-48b5-b2bb-6fca7b618c96",
"correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8"
}
'import requests
url = "https://api.fernhq.com/transactions"
payload = {
"quoteId": "c88ebfc2-3356-48b5-b2bb-6fca7b618c96",
"correlationId": "03b7030f-6da1-4e76-3352-3debd82112c8"
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quoteId: 'c88ebfc2-3356-48b5-b2bb-6fca7b618c96',
correlationId: '03b7030f-6da1-4e76-3352-3debd82112c8'
})
};
fetch('https://api.fernhq.com/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fernhq.com/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => 'c88ebfc2-3356-48b5-b2bb-6fca7b618c96',
'correlationId' => '03b7030f-6da1-4e76-3352-3debd82112c8'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fernhq.com/transactions"
payload := strings.NewReader("{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fernhq.com/transactions")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"c88ebfc2-3356-48b5-b2bb-6fca7b618c96\",\n \"correlationId\": \"03b7030f-6da1-4e76-3352-3debd82112c8\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
To authenticate server-side requests
Headers
Body
Schema for creating a new transaction
Schema for creating a new transaction
Response
Response schema for a transaction creation request
Response schema for a transaction creation request
Unique identifier of the transaction
"1d8beb26-b4d1-47ee-8e5d-0d3905f200c7"
ID of the customer associated with this transaction
"0423300f-ae6d-4e82-8afb-a3b430e22e29"
ID of the quote used for this transaction
"1d8beb26-b4d1-47ee-8e5d-0d3905f200c7"
Current status of the transaction
AWAITING_TRANSFER, PROCESSING, COMPLETED, FAILED, CANCELLED, CREATED, EXPIRED "PROCESSING"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Fee structure for a transaction
Show child attributes
Show child attributes
ISO timestamp when this transaction was created
"2023-08-01T12:00:00Z"
ISO timestamp when this transaction was last updated
"2023-08-01T12:00:00Z"
Optional: You can add your own correlationId to match the transaction to your own internal records.
"03b7030f-6da1-4e76-3352-3debd82112c8"
Instructions for the customer to initiate the fiat transfer
- Fiat Transfer Instructions
- Crypto Transfer Instructions
Show child attributes
Show child attributes
ISO timestamp when this transaction expires (only for AWAITING_TRANSFER status)
"2023-08-01T12:05:00Z"
Was this page helpful?