Submit a payment attempt (Kalixo.js)
curl --request POST \
--url https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kalixo-Client-Secret: <kalixo-client-secret>' \
--data '
{
"payment_method_data": {},
"store_payment_method": true,
"origin": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Kalixo-Client-Secret': '<kalixo-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({payment_method_data: {}, store_payment_method: true, origin: '<string>'})
};
fetch('https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts"
payload = {
"payment_method_data": {},
"store_payment_method": True,
"origin": "<string>"
}
headers = {
"Kalixo-Client-Secret": "<kalixo-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts",
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([
'payment_method_data' => [
],
'store_payment_method' => true,
'origin' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Kalixo-Client-Secret: <kalixo-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"attempt_id": "<string>",
"status": "authorized",
"error": {
"code": "payment_declined",
"decline_code": "insufficient_funds",
"message": "<string>"
},
"provider_payload": {}
}{
"error": {
"type": "invalid_request_error",
"code": "amount_locked",
"message": "<string>",
"request_id": "<string>",
"decline_code": "<string>",
"param": "<string>"
}
}Client
Submit a payment attempt (Kalixo.js)
POST
/
v1
/
client
/
checkout-sessions
/
{id}
/
attempts
Submit a payment attempt (Kalixo.js)
curl --request POST \
--url https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kalixo-Client-Secret: <kalixo-client-secret>' \
--data '
{
"payment_method_data": {},
"store_payment_method": true,
"origin": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Kalixo-Client-Secret': '<kalixo-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({payment_method_data: {}, store_payment_method: true, origin: '<string>'})
};
fetch('https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts"
payload = {
"payment_method_data": {},
"store_payment_method": True,
"origin": "<string>"
}
headers = {
"Kalixo-Client-Secret": "<kalixo-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://checkout.kalixo.io/v1/client/checkout-sessions/{id}/attempts",
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([
'payment_method_data' => [
],
'store_payment_method' => true,
'origin' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Kalixo-Client-Secret: <kalixo-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"attempt_id": "<string>",
"status": "authorized",
"error": {
"code": "payment_declined",
"decline_code": "insufficient_funds",
"message": "<string>"
},
"provider_payload": {}
}{
"error": {
"type": "invalid_request_error",
"code": "amount_locked",
"message": "<string>",
"request_id": "<string>",
"decline_code": "<string>",
"param": "<string>"
}
}Authorizations
Publishable key, kc_pk_test_... or kc_pk_live_.... Safe for browsers.
Headers
The checkout session's client_secret.
Path Parameters
Body
application/json