Channel: 14

Provider: Trio Brasil

Payment Method: APM

Available Currencies

NameCodeCountry
Brazilian realBRLBrazil

Request example

curl --request POST \
  --url http://paymentscert.alps.cl/justpay/check-out/SecurePayment \
  --data public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks \
  --data time=2022-10-13T14:39:09 \
  --data channel=14 \
  --data amount=100 \
  --data currency=BRL \
  --data trans_id=1 \
  --data time_expired=120 \
  --data url_ok=https://bit.ly/3S4I7iR \
  --data url_error=https://bit.ly/3S5aOwc \
  --data signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208 \
  --data 'shopper_information={"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "http://paymentscert.alps.cl/justpay/check-out/SecurePayment",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks&time=2022-10-13T14%3A39%3A09&channel=14&amount=100&currency=BRL&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208&shopper_information=%7B%22Phone%22%3A%20%2211995588222%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%22country_code%22%3A%20%22BRL%22%2C%22name_shopper%22%3A%20%22Jhon%22%2C%22Num_doc_identi%22%3A%20%2244227766880%22%2C%22type_doc_identi%22%3A%20%22CPF%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22address%22%3A%20%7B%22zipcode%22%3A%20%2201156060%22%2C%22street%22%3A%20%22Rua%20J%C3%BAlio%20Gonzalez%22%2C%22number%22%3A%20%221044%22%2C%22district%22%3A%20%22Barra%20Funda%22%2C%22complement%22%3A%20%22Sala%2001%22%2C%22city%22%3A%20%22S%C3%A3o%20Paulo%22%2C%22state%22%3A%20%22SP%22%7D%7D",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "http://paymentscert.alps.cl/justpay/check-out/SecurePayment"

payload = "public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks&time=2022-10-13T14%3A39%3A09&channel=14&amount=100&currency=BRL&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208&shopper_information=%7B%22Phone%22%3A%20%2211995588222%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%22country_code%22%3A%20%22BRL%22%2C%22name_shopper%22%3A%20%22Jhon%22%2C%22Num_doc_identi%22%3A%20%2244227766880%22%2C%22type_doc_identi%22%3A%20%22CPF%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22address%22%3A%20%7B%22zipcode%22%3A%20%2201156060%22%2C%22street%22%3A%20%22Rua%20J%C3%BAlio%20Gonzalez%22%2C%22number%22%3A%20%221044%22%2C%22district%22%3A%20%22Barra%20Funda%22%2C%22complement%22%3A%20%22Sala%2001%22%2C%22city%22%3A%20%22S%C3%A3o%20Paulo%22%2C%22state%22%3A%20%22SP%22%7D%7D"
response = requests.request("POST", url, data=payload)

print(response.text)
const qs = require("querystring");
const http = require("http");

const options = {
  "method": "POST",
  "hostname": "paymentscert.alps.cl",
  "port": null,
  "path": "/justpay/check-out/SecurePayment",
  "headers": {}
};

const req = http.request(options, function (res) {
  const chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(qs.stringify({
  public_key: 'zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks',
  time: '2022-10-13T14:39:09',
  channel: '14',
  amount: '100',
  currency: 'BRL',
  trans_id: '1',
  time_expired: '120',
  url_ok: 'https://bit.ly/3S4I7iR',
  url_error: 'https://bit.ly/3S5aOwc',
  signature: 'e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208',
  shopper_information: '{"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'
}));
req.end();

Mandatory Data

AttributeMandatoryData typeDescription
public_keyTrueString (255)Public key, unique value that identifies the commerce
timeTrueDatetimeRequest data time
channelTrueIntegerPayment Channel
amountTrueDoubleThe amount of the transaction. Use 2 decimals.
currencyTrueString (3)Transaction currency code
trans_idTrueString (255)Transaction id
time_expiredTrueString (255)Time in minutes to expire the token. Value given in minutes. Minimum Suggested: Online: 30 minutes Cash: 2 hours For Brazil: Online: 2 hours Cash 24 hrs
url_okTrueString (255)URL where shopper will be redirected from the online banking if payment was successful (Must be Https)
url_errorTrueString (255)URL where shopper will be redirected from the online banking if payment was wrong.(Must be Https)
signatureTrueString (255)Signature hash256: Review signature calculation
shopper_informationTrueJSON StringJSON String Data: Review JSON index & format

shopper_information JSON format

📘

Field shopper_information must be send in string format (JSON encode).

'{"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'

The shopper_information field is a column corresponding to a json with the next keys:

ParameterMandatoryData TypeDescription
name_shopperTrueString (255)Shopper's name
last_name_ShopperTrueString (255)Shopper's last name
type_doc_identiTrueString (3)Identification document [CPF, CNPJ]
Num_doc_identiTrueString (12)Identification document number
emailTrueString (255)Shopper's email
country_codeTrueString (4)Country's phone code [+57]
PhoneTrueString (12)Shopper's phone number
countryTrueString (3)Country ISO code [BRA]
direct_integrationFalseBooleanUse direct integration. Server will response JSON Object

Direct integration

You have the option to create a direct checkout, for this integration you'll receive a JSON Object instead of the checkout url.

Aditional fields for direct integration

AttributeMandatoryData typeDescription
direct_integrationTrueIntegerSend 1 for direct integration

Errors

To better error handling, we'll return the errors in the response body using the following fields:

{
  "error":{
    "code":"UNAUTHORIZED_RESOURCE",
    "message":"Resource being accessed is unauthorized."
  }
}

General error handling

CodeMessage
TRIO_SERVICE_UNAVAILABLEUnavailable service
TRIO_SERVICE_REQUEST_TIMED_OUTTimeout
TRIO_SERVICE_REQUEST_METHOD_FORBIDDENMethod not allowed
ALREADY_EXISTS_RESOURCEA {resource} already exists for the given reference.
INVALID_RESOURCE{resource} is invalid.
NOT_FOUND_RESOURCE{resource} was not found.
INVALID_PARAMETERField {parameter} is invalid.
REQUIRED_PARAMETERField {parameter} is required.

Authentication error handling

CodeMessage
UNAUTHORIZED_RESOURCEUnauthorized feature
TRIO_CLIENT_SECRET_INVALIDInvalid client secret.
TRIO_CLIENT_ID_INVALIDInvalid client id.

Integrations error handling

CodeMessage
INTEGRATION_ERRORAn unexpected error occurred in bank integration.
INTEGRATION_TIMEOUTBank integration time was longer than expected.

Business error handling

CodeMessage
ENTITY_IN_ANALYSISEntity is under review, wait for approval. Reference: #{id}.
ENTITY_INVALID_CURRENCYTransaction currency different from the one informed in the entity. Use currency #{currency}.
ENTITY_INVALID_ADDRESSEntity does not have a valid address. Reference: #{id}.
BANK_ACCOUNT_IN_ANALYSISBank account is under review, wait for approval. Reference: #{id}.
BANK_ACCOUNT_DAILY_TRANS_LIMIT_REACHEDDaily transaction limit reached.
BANK_ACCOUNT_DAILY_AMOUNT_LIMIT_REACHEDDaily transaction value limit reached.
BANK_ACCOUNT_OVERNIGHT_TRANS_LIMIT_REACHEDNightly transaction limit reached.
BANK_ACCOUNT_OVERNIGHT_AMOUNT_LIMIT_REACHEDNightly transaction amount limit reached.
BANK_ACCOUNT_MIN_SINGLE_TRANS_AMOUNT_REACHEDMinimum transaction amount threshold has not been reached.
BANK_ACCOUNT_MAX_SINGLE_TRANS_AMOUNT_REACHEDMaximum transaction amount limit reached.
BANK_ACCOUNT_MAX_COUNTERPARTY_TRANS_REACHEDDaily transaction limit for an offset reached.
BANK_ACCOUNT_MAX_COUNTERPARTY_AMOUNT_REACHEDDaily transaction value limit for an offset reached.
PIX_KEY_CANCELEDPix key is cancelled. Reference: #{id}.
PIX_KEY_CONFIRMEDPix key has already been confirmed. Reference: #{id}.
PIX_KEY_ALREADY_EXISTSThere is already a pix key created or confirmed. Reference: #{key}.
PIX_KEY_INVALID_KEYInvalid pix key
PIX_KEY_REQUIREDThe key must be informed when the type is 'random_key'.
PIX_KEY_INVALID_TYPEThe type must be: 'tax_number', 'email', 'phone' or 'random_key.'
PIX_KEY_CONFIRMATION_TYPE_INVALIDCode confirmation should only be performed for pix keys of type: 'email' or 'phone'.
PIX_KEY_PENDINGPix key not confirmed. Reference: #{id}.
COLLECTING_DOCUMENT_NOT_SETTLEDReceipt document is not settled. Reference: #{id}.
COLLECTING_DOCUMENT_WITHOUT_BALANCEReturn amount #{amount}, greater than the balance #{balance} of the receipt document.
PAYMENT_BRCODE_ALREADY_USEDBrcode #{id}, already has a linked document #{id}.
PAYMENT_AMOUNT_ERRORPayment amount #{amount} must be equal to the value of the brocode #{id}, value #{amount}.
PAYMENT_ACCOUNT_WITHOUT_BALANCEInsufficient balance to execute the payment. Current balance #{amount}.
DICT_QUERY_LIMIT_REACHEDQuery limit reached. Try again in 1 minute.
DICT_KEY_NOT_FOUNDPix key not found. Reference: {key}.
DICT_BRCODE_NOT_FOUNDBrcode not found. Reference: {brcode}.
VIRTUAL_TRANSFER_DIFFERENT_BANK_ACCOUNTBank account of source and destination virtual accounts are different. For virtual transfers they must be the same.