Create a payment initiation
1 min
payments
Create a payment initiation
POST
https://api-sandbox.klavi.ai/payment/customer/v1/instant/payments
Header Parameters
- AuthorizationstringrequiredDescription
Body Parameters
- clientRequestIdstringrequiredDescription
- institutionIdstringrequiredDescription
- initTypestringrequiredDescription
- customerObjectrequiredDescription
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringDescription
- phonestringDescription
- emailstringDescription
- loggedUserCpfstringDescription
- ibgeTownCodestringDescription
- proxystringDescription
- qrCodestringDescription
- amountstringrequiredDescription
- currencystringrequiredDescription
- redirectURLstringrequiredDescription
- remittanceInformationstringDescription
- debtorAccountObjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- creditorAccountObjectDescription
- ispbstringrequiredDescription
- issuerstringDescription
- numberstringrequiredDescription
- accountTypestringrequiredDescription
- holderobjectDescription
- identifierTypestringrequiredDescription
- identifierstringrequiredDescription
- namestringrequiredDescription
- externalInfoObjectDescription
- appLinkstringDescription
- appRedirectURLKeystringDescription
- clientMetadataObjectrequiredDescription
- platformstringrequiredDescription
- osstringrequiredDescription
- osVersionstringrequiredDescription
Response
- idstringDescription
- clientRequestIdstringDescription
- amountstringDescription
- currencystringDescription
- statusstringDescription
- statusReasonobject
- codestring
- messagestring
- consentRedirectURLstringDescription
curl
curl --location 'https://api-sandbox.klavi.ai/payment/customer/v1/instant/payments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"clientRequestId": "String",
"institutionId": "String",
"initType": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"amount": "String",
"currency": "String",
"redirectURL": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"clientMetadata": {
"platform": "String",
"os": "String",
"osVersion": "String"
}
}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/instant/payments',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"clientRequestId": "String",
"institutionId": "String",
"initType": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"amount": "String",
"currency": "String",
"redirectURL": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"clientMetadata": {
"platform": "String",
"os": "String",
"osVersion": "String"
}
})
};
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",
"institutionId": "String",
"initType": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"amount": "String",
"currency": "String",
"redirectURL": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"clientMetadata": {
"platform": "String",
"os": "String",
"osVersion": "String"
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api-sandbox.klavi.ai/payment/customer/v1/instant/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/instant/payments"
payload = json.dumps({
"clientRequestId": "String",
"institutionId": "String",
"initType": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"amount": "String",
"currency": "String",
"redirectURL": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"clientMetadata": {
"platform": "String",
"os": "String",
"osVersion": "String"
}
})
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/instant/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",
"institutionId": "String",
"initType": "String",
"customer": {
"identifierType": "String",
"identifier": "String",
"name": "String",
"phone": "String",
"email": "String"
},
"amount": "String",
"currency": "String",
"redirectURL": "String",
"debtorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String"
},
"creditorAccount": {
"ispb": "String",
"issuer": "String",
"number": "String",
"accountType": "String",
"holder": {
"identifierType": "String",
"identifier": "String",
"name": "String"
}
},
"clientMetadata": {
"platform": "String",
"os": "String",
"osVersion": "String"
}
})
response = https.request(request)
puts response.read_body
200
{
"id": "fcb72e3a-b346-4f71-b044-971dc23232c9",
"clientRequestId": "fcb72e3a-b346-4f71-b044-dsndsnmnkdsmk",
"amount": "1333.04",
"currency": "BRL",
"status": "CONSENT_AWAITING_AUTHORIZATION",
"statusReason": {
"code": "NAO_INFORMADO",
"message": "Erro não informado na iniciadora ou detentora de conta."
},
"consentRedirectURL": "https://server.example.com/cb"
}