Payments
Create Pay-In
Creates a pay-in to collect fiat from one of your users. For PSE, the response includes the pseLink the user must open to pay.
Request
| Field | Type | Required | Description |
|---|---|---|---|
| Authorization | Header | Yes | Bearer <access_token> obtained from POST /api/v1/client/token. |
| user_id | Path | Yes | User who pays. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | Yes | Amount to collect. |
| currency | string | Yes | Fiat currency (COP). |
| paymentMethod | string | No | Rail used to collect (e.g. PSE, NEQUI, DAVIPLATA). |
| bank | string | No | Bank code from GET /admin/banks. Required for PSE. |
| redirectUrl | string | No | Where the user returns after paying. |
| phone | string | No | Phone number, for NEQUI / DAVIPLATA. |
| externalReference | string | No | Your own reference for reconciliation. |
| expirationDate | string | No | Expiration of the payment request. |
Response
| Field | Description |
|---|---|
| id | Identifier of the pay-in. |
| status | Initial status (PENDING). |
| currency / amount | Amount to collect. |
| paymentMethod | Rail used. |
| pseLink | Payment link for PSE. |
| externalReference | Your reference, if sent. |
POST
/
api
/
v1
/
admin
/
fiats
/
{user_id}
/
payin
Create Pay-In
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100000,
"currency": "COP",
"bank": "{{pse_bank_code}}",
"redirectUrl": "https://app.kravata.co/"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin"
payload = {
"amount": 100000,
"currency": "COP",
"bank": "{{pse_bank_code}}",
"redirectUrl": "https://app.kravata.co/"
}
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({
amount: 100000,
currency: 'COP',
bank: '{{pse_bank_code}}',
redirectUrl: 'https://app.kravata.co/'
})
};
fetch('https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin', 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/admin/fiats/{user_id}/payin",
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([
'amount' => 100000,
'currency' => 'COP',
'bank' => '{{pse_bank_code}}',
'redirectUrl' => 'https://app.kravata.co/'
]),
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/admin/fiats/{user_id}/payin"
payload := strings.NewReader("{\n \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\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/admin/fiats/{user_id}/payin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin")
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 \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2a6777d2-a9d6-426d-b4e5-edd5124b613e",
"status": "CASHININIT",
"currency": "COP",
"amount": 100000,
"paymentMethod": "PSE",
"pseLink": "https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=lndJwmelhJEXv02LyLwiExk%2fJuRztgJmSlsbEKi04Ug%3d"
}Create Pay-In
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100000,
"currency": "COP",
"bank": "{{pse_bank_code}}",
"redirectUrl": "https://app.kravata.co/"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin"
payload = {
"amount": 100000,
"currency": "COP",
"bank": "{{pse_bank_code}}",
"redirectUrl": "https://app.kravata.co/"
}
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({
amount: 100000,
currency: 'COP',
bank: '{{pse_bank_code}}',
redirectUrl: 'https://app.kravata.co/'
})
};
fetch('https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin', 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/admin/fiats/{user_id}/payin",
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([
'amount' => 100000,
'currency' => 'COP',
'bank' => '{{pse_bank_code}}',
'redirectUrl' => 'https://app.kravata.co/'
]),
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/admin/fiats/{user_id}/payin"
payload := strings.NewReader("{\n \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\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/admin/fiats/{user_id}/payin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payin")
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 \"amount\": 100000,\n \"currency\": \"COP\",\n \"bank\": \"{{pse_bank_code}}\",\n \"redirectUrl\": \"https://app.kravata.co/\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2a6777d2-a9d6-426d-b4e5-edd5124b613e",
"status": "CASHININIT",
"currency": "COP",
"amount": 100000,
"paymentMethod": "PSE",
"pseLink": "https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=lndJwmelhJEXv02LyLwiExk%2fJuRztgJmSlsbEKi04Ug%3d"
}
