Get the payment resource
1 min
/consents/{consentId}/payments/{paymentId}
Get the payment resouce
GET
https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/payments/{paymentId}
Path Parameters
- consentIdstringrequiredDescription
- paymentIdstringrequiredDescription
Header Parameters
- AuthorizationstringrequiredDescription
Response
- idstringDescription
- appIdstringDescription
- clientRequestIdstringDescription
- institutionIdstringDescription
- consentIdstringDescription
- customerobjectDescription
- identifierTypestringDescription
- identifierstringDescription
- namestringDescription
- phonestringDescription
- emailstringDescription
- datestringDescription
- consentIdstringDescription
- endToEndIdstringDescription
- transactionIdentificationstringDescription
- loggedUserCpfstringDescription
- ibgeTownCodestringDescription
- amountstringDescription
- currencystringDescription
- redirectURLstringDescription
- remittanceInformationstringDescription
- debtorAccountobjectDescription
- ispbstringDescription
- issuerstringDescription
- numberstringDescription
- accountTypestringDescription
- creditorAccountobjectDescription
- ispbstringDescription
- issuerstringDescription
- numberstringDescription
- accountTypestringDescription
- holderobjectDescription
- identifierstringDescription
- namestringDescription
- identifierTypestringDescription
- externalInfoobjectDescription
- keystring
- cancellationobjectDescription
- cancelledFromstringDescription
- cancelledAtstringDescription
- cancelledByobjectDescription
- identifierstringDescription
- identifierTypestringDescription
- statusstringDescription
- statusReasonobjectDescription
- codestringDescription
- messagestringDescription
- createAtstringDescription
- statusUpdateAtstringDescription
- paymentMethodstringDescription
- paymentMethodConfigobject
- firstPaymentbooleanDescription
- originalPaymentIdstringDescription
curl
curl --location --globoff 'https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/payments/{paymentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'nodejs
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}"
payload = {}
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
response = https.request(request)
puts response.read_body
200
{
"id": "fcb72e3a-b346-4f71-b044-971dc23232c9", // Required
"appId": "0b59d801-08e0-4e84-9ecd-569f34e32279", // Required
"clientRequestId": "fcb72e3a-b346-4f71-b044-dsndsnmnkdsmk", // Required
"institutionId": "c8f0bf49-4744-4933-8960-7add6e590841", // Required
"consentId": "yyt72e3a-b846-i771-b044-971dc232ujd8", // Required
"customer":
{
"identifierType": "CPF", // Required, CPF | CNPJ
"identifier": "76109277673", // Required, mask this field
"name": "João Silva", // Required
"phone": "12345", // Optional, mask this field
"email": "[email protected]" // Required, mask this field
}, // Required
"date": "2023-01-23", // Required, utc -3
"consentId": "yyt72e3a-b846-i771-b044-971dc232ujd8", // Optional
"endToEndId": "E9040088820210128000800123873170", // Optional after the status CONSENT_AUTHORIZED
"transactionIdentification": "cxf0bf49-4744-4933-8960-7add6e5908cc", // Optional
"loggedUserCpf": "76109277673", // required if customer.identifierType = CNPJ
"ibgeTownCode": "5300108", // Optional
"amount": "1333.04", // Required
"currency": "BRL", // Required
"remittanceInformation": "Any description", // Optinal, payment description
"debtorAccount":
{
"ispb": "00000000", // Required, ISPB (Brazilian Payment System Identifier) of the SPI (Instant Payment System)
"issuer": "0001", // Optional, Code of the issuing Agency of the account without digit, mask this field
"number": "324223", // Required, account number, mask this field
"accountType": "CACC" // Required, CACC(Current Account)|SVGS(Savings Account)|TRAN(TransactingAccount)
}, // Optinal, payer's account
"creditorAccount":
{
"ispb": "00000000", // Required
"issuer": "0001", // Optional, mask this field if method != PIX_MANU
"number": "324223", // Required, mask this field if method != PIX_MANU
"accountType": "CACC", // Required
"holder":
{
"identifier": "76109277673", // Required, mask this field
"name": "John Doe", // Required
"identifierType": "CPF" // Required
} // Required
}, // Required if mthod = PIX_MANU
"externalInfo":
{
"key": "value"
}, // Optional
"cancellation":
{
"cancelledFrom": "INSTITUTION", // Required, the cancellation source, INITIATOR|INSTITUTION
"cancelledAt": "2021-05-21T08:30:00Z", // Required
"cancelledBy":
{
"identifier": "11111111111", // Required
"identifierType": "CPF" // Required
} // Required
}, // Required if the status is CANCELED
"status": "CANCELED", // Required
"statusReason": {
"code": "NAO_INFORMADO", // Required
"message": "Erro não informado na iniciadora ou detentora de conta." // Required
}, // Optional
"createAt": "2023-01-23T14:17:06.45Z", // Required
"statusUpdateAt": "2023-01-23T14:17:06.45Z", // Optional
"paymentMethod": "SMART_PIX" // Required
}