Payments
Create Payment
Creates a payment that, in a single request, collects the funds from the user (pay-in) and sends them to a destination account (payout).
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 |
|---|---|---|---|
| asset | string | Yes | Fiat currency (e.g. COP). |
| amount | number | Yes | Amount of the payment. |
| paymentMethod | string | Yes | Rail used to collect the funds (e.g. PSE, BREB). |
| bank | string | No | Bank code from GET /admin/banks. Required for PSE. |
| destinationId | uuid | No | Registered, APPROVED destination account. Send this or accountExternalId. |
| accountExternalId | string | No | External identifier of the destination account. |
| transactionPurpose | string | No | Description of the payment. |
| redirectUrl | string | No | Where the user returns after paying. |
Response
| Field | Description |
|---|---|
| id | Identifier of the payment. |
| status | Initial status (PENDING). |
| asset / amount | Amount of the payment. |
| paymentMethod | Rail used. |
| pseLink | Payment link for PSE. |
| brebKey / ownerName | Bre-B key and account holder to pay, for BREB. |
POST
/
api
/
v1
/
admin
/
fiats
/
{user_id}
/
payment
Create Payment
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "COP",
"amount": 400000,
"paymentMethod": "PSE",
"bank": "{{pse_bank_code}}",
"destinationId": "{{destination_account_id}}",
"transactionPurpose": "Cuota mensual"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment"
payload = {
"asset": "COP",
"amount": 400000,
"paymentMethod": "PSE",
"bank": "{{pse_bank_code}}",
"destinationId": "{{destination_account_id}}",
"transactionPurpose": "Cuota mensual"
}
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({
asset: 'COP',
amount: 400000,
paymentMethod: 'PSE',
bank: '{{pse_bank_code}}',
destinationId: '{{destination_account_id}}',
transactionPurpose: 'Cuota mensual'
})
};
fetch('https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment', 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}/payment",
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([
'asset' => 'COP',
'amount' => 400000,
'paymentMethod' => 'PSE',
'bank' => '{{pse_bank_code}}',
'destinationId' => '{{destination_account_id}}',
'transactionPurpose' => 'Cuota mensual'
]),
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}/payment"
payload := strings.NewReader("{\n \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\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}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment")
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 \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "39cd20e4-a52a-48b1-9463-667b14cc9e5e",
"status": "CASHININIT",
"paymentMethod": "PSE",
"asset": "COP",
"amount": 400000,
"pseLink": "https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=cl6nXJFR92YL6Sj62YhibLe0COmiYV0boEbmUEwR%2bfI%3d"
}Body
application/json
Create Payment
curl --request POST \
--url https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset": "COP",
"amount": 400000,
"paymentMethod": "PSE",
"bank": "{{pse_bank_code}}",
"destinationId": "{{destination_account_id}}",
"transactionPurpose": "Cuota mensual"
}
'import requests
url = "https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment"
payload = {
"asset": "COP",
"amount": 400000,
"paymentMethod": "PSE",
"bank": "{{pse_bank_code}}",
"destinationId": "{{destination_account_id}}",
"transactionPurpose": "Cuota mensual"
}
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({
asset: 'COP',
amount: 400000,
paymentMethod: 'PSE',
bank: '{{pse_bank_code}}',
destinationId: '{{destination_account_id}}',
transactionPurpose: 'Cuota mensual'
})
};
fetch('https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment', 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}/payment",
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([
'asset' => 'COP',
'amount' => 400000,
'paymentMethod' => 'PSE',
'bank' => '{{pse_bank_code}}',
'destinationId' => '{{destination_account_id}}',
'transactionPurpose' => 'Cuota mensual'
]),
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}/payment"
payload := strings.NewReader("{\n \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\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}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api-kore.kravata.co/api/v1/admin/fiats/{user_id}/payment")
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 \"asset\": \"COP\",\n \"amount\": 400000,\n \"paymentMethod\": \"PSE\",\n \"bank\": \"{{pse_bank_code}}\",\n \"destinationId\": \"{{destination_account_id}}\",\n \"transactionPurpose\": \"Cuota mensual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "39cd20e4-a52a-48b1-9463-667b14cc9e5e",
"status": "CASHININIT",
"paymentMethod": "PSE",
"asset": "COP",
"amount": 400000,
"pseLink": "https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=cl6nXJFR92YL6Sj62YhibLe0COmiYV0boEbmUEwR%2bfI%3d"
}
