Create a payment
1 min
/consent/{consentId}/payments
Create a payment
POST
https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/payments
Path Parameters
- consentIdstringrequiredDescription
Header Parameters
- AuthorizationstringrequiredDescription
Body Parameters
- clientRequestIdstringrequiredDescription
- amountstringrequiredDescription
- currencystringrequiredDescription
- creditorAccountobjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- holderobjectDescription
- identifierstringDescription
- namestringDescription
- identifierTypestringDescription
- remittanceInformationstringDescription
- ibgeTownCodestringDescription
- externalInfoobjectDescription
- keystring
- initTypestringrequiredDescription
- paymentMethodConfigobjectrequiredDescription
- riskSignalsobjectrequiredDescription
- manualobjectDescription
- deviceIdstringrequiredDescription
- osVersionstringrequiredDescription
- userTimeZoneOffsetstringrequiredDescription
- languagestringrequiredDescription
- screenDimensionsobjectrequiredDescription
- heightintegerrequiredDescription
- widthintegerrequiredDescription
- isRootedDevicebooleanDescription
- screenBrightnessnumberDescription
- elapsedTimeSinceBootintegerDescription
- geolocationobject
- latitudenumberDescription
- longitudenumberDescription
- typestringDescription
- integrityobjectDescription
- appRecognitionVerdictstringDescription
- deviceRecognitionVerdictstringDescription
- isCallInProgressbooleanDescription
- isDevModeEnabledbooleanDescription
- isMockGPSbooleanDescription
- isEmulatedbooleanDescription
- isMonkeyRunnerbooleanDescription
- isChargingbooleanDescription
- isUsbConnectedbooleanDescription
- antennaInformationstringDescription
- automaticobjectDescription
- lastLoginDateTimestringrequiredDescription
- pixKeyRegistrationDateTimestringDescription
Response
- idstringDescription
- clientRequestIdstringDescription
- amountnumberDescription
- currencystringDescription
- statusstringDescription
- statusReasonobjectDescription
- codestringDescription
- messagestringDescription
curl
curl --location --globoff 'https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/payments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"clientRequestId":"string","amount":0,"creditorAccount":{"holder":{}}}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"clientRequestId": "string",
"date": "string",
"amount": 0,
"creditorAccount": {
"holder": {}
}
})
};
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 raw = JSON.stringify({
"clientRequestId": "string",
"date": "string",
"amount": 0,
"creditorAccount": {
"holder": {}
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments", 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"
payload = json.dumps({
"clientRequestId": "string",
"date": "string",
"amount": 0,
"creditorAccount": {
"holder": {}
}
})
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request("POST", 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")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"clientRequestId": "string",
"date": "string",
"amount": 0,
"creditorAccount": {
"holder": {}
}
})
response = https.request(request)
puts response.read_body
201
{
"id": "fcb72e3a-b346-4f71-b044-971dc23232c9",
"clientRequestId": "fcb72e3a-b346-4f71-b044-dsndsnmnkdsmk",
"amount": "1333.04",
"currency": "BRL",
"status": "PAYMENT_PENDING",
"statusReason": {
"code": "NAO_INFORMADO",
"message": "Erro não informado na iniciadora ou detentora de conta."
}
}