Transaction
This operation consists of registering the transaction consulted. For this operation you will only perform the registration and for it to be effective, the confirmation must be made.

Production: https://cashin.payvalida.com/v1/transactions/
Field
Type
Required
Descripción
name
string
yes
Name of the payment network.
checksum
string
yes
Check string, calculated with SHA512(name + reference + amount + transaction + FIXED_HASH)
reference
string
yes
Payment reference
amount
string
yes
Amount of the transaction. It must be equal to the amount returned in the query. unless the query is open amount (0) in which case this amount must be higher.
transaction
string
yes
Unique transaction ID for the payment network
commerce
string
no
Name of the commerce on which the transaction is being carried out.
teller
string
yes
Identification of the collection point. (ip or code of store).
money
string
yes
Transaction currency code **
nombres
string
no
User name
apellido1
string
no
User's first last name
apellido2
string
no
User's second last name
curl --location --request POST 'https://sandbox-cashin.payvalida.com/v1/transactions/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "BEVALIDA_343",
"reference": "9999999999",
"amount": "45000",
"transaction": "129999999",
"commerce": "Payvalida",
"teller": "1.1.1.1",
"money": "COP",
"checksum": "11C4152A38CFE360EE83AB6B991B715774DCE6810BB4DF9F8A91FD79BFC20235CBCD107BC1DC392A43E5D185174978CBAA0874C207CFBDF02D0D63FD504A7E43"
}'Field
Struct
Type
Description
CODE
-
string
Response code 0000 for OK.
TEXT
-
string
Description of the response
DATA
-
-
payment data
AMOUNT
DATA
double
Confirmation of the transaction amount.
DESCRIPTION
DATA
string
Description of the transaction
REFERENCE
DATA
string
Confirmation of the reference number.
IDTRANSACTION
DATA
string
Confirmation of the transaction id sent by the network.
IDPAYVALIDA
DATA
string
Code of the operation in Payvalida.
COMMERCE
DATA
string
Name of the merchant registering the transaction.
{
"CODE": "0000",
"TEXT": "OK",
"DATA": {
"AMOUNT": 45000.0,
"DESCRIPTION": "Cliente Payvalida Test([email protected])",
"REFERENCE": "9999999999",
"IDTRANSACTION": "129999999",
"IDPAYVALIDA": "47961",
"COMMERCE": "Payvalida"
}
}Header
Value
Content-Type
application/json
Transaction currency codes
Currency - ISO
Country
343
COP
🇨🇴 Colombia
314
CRC
🇨🇷 Costa Rica
345
USD
🇪🇨 Ecuador
348
PEN
🇵🇪 Perú
Examples:
GO
package main
import (
"bytes"
"crypto/sha512"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type Request struct {
Name string `json:"name,omitempty"`
Checksum string `json:"checksum,omitempty"`
Reference string `json:"reference,omitempty"`
Amount string `json:"amount,omitempty"`
Transaction string `json:"transaction,omitempty"`
Commerce string `json:"commerce,omitempty"`
Teller string `json:"teller,omitempty"`
Money string `json:"money,omitempty"`
Nombres string `json:"nombres,omitempty"`
Apellido1 string `json:"apellido1,omitempty"`
Apellido2 string `json:"apellido2,omitempty"`
}
func main() {
url := "https://sandbox-cashin.payvalida.com/v1/transactions/"
method := "POST"
red := "BEVALIDA_343" //cambiar por el nombre de la red
amount := "45000"
reference := "9999999999"
transaction := "129999999"
fixedHash := "COMPLETAR" //Completar con la credencial asignada por payvalida
key := sha512.Sum512([]byte(red + reference + amount + transaction + fixedHash))
checksum := hex.EncodeToString(key[:])
request := Request{
Name: red,
Checksum: checksum,
Reference: reference,
Amount: amount,
Transaction: transaction,
Commerce: "Payvalida",
Teller: "1.1.1.1",
Money: "COP",
Nombres: "nombre1",
Apellido1: "apellido1",
Apellido2: "apellido2",
}
json, err := json.Marshal(request)
if err != nil {
fmt.Println(err)
return
}
client := &http.Client{}
req, err := http.NewRequest(method, url, bytes.NewBuffer(json))
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://sandbox-cashin.payvalida.com/v1/transactions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n \"name\": \"BEVALIDA_343\",\n \"reference\": \"9999999999\",\n \"amount\": \"45000\",\n \"transaction\": \"129999999\",\n \"commerce\": \"Payvalida\",\n \"teller\": \"1.1.1.1\",\n \"money\": \"COP\",\n \"checksum\": \"11C4152A38CFE360EE83AB6B991B715774DCE6810BB4DF9F8A91FD79BFC20235CBCD107BC1DC392A43E5D185174978CBAA0874C207CFBDF02D0D63FD504A7E43\"\n}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"BEVALIDA_343\",\n \"reference\": \"9999999999\",\n \"amount\": \"45000\",\n \"transaction\": \"129999999\",\n \"commerce\": \"Payvalida\",\n \"teller\": \"1.1.1.1\",\n \"money\": \"COP\",\n \"checksum\": \"11C4152A38CFE360EE83AB6B991B715774DCE6810BB4DF9F8A91FD79BFC20235CBCD107BC1DC392A43E5D185174978CBAA0874C207CFBDF02D0D63FD504A7E43\"\n}");
Request request = new Request.Builder()
.url("https://sandbox-cashin.payvalida.com/v1/transactions/")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();PYTHON
import http.client
import mimetypes
conn = http.client.HTTPSConnection("sandbox-cashin.payvalida.com")
payload = "{\n \"name\": \"BEVALIDA_343\",\n \"reference\": \"9999999999\",\n \"amount\": \"45000\",\n \"transaction\": \"129999999\",\n \"commerce\": \"Payvalida\",\n \"teller\": \"1.1.1.1\",\n \"money\": \"COP\",\n \"checksum\": \"11C4152A38CFE360EE83AB6B991B715774DCE6810BB4DF9F8A91FD79BFC20235CBCD107BC1DC392A43E5D185174978CBAA0874C207CFBDF02D0D63FD504A7E43\"\n}"
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/transactions/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))Última actualización
¿Te fue útil?