WhatsApp Channel
Create a PIN challenge
Creates a single-use flowToken (5 minutes) for the WhatsApp PIN Flow, bound to this user session. Send the Flow with it; when the user enters the right PIN, send the operation with the same user token within 120 seconds. One confirmation authorizes one operation. Wrong PINs count toward the same 3-attempt lock as the widget.
Authentication
The user token returned by Verify the OTP, in both headers: Authorization: Bearer <user token> and Cookie: accessToken=<user token>.
See the WhatsApp channel guide for the full flow.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | - | Invalid purpose. |
| 404 | - | The user has no PIN: send them to the widget to create it. |
POST
/
api
/
v1
/
pin
/
challenge
Create a PIN challenge
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/pin/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "withdrawal",
"summary": "Retiro de 100.000 COP a Bancolombia ****4321"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/pin/challenge"
payload = {
"purpose": "withdrawal",
"summary": "Retiro de 100.000 COP a Bancolombia ****4321"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'withdrawal', summary: 'Retiro de 100.000 COP a Bancolombia ****4321'})
};
fetch('https://test-api-kore.kravata.co/api/v1/pin/challenge', 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://test-api-kore.kravata.co/api/v1/pin/challenge",
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([
'purpose' => 'withdrawal',
'summary' => 'Retiro de 100.000 COP a Bancolombia ****4321'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://test-api-kore.kravata.co/api/v1/pin/challenge"
payload := strings.NewReader("{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://test-api-kore.kravata.co/api/v1/pin/challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/pin/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}"
response = http.request(request)
puts response.read_body{
"flowToken": "<string>",
"expiresIn": 300
}Authorizations
Access token from POST /api/v1/client/token.
Body
application/json
Create a PIN challenge
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/pin/challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "withdrawal",
"summary": "Retiro de 100.000 COP a Bancolombia ****4321"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/pin/challenge"
payload = {
"purpose": "withdrawal",
"summary": "Retiro de 100.000 COP a Bancolombia ****4321"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({purpose: 'withdrawal', summary: 'Retiro de 100.000 COP a Bancolombia ****4321'})
};
fetch('https://test-api-kore.kravata.co/api/v1/pin/challenge', 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://test-api-kore.kravata.co/api/v1/pin/challenge",
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([
'purpose' => 'withdrawal',
'summary' => 'Retiro de 100.000 COP a Bancolombia ****4321'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://test-api-kore.kravata.co/api/v1/pin/challenge"
payload := strings.NewReader("{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://test-api-kore.kravata.co/api/v1/pin/challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/pin/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"purpose\": \"withdrawal\",\n \"summary\": \"Retiro de 100.000 COP a Bancolombia ****4321\"\n}"
response = http.request(request)
puts response.read_body{
"flowToken": "<string>",
"expiresIn": 300
}
