cURL
curl --request POST \
--url https://api-test.klyme.io/api/v1/payment-auth-requests \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantUuid": "<string>",
"amount": 10.99,
"redirectUrl": "<string>",
"bankId": "<string>",
"reference": "<string>",
"email": "[email protected]",
"firstName": "<string>",
"surname": "<string>",
"mobile": 123,
"phone": 123,
"customerId": "<string>",
"title": "<string>",
"dob": "2023-12-25",
"gender": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"postcode": "<string>",
"country": "FR",
"cart": "<array>",
"discountCode": "<string>",
"affiliateId": "<string>",
"custom1": "<string>",
"custom2": "<string>",
"custom3": "<string>",
"custom4": "<string>",
"custom5": "<string>",
"customJson": {}
}
'import requests
url = "https://api-test.klyme.io/api/v1/payment-auth-requests"
payload = {
"merchantUuid": "<string>",
"amount": 10.99,
"redirectUrl": "<string>",
"bankId": "<string>",
"reference": "<string>",
"email": "[email protected]",
"firstName": "<string>",
"surname": "<string>",
"mobile": 123,
"phone": 123,
"customerId": "<string>",
"title": "<string>",
"dob": "2023-12-25",
"gender": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"postcode": "<string>",
"country": "FR",
"cart": "<array>",
"discountCode": "<string>",
"affiliateId": "<string>",
"custom1": "<string>",
"custom2": "<string>",
"custom3": "<string>",
"custom4": "<string>",
"custom5": "<string>",
"customJson": {}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantUuid: '<string>',
amount: 10.99,
redirectUrl: '<string>',
bankId: '<string>',
reference: '<string>',
email: '[email protected]',
firstName: '<string>',
surname: '<string>',
mobile: 123,
phone: 123,
customerId: '<string>',
title: '<string>',
dob: '2023-12-25',
gender: '<string>',
company: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
postcode: '<string>',
country: 'FR',
cart: '<array>',
discountCode: '<string>',
affiliateId: '<string>',
custom1: '<string>',
custom2: '<string>',
custom3: '<string>',
custom4: '<string>',
custom5: '<string>',
customJson: {}
})
};
fetch('https://api-test.klyme.io/api/v1/payment-auth-requests', 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-test.klyme.io/api/v1/payment-auth-requests",
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([
'merchantUuid' => '<string>',
'amount' => 10.99,
'redirectUrl' => '<string>',
'bankId' => '<string>',
'reference' => '<string>',
'email' => '[email protected]',
'firstName' => '<string>',
'surname' => '<string>',
'mobile' => 123,
'phone' => 123,
'customerId' => '<string>',
'title' => '<string>',
'dob' => '2023-12-25',
'gender' => '<string>',
'company' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'postcode' => '<string>',
'country' => 'FR',
'cart' => '<array>',
'discountCode' => '<string>',
'affiliateId' => '<string>',
'custom1' => '<string>',
'custom2' => '<string>',
'custom3' => '<string>',
'custom4' => '<string>',
'custom5' => '<string>',
'customJson' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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-test.klyme.io/api/v1/payment-auth-requests"
payload := strings.NewReader("{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-test.klyme.io/api/v1/payment-auth-requests")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-test.klyme.io/api/v1/payment-auth-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}"
response = http.request(request)
puts response.read_body{
"uuid": "2ae4c7bb76b6e8a323a12ecea143e613"
}Payments
Create Payment Authorisation
Create a new payment authorisation request
POST
/
payment-auth-requests
cURL
curl --request POST \
--url https://api-test.klyme.io/api/v1/payment-auth-requests \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantUuid": "<string>",
"amount": 10.99,
"redirectUrl": "<string>",
"bankId": "<string>",
"reference": "<string>",
"email": "[email protected]",
"firstName": "<string>",
"surname": "<string>",
"mobile": 123,
"phone": 123,
"customerId": "<string>",
"title": "<string>",
"dob": "2023-12-25",
"gender": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"postcode": "<string>",
"country": "FR",
"cart": "<array>",
"discountCode": "<string>",
"affiliateId": "<string>",
"custom1": "<string>",
"custom2": "<string>",
"custom3": "<string>",
"custom4": "<string>",
"custom5": "<string>",
"customJson": {}
}
'import requests
url = "https://api-test.klyme.io/api/v1/payment-auth-requests"
payload = {
"merchantUuid": "<string>",
"amount": 10.99,
"redirectUrl": "<string>",
"bankId": "<string>",
"reference": "<string>",
"email": "[email protected]",
"firstName": "<string>",
"surname": "<string>",
"mobile": 123,
"phone": 123,
"customerId": "<string>",
"title": "<string>",
"dob": "2023-12-25",
"gender": "<string>",
"company": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"postcode": "<string>",
"country": "FR",
"cart": "<array>",
"discountCode": "<string>",
"affiliateId": "<string>",
"custom1": "<string>",
"custom2": "<string>",
"custom3": "<string>",
"custom4": "<string>",
"custom5": "<string>",
"customJson": {}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantUuid: '<string>',
amount: 10.99,
redirectUrl: '<string>',
bankId: '<string>',
reference: '<string>',
email: '[email protected]',
firstName: '<string>',
surname: '<string>',
mobile: 123,
phone: 123,
customerId: '<string>',
title: '<string>',
dob: '2023-12-25',
gender: '<string>',
company: '<string>',
address1: '<string>',
address2: '<string>',
city: '<string>',
postcode: '<string>',
country: 'FR',
cart: '<array>',
discountCode: '<string>',
affiliateId: '<string>',
custom1: '<string>',
custom2: '<string>',
custom3: '<string>',
custom4: '<string>',
custom5: '<string>',
customJson: {}
})
};
fetch('https://api-test.klyme.io/api/v1/payment-auth-requests', 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-test.klyme.io/api/v1/payment-auth-requests",
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([
'merchantUuid' => '<string>',
'amount' => 10.99,
'redirectUrl' => '<string>',
'bankId' => '<string>',
'reference' => '<string>',
'email' => '[email protected]',
'firstName' => '<string>',
'surname' => '<string>',
'mobile' => 123,
'phone' => 123,
'customerId' => '<string>',
'title' => '<string>',
'dob' => '2023-12-25',
'gender' => '<string>',
'company' => '<string>',
'address1' => '<string>',
'address2' => '<string>',
'city' => '<string>',
'postcode' => '<string>',
'country' => 'FR',
'cart' => '<array>',
'discountCode' => '<string>',
'affiliateId' => '<string>',
'custom1' => '<string>',
'custom2' => '<string>',
'custom3' => '<string>',
'custom4' => '<string>',
'custom5' => '<string>',
'customJson' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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-test.klyme.io/api/v1/payment-auth-requests"
payload := strings.NewReader("{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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-test.klyme.io/api/v1/payment-auth-requests")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-test.klyme.io/api/v1/payment-auth-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantUuid\": \"<string>\",\n \"amount\": 10.99,\n \"redirectUrl\": \"<string>\",\n \"bankId\": \"<string>\",\n \"reference\": \"<string>\",\n \"email\": \"[email protected]\",\n \"firstName\": \"<string>\",\n \"surname\": \"<string>\",\n \"mobile\": 123,\n \"phone\": 123,\n \"customerId\": \"<string>\",\n \"title\": \"<string>\",\n \"dob\": \"2023-12-25\",\n \"gender\": \"<string>\",\n \"company\": \"<string>\",\n \"address1\": \"<string>\",\n \"address2\": \"<string>\",\n \"city\": \"<string>\",\n \"postcode\": \"<string>\",\n \"country\": \"FR\",\n \"cart\": \"<array>\",\n \"discountCode\": \"<string>\",\n \"affiliateId\": \"<string>\",\n \"custom1\": \"<string>\",\n \"custom2\": \"<string>\",\n \"custom3\": \"<string>\",\n \"custom4\": \"<string>\",\n \"custom5\": \"<string>\",\n \"customJson\": {}\n}"
response = http.request(request)
puts response.read_body{
"uuid": "2ae4c7bb76b6e8a323a12ecea143e613"
}Call this endpoint to create a payment authorisation request and generate a unique 
uuid that you then insert into the id parameter
of the Klyme HTML element.
If everything is set up correctly as per the quickstart, you should see something similar to the following.

Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Example:
10.99
Available options:
EUR, GBP Where the user will be redirected to once the payment has been authorised.
Maximum string length:
256Maximum string length:
64Maximum string length:
36Maximum string length:
256Maximum string length:
64Maximum string length:
64Maximum string length:
32Maximum string length:
32Maximum string length:
128Maximum string length:
128Maximum string length:
128Maximum string length:
128Maximum string length:
64Maximum string length:
10Required string length:
2Example:
"FR"
Maximum string length:
32Maximum string length:
32Maximum string length:
128Maximum string length:
128Maximum string length:
128Maximum string length:
128Maximum string length:
128⌘I
